/* ==========================================================================
   Ibrahim Games — portal shell (home, category and list pages)
   Dark, chunky and bright: built for players aged 10-14. Everything is driven
   by assets/catalog.js — no game or category is hard-coded in here.
   ========================================================================== */

@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-latin-var.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: "Lilita One";
  src: url("fonts/lilita-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #0a0c18;
  --bg-2: #0f1222;
  --surface: #171a2e;
  --surface-2: #21253f;
  --surface-3: #2c3152;
  --line: rgba(255, 255, 255, 0.07);
  --ink: #f6f7ff;
  --ink-2: #b9bdd9;
  --ink-3: #7e83a8;
  --play: #ffcc1f;       /* the Play colour — Ridgeline yellow */
  --play-deep: #d99a00;
  --cyan: #38e1ff;
  --pink: #ff4fd8;
  --lime: #7cff6b;
  --hot: linear-gradient(135deg, #ff2f0f, #ff8b2d);
  --new: linear-gradient(135deg, #d13dd1, #7a4fff);
  --upd: linear-gradient(135deg, #1fc7df, #5082ff);
  --beta: linear-gradient(135deg, #2bd67b, #13a4a4);
  --radius: 16px;
  --side-w: 232px;
  --top-h: 68px;
  --gutter: 28px;
  --tile-w: 248px;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Lilita One", "Nunito", "Segoe UI Black", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 700 16px/1.4 var(--font);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Aurora: two soft colour blobs behind the top of the page, so it never reads flat. */
.aurora {
  position: fixed;
  inset: 0 0 auto 0;
  height: 620px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 300px at 18% -60px, rgba(122, 79, 255, 0.28), transparent 70%),
    radial-gradient(560px 280px at 82% -40px, rgba(56, 225, 255, 0.16), transparent 70%),
    radial-gradient(480px 260px at 55% 120px, rgba(255, 79, 216, 0.09), transparent 70%);
}

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--top-h);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px 0 14px;
  background: rgba(10, 12, 24, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  font-size: 20px;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.logo-mark {
  width: 40px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 4px 12px rgba(255, 204, 31, 0.35));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo:hover .logo-mark { transform: rotate(-12deg) scale(1.08); }
.logo-word {
  font-family: var(--display);
  font-size: 21px;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.logo-word span { display: block; color: var(--play); }

.search {
  position: relative;
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}
.search input {
  width: 100%;
  height: 46px;
  padding: 0 48px 0 20px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font: 700 16px var(--font);
  transition: border-color 0.15s, background 0.15s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--cyan); background: var(--surface); }
.search svg {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.top-right { display: flex; align-items: center; gap: 10px; flex: none; }

/* The player chip: rider level ring + XP. Progress only ever goes up. */
.player-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  transition: background 0.15s, transform 0.15s;
}
.player-chip:hover { background: var(--surface-3); }
.lvl-ring {
  --p: 0;
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) calc(var(--p) * 1%), rgba(255, 255, 255, 0.12) 0);
}
.lvl-ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface);
}
.lvl-ring b { position: relative; font: 900 14px var(--font); }
.player-meta { display: flex; flex-direction: column; line-height: 1.05; }
.player-meta small { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.player-meta span { font-size: 15px; font-weight: 900; }
.player-meta .stars { color: var(--play); }

.btn-friends {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8a4fff, #ff4fd8);
  font-weight: 900;
  box-shadow: 0 6px 20px rgba(160, 80, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-friends:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(160, 80, 255, 0.5); }
.btn-friends:active { transform: translateY(1px); }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  top: var(--top-h);
  bottom: 0;
  left: 0;
  width: var(--side-w);
  z-index: 30;
  padding: 14px 10px 30px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
  background: var(--bg);
  border-right: 1px solid var(--line);
  transition: width 0.2s ease, transform 0.25s ease;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface); color: var(--ink); }
.nav-item.on { background: var(--surface-2); color: var(--ink); }
.nav-item.on::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--play);
}
.nav-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  font-size: 18px;
  background: var(--surface-2);
}
.nav-item.on .nav-ic, .nav-item:hover .nav-ic { background: var(--surface-3); }
.nav-count {
  margin-left: auto;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  text-align: center;
  color: var(--ink-3);
}
.nav-sep { height: 1px; margin: 12px 8px; background: var(--line); }
.nav-head {
  padding: 4px 12px 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Collapsed: icons only (desktop, via the ☰ button). */
body.nav-mini { --side-w: 76px; }
body.nav-mini .nav-item span:not(.nav-ic), body.nav-mini .nav-head, body.nav-mini .nav-count { display: none; }
body.nav-mini .nav-item { justify-content: center; padding: 0; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* ---------- Main column ---------- */

.main {
  position: relative;
  z-index: 1;
  margin-left: var(--side-w);
  padding: calc(var(--top-h) + 22px) var(--gutter) 40px;
  min-width: 0;
  transition: margin-left 0.2s ease;
}

/* Greeting + player card */
.hello {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.hello h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.hello h1 .wave { display: inline-block; transform-origin: 70% 80%; animation: wave 2.4s ease-in-out 0.6s 2; }
.hello p { margin-top: 4px; color: var(--ink-2); font-size: 17px; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(16deg); }
  20%, 40% { transform: rotate(-8deg); }
}

/* Mood chips: the "what do you feel like?" row */
.moods {
  display: flex;
  gap: 10px;
  margin: 0 calc(var(--gutter) * -1) 26px;
  padding: 4px var(--gutter) 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.moods::-webkit-scrollbar { display: none; }
.mood {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 8px 18px 8px 8px;
  border-radius: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.mood:hover { transform: translateY(-3px); border-color: var(--mc, var(--cyan)); background: var(--surface-2); }
.mood .m-ic {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 22px;
  background: var(--mc, var(--cyan));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}
.mood b { display: block; font-size: 15px; font-weight: 900; white-space: nowrap; }
.mood small { display: block; font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Sections ---------- */

.section { margin-bottom: 34px; scroll-margin-top: calc(var(--top-h) + 16px); }
.sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.sec-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.sec-head h2 a { display: inline-flex; align-items: center; gap: 6px; }
.sec-head h2 a::after {
  content: "›";
  font-family: var(--font);
  font-weight: 900;
  font-size: 30px;
  line-height: 0;
  color: var(--ink-3);
  transition: transform 0.15s, color 0.15s;
}
.sec-head h2 a:hover::after { transform: translateX(4px); color: var(--play); }
.sec-emoji { font-size: 24px; }
.sec-sub { color: var(--ink-3); font-size: 15px; }
.sec-arrows { margin-left: auto; display: flex; gap: 8px; }
.sec-arrows button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 22px;
  font-weight: 900;
  transition: background 0.15s, opacity 0.15s;
}
.sec-arrows button:hover { background: var(--surface-3); }
.sec-arrows button:disabled { opacity: 0.3; cursor: default; }

/* A horizontal row of tiles, scroll-snapped. */
.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--tile-w);
  gap: 14px;
  margin: -12px calc(var(--gutter) * -1) -16px;
  padding: 12px var(--gutter) 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; }
.row.small { --tile-w: 150px; }

/* Grid pages (category / search results) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ---------- Tiles ---------- */

.tile {
  --c: var(--play);
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--surface-2);
  isolation: isolate;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s;
}
.tile .t-img {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: var(--c);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 3.5s ease-out;
}
/* Title always shows: our covers have no baked-in logo. */
.tile .t-shade {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 38%, rgba(6, 8, 18, 0.88));
  pointer-events: none;
}
.tile .t-title {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 9px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile .t-title small {
  display: block;
  margin-top: 2px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.tile .t-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--play);
  color: #1b1400;
  box-shadow: 0 6px 0 var(--play-deep), 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.6);
  transition: opacity 0.18s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.tile .t-play svg { width: 24px; height: 24px; margin-left: 4px; }
