/* Game Hub (menu) */
:root{
  --bg: #474A51;
  --card: #141424;
  --stroke: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --top:  #9966CC;   /* верх */
  --bottom: #A5A5A5; /* низ */
  --easter-gap: 350px; /* <-- расстояние между © и пасхалкой */

  /* Твой цвет #9966CC */
  --accent: #9966CC;

  /* Готовые цвета (без var() внутри rgba) */
  --glow-strong: rgba(153,102,204,0.35);
  --glow-soft:   rgba(153,102,204,0.14);
  --accent-55:   rgba(153,102,204,0.55);
  --accent-12:   rgba(153,102,204,0.12);
  --accent-18:   rgba(153,102,204,0.18);
  --accent-35:   rgba(153,102,204,0.35);
}
*{ box-sizing:border-box; }
html,body{ min-height:100%; height:auto; }

html{ background: var(--bottom); }

body{
  margin:0;
  min-height: 100vh;
  min-height: 100svh;

  /* iOS overscroll color (when you pull the page) */
  background-color: var(--bottom);

  /* Text */
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Needed for fixed pseudo-background layering */
  position: relative;
  isolation: isolate;
}

/* ✅ Stable split background: stays in place while scrolling (important for iPhone) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -2;

  background: linear-gradient(
    to bottom,
    var(--top) 0%,
    var(--top) 45%,
    var(--bottom) 65%,
    var(--bottom) 100%
  );
}

/* Optional: soft glow only in the TOP part so bottom stays bottom color */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events:none;

  background:
    radial-gradient(900px 520px at 30% 12%, var(--glow-strong), transparent 60%),
    radial-gradient(900px 600px at 70% 30%, var(--glow-soft), transparent 65%);

  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 75%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 75%, transparent 100%);
}

.header{
  padding: 28px 18px 10px;
  text-align:center;
}
.header h1{
  margin:0;
  font-size: 26px;
  letter-spacing:.2px;
}
.header p{
  margin: 8px 0 0;
  color: var(--muted);
}
.grid{
  width:min(1100px, 100%);
  margin: 0 auto;
  padding: 18px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px){
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .grid{ grid-template-columns: 1fr; }
}
.tile{
  display:block;
  text-decoration:none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px;
  min-height: 120px;
  position: relative;
  overflow:hidden;
}
.tile:hover{
  border-color: var(--accent-55);
  box-shadow: 0 0 0 3px var(--accent-12);
}
.badge{
  position:absolute;
  top: 12px;
  right: 12px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-18);
  border: 1px solid var(--accent-35);
  color: rgba(255,255,255,.92);
}
.title{
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
}
.desc{
  margin:0;
  color: var(--muted);
  line-height: 1.35;
}
.soon{
  opacity: .55;
  cursor: default;
  pointer-events: none;
}
.footer{
  padding: 18px;
  text-align:center;
  color: var(--muted);
  font-size: 13px;
}
.themeBtn{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: white;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

body.light{
  --top: #9966CC;
  --bottom: #A5A5A5;
  --text: rgba(0,0,0,.88);
  --muted: rgba(0,0,0,.62);
  --stroke: rgba(0,0,0,.12);
}

body.dark{
  --top: #2a1341;
  --bottom: #0b0b0f;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --stroke: rgba(255,255,255,.14);
}

body.dark .darkEaster{
  display: block !important;
  margin-top: var(--easter-gap);

  /* чтобы её можно было выделять */
  user-select: text;
  -webkit-user-select: text;

  /* "невидимый" цвет — как низ (в dark это #0b0b0f) */
  color: var(--bottom);

  font-size: 13px;
  line-height: 1.2;
}
/* Easter egg: игра 6 кликабельна, даже если "soon" */
#game6{
  pointer-events: auto;
  cursor: pointer;
}


body.light .darkEaster{ display:none !important; }