/* =========================================================
   Brand tokens
   Lagoon #3FB4C6  Meadow #7ACB8A  Sunbeam #FFC24B
   Blossom #FF8FA3  Lilac #A99AF0  Ink #26305E  Cloud #F4FAFF
   ========================================================= */
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  --ink: #26305E;
  --ink-2: #56608F;
  --lagoon: #3FB4C6;
  --lagoon-deep: #16808F;
  --meadow: #7ACB8A;
  --sun: #FFC24B;
  --blossom: #FF8FA3;
  --lilac: #A99AF0;
  --land: #F4FAFF;
  --paper: #FFFFFF;
  --line: rgba(38, 48, 94, .12);
  --glass: rgba(255, 255, 255, .78);
  --sky1: #A9E1F4;
  --sky2: #E6F7EF;
  --hill1: color-mix(in srgb, var(--tint, #7ACB8A) 32%, #CBEBD5);
  --hill2: color-mix(in srgb, var(--tint, #7ACB8A) 55%, #A5DDB2);
  --hill3: color-mix(in srgb, var(--tint, #7ACB8A) 40%, #8FD0A0);
  --trunk: #9A6B4A;
  --crown: color-mix(in srgb, var(--tint, #7ACB8A) 30%, #5DB673);
  --shadow: 0 1px 2px rgba(38, 48, 94, .06), 0 10px 28px -12px rgba(38, 48, 94, .28);
  --font-d: "Grandstander", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-b: "Lexend", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --r-lg: 28px;
  --r-md: 20px;
  --top-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EEF1FF; --ink-2: #B6BEE6; --land: #1A2052; --paper: #242B66; --line: rgba(255, 255, 255, .14);
    --glass: rgba(26, 32, 82, .8); --sky1: #0E1338; --sky2: #2C3574;
    --hill1: color-mix(in srgb, var(--tint, #7ACB8A) 18%, #2E3A7A); --hill2: color-mix(in srgb, var(--tint, #7ACB8A) 22%, #25336B);
    --hill3: color-mix(in srgb, var(--tint, #7ACB8A) 18%, #1E2A5E); --crown: #2F5C63; --trunk: #4D3A55; --lagoon-deep: #7FD6E3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 12px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--sky2); color: var(--ink); font-family: var(--font-b); font-size: 1.02rem; line-height: 1.55; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lagoon-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 800; line-height: 1.08; letter-spacing: -.01em; margin: 0; }
:focus-visible { outline: 3px solid var(--lagoon); outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--paper); padding: 10px 16px; border-radius: 12px; font-weight: 600; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 10px); }
main { display: block; outline: none; position: relative; z-index: 1; }

/* ---------- the world behind everything ---------- */
.world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; pointer-events: none; }
.world .sky1 { stop-color: var(--sky1); } .world .sky2 { stop-color: var(--sky2); }
.w-hill1 { fill: var(--hill1); transition: fill .8s; } .w-hill2 { fill: var(--hill2); transition: fill .8s; } .w-hill3 { fill: var(--hill3); transition: fill .8s; }
.w-trees .trunk { fill: var(--trunk); } .w-trees .crown { fill: var(--crown); transition: fill .8s; }
.w-path { stroke: rgba(255, 255, 255, .55); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 2 26; }
.w-cloud { animation: drift linear infinite; opacity: .9; }
@keyframes drift { from { transform: translateX(-300px); } to { transform: translateX(1900px); } }
.w-night { opacity: 0; transition: opacity .6s; } .w-night circle { animation: twinkle 3s ease-in-out infinite alternate; }
.w-night .moon-cut { fill: var(--sky1); animation: none; }
@keyframes twinkle { from { opacity: .3; } to { opacity: 1; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-night { opacity: 1; } :root:not([data-theme="light"]) .w-day, :root:not([data-theme="light"]) .w-clouds { opacity: .12; } }

/* ---------- top bar ---------- */
.topbar { position: fixed; left: 0; right: 0; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 999px; padding: 4px 16px 4px 6px; box-shadow: var(--shadow); min-height: 48px; }
.brand span { font-family: var(--font-d); font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }
.search { position: relative; flex: 1; min-width: 0; max-width: 520px; margin-left: auto; display: flex; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 999px; box-shadow: var(--shadow); min-height: 48px; }
.search input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 0 8px 0 20px; outline: none; }
.search input::placeholder { color: var(--ink-2); }
.search:focus-within { box-shadow: var(--shadow), 0 0 0 3px var(--lagoon); }
.search button { border: 0; background: var(--lagoon); color: #fff; width: 40px; height: 40px; margin: 4px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.topnav { display: flex; gap: 8px; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 600; }
.topnav a[aria-current="page"] { background: var(--ink); color: var(--land); }
.count { background: var(--blossom); color: #3A1020; border-radius: 999px; font-size: .78rem; font-weight: 700; padding: 1px 8px; }

/* suggestions dropdown */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--paper); border-radius: 22px; box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 8px; z-index: 30; max-height: min(70vh, 520px); overflow: auto; text-align: left; }
.suggest a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.suggest a[aria-selected="true"], .suggest a:hover { background: color-mix(in srgb, var(--lagoon) 14%, transparent); }
.suggest .s-ico { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-family: var(--emoji); font-size: 22px; background: color-mix(in srgb, var(--c, var(--lagoon)) 30%, var(--paper)); }
.suggest .s-ico.round { border-radius: 50%; }
.suggest b { display: block; font-weight: 600; line-height: 1.25; }
.suggest small { color: var(--ink-2); font-size: .82rem; line-height: 1.3; display: block; }
.suggest .s-head { font-size: .8rem; font-weight: 600; color: var(--ink-2); padding: 6px 10px 2px; }
.suggest .s-all { justify-content: center; font-weight: 600; color: var(--lagoon-deep); }
.suggest .s-none { padding: 14px; color: var(--ink-2); }

/* ---------- stages (content that sits in the world) ---------- */
.stage { position: relative; padding: calc(env(safe-area-inset-top, 0px) + var(--top-h) + 36px) max(20px, env(safe-area-inset-right)) 48px max(20px, env(safe-area-inset-left)); max-width: 1240px; margin: 0 auto; }
.stage-cat { padding-bottom: clamp(48px, 16vh, 150px); }
.page-title { font-size: clamp(2.2rem, 6vw, 3.8rem); text-shadow: 0 2px 0 rgba(255, 255, 255, .35); }
.page-lead { font-size: 1.15rem; color: var(--ink-2); margin: 10px 0 0; max-width: 46ch; }

.hero { display: flex; align-items: center; gap: clamp(16px, 4vw, 48px); padding-top: clamp(8px, 4vh, 48px); }
.hero-pip { flex: none; animation: hover 4.5s ease-in-out infinite; filter: drop-shadow(0 16px 18px rgba(38, 48, 94, .18)); }
@keyframes hover { 50% { transform: translateY(-10px) rotate(-2deg); } }
.hero-talk { flex: 1; max-width: 660px; }
.hero-talk h1 { font-size: clamp(2.3rem, 6.4vw, 4.4rem); line-height: .98; letter-spacing: -.02em; }
.hero-talk > p { font-size: 1.2rem; margin: 12px 0 20px; color: var(--ink-2); }
.bigsearch { position: relative; display: flex; background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); padding: 6px; max-width: 620px; margin-top: 18px; }
.hero-talk .bigsearch { margin-top: 0; }
.bigsearch:focus-within { box-shadow: var(--shadow), 0 0 0 4px var(--lagoon); }
.bigsearch input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.15rem; color: var(--ink); padding: 0 12px 0 20px; outline: none; min-height: 52px; }
.bigsearch button { border: 0; background: var(--sun); color: #3A2A00; font: inherit; font-weight: 600; font-size: 1.05rem; padding: 0 26px; border-radius: 999px; cursor: pointer; }
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.try span { color: var(--ink-2); font-weight: 500; }
.try a { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; }

/* portals: one circle per subject world */
.portals { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 3vw, 34px); margin-top: clamp(28px, 7vh, 72px); }
.portal { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); width: 128px; text-align: center; animation: rise .7s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.8); } }
.portal-ring { width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from 200deg, var(--c), color-mix(in srgb, var(--c) 45%, #fff), var(--c)); padding: 7px; box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2, .9, .3, 1.4); }
.portal-ring span { width: 100%; height: 100%; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-family: var(--emoji); font-size: 46px; }
.portal:hover .portal-ring, .portal:focus-visible .portal-ring { transform: translateY(-6px) rotate(-6deg); }
.portal b { font-family: var(--font-d); font-size: 1.12rem; line-height: 1.1; margin-top: 10px; }
.portal small { color: var(--ink-2); font-size: .85rem; }
.portal:focus-visible { outline: none; }
.portal:focus-visible .portal-ring { box-shadow: 0 0 0 4px var(--ink); }

/* ---------- land: the content surface with a hill-shaped top edge ---------- */
.land { position: relative; background: var(--land); padding: 34px max(20px, env(safe-area-inset-right)) 56px max(20px, env(safe-area-inset-left)); margin-top: 40px; }
.land::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 48px; background: var(--land); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48V30C150 6 300 0 450 14S750 44 900 30 1100 4 1200 16V48Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48V30C150 6 300 0 450 14S750 44 900 30 1100 4 1200 16V48Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.land > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.land-title { font-size: 1.6rem; margin: 6px auto 16px; }
.land-title small { font-family: var(--font-b); font-size: 1rem; color: var(--ink-2); font-weight: 500; margin-left: 6px; }
.foot { position: relative; z-index: 1; background: var(--land); border-top: 1px solid var(--line); padding: 28px 20px calc(env(safe-area-inset-bottom, 0px) + 28px); }
.foot-in { max-width: 1200px; margin: 0 auto; display: grid; gap: 12px; }
.foot-brand { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.foot-brand b { font-family: var(--font-d); font-size: 1.2rem; }
.foot-brand span { color: var(--ink-2); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot nav a { color: var(--ink); font-weight: 500; }
.foot-note { margin: 0; color: var(--ink-2); font-size: .9rem; }

/* ---------- rails & cards ---------- */
.rail { margin-bottom: 34px; }
.rail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rail-head h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); display: flex; align-items: center; gap: 10px; }
.rail-icon { font-family: var(--emoji); font-weight: 400; font-size: .95em; }
.see-all { font-weight: 600; margin-left: 6px; white-space: nowrap; }
.rail-nav { margin-left: auto; display: flex; gap: 8px; }
.rail-nav button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.rail-nav button:disabled { opacity: .35; cursor: default; }
.rail-nav.none { visibility: hidden; }
.rail-track { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 270px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 4px; padding: 6px 4px 18px; margin: 0 -4px; scrollbar-width: none; overscroll-behavior-x: contain; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 20px; }

.card { position: relative; background: var(--paper); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-link:focus-visible { outline-offset: -4px; border-radius: var(--r-md); }
.card-art { position: relative; aspect-ratio: 16 / 10; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 50%, #fff), var(--c)); display: grid; place-items: center; overflow: hidden; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-emoji { font-family: var(--emoji); font-size: 64px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .15)); }
.card-art.has-img .card-emoji { position: absolute; left: 10px; bottom: 10px; font-size: 22px; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--paper); filter: none; box-shadow: var(--shadow); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 1.18rem; line-height: 1.15; }
.card-sum { color: var(--ink-2); font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.card-meta span { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, var(--paper)); color: var(--ink); }
.card-fav, .gh-actions [data-fav] { cursor: pointer; }
.card-fav { position: absolute; right: 10px; top: 10px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .88); color: #C4405C; font-size: 1.3rem; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow); }
.card-fav[aria-pressed="true"], [data-fav][aria-pressed="true"] { color: #E0355B; }
.card-fav[aria-pressed="true"] { background: #FFE3EA; }

/* ---------- buttons, chips, filters ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s; }
.btn:active { transform: scale(.97); }
.btn-play { background: var(--sun); color: #3A2A00; box-shadow: 0 6px 0 #E3A322, var(--shadow); font-size: 1.12rem; padding: 0 28px; min-height: 56px; }
.btn-play:active { box-shadow: 0 2px 0 #E3A322; transform: translateY(4px); }
.btn-soft { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem; }
.chip.on { background: var(--ink); color: var(--land); box-shadow: none; }
.sort { display: flex; gap: 4px; margin-left: auto; background: var(--paper); border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 2px var(--line); }
.sort a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 500; }
.sort a.on { background: color-mix(in srgb, var(--lagoon) 20%, var(--paper)); color: var(--ink); }
.more { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 26px; color: var(--ink-2); }

/* ---------- explore ---------- */
.worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; margin-top: 26px; }
.world-card { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; }
.world-head { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.world-emoji { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-family: var(--emoji); font-size: 30px; background: color-mix(in srgb, var(--c) 35%, var(--paper)); box-shadow: inset 0 0 0 4px var(--c); flex: none; }
.world-head b { display: block; font-family: var(--font-d); font-size: 1.3rem; line-height: 1.1; }
.world-head small { color: var(--ink-2); }
.subjects { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.subjects a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500; }

/* ---------- category ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; padding: 0; font-size: .9rem; }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--ink-2); }
.crumbs a { color: var(--ink); text-decoration: none; font-weight: 500; background: var(--glass); padding: 3px 10px; border-radius: 999px; }
.crumbs [aria-current] { color: var(--ink-2); padding: 3px 4px; }
.cat-hero { display: flex; align-items: center; gap: clamp(16px, 3vw, 28px); }
.cat-badge { flex: none; width: clamp(96px, 16vw, 150px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--emoji); font-size: clamp(48px, 8vw, 76px); background: var(--paper); box-shadow: 0 0 0 10px var(--c), var(--shadow); }
.cat-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.cat-hero p { font-size: 1.1rem; max-width: 54ch; margin: 10px 0 0; }
.subject-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.subject-chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--ink); text-decoration: none; font-weight: 500; box-shadow: var(--shadow); }
.subject-chips a.on { background: var(--ink); color: var(--land); }
.subject-chips.big a { background: var(--paper); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c, var(--lagoon)) 60%, transparent); min-height: 52px; font-size: 1.05rem; }

/* ---------- game page ---------- */
.game-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; }
.gh-art { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 45%, #fff), var(--c)); box-shadow: var(--shadow); color: #fff; text-decoration: none; }
.gh-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gh-emoji { font-family: var(--emoji); font-size: clamp(80px, 12vw, 130px); }
.gh-art.has-img .gh-emoji { display: none; }
.gh-play { position: absolute; width: 92px; height: 92px; border-radius: 50%; background: var(--sun); color: #3A2A00; display: grid; place-items: center; box-shadow: 0 8px 0 #E3A322, 0 18px 30px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.2, .9, .3, 1.4); }
.gh-play svg { margin-left: 6px; }
.gh-art:hover .gh-play { transform: scale(1.08); }
.gh-info h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
.gh-info .lead { font-size: 1.18rem; margin: 12px 0 0; }
.facts { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li, .facts a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-weight: 500; font-size: .95rem; color: var(--ink); text-decoration: none; }
.facts li:has(a) { padding: 0; background: none; backdrop-filter: none; }
.facts span { font-family: var(--emoji); }
.gh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; align-items: center; }
.game-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; margin-bottom: 40px; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.55rem; margin: 30px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 1.05rem; }
.learn { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.learn li { position: relative; padding: 12px 16px 12px 50px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); }
.learn li::before { content: "✓"; position: absolute; left: 14px; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--meadow); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.faqs { display: grid; gap: 10px; }
.faqs details { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 4px 18px; }
.faqs summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faqs summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--lagoon-deep); }
.faqs details[open] summary::after { content: "–"; }
.faqs details p { margin: 0 0 14px; }
.side-card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 22px; }
.side-card h2 { font-size: 1.3rem; margin-bottom: 10px; }
.side-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.side-card dt { color: var(--ink-2); font-size: .92rem; }
.side-card dd { margin: 0; font-weight: 500; font-size: .95rem; }
.also { margin: 16px 0 0; font-size: .95rem; }

/* ---------- misc pages ---------- */
.about-strip { background: var(--paper); border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--shadow); max-width: 820px; margin-top: 10px; }
.about-strip h2 { font-size: 1.5rem; margin-bottom: 6px; }
.about-strip p { margin: 0; color: var(--ink-2); }
.page-body { background: var(--paper); border-radius: var(--r-lg); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); max-width: 820px; }
.page-body h2 { margin-top: 26px; font-size: 1.45rem; }
.empty { text-align: center; padding: 40px 20px; display: grid; justify-items: center; gap: 8px; }
.empty h2 { font-size: 1.6rem; }
.empty p { margin: 0; color: var(--ink-2); }
.empty.small h2 { font-size: 1.3rem; }
.lost { text-align: center; display: grid; justify-items: center; gap: 10px; }
.lost .page-lead { margin: 0 auto; }
.tabs { display: inline-flex; gap: 6px; margin-top: 22px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 5px; border-radius: 999px; }
.tabs button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 999px; color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--paper); box-shadow: var(--shadow); }

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --top-h: 58px; }
  .topbar { gap: 8px; }
  .brand span { font-size: 1.15rem; }
  .topnav { display: none; }
  .search { max-width: none; }
  .search input { padding-left: 14px; font-size: 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 20; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 24px; box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 6px; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 18px; color: var(--ink); text-decoration: none; font-size: .74rem; font-weight: 600; }
  .tabbar a span { font-family: var(--emoji); font-size: 1.35rem; line-height: 1.2; }
  .tabbar a[aria-current="page"] { background: color-mix(in srgb, var(--lagoon) 22%, transparent); }
  .foot { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
  .hero { flex-direction: column; text-align: center; gap: 8px; }
  .hero-pip svg { width: 110px; height: 110px; }
  .hero-talk .bigsearch { margin-inline: auto; }
  .try { justify-content: center; }
  .bigsearch input { font-size: 16px; }
  .bigsearch button { padding: 0 18px; }
  .portals { gap: 16px 4px; }
  .portal { width: calc(33.33% - 4px); }
  .portal-ring { width: 88px; height: 88px; }
  .portal-ring span { font-size: 38px; }
  .portal b { font-size: 1rem; }
  .rail-nav { display: none; }
  .game-hero, .game-body { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .sort { margin-left: 0; }
  .cat-hero { flex-direction: column; align-items: flex-start; }
  .filters { gap: 10px; }
}
@media (max-width: 380px) { .brand span { display: none; } }

/* ---------- player overlay ---------- */
.player { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #10163D; color: #EEF1FF; }
.player.opening { animation: open .38s cubic-bezier(.2, .8, .2, 1) both; }
.player.closing { animation: open .25s ease-in reverse both; }
@keyframes open { from { opacity: 0; transform: scale(.94) translateY(24px); border-radius: 30px; } }
.pl-bar { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 6px) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); background: #151C4B; flex: none; }
.pl-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; }
.pl-title b { font-family: var(--font-d); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-icon { font-family: var(--emoji); font-size: 1.3rem; }
.pl-tools { display: flex; gap: 6px; }
.pl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.pl-btn:hover { background: rgba(255, 255, 255, .18); }
.pl-close span { font-size: 1.5rem; line-height: 1; margin-top: -2px; }
.pl-fav { font-size: 1.25rem; padding: 0 12px; }
.pl-fav[aria-pressed="true"] { color: #FF8FA3; }
.pl-stage { position: relative; flex: 1; min-height: 0; }
.pl-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #10163D; }
.pl-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; font-weight: 600; transition: opacity .3s; }
.pl-loading .pip { animation: hover 1.4s ease-in-out infinite; }
.pl-loading.done { opacity: 0; pointer-events: none; }
body.playing { overflow: hidden; }
@media (max-width: 520px) { .pl-about { display: none; } .pl-title b { font-size: 1rem; } }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); transform: translateX(-50%); background: var(--ink); color: var(--land); padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); animation: toast 2.4s ease both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* page swaps */
main.leaving { opacity: .35; transition: opacity .15s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }


/* ---------- accounts ---------- */
.login-btn { background: var(--ink) !important; color: var(--land) !important; }
.me-btn .me-e { font-family: var(--emoji); font-size: 1.3rem; }
.form-stage { display: grid; place-items: center; padding-bottom: 80px; }
.form-card { width: min(100%, 480px); background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(22px, 4vw, 34px); text-align: center; }
.form-card h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin-top: 6px; }
.form-card .page-lead { margin: 8px auto 0; font-size: 1.02rem; }
.stack { display: grid; gap: 14px; text-align: left; margin-top: 18px; }
.stack label, .player-row label { display: grid; gap: 6px; font-weight: 600; }
.stack small { color: var(--ink-2); font-weight: 400; font-size: .85rem; }
.stack input:not([type=checkbox]):not([type=radio]), .player-row input:not([type=radio]) { font: inherit; font-size: 16px; color: var(--ink); background: var(--land); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stack input:focus, .player-row input:focus { outline: none; border-color: var(--lagoon); }
.stack .check, .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .95rem; }
.check input { width: 22px; height: 22px; accent-color: var(--lagoon-deep); flex: none; margin-top: 1px; }
.stack .btn-play { width: 100%; margin-top: 4px; }
.form-err, .form-ok { border-radius: 14px; padding: 10px 14px; margin: 14px 0 0; font-weight: 500; text-align: left; }
.form-err { background: #FFE6EB; color: #8A1F33; } .form-ok { background: #E1F5E7; color: #1F5E31; }
.form-alt { margin: 18px 0 0; font-size: .95rem; }
.form-note { margin: 10px 0 0; font-size: .85rem; color: var(--ink-2); }
.avatars { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatars legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.avatars label { position: relative; display: block; cursor: pointer; }
.avatars input { position: absolute; opacity: 0; inset: 0; }
.avatars span[aria-hidden] { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-family: var(--emoji); font-size: 1.6rem; background: var(--land); border: 3px solid transparent; transition: transform .15s; }
.avatars input:checked + span { border-color: var(--lagoon); background: color-mix(in srgb, var(--lagoon) 18%, var(--paper)); transform: scale(1.08); }
.avatars input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.form-wide { display: grid; gap: 18px; max-width: 720px; }
.panel-card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px 24px; }
.panel-card h2 { font-size: 1.4rem; margin-bottom: 10px; }
.panel-card h3 { font-size: 1.15rem; }
.player-row { border-bottom: 1px solid var(--line); padding: 8px 0; }
.player-row summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 6px 0; font-size: 1.1rem; }
.player-row summary .av { font-family: var(--emoji); font-size: 1.8rem; }
.player-row summary .edit { margin-left: auto; font-size: .9rem; color: var(--lagoon-deep); font-weight: 600; }
.player-row details[open] { display: grid; gap: 12px; padding-bottom: 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger { color: #B42845; }
.add-player { border-top: 0; margin-top: 18px; }
.danger-zone { margin-top: 14px; } .danger-zone summary { cursor: pointer; color: #B42845; font-weight: 600; }

.join-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 22px; margin-top: 22px; max-width: 760px; }
.join-card > span { font-family: var(--emoji); font-size: 2rem; }
.join-card p { flex: 1 1 260px; margin: 0; }
.me-head { display: flex; align-items: center; gap: 18px; }
.me-av { width: 96px; height: 96px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-family: var(--emoji); font-size: 54px; box-shadow: 0 0 0 8px var(--lagoon), var(--shadow); flex: none; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.who > span { font-weight: 600; margin-right: 4px; }
.who button { display: inline-flex; align-items: center; gap: 6px; border: 0; font: inherit; font-weight: 600; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--glass); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.who button span { font-family: var(--emoji); font-size: 1.3rem; }
.who button.on { background: var(--ink); color: var(--land); }
.me-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 20px 0 0; }
.me-stats li { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 18px; padding: 10px 16px; font-weight: 500; }
.me-stats b { font-family: var(--font-d); font-size: 1.5rem; margin-right: 4px; }
.prog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-bottom: 34px; }
.prog { background: var(--paper); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 10px; align-content: start; border-top: 6px solid var(--c); }
.prog header { display: flex; gap: 12px; align-items: center; }
.prog-ico { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-family: var(--emoji); font-size: 26px; background: color-mix(in srgb, var(--c) 25%, var(--paper)); flex: none; }
.prog-t { flex: 1; min-width: 0; }
.prog-t h3 { font-size: 1.15rem; } .prog-t h3 a { color: var(--ink); text-decoration: none; }
.prog-t small { color: var(--ink-2); }
.state { font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.s-completed { background: #DDF4E3; color: #1F5E31; } .s-in_progress { background: #FFF1CC; color: #6B4B00; } .s-started { background: #E4EEFB; color: #274B84; }
.bar { height: 12px; border-radius: 999px; background: var(--land); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--meadow), var(--lagoon)); border-radius: inherit; }
.bar-l { margin: -4px 0 0; font-size: .88rem; color: var(--ink-2); }
.parts summary { cursor: pointer; font-weight: 600; color: var(--lagoon-deep); }
.parts ol, .mine-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.parts li, .mine-list li { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.parts em, .mine-list em { margin-left: auto; font-style: normal; color: var(--ink-2); font-size: .85rem; white-space: nowrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C5D0DC; flex: none; }
.p-started .dot { border-color: #7EA6E0; } .p-in_progress .dot { border-color: var(--sun); background: conic-gradient(var(--sun) 50%, transparent 0); }
.p-completed .dot { border-color: var(--meadow); background: var(--meadow); }
.prog-go { justify-self: start; min-height: 42px; }
.acct-link { margin-bottom: 30px; } .tabs.light { display: flex; width: max-content; max-width: 100%; background: var(--paper); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-prog { position: absolute; right: 10px; bottom: 10px; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #FFF1CC; color: #6B4B00; box-shadow: var(--shadow); }
.card-prog[data-state="completed"] { background: #DDF4E3; color: #1F5E31; } .card-prog[data-state="started"] { background: #E4EEFB; color: #274B84; }
.chapters { padding-left: 1.4em; display: grid; gap: 4px; } .chapters .is-quiz { font-weight: 600; }
.side { display: grid; gap: 16px; align-content: start; }
.side-card.mine h2 span { font-family: var(--emoji); }
.save-nudge p { margin: 0; }
@media (max-width: 760px) { .avatars { grid-template-columns: repeat(6, 1fr); gap: 4px; } .avatars span[aria-hidden] { font-size: 1.35rem; } .me-av { width: 72px; height: 72px; font-size: 40px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