.tile:hover, .tile:focus-visible {
  transform: translateY(-6px) scale(1.035);
  z-index: 2;
  box-shadow: 0 0 0 3px var(--c), 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 40px color-mix(in srgb, var(--c) 45%, transparent);
  outline: none;
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.14) translateX(-3%); }
.tile:hover .t-play, .tile:focus-visible .t-play { opacity: 1; transform: translate(-50%, -62%) scale(1); }
.tile:active { transform: translateY(-2px) scale(1.01); }

/* Corner badge: at most one per tile, so it keeps its meaning. */
.badge {
  position: absolute;
  top: -6px;
  left: -6px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.badge.hot { background: var(--hot); }
.badge.new { background: var(--new); }
.badge.updated { background: var(--upd); }
.badge.beta { background: var(--beta); }
.badge.original { background: #fff; color: #5a2fff; }

/* Personal progress in the top-right: stars won, a ghost to race. */
.t-prog {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 9px;
  background: rgba(6, 8, 18, 0.72);
  backdrop-filter: blur(4px);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--play);
}
.t-prog .off { color: rgba(255, 255, 255, 0.3); }

/* Square "continue playing" tiles */
.tile.sq { aspect-ratio: 1; }
.tile.sq .t-title { font-size: 16px; }

/* "More soon" placeholder tile */
.tile.soon {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
  background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 12px, var(--bg-2) 12px, var(--bg-2) 24px);
  border: 2px dashed var(--surface-3);
  color: var(--ink-3);
  font-size: 15px;
}
.tile.soon b { display: block; font-size: 26px; margin-bottom: 4px; }
.tile.soon:hover { transform: none; box-shadow: none; }

/* ---------- Top picks mosaic ---------- */

.mosaic {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
}
/* The hero takes its height from the two small rows beside it; its own 16:9
   would otherwise push the columns wider than the page. */
.mosaic .tile:first-child { grid-row: span 2; aspect-ratio: auto; min-height: 100%; }
.mosaic .tile:first-child .t-title { left: 22px; bottom: 20px; font-size: clamp(30px, 3.2vw, 46px); }
.mosaic .tile:first-child .t-title small { font-size: 15px; margin-top: 6px; white-space: normal; max-width: 60%; }
.mosaic .tile:first-child .t-play { display: none; }
.mosaic .tile:first-child .badge { font-size: 14px; padding: 4px 12px; }
.hero-cta {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 30px 0 24px;
  border-radius: 18px;
  background: var(--play);
  color: #1b1400;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 0 var(--play-deep), 0 14px 30px rgba(0, 0, 0, 0.45);
  animation: breathe 2.6s ease-in-out infinite;
  transition: transform 0.12s;
}
.hero-cta svg { width: 22px; height: 22px; }
.tile:hover .hero-cta { animation: none; transform: translateY(-2px) scale(1.04); }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---------- Category + list pages ---------- */

.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.page-ic {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 18px;
  font-size: 34px;
  background: var(--mc, var(--surface-2));
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18);
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.05;
}
.page-head p { color: var(--ink-2); font-size: 17px; margin-top: 2px; }
.crumbs { display: flex; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

.empty {
  padding: 50px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  color: var(--ink-2);
}
.empty b { display: block; font-size: 44px; margin-bottom: 8px; }
.empty h3 { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--ink); margin-bottom: 4px; }

/* ---------- About / footer ---------- */

.about {
  margin-top: 16px;
  padding: 24px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.6;
}
.about h2 { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--ink); margin-bottom: 6px; }
.about p + p { margin-top: 10px; }
.about b { color: var(--ink); }
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
}
.foot a:hover { color: var(--ink); }
.foot .spacer { flex: 1; }

/* Prose pages (about, privacy, parents) */
.prose { max-width: 760px; color: var(--ink-2); font-weight: 600; font-size: 17px; line-height: 1.65; }
.prose h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 4vw, 44px); color: var(--ink); line-height: 1.1; margin-bottom: 12px; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--ink); margin: 26px 0 6px; }
.prose p + p, .prose ul { margin-top: 12px; }
.prose ul { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose b { color: var(--ink); }
.prose a { color: var(--cyan); text-decoration: underline; }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .mosaic { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .mosaic .tile:nth-child(n + 4) { display: none; }
}

/* Tablet / phone: the sidebar becomes a drawer behind the ☰ button. */
@media (max-width: 960px) {
  :root { --gutter: 18px; --tile-w: 210px; }
  body, body.nav-mini { --side-w: 0px; }
  .sidebar { width: 260px; transform: translateX(-102%); box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-mini .nav-item span:not(.nav-ic), body.nav-mini .nav-head, body.nav-mini .nav-count { display: revert; }
  body.nav-mini .nav-item { justify-content: flex-start; padding: 0 12px; }
  .player-meta, .btn-friends .bf-txt { display: none; }
  .player-chip { padding: 0 5px; }
  .btn-friends { width: 46px; padding: 0; justify-content: center; }
}

@media (max-width: 700px) {
  :root { --top-h: 62px; --tile-w: 172px; }
  .topbar { gap: 8px; padding: 0 10px 0 6px; }
  .logo-word { display: none; }
  .search input { height: 42px; font-size: 15px; padding-left: 16px; }
  .mosaic { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mosaic .tile:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 9; }
  .sec-sub { display: none; }
  .mosaic .tile:nth-child(n + 4) { display: block; }
  .mosaic .tile:nth-child(n + 6) { display: none; }
  .mosaic .tile:first-child .t-title small { display: none; }
  .hero-cta { height: 46px; font-size: 20px; padding: 0 20px 0 16px; right: 12px; bottom: 12px; }
  .mosaic .tile:first-child .t-title { left: 14px; bottom: 14px; font-size: 26px; }
  .hello h1 { font-size: 27px; }
  .hello p { font-size: 15px; }
  .sec-head h2 { font-size: 22px; }
  .sec-arrows { display: none; }
  .tile .t-title { font-size: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

@media (hover: none) {
  .tile .t-play { display: none; }
  .tile:hover { transform: none; box-shadow: none; }
  .tile:hover img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Small extras ---------- */
.prose .dim { color: var(--ink-3); font-size: 14px; margin-top: 26px; }
.hello-link { color: var(--play); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.about a { color: var(--cyan); }
.about a b { color: inherit; }

/* ---------- Play with friends ---------- */

/* Home banner: the two doors */
.mp-doors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mp-door {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  padding: 18px 22px;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}
.mp-door.online { background: linear-gradient(120deg, #5b2bff, #b43cff 60%, #ff4fd8); }
.mp-door.local { background: linear-gradient(120deg, #0f8fb0, #13b68a 60%, #7cd83a); }
.mp-door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(260px 140px at 90% 10%, rgba(255, 255, 255, 0.25), transparent 70%);
}
.mp-door:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.mp-ic { display: grid; place-items: center; width: 62px; height: 62px; flex: none; border-radius: 18px; font-size: 32px; background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15); }
.mp-door b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.05; letter-spacing: 0.01em; }
.mp-door small { display: block; margin-top: 4px; font-size: 15px; color: rgba(255, 255, 255, 0.88); }
.mp-go { margin-left: auto; font-size: 40px; font-weight: 900; opacity: 0.8; transition: transform 0.15s; }
.mp-door:hover .mp-go { transform: translateX(5px); }

/* Hub */
.mp-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; margin-bottom: 34px; }
.mp-card { position: relative; padding: 22px 24px 24px; border-radius: 20px; background: var(--surface); border: 2px solid var(--line); scroll-margin-top: calc(var(--top-h) + 16px); }
.mp-card.online { background: linear-gradient(160deg, rgba(122, 79, 255, 0.28), rgba(255, 79, 216, 0.1) 60%, var(--surface)); border-color: rgba(160, 110, 255, 0.35); }
.mp-card.local { background: linear-gradient(160deg, rgba(19, 182, 138, 0.26), rgba(56, 225, 255, 0.08) 60%, var(--surface)); border-color: rgba(40, 200, 150, 0.35); }
.mp-tag { display: inline-block; padding: 3px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 13px; font-weight: 900; letter-spacing: 0.05em; }
.mp-card h2 { margin: 8px 0 4px; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.05; }
.mp-lead { color: var(--ink-2); font-size: 16px; margin-bottom: 16px; }
.mp-field { display: block; margin-bottom: 12px; }
.mp-field > span:first-child { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.mp-field small { display: block; margin-top: 5px; color: var(--ink-3); font-size: 13px; }
.mp-inline { display: flex; gap: 8px; }
.mp-inline input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(6, 8, 18, 0.55);
  color: var(--ink);
  font: 800 18px var(--font);
}
.mp-inline input:focus { outline: none; border-color: var(--cyan); }
.mp-inline input::placeholder { color: var(--ink-3); font-weight: 700; }
.mp-dice { width: 50px; height: 50px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, 0.12); font-size: 24px; transition: transform 0.3s; }
.mp-dice:hover { transform: rotate(-20deg) scale(1.08); }
.mp-dice.roll { animation: roll 0.45s ease-out; }
@keyframes roll { to { transform: rotate(360deg); } }
.mp-games { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mp-game { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 14px; background: rgba(6, 8, 18, 0.45); border: 2px solid transparent; cursor: pointer; font-weight: 900; }
.mp-game img { width: 64px; height: 36px; border-radius: 8px; object-fit: cover; }
.mp-game input { position: absolute; opacity: 0; pointer-events: none; }
.mp-game:has(input:checked) { border-color: var(--play); }
.mp-games.one .mp-game { cursor: default; border-color: rgba(255, 255, 255, 0.12); }
.mp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 54px;
  padding: 0 22px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 17px;
  transition: transform 0.12s, filter 0.15s;
}
.mp-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.mp-btn:active { transform: translateY(1px); }
.mp-btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.mp-btn.create { width: 100%; background: var(--play); color: #1b1400; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: 0.03em; box-shadow: 0 6px 0 var(--play-deep); }
.mp-btn.join { height: 50px; background: var(--cyan); color: #04202a; }
.mp-btn.soft { flex: 1; height: 46px; background: rgba(255, 255, 255, 0.12); font-size: 15px; }
.mp-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--ink-3); font-size: 14px; }
.mp-or::before, .mp-or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.12); }
.mp-msg { min-height: 22px; font-size: 15px; color: #ff9a7a; }
.mp-msg.ok { color: var(--lime); }
.mp-room { text-align: center; animation: pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
.mp-room-label { font-size: 13px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.mp-code {
  margin: 8px 0 14px;
  padding: 16px 10px;
  border-radius: 18px;
  background: rgba(6, 8, 18, 0.6);
  border: 3px dashed rgba(255, 204, 31, 0.6);
  font-family: var(--display);
  font-size: clamp(30px, 4.4vw, 44px);
  letter-spacing: 0.03em;
  color: var(--play);
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}
.mp-room-btns { display: flex; gap: 8px; }
.mp-room-note { margin: 14px 0 16px; color: var(--ink-2); font-size: 15px; }
.mp-room-note b { color: var(--ink); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.9); } }
.mp-local-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 960px) {
  .mp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .mp-doors { grid-template-columns: minmax(0, 1fr); }
  .mp-door { min-height: 90px; padding: 14px 16px; }
  .mp-door b { font-size: 22px; }
  .mp-ic { width: 52px; height: 52px; font-size: 26px; }
  .mp-card { padding: 18px 16px 20px; }
  .mp-card h2 { font-size: 27px; }
}
