/* LearningCave — one stylesheet, no build step.
   Parent screens: calm "cave light" (warm paper, deep indigo, amber).
   Kid screens: a glowing crystal cave with bright, chunky game panels. */
:root {
  --ink: #1b1840; --ink-soft: #5d5a7e; --paper: #fbf7ef; --card: #ffffff; --line: #ebe4d6;
  --sun: #ffc93c; --amber: #ffb02e; --orange: #ff8a3d; --berry: #e84393; --grape: #6c5ce7; --sky: #1fa2d6; --leaf: #2bb673; --night: #262056; --cave: #120f2e; --crystal: #7ef0ff;
  --ok: #1f9d55; --bad: #d64545; --warn: #a86a00;
  --radius: 22px; --shadow: 0 6px 0 rgba(27,24,64,.07), 0 16px 34px rgba(27,24,64,.09);
  --font-fun: "Baloo 2", "Nunito", system-ui, sans-serif; --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--grape); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-fun); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); } h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); } .small { font-size: .88rem; } .center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 18px; } .grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } .grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 24px 20px 60px; } .wrap.narrow { max-width: 560px; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 2px solid var(--line); color: var(--ink); }
.card.flat { box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: #efeafd; color: var(--ink); font-weight: 700; font-size: .85rem; }
.pill.ok { background: #e3f7ea; color: var(--ok); } .pill.bad { background: #fdeaea; color: var(--bad); } .pill.warn { background: #fff1d1; color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  font: 800 1rem var(--font); padding: 12px 20px; border-radius: 14px; background: var(--grape); color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.2); transition: transform .08s, box-shadow .08s, filter .15s; min-height: 48px; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tile:focus-visible, .gbtn:focus-visible, .gtool:focus-visible { outline: 4px solid var(--sun); outline-offset: 2px; }
.btn.big { font-size: 1.25rem; padding: 18px 28px; border-radius: 18px; min-height: 64px; font-family: var(--font-fun); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; opacity: .9; }
.btn.sun { background: var(--sun); color: var(--ink); } .btn.leaf { background: var(--leaf); } .btn.berry { background: var(--berry); }
.btn.sky { background: var(--sky); } .btn.orange { background: var(--orange); } .btn.danger { background: var(--bad); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--grape); cursor: pointer; text-decoration: underline; }

/* Forms */
label { font-weight: 700; display: block; margin-bottom: 6px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
textarea { min-height: 120px; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.field { margin-bottom: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; margin-bottom: 10px; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.error { color: var(--bad); font-weight: 700; font-size: .92rem; margin-top: 4px; }
.flash { padding: 14px 18px; border-radius: 14px; background: #e9f9ef; border: 2px solid #bfe9cf; color: #124d2c; font-weight: 700; margin-bottom: 18px; }
.flash.bad { background: #fdeeee; border-color: #f4c5c5; color: #7a1f1f; }

/* Brand */
.brand { font-family: var(--font-fun); font-weight: 800; font-size: 1.45rem; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.brand b { color: var(--grape); }
.brand-mark { width: 36px; height: 36px; flex: none; }

/* Grown-up chrome */
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button { text-decoration: none; color: var(--ink); font-weight: 700; padding: 8px 12px; border-radius: 10px; background: none; border: 0; font: 700 1rem var(--font); cursor: pointer; }
.nav a:hover, .nav a.on { background: #efeafd; color: var(--grape); }
.nav a.btn { color: #fff; background: var(--grape); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; }
.stat { font-family: var(--font-fun); font-size: 2rem; font-weight: 800; line-height: 1; }
.bars { display: flex; gap: 8px; align-items: flex-end; height: 120px; padding-top: 10px; }
.bars div { flex: 1; background: linear-gradient(var(--grape), #8f7cf5); border-radius: 8px 8px 3px 3px; min-height: 3px; position: relative; }
.bars div span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--ink-soft); }
.meter { height: 12px; background: #ece7fb; border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--grape), var(--berry)); border-radius: 99px; transition: width .4s; }
details summary { cursor: pointer; font-weight: 800; }
footer.foot { text-align: center; padding: 30px; color: var(--ink-soft); font-size: .9rem; }
nav[role=navigation] svg { width: 18px; }

/* ================================================= Kid screens: the crystal cave */
body.kid { color: #f3f0ff; min-height: 100vh;
  background: radial-gradient(1200px 500px at 15% -10%, rgba(126,240,255,.18), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(232,67,147,.18), transparent 60%),
              radial-gradient(800px 600px at 50% 120%, rgba(108,92,231,.35), transparent 60%), var(--cave);
  background-attachment: fixed; }
body.kid::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 20%, #bdf6ff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 40% 80%, #ffd6f0 50%, transparent 51%), radial-gradient(2px 2px at 85% 60%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 10% 70%, #fff 50%, transparent 51%);
  background-size: 380px 380px; }
body.kid.large-text { font-size: 20px; }
.kid .muted { color: #c2bce8; }
.kid .card .muted, .kid .q-card .muted, .kid .gcard .muted, .kid .bubble .muted { color: var(--ink-soft); }
.kid a { color: var(--crystal); } .kid .card a { color: var(--grape); }
.kid h1, .kid h2 { text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.kid .card h1, .kid .card h2, .kid .card h3 { text-shadow: none; }
.kid .card { border: 0; box-shadow: 0 8px 0 rgba(0,0,0,.25), 0 0 0 4px rgba(255,255,255,.08); }
.kid .btn.ghost { color: #fff; } .kid .card .btn.ghost { color: var(--ink); }
.kid .kidbar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: rgba(18,15,46,.82); backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(126,240,255,.18); position: sticky; top: 0; z-index: 40; flex-wrap: wrap; }
.kidbar .home { font-size: 1.6rem; text-decoration: none; display: flex; align-items: center; gap: 8px; color: #fff; font-family: var(--font-fun); font-weight: 800; }
.kidbar .who { display: flex; align-items: center; gap: 10px; font-family: var(--font-fun); font-weight: 800; font-size: 1.15rem; text-decoration: none; color: #fff; }
.kidbar .spacer { flex: 1; }
.timer { font-weight: 800; padding: 6px 12px; border-radius: 999px; background: rgba(43,182,115,.25); color: #c9ffe0; border: 2px solid rgba(43,182,115,.5); }
.timer.low { background: rgba(255,201,60,.25); color: #ffe9a8; border-color: rgba(255,201,60,.6); }
.chip { background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: .9rem; white-space: nowrap; }
.avatar { --c: var(--grape); width: 52px; height: 52px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-size: 1.7rem; position: relative; flex: none; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), 0 0 0 3px rgba(255,255,255,.85); }
.avatar.xl { width: 140px; height: 140px; font-size: 4.5rem; box-shadow: inset 0 -10px 0 rgba(0,0,0,.18), 0 0 0 5px #fff, 0 0 40px rgba(126,240,255,.45); }
.avatar .hat { position: absolute; top: -18%; font-size: .7em; } .avatar .gear { position: absolute; bottom: -6%; right: -14%; font-size: .55em; }
.avatar .outfit { position: absolute; bottom: -10%; left: -12%; font-size: .55em; } .avatar .pet { position: absolute; bottom: -8%; right: -40%; font-size: .6em; }

.hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-bottom: 22px; }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero .avatar { margin: 0 auto; } }
.guide { display: flex; gap: 14px; align-items: flex-start; }
.guide .face { font-size: 3rem; line-height: 1; flex: none; animation: bob 3s ease-in-out infinite; }
.bubble { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 20px; padding: 14px 18px; position: relative; font-weight: 700; box-shadow: 4px 4px 0 var(--ink); }
.bubble::before { content: ""; position: absolute; left: -14px; top: 18px; border: 8px solid transparent; border-right-color: var(--ink); }
.say { margin-left: 8px; background: var(--sun); color: var(--ink); border: 0; border-radius: 999px; padding: 4px 10px; font-weight: 800; cursor: pointer; font-size: .85rem; }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(255,255,255,.12), 0 0 34px rgba(126,240,255,.55); } }
.reduced-motion *, .reduced-motion *::before { animation: none !important; transition: none !important; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 24px; text-decoration: none; color: #fff !important; min-height: 140px;
  font-family: var(--font-fun); font-size: 1.3rem; font-weight: 800; box-shadow: 0 7px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.3); position: relative; overflow: hidden; transition: transform .12s; border: 0; cursor: pointer; text-align: left; }
.tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.12); }
.tile:hover { transform: translateY(-4px) rotate(-.5deg); }
.tile .ico { font-size: 2.5rem; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.2)); }
.tile small { font-family: var(--font); font-size: .95rem; font-weight: 700; opacity: .92; }
.tile .badge { position: absolute; top: 14px; right: 14px; background: #fff; color: var(--berry); border-radius: 999px; padding: 2px 10px; font-size: .9rem; z-index: 1; }
.tile.next { grid-column: 1 / -1; min-height: 110px; flex-direction: row; align-items: center; gap: 20px; background: linear-gradient(120deg, #ff8a3d, #e84393 60%, #6c5ce7); animation: glow 2.6s ease-in-out infinite; }
.tile.next .ico { font-size: 3.2rem; }
.t1 { background: linear-gradient(160deg, #8a7cff, #5b49e0); } .t2 { background: linear-gradient(160deg, #3cc3f2, #1784c2); } .t3 { background: linear-gradient(160deg, #3fd38a, #1f9d63); }
.t4 { background: linear-gradient(160deg, #ff6bb5, #d42f7f); } .t5 { background: linear-gradient(160deg, #ffad5c, #f07a20); } .t6 { background: linear-gradient(160deg, #4b4392, #2a2366); }

.world-card { border-radius: 24px; padding: 18px; color: #fff; text-decoration: none; display: flex; flex-direction: column; gap: 4px; min-height: 140px; box-shadow: 0 6px 0 rgba(0,0,0,.25); position: relative; }
.world-card .ico { font-size: 2.4rem; } .world-card b { font-family: var(--font-fun); font-size: 1.3rem; }
.world-card.locked { filter: grayscale(.75); opacity: .75; } .world-card .lock { position: absolute; right: 14px; top: 12px; font-size: 1.4rem; }

/* ================================================= Game stage (worlds + island map) */
.game { position: relative; height: calc(100vh - 150px); min-height: 460px; border-radius: 26px; overflow: hidden; background: #000;
  box-shadow: 0 10px 0 rgba(0,0,0,.35), 0 0 0 4px rgba(126,240,255,.25), 0 0 60px rgba(108,92,231,.35); user-select: none; -webkit-user-select: none; touch-action: none; }
.game:fullscreen { border-radius: 0; height: 100vh; }
.game canvas { display: block; width: 100%; height: 100%; }
.game .hud { position: absolute; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; z-index: 5; }
.hud.tl { left: 12px; top: 12px; max-width: 60%; } .hud.tr { right: 12px; top: 12px; justify-content: flex-end; max-width: 45%; }
.hud.bl { left: 12px; bottom: 12px; } .hud.br { right: 12px; bottom: 12px; }
.hud-title { background: rgba(18,15,46,.78); color: #fff; padding: 8px 14px; border-radius: 16px; font-family: var(--font-fun); font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; border: 2px solid rgba(255,255,255,.15); }
.hud-hint { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 4; background: rgba(18,15,46,.7); color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; max-width: 70%; text-align: center; pointer-events: none; }
@media (max-width: 760px) {
  .hud-hint { bottom: 74px; max-width: 70%; font-size: .8rem; }
  .hud.br { flex-direction: column; flex-wrap: nowrap; bottom: 12px; top: auto; }
  .hud.br .gbtn { min-height: 40px; min-width: 40px; padding: 4px; }
  .hud.tr { top: 60px; max-width: calc(100% - 24px); }
  .hud-title { font-size: 1rem; }
}
.gchip { background: rgba(255,255,255,.95); color: var(--ink); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: .9rem; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; min-width: 46px; padding: 8px 14px; border: 0; border-radius: 14px; cursor: pointer;
  font: 800 1rem var(--font); color: #fff; background: var(--grape); box-shadow: 0 4px 0 rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.25); text-decoration: none; }
.gbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.gbtn.on { background: var(--sun); color: var(--ink); } .gbtn.green { background: var(--leaf); } .gbtn.sky { background: var(--sky); } .gbtn.red { background: var(--bad); } .gbtn.sun { background: var(--sun); color: var(--ink); }
.gbtn.ghost { background: rgba(255,255,255,.92); color: var(--ink); } .gbtn.sm { min-height: 38px; padding: 6px 10px; font-size: .9rem; }
.gbtn[disabled] { opacity: .45; pointer-events: none; }
.gbtn-group { display: flex; background: rgba(18,15,46,.6); padding: 4px; border-radius: 18px; gap: 4px; }
.toolbox { position: absolute; right: 12px; top: 64px; bottom: 74px; width: 250px; z-index: 6; background: rgba(18,15,46,.86); border: 2px solid rgba(126,240,255,.25); border-radius: 20px; padding: 12px; overflow-y: auto; color: #fff; }
.toolbox h3 { color: #fff; margin: 0 0 8px; font-size: 1.05rem; }
.toolbox .palette { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 760px) {
  .toolbox { left: 12px; right: 64px; top: auto; bottom: 70px; width: auto; padding: 8px; overflow: hidden; }
  .toolbox h3 { display: none; }
  .toolbox .palette { display: flex; overflow-x: auto; gap: 8px; scroll-snap-type: x mandatory; padding-bottom: 2px; }
  .toolbox .gtool { min-width: 92px; scroll-snap-align: start; }
  .is-build .hud-hint { display: none; }
  .hud.tl .lbl { display: none; }
  .hud.tl { flex-wrap: nowrap; max-width: calc(100% - 24px); }
}
.gtool { border: 3px solid transparent; border-radius: 14px; background: rgba(255,255,255,.95); color: var(--ink); padding: 8px 4px; text-align: center; cursor: pointer; font: 700 .8rem var(--font); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gtool .i { font-size: 1.8rem; line-height: 1.1; } .gtool .c { font-size: .72rem; color: var(--ink-soft); }
.gtool.on { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255,201,60,.4); } .gtool.locked { opacity: .45; } .gtool.poor .c { color: var(--bad); }
.gpop { position: absolute; z-index: 8; transform: translate(-50%, -100%); background: #fff; color: var(--ink); border-radius: 16px; padding: 10px 12px; box-shadow: 0 6px 0 rgba(0,0,0,.3); min-width: 200px; }
.gpop::after { content: ""; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; }
.gpop .row { margin-top: 8px; gap: 6px; }
.gcard { position: absolute; z-index: 9; left: 50%; bottom: 80px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); background: #fff; color: var(--ink);
  border-radius: 22px; padding: 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: 0 8px 0 rgba(0,0,0,.3), 0 0 0 4px rgba(255,255,255,.3); animation: pop .25s ease-out; }
.gcard h3 { margin: 2px 0 6px; } .gcard p { margin: 0 0 10px; } .gcard .small { color: var(--ink-soft); font-weight: 700; }
.gcard-face { font-size: 2.6rem; width: 64px; height: 64px; border-radius: 18px; background: #efeafd; display: grid; place-items: center; flex: none; }
.gcard form { margin: 0; }
.island-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.island-list button { background: rgba(255,255,255,.12); color: inherit; border: 2px solid rgba(255,255,255,.2); border-radius: 999px; padding: 6px 12px; font: 700 .9rem var(--font); cursor: pointer; }
.public .island-list button { background: #fff; border-color: var(--line); }
.game.hub { height: min(70vh, 640px); min-height: 420px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 16px; font-weight: 800; z-index: 300; box-shadow: var(--shadow); max-width: 90vw; text-align: center; border: 2px solid rgba(255,255,255,.2); }
.toast.warn { background: var(--warn); }

/* ================================================= Mission player */
.player { max-width: 780px; margin: 0 auto; }
.quest-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.quest-path { display: flex; align-items: center; gap: 0; margin: 10px auto 18px; max-width: 520px; position: relative; }
.quest-path i { flex: 1; height: 8px; background: rgba(255,255,255,.18); } .quest-path i.done { background: linear-gradient(90deg, #3fd38a, #2bb673); }
.quest-path b { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 1rem; flex: none; border: 3px solid rgba(255,255,255,.35); }
.quest-path b.done { background: var(--leaf); border-color: #b9f5d3; } .quest-path b.now { background: var(--sun); border-color: #fff; transform: scale(1.2); box-shadow: 0 0 24px rgba(255,201,60,.7); }
.quest-path b.goal { background: linear-gradient(135deg, #ffd93d, #ff8a3d); border-color: #fff; font-size: 1.1rem; }
.q-card { background: #fff; color: var(--ink); border-radius: 28px; padding: 28px; border: 0; box-shadow: 0 10px 0 rgba(0,0,0,.3), 0 0 0 5px rgba(255,255,255,.18), 0 0 50px rgba(126,240,255,.25); position: relative; }
.q-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.q-npc { position: absolute; top: -28px; left: 22px; font-size: 2.6rem; background: #fff; border-radius: 50%; width: 62px; height: 62px; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.q-prompt { font-family: var(--font-fun); font-size: 1.55rem; font-weight: 700; line-height: 1.3; margin: 12px 0 20px; }
.answer-input { font-size: 1.6rem !important; text-align: center; font-weight: 800; max-width: 280px; }
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice { padding: 18px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font: 800 1.1rem var(--font); cursor: pointer; text-align: left; color: var(--ink); min-height: 64px; box-shadow: 0 4px 0 var(--line); }
.choice:hover { border-color: var(--grape); } .choice.picked { border-color: var(--grape); background: #f2eefc; box-shadow: 0 4px 0 #cfc6fb; }
.order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.order-list li { display: flex; gap: 10px; align-items: center; background: #fff; color: var(--ink); border: 3px solid var(--line); border-radius: 16px; padding: 10px 12px; font-weight: 800; }
.order-list li .n { background: var(--grape); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; flex: none; }
.order-list li .mv { margin-left: auto; display: flex; gap: 6px; }
.order-list li .mv button { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: #faf8ff; font-size: 1.1rem; cursor: pointer; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 18px; font-weight: 800; }
.feedback.ok { background: #e3f7ea; color: #13643a; } .feedback.no { background: #fff4d6; color: #7a5200; }
.hints { margin-top: 14px; display: grid; gap: 8px; }
.hints div { background: #fffbe8; color: var(--ink); border: 2px dashed var(--sun); border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.role-tag { display: inline-flex; gap: 6px; align-items: center; background: var(--sky); color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 999px; margin-bottom: 4px; }
.celebrate { text-align: center; }
.celebrate .big-ico { font-size: 6rem; line-height: 1; animation: pop .6s ease-out; filter: drop-shadow(0 8px 0 rgba(0,0,0,.15)); }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.reward-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }
.reward { background: #fff; color: var(--ink); border: 3px solid var(--sun); border-radius: 18px; padding: 10px 16px; font-weight: 800; animation: pop .5s ease-out both; }
.reward:nth-child(2) { animation-delay: .15s; } .reward:nth-child(3) { animation-delay: .3s; } .reward:nth-child(4) { animation-delay: .45s; } .reward:nth-child(5) { animation-delay: .6s; }
.victory { background: linear-gradient(180deg, #fff, #fff6dd); }

/* Rooms & social */
.players { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.player-card { background: #fff; color: var(--ink); border-radius: 18px; padding: 14px; border: 3px solid var(--line); text-align: center; }
.player-card .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #bbb; } .player-card .dot.on { background: var(--leaf); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button { border: 2px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 800 .95rem var(--font); cursor: pointer; }
.feed { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.feed div { background: #f7f5fd; color: var(--ink); border-radius: 12px; padding: 6px 10px; font-weight: 700; }
.code-box { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: .12em; font-weight: 800; background: #fff; color: var(--ink); border: 3px dashed var(--grape); border-radius: 14px; padding: 8px 16px; display: inline-block; }

/* Public landing */
.public-hero { text-align: center; padding: 26px 0 8px; }
.public-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.public-hero .lede { max-width: 640px; margin: 0 auto 10px; color: var(--ink-soft); font-size: 1.12rem; }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 720px; margin: 22px auto; }
.door { border-radius: 26px; padding: 26px; text-decoration: none; color: #fff !important; font-family: var(--font-fun); font-size: 1.45rem; font-weight: 800; box-shadow: 0 8px 0 rgba(0,0,0,.2); transition: transform .12s; }
.door:hover { transform: translateY(-4px); } .door span { display: block; font-size: 3rem; } .door small { display: block; font: 700 1rem var(--font); opacity: .92; }

/* ================================================= v3: thumb stick, keypad, citizens, rooms, restaurant */
.gbtn.orange { background: var(--orange); } .gbtn.off { opacity: .45; text-decoration: line-through; }
.gchip.coins { background: linear-gradient(180deg, #fff6c9, #ffd95a); }
.kidbar .gchip { box-shadow: none; }

.stick { position: absolute; left: 18px; bottom: 74px; z-index: 7; display: none; touch-action: none; }
@media (pointer: coarse), (max-width: 760px) { .stick { display: block; } }
.is-build .stick { display: none !important; }
.stick-base { width: 128px; height: 128px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,.12)); border: 3px solid rgba(255,255,255,.55); position: relative; backdrop-filter: blur(3px); box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c9c2ff); box-shadow: 0 4px 0 rgba(0,0,0,.3); transition: transform .05s; }
.stick.held .stick-knob { background: radial-gradient(circle at 35% 30%, #fff, #ffd93d); }
.stick .a { position: absolute; color: rgba(255,255,255,.85); font-size: 13px; font-weight: 900; }
.stick .a.n { top: 6px; left: 50%; transform: translateX(-50%); } .stick .a.s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.stick .a.w { left: 8px; top: 50%; transform: translateY(-50%); } .stick .a.e { right: 8px; top: 50%; transform: translateY(-50%); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; margin-top: 12px; }
.keypad button { min-height: 54px; border-radius: 14px; border: 0; background: #efeafd; color: var(--ink); font: 900 1.4rem var(--font-fun); box-shadow: 0 4px 0 #cfc6fb; cursor: pointer; }
.keypad button:active { transform: translateY(3px); box-shadow: 0 1px 0 #cfc6fb; }
.keypad button[data-k="⌫"] { background: #ffe3e3; box-shadow: 0 4px 0 #f5b5b5; }

.gcard.ask { max-height: calc(100% - 100px); overflow-y: auto; width: min(620px, calc(100% - 24px)); }
.gcard.shake, .customer.shake { animation: shake .4s; }
.ask-prompt { font: 700 1.15rem var(--font-fun); }
.ask-input { font: 800 1.4rem var(--font) !important; text-align: center; max-width: 200px; padding: 10px; border-radius: 12px; border: 3px solid var(--line); }
.small-choices { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.small-choices .choice { padding: 10px; min-height: 48px; font-size: 1rem; }

.room-game { background: #1b1546; }
.shop { width: 280px; }
.shop .gtool .c { font-weight: 800; }

/* Restaurant */
.resto { --resto-bg: #ffe0b5; max-width: 1100px; margin: 0 auto; }
.resto-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.resto-stage { display: grid; grid-template-columns: 1fr 260px; gap: 14px; }
@media (max-width: 760px) { .resto-stage { grid-template-columns: 1fr; } }
.resto-scene { position: relative; height: 300px; border-radius: 24px; overflow: hidden; background: linear-gradient(180deg, var(--resto-bg) 0 62%, #c98b55 62% 100%);
  box-shadow: 0 8px 0 rgba(0,0,0,.3), 0 0 0 4px rgba(255,255,255,.2); }
.resto-wall { position: absolute; inset: 0 0 38% 0; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 22px, transparent 22px 44px); }
.resto-wall .sign { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: #3b2a5a; color: #ffd93d; font: 800 1.2rem var(--font-fun); padding: 6px 18px; border-radius: 12px; box-shadow: 0 0 18px rgba(255,217,61,.6); white-space: nowrap; }
.resto-wall .lamp { position: absolute; top: 8px; left: 14%; font-size: 1.6rem; animation: bob 3s ease-in-out infinite; } .resto-wall .lamp.r { left: auto; right: 14%; }
.resto-door { position: absolute; left: 14px; bottom: 34%; font-size: 4.6rem; line-height: 1; }
.customer-wrap { position: absolute; left: 30%; bottom: 36%; width: 120px; text-align: center; z-index: 2; }
.resto-q .keypad { max-width: 340px; }
.customer { font-size: 5.4rem; line-height: 1; transform: translateX(-260px); opacity: 0; }
.customer.enter { animation: walkIn .9s ease-out forwards; }
.customer.leave { animation: walkOut .9s ease-in forwards; } .customer.leave-happy { animation: hopOut 1s ease-in forwards; }
@keyframes walkIn { 0% { transform: translateX(-260px); opacity: 0; } 60% { opacity: 1; } 70% { transform: translateX(10px) translateY(-8px); } 100% { transform: translateX(0); opacity: 1; } }
@keyframes walkOut { to { transform: translateX(-280px); opacity: 0; } }
@keyframes hopOut { 30% { transform: translateY(-30px); } 100% { transform: translateX(-280px) translateY(0); opacity: 0; } }
.mood { position: absolute; right: -6px; top: -6px; font-size: 2rem; }
.resto-bubble { position: absolute; left: 110px; bottom: 90px; width: max-content; max-width: 300px; font-size: .95rem; opacity: 0; transform: scale(.6); transition: .25s; transform-origin: left bottom; }
.resto-bubble.show { opacity: 1; transform: scale(1); }
@media (max-width: 760px) { .customer-wrap { left: 18%; } .resto-bubble { left: 70px; bottom: 100px; max-width: 220px; } }
.counter { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(180deg, #8d5a33, #6e4426); border-top: 8px solid #b77a49; }
.counter .chef { position: absolute; right: 18%; top: -78px; font-size: 4.2rem; }
.counter .register { position: absolute; right: 5%; top: -46px; font-size: 3rem; }
.counter .tray { position: absolute; left: 34%; top: -38px; font-size: 2rem; letter-spacing: 2px; }
.ticket { background: #fffdf5; color: var(--ink); border-radius: 6px 6px 18px 18px; padding: 14px; box-shadow: 0 8px 0 rgba(0,0,0,.25); font-family: ui-monospace, Menlo, monospace; position: relative; }
.ticket::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; background: radial-gradient(circle at 6px 0, transparent 6px, #fffdf5 6px) repeat-x; background-size: 12px 8px; }
.ticket-head { font-weight: 900; border-bottom: 2px dashed #ddd; padding-bottom: 6px; margin-bottom: 6px; }
.ticket ul { list-style: none; padding: 0; margin: 0; }
.ticket li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 6px; align-items: center; padding: 4px 0; font-weight: 700; animation: pop .35s ease-out both; }
.ticket .li { font-size: 1.5rem; } .ticket .lq { color: var(--grape); } .ticket .lp { font-weight: 900; }
.ticket .tag { margin-top: 8px; padding: 6px 10px; border-radius: 10px; font-weight: 900; font-family: var(--font); }
.tag.pay { background: #e3f7ea; } .tag.split { background: #e0f3fb; } .tag.sale { background: #ffe3ef; color: #b0175f; }
.resto-q { margin-top: 18px; }
.patience { height: 10px; background: #eee; border-radius: 99px; overflow: hidden; } .patience i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffb02e, #2bb673); transition: width .25s linear; }
.money-input { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 3px solid var(--grape); border-radius: 16px; padding: 4px 12px; }
.money-input span { font: 900 2rem var(--font-fun); color: var(--grape); }
.money-input input { border: 0 !important; font: 900 2rem var(--font-fun) !important; width: 160px; padding: 6px !important; outline: none; }
.fly-coin { position: fixed; z-index: 300; font-size: 1.8rem; transition: left .6s cubic-bezier(.4,-0.3,.6,1), top .6s cubic-bezier(.4,-0.3,.6,1), opacity .6s; pointer-events: none; }
@media (pointer: coarse), (max-width: 760px) {
  .game .hud-hint { display: none; }
  .room-game .stick { bottom: 128px; }
  .room-game .hud.bl { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------- v4: chat, live worlds, showcase */
.chat { display: flex; flex-direction: column; color: var(--ink); }
.chat-head { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--font-fun); font-weight: 800; font-size: 1.15rem; padding: 2px 0 8px; }
.chat-head[disabled] { cursor: default; }
.chat-badge { background: var(--berry); color: #fff; border-radius: 999px; font-size: .78rem; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; font-family: var(--font); }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; min-height: 90px; overflow-y: auto; padding: 8px; background: #f6f3fc; border-radius: 16px; scroll-behavior: smooth; }
.chat-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.chat-msg .bubble-c { background: #fff; border-radius: 16px 16px 16px 4px; padding: 6px 12px; box-shadow: 0 2px 0 rgba(27,24,64,.07); overflow-wrap: anywhere; }
.chat-msg .who { font-size: .74rem; font-weight: 800; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; }
.chat-msg .who span { font-weight: 600; opacity: .75; }
.chat-msg .rep { text-decoration: none; font-size: .8rem; opacity: .5; } .chat-msg .rep:hover { opacity: 1; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.mine .bubble-c { background: var(--grape); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-msg.mine .who { color: rgba(255,255,255,.8); }
.chat-sys { align-self: center; font-size: .82rem; font-weight: 700; background: #fff4cf; color: #5b3b00; padding: 4px 12px; border-radius: 999px; text-align: center; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input { flex: 1; min-width: 0; margin: 0; }
.chat-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat-presets button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.chat-presets button:hover { border-color: var(--grape); }
.chat-note { color: var(--ink-soft); margin-top: 6px; }
.chat.closed .chat-body { display: none; }
.chat.closed .chat-head { padding-bottom: 0; }

/* chat panel inside a game world */
.game-chat { position: absolute; z-index: 6; right: 12px; top: 64px; width: min(320px, calc(100% - 24px)); background: rgba(255,255,255,.96); border-radius: 18px; padding: 10px 12px; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.game-chat .chat-head { font-size: 1rem; padding-bottom: 6px; }
.game-chat .chat-list { max-height: 190px; min-height: 60px; }
.game-chat.closed { width: auto; padding: 6px 12px; }
@media (max-width: 700px) { .game-chat { top: auto; bottom: 122px; right: 8px; } .game-chat .chat-list { max-height: 130px; } }
.gchip.here { background: rgba(43,182,115,.95); color: #fff; }
.emote-tray { position: absolute; left: 0; bottom: 56px; display: grid; grid-template-columns: repeat(5, 44px); gap: 6px; background: rgba(255,255,255,.96); padding: 8px; border-radius: 18px; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.emote-tray button { all: unset; cursor: pointer; font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
.emote-tray button:hover, .emote-tray button:focus-visible { background: #efeafd; }
.hud.bl { position: absolute; }

/* team town */
.team-brain { background: linear-gradient(135deg, #fff7da, #ffe9f3); border-radius: 18px; padding: 14px; border: 2px dashed #f3c64a; }
.gcard.team-ask { position: relative; left: auto; bottom: auto; transform: none; width: 100%; margin-top: 12px; display: flex; gap: 12px; }
.visit-worlds .pill { text-decoration: none; } .pill.on { background: var(--grape); color: #fff; }

/* home page showcase */
.showcase { position: relative; margin: 10px auto 18px; max-width: 1100px; border-radius: 30px; overflow: hidden; background: #0f1b3a; box-shadow: 0 18px 50px rgba(27,24,64,.25); border: 4px solid #fff; }
.showcase-stage { height: clamp(320px, 52vw, 520px); }
.showcase-stage canvas { display: block; width: 100%; height: 100%; }
.showcase-stage.in { animation: scIn .9s ease-out; }
@keyframes scIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.showcase-cap { position: absolute; left: 16px; top: 16px; display: flex; gap: 12px; align-items: center; background: rgba(18,15,46,.72); color: #fff; padding: 10px 16px 10px 10px; border-radius: 20px; backdrop-filter: blur(4px); max-width: calc(100% - 32px); }
.sc-ico { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; background: rgba(255,255,255,.15); border-radius: 14px; }
.sc-name { font-family: var(--font-fun); font-weight: 800; font-size: 1.3rem; line-height: 1.1; }
.sc-tag { font-size: .9rem; opacity: .85; }
.showcase-live { position: absolute; right: 16px; top: 16px; background: rgba(255,255,255,.92); color: var(--ink); font-weight: 800; font-size: .88rem; padding: 6px 12px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.showcase-live .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); animation: livePulse 1.6s infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px rgba(43,182,115,.25); } }
.showcase-dots { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); display: flex; gap: 8px; background: rgba(18,15,46,.6); padding: 6px; border-radius: 999px; }
.showcase-dots button { all: unset; cursor: pointer; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; transition: transform .2s, background .2s; }
.showcase-dots button[aria-selected="true"] { background: #fff; transform: scale(1.12); }
.showcase-dots button:focus-visible { outline: 3px solid var(--sun); }
.showcase-feats { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 10px 14px; background: linear-gradient(0deg, rgba(18,15,46,.85), rgba(18,15,46,0)); color: #fff; font-weight: 800; font-size: .92rem; }
@media (max-width: 640px) { .showcase-live { display: none; } .showcase-feats { display: none; } .showcase-dots { bottom: 12px; } .showcase-dots button { width: 34px; height: 34px; font-size: 1.1rem; } .sc-name { font-size: 1.05rem; } .sc-ico { width: 40px; height: 40px; font-size: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { .showcase-stage.in { animation: none; } .showcase-live .dot { animation: none; } }
.game.is-build .game-chat { right: auto; left: 12px; top: 64px; }
.game-chat .chat-presets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.game-chat .chat-presets button { flex: none; }
.chat-form input:disabled { background: #f3f0f8; color: var(--ink-soft); }
.chat-form button:disabled { opacity: .45; }

/* v7: explorer sign-up */
.err { color: var(--bad); font-weight: 700; font-size: .9rem; margin-top: 4px; }
#uname-help .ok { color: var(--ok); font-weight: 800; }
.kid .err { color: #c62828; }
.recovery-code { font: 800 2rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; background: #fff7da; border: 3px dashed var(--sun); border-radius: 18px; padding: 18px 10px; margin: 14px 0; color: var(--ink); word-break: break-all; }
.link-code { font: 800 1.5rem ui-monospace, Menlo, monospace; letter-spacing: .15em; background: #efeafd; border-radius: 12px; padding: 6px 14px; display: inline-block; }
button.pill { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem; }
@media print { .kidbar, .topbar, header, nav, .btn, .check, footer { display: none !important; } .recovery-code { border-color: #000; } }

/* ================================================================ v8: public homepage (lc-home) */
.lc-home { --h-bg: #fbf8ef; --h-ink: #1e3a2f; --h-soft: #5e6b64; --h-orange: #e8743b; --h-blue: #1f5fd6; --h-blue-d: #1647a8; --h-line: #ece6d6;
  background: var(--h-bg); color: var(--h-ink); font-family: var(--font); }
.lc-home .skip { position: absolute; left: -999px; } .lc-home .skip:focus { left: 12px; top: 12px; z-index: 50; background: #fff; padding: 8px 12px; border-radius: 10px; }
.h-wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.lc-home h1, .lc-home h2, .lc-home h3 { font-family: var(--font-fun); color: var(--h-ink); letter-spacing: -.015em; }
.lc-home .center { text-align: center; }
.h-kicker { font: 800 .74rem/1.2 var(--font); letter-spacing: .14em; text-transform: uppercase; color: #2f6b4f; margin: 0 0 8px; }

/* header */
.h-top { position: sticky; top: 0; z-index: 20; background: rgba(251,248,239,.92); backdrop-filter: blur(8px); }
.h-bar { display: flex; align-items: center; gap: 20px; height: 78px; }
.h-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 800 1.45rem var(--font-fun); color: var(--h-blue); }
.h-brand .brand-mark { width: 34px; height: 34px; }
.h-nav { margin: 0 auto; display: flex; gap: 26px; }
.h-nav a, .h-login { color: var(--h-ink); text-decoration: none; font-weight: 800; font-size: .95rem; white-space: nowrap; }
.h-nav a:hover, .h-login:hover { color: var(--h-blue); }
.h-actions { display: flex; align-items: center; gap: 20px; }
.h-btn { display: inline-flex; align-items: center; gap: 12px; background: var(--h-blue); color: #fff !important; text-decoration: none; font-weight: 800; font-size: .95rem;
  padding: 12px 20px; border-radius: 12px; box-shadow: 0 4px 0 var(--h-blue-d); border: 0; cursor: pointer; transition: transform .12s, box-shadow .12s; white-space: nowrap; }
.h-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--h-blue-d); } .h-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--h-blue-d); }
.h-btn.big { padding: 15px 22px; font-size: 1rem; }
.h-btn.ghost { background: #fff; color: var(--h-ink) !important; box-shadow: 0 4px 0 #e2dccb; border: 2px solid #e8e2d2; }
.h-btn:focus-visible, .h-card:focus-visible, .h-nav a:focus-visible { outline: 3px solid #f1b93a; outline-offset: 3px; }

/* hero */
.h-hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 30px; align-items: center; padding-top: 30px; padding-bottom: 40px; }
.h-eyebrow { font: 800 .76rem var(--font); letter-spacing: .16em; text-transform: uppercase; color: #2f6b4f; margin: 0 0 16px; }
.h-eyebrow .spark { color: var(--h-orange); font-size: 1rem; margin-right: 6px; }
.h-hero h1 { font-size: clamp(2.5rem, 5.4vw, 3.9rem); line-height: 1.04; margin: 0; }
.h-accent { color: var(--h-orange); }
.h-swoosh { width: min(260px, 60%); margin: 4px 0 18px 14px; display: block; }
.h-lede { color: var(--h-soft); font-size: 1.12rem; line-height: 1.6; margin: 0 0 26px; }
.h-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.h-note { margin: 22px 0 0; font-size: .82rem; color: var(--h-soft); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.h-note .tick { width: 18px; height: 18px; border-radius: 50%; background: #e2efdf; color: #2f8a4f; display: inline-grid; place-items: center; font-size: .7rem; font-weight: 900; }
.h-note b { color: var(--h-ink); }

.h-art { position: relative; padding: 30px 10px 34px; }
.h-island { position: relative; border-radius: 46% 54% 44% 56% / 52% 46% 54% 48%; overflow: hidden; aspect-ratio: 1.08 / 1;
  box-shadow: 0 30px 60px rgba(60,80,60,.18), inset 0 0 0 6px rgba(255,255,255,.6); background: #dff1ff; }
.h-island .showcase-stage { position: absolute; inset: 0; height: auto; }
.h-island .showcase-stage canvas { width: 100%; height: 100%; display: block; }
.h-island::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; pointer-events: none;
  background: radial-gradient(60% 100% at 30% 100%, rgba(255,255,255,.95), transparent 70%), radial-gradient(60% 100% at 75% 100%, rgba(255,255,255,.9), transparent 70%); }
.h-world-tag { position: absolute; left: 50%; top: 7%; transform: translateX(-50%); background: rgba(255,255,255,.92); border-radius: 999px; padding: 6px 14px; font-size: .88rem; color: var(--h-ink); box-shadow: 0 4px 12px rgba(0,0,0,.08); white-space: nowrap; z-index: 2; }
.h-float { position: absolute; z-index: 3; background: #fff; border-radius: 14px; box-shadow: 0 10px 26px rgba(40,60,40,.16); font-weight: 800; color: var(--h-ink); }
.h-float-a { right: -4px; top: 46px; transform: rotate(8deg); padding: 12px 18px; font-size: .92rem; animation: hFloat 5s ease-in-out infinite; }
.h-float-a .spark { color: #e2a52a; margin-right: 6px; }
.h-float-b { left: 6px; bottom: 30px; transform: rotate(-6deg); padding: 12px 16px; display: flex; gap: 10px; align-items: center; font-size: .9rem; animation: hFloat 6s ease-in-out infinite reverse; }
.h-float-b .sprout { font-size: 1.6rem; } .h-float-b small { display: block; font-weight: 600; color: var(--h-soft); font-size: .76rem; }
@keyframes hFloat { 50% { translate: 0 -8px; } }

/* subject strip */
.h-strip { background: #e9eee6; }
.h-strip-in { display: flex; align-items: center; justify-content: center; gap: 40px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; font-size: .92rem; }
.h-strip ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; flex-wrap: wrap; font-weight: 800; }
.h-strip li span { margin-right: 6px; opacity: .7; }

/* worlds */
.h-worlds { padding-top: 64px; padding-bottom: 30px; }
.h-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.h-head-row h2, .h-how h2, .h-cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin: 0; }
.h-side { color: var(--h-soft); font-size: .92rem; margin: 0; line-height: 1.6; }
.h-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.h-card { position: relative; text-align: left; background: var(--tint); border: 2px solid transparent; border-radius: 18px; padding: 10px 12px 14px; cursor: pointer; font: inherit; color: var(--h-ink);
  display: flex; flex-direction: column; gap: 2px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.h-card:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(40,60,40,.12); }
.h-card[aria-selected="true"] { border-color: var(--h-blue); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--h-blue); }
.h-card-art svg { width: 100%; height: auto; display: block; margin: 6px 0 8px; }
.h-card-go { position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.85); display: grid; place-items: center; font-size: .75rem; }
.h-card b { font-family: var(--font-fun); font-size: 1rem; }
.h-card small { color: var(--h-soft); font-size: .74rem; }
.h-panel { margin-top: 22px; display: flex; align-items: center; gap: 20px; background: #fff; border: 2px solid var(--h-line); border-radius: 20px; padding: 20px 24px; }
.h-panel-ico { width: 62px; height: 62px; border-radius: 14px; display: grid; place-items: center; font-size: 2rem; flex: none; }
.h-panel-text { flex: 1; } .h-panel-text h3 { margin: 0 0 4px; font-size: 1.25rem; } .h-panel-text p { margin: 0; color: var(--h-soft); font-size: .9rem; }
.h-panel .h-kicker { margin-bottom: 4px; }

/* how it works */
.h-how { padding-top: 70px; padding-bottom: 80px; }
.h-sub { color: var(--h-soft); margin: 10px 0 0; }
.h-steps { list-style: none; padding: 0; margin: 46px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; text-align: center; }
.h-steps li { position: relative; }
.h-blob { display: inline-grid; place-items: center; width: 104px; height: 90px; border-radius: 50% 46% 52% 48% / 55% 50% 50% 45%; background: var(--b); font-size: 3rem; }
.h-num { position: absolute; left: calc(50% - 72px); top: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); font: 800 .68rem var(--font); display: grid; place-items: center; }
.h-steps h3 { margin: 18px 0 8px; font-size: 1.2rem; } .h-steps p { margin: 0; color: var(--h-soft); font-size: .9rem; line-height: 1.6; }

/* closing CTA */
.h-cta { position: relative; background: #f6e8c6; padding: 64px 24px 56px; overflow: hidden; }
.h-cta h2 { margin: 6px 0 0; line-height: 1.12; }
.h-cta .h-btn { margin-top: 22px; }
.h-fine { color: var(--h-soft); font-size: .8rem; margin-top: 14px; }
.h-star { position: absolute; font-size: 3.4rem; line-height: 1; }
.h-star.s1 { left: 17%; top: 46%; color: #dba83c; animation: hTwinkle 3s ease-in-out infinite; }
.h-star.s2 { right: 19%; top: 62%; color: var(--h-orange); font-size: 2.8rem; animation: hTwinkle 3.6s ease-in-out infinite .8s; }
@keyframes hTwinkle { 50% { transform: scale(.82) rotate(12deg); opacity: .75; } }

/* footer */
.h-foot { padding: 28px 0 20px; }
.h-foot-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--h-line); }
.h-tag { color: var(--h-soft); font-size: .82rem; }
.h-foot nav { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.h-foot nav a { color: var(--h-ink); text-decoration: none; font-weight: 800; font-size: .82rem; }
.h-copy-row { padding-top: 14px; font-size: .74rem; color: var(--h-soft); }

/* responsive */
@media (max-width: 980px) {
  .h-cards { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .h-hero { grid-template-columns: 1fr; padding-top: 10px; }
  .h-art { order: -1; padding: 10px 0 20px; }
  .h-nav { display: none; }
  .h-actions { margin-left: auto; }
  .h-steps { grid-template-columns: 1fr; gap: 40px; }
  .h-panel { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .h-wrap { padding: 0 16px; }
  .h-bar { height: 64px; gap: 10px; }
  .h-brand { font-size: 1.2rem; } .h-brand .brand-mark { width: 28px; height: 28px; }
  .h-actions { gap: 12px; } .h-btn { padding: 10px 14px; }
  .h-cards { grid-template-columns: repeat(2, 1fr); }
  .h-float-a { right: 0; top: 0; font-size: .8rem; padding: 8px 12px; }
  .h-float-b { bottom: 8px; left: 0; font-size: .8rem; }
  .h-strip-in { gap: 12px; } .h-strip ul { gap: 14px; justify-content: center; }
  .h-ctas .h-btn { flex: 1 1 100%; justify-content: center; }
  .h-star { display: none; }
  .h-worlds { padding-top: 44px; } .h-how { padding-top: 56px; padding-bottom: 56px; }
  .h-strip-in { padding-top: 14px; padding-bottom: 14px; }
  .h-foot nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .h-float, .h-star { animation: none; } .h-card, .h-btn { transition: none; } }

/* ================================================================ v9: "homepage" skin for every page (lc-skin) */
body.lc-skin { --ink: #1e3a2f; --ink-soft: #5e6b64; --paper: #fbf8ef; --line: #ece6d6; --grape: #1f5fd6;
  --h-ink: #1e3a2f; --h-soft: #5e6b64; --h-orange: #e8743b; --h-blue: #1f5fd6; --h-blue-d: #1647a8; --h-line: #ece6d6;
  background: #fbf8ef !important; color: var(--ink); }
body.lc-skin::before { display: none; }
.lc-skin h1, .lc-skin h2, .lc-skin h3 { color: var(--ink); text-shadow: none !important; letter-spacing: -.015em; }
.lc-skin .muted, .lc-skin.kid .muted { color: var(--ink-soft); }
.lc-skin a { color: var(--h-blue); }
.lc-skin main.wrap { padding-top: 30px; min-height: calc(100vh - 230px); }

/* header in the app */
.lc-skin .h-top { border-bottom: 1px solid #efe9da; }
.lc-skin .skin-nav { gap: 6px; }
.lc-skin .skin-nav a { padding: 8px 12px; border-radius: 10px; }
.lc-skin .skin-nav a.on, .lc-skin .skin-nav a:hover { background: #e7eefb; color: var(--h-blue); }
.lc-skin .h-actions form { margin: 0; }
.lc-skin button.h-btn { font-family: var(--font); }
@media (max-width: 860px) {
  .lc-skin .skin-nav { display: flex; order: 3; width: 100%; margin: 0; overflow-x: auto; padding-bottom: 8px; }
  .lc-skin .h-bar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 4px; row-gap: 6px; }
}

/* kids' top bar: light, like the homepage header */
.lc-skin .kidbar { background: rgba(251,248,239,.94) !important; border-bottom: 1px solid #efe9da; box-shadow: none; color: var(--ink); }
.lc-skin .kidbar .home { color: var(--h-blue); font-size: 1.35rem; }
.lc-skin .kidbar .home .kb-name { font-family: var(--font-fun); font-weight: 800; }
.lc-skin .kidbar .who { color: var(--ink); }
.lc-skin .kidbar .btn.ghost { color: var(--ink); box-shadow: inset 0 0 0 2px #e2dccb; background: #fff; }
.lc-skin .kidbar .gchip { box-shadow: inset 0 0 0 2px #f1dc94; }
@media (max-width: 560px) { .lc-skin .kidbar .home .kb-name { display: none; } }

/* buttons */
.lc-skin .btn { background: var(--h-blue); color: #fff; box-shadow: 0 4px 0 var(--h-blue-d); border-radius: 12px; font-weight: 800; }
.lc-skin .btn:hover { filter: none; transform: translateY(-1px); }
.lc-skin .btn.ghost, .lc-skin.kid .btn.ghost, .lc-skin .card .btn.ghost { background: #fff; color: var(--ink) !important; box-shadow: 0 3px 0 #e2dccb, inset 0 0 0 2px #e8e2d2; opacity: 1; }
.lc-skin .btn.leaf { background: #2f8a4f; box-shadow: 0 4px 0 #1f6438; }
.lc-skin .btn.sun { background: #f1b93a; color: var(--ink); box-shadow: 0 4px 0 #c99320; }
.lc-skin .btn.sky { background: #2a8fc9; box-shadow: 0 4px 0 #1d6a97; }
.lc-skin .btn.danger { background: #d64545; box-shadow: 0 4px 0 #a52f2f; }
.lc-skin .btn.big { border-radius: 14px; font-family: var(--font); }
.lc-skin .linkbtn { color: var(--h-blue); }

/* cards, forms, pills */
.lc-skin .card, .lc-skin.kid .card { background: #fff; border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 10px 28px rgba(60,70,50,.06); color: var(--ink); }
.lc-skin input:not([type=checkbox]):not([type=radio]), .lc-skin select, .lc-skin textarea { border: 2px solid #e6e0d0; border-radius: 12px; background: #fff; color: var(--ink); }
.lc-skin input:focus, .lc-skin select:focus, .lc-skin textarea:focus { border-color: var(--h-blue); outline: none; box-shadow: 0 0 0 3px #d8e4fb; }
.lc-skin .pill { background: #eef2ec; color: var(--ink); }
.lc-skin .pill.ok { background: #e2efdf; color: #2f8a4f; }
.lc-skin .flash { border-radius: 14px; background: #e9f3e6; border-color: #cfe3c9; color: #1e4d2c; }
.lc-skin .code-box { border-color: var(--h-blue); color: var(--ink); }
.lc-skin .link-code { background: #e7eefb; color: var(--ink); }
.lc-skin .recovery-code { background: #fdf3d9; border-color: #f1b93a; }
.lc-skin .bubble { border-color: #e6e0d0; box-shadow: 0 6px 18px rgba(60,70,50,.08); color: var(--ink); }
.lc-skin .bubble::before { border-right-color: #e6e0d0; }
.lc-skin .stat { color: var(--ink); }
.lc-skin .meter { background: #eef2ec; } .lc-skin .meter i { background: linear-gradient(90deg, #2f8a4f, #5fb36f); }
.lc-skin table th { color: var(--ink-soft); }
.lc-skin .chip { border-color: #ece6d6; }

/* page heading pattern: small green kicker + big heading */
.skin-kicker { font: 800 .74rem/1.2 var(--font); letter-spacing: .14em; text-transform: uppercase; color: #2f6b4f; margin: 0 0 6px; }
.lc-skin .page-head { margin-bottom: 22px; }
.lc-skin .page-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0; }
.lc-skin .page-head p { color: var(--ink-soft); margin: 6px 0 0; }

/* doors (sign in / join): tinted cards like the world cards */
.lc-skin .door { color: var(--ink) !important; box-shadow: 0 10px 24px rgba(60,70,50,.08); border: 2px solid transparent; font-size: 1.35rem; }
.lc-skin .door.t1 { background: #e7eefb; } .lc-skin .door.t5 { background: #f6e8c6; }
.lc-skin .door small { color: var(--ink-soft); }
.lc-skin .door:hover { border-color: var(--h-blue); }

/* auth pages: two-column panel with a soft illustration side */
.auth-shell { display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; max-width: 980px; margin: 10px auto 40px; background: #fff; border: 2px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: 0 20px 50px rgba(60,70,50,.08); }
.auth-side { background: linear-gradient(160deg, #e5efdc, #f6e8c6); padding: 34px 30px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.auth-side h2 { font-size: 1.7rem; margin: 0; line-height: 1.15; }
.auth-side p { color: var(--ink-soft); margin: 0; }
.auth-side ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; }
.auth-side li { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: .95rem; }
.auth-side li span { width: 30px; height: 30px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none; }
.auth-side .auth-art { margin-top: auto; width: 100%; max-width: 260px; align-self: center; }
.auth-main { padding: 34px 32px; }
.auth-main > .card { border: 0; box-shadow: none; padding: 0; }
.auth-main h1 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); margin: 0 0 4px; }
.auth-main .sub { color: var(--ink-soft); margin: 0 0 20px; }
.auth-step { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font: 800 1.05rem var(--font-fun); }
.auth-step b { width: 26px; height: 26px; border-radius: 50%; background: var(--h-blue); color: #fff; display: grid; place-items: center; font: 800 .8rem var(--font); }
.auth-alt { text-align: center; color: var(--ink-soft); margin-top: 16px; font-size: .95rem; }
@media (max-width: 820px) { .auth-shell { grid-template-columns: 1fr; } .auth-side { padding: 22px; } .auth-side .auth-art, .auth-side ul { display: none; } .auth-main { padding: 24px 20px; } }

/* kids' home dashboard */
.kid-hello { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.kid-hello h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.lc-skin .tile { color: var(--ink) !important; box-shadow: none; border: 2px solid transparent; font-size: 1.15rem; min-height: 130px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.lc-skin .tile::after { display: none; }
.lc-skin .tile:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(40,60,40,.12); border-color: var(--h-blue); }
.lc-skin .tile .ico { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.75); display: grid; place-items: center; font-size: 1.9rem; filter: none; }
.lc-skin .tile small { color: var(--ink-soft); opacity: 1; }
.lc-skin .t1 { background: #e7eefb; } .lc-skin .t2 { background: #dcedf1; } .lc-skin .t3 { background: #e5efdc; }
.lc-skin .t4 { background: #ebe5ef; } .lc-skin .t5 { background: #f6ead6; } .lc-skin .t6 { background: #f6e3d9; }
.lc-skin .tile.next { background: linear-gradient(120deg, #1f5fd6, #3d7ae6) !important; color: #fff !important; animation: none; box-shadow: 0 6px 0 var(--h-blue-d); }
.lc-skin .tile.next small { color: #e3ecff; }
.lc-skin .tile .badge { background: var(--h-orange); color: #fff; }

/* parent dashboard */
.lc-skin .stat { font-family: var(--font-fun); font-size: 2rem; font-weight: 800; }
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-hero h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); }

/* game pages keep their own look inside the frame */
.lc-skin .game { box-shadow: 0 20px 50px rgba(30,40,60,.18); }
.lc-skin .hud-title { font-family: var(--font-fun); }
/* v9 touch-ups */
.lc-skin .h-actions { margin-left: auto; }
.lc-skin .h-nav a, .lc-skin .h-login, .lc-skin .h-foot nav a { color: var(--h-ink); }
.lc-skin .h-brand { color: var(--h-blue); }
.lc-skin .auth-main .card { border: 0; box-shadow: none; padding: 0; background: transparent; }
.lc-skin .auth-main .card.center { background: #f6f9f3; padding: 16px; border-radius: 16px; }
@media (max-width: 420px) { .lc-skin .h-brand span { display: none; } .lc-skin .h-bar { flex-wrap: nowrap; } .lc-skin.kid .h-bar, .lc-skin:not(:has(.skin-nav a)) .h-bar { flex-wrap: nowrap; } }
.lc-skin a.btn, .lc-skin .card a.btn, .lc-skin.kid .card a.btn { color: #fff !important; text-decoration: none; }
.lc-skin a.btn.ghost, .lc-skin a.btn.sun, .lc-skin .card a.btn.ghost { color: var(--ink) !important; }
/* grade picker */
.grade-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.grade-opt { margin: 0; cursor: pointer; }
.grade-opt input { position: absolute; opacity: 0; pointer-events: none; }
.grade-opt span { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; border: 2px solid #e6e0d0; background: #fff; transition: all .12s; }
.grade-opt b { font: 800 1.5rem var(--font-fun); line-height: 1; color: var(--ink); }
.grade-opt small { font-size: .7rem; color: var(--ink-soft); font-weight: 700; }
.grade-opt input:checked + span { border-color: var(--h-blue, #1f5fd6); background: #e7eefb; box-shadow: 0 3px 0 var(--h-blue-d, #1647a8); }
.grade-opt input:focus-visible + span { outline: 3px solid #f1b93a; outline-offset: 2px; }
@media (max-width: 420px) { .grade-pick { grid-template-columns: repeat(3, 1fr); } }

/* "who are you?" cards on Log in / Join */
.role-head { text-align: center; padding: 18px 0 6px; }
.role-head h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); margin: 0; }
.role-head .muted { margin: 8px 0 0; }
.role-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 22px; margin: 28px auto 22px; }
.role-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 22px 22px; border-radius: 24px; text-decoration: none; color: var(--ink) !important;
  border: 2px solid transparent; transition: transform .15s, box-shadow .15s, border-color .15s; }
.role-card.explorer { background: #e7eefb; } .role-card.parent { background: #f6ead6; }
.role-card:hover, .role-card:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(40,60,40,.12); border-color: var(--h-blue, #1f5fd6); }
.role-card:focus-visible { outline: 3px solid #f1b93a; outline-offset: 3px; }
.role-art { display: block; background: rgba(255,255,255,.6); border-radius: 18px; padding: 8px; margin-bottom: 10px; }
.role-art svg { display: block; width: 100%; height: auto; max-height: 170px; }
.role-go { position: absolute; right: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: .85rem; }
.role-card b { font: 800 1.4rem var(--font-fun); }
.role-card small { color: var(--ink-soft); font-size: .95rem; }
.role-cta { margin-top: 12px; align-self: flex-start; background: var(--h-blue, #1f5fd6); color: #fff; font-weight: 800; font-size: .92rem; padding: 10px 16px; border-radius: 12px; box-shadow: 0 4px 0 var(--h-blue-d, #1647a8); }
.role-card.parent .role-cta { background: #1e3a2f; box-shadow: 0 4px 0 #0f2219; }
@media (max-width: 640px) { .role-cards { grid-template-columns: 1fr; max-width: 380px; } }
@media (max-width: 860px) { .lc-skin .skin-nav.guest { display: none; } }

/* v12: header user menu */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 999px; background: #fff; border: 2px solid #e8e2d2; font-weight: 800; color: var(--ink); user-select: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { border-color: var(--h-blue, #1f5fd6); }
.user-menu > summary:focus-visible { outline: 3px solid #f1b93a; outline-offset: 2px; }
.user-menu .avatar { width: 34px; height: 34px; font-size: 1.15rem; }
.um-initial { width: 34px; height: 34px; border-radius: 50%; background: #e7eefb; color: var(--h-blue, #1f5fd6); display: grid; place-items: center; font: 800 1rem var(--font-fun); flex: none; }
.um-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-caret { font-size: .75rem; opacity: .6; }
.um-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 2px solid #ece6d6; border-radius: 16px; box-shadow: 0 16px 40px rgba(30,40,30,.14); padding: 8px; z-index: 60; display: flex; flex-direction: column; }
.um-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid #f0ebde; margin-bottom: 6px; }
.um-head b { display: block; color: var(--ink); } .um-head small { color: var(--ink-soft); font-size: .78rem; word-break: break-all; }
.um-panel a, .um-panel button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 10px 12px; border-radius: 10px; font-weight: 700; color: var(--ink) !important; cursor: pointer; text-decoration: none; }
.um-panel a:hover, .um-panel button:hover, .um-panel a:focus-visible, .um-panel button:focus-visible { background: #f2f6ef; }
.um-panel form { margin: 0; border-top: 1px solid #f0ebde; margin-top: 6px; padding-top: 6px; }
.lc-skin .kidbar { gap: 12px; }
.kb-links { display: flex; gap: 4px; margin-left: 10px; }
.kb-links a { color: var(--ink) !important; text-decoration: none; font-weight: 800; font-size: .95rem; padding: 8px 12px; border-radius: 10px; }
.kb-links a.on, .kb-links a:hover { background: #e7eefb; color: var(--h-blue, #1f5fd6) !important; }
@media (max-width: 900px) { .kb-links { display: none; } }
@media (max-width: 560px) { .um-name { display: none; } .user-menu > summary { padding: 3px 8px 3px 3px; } }

/* paint swatches in the build popover */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-width: 250px; }
.swatches .sw { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #e2dccb; cursor: pointer; padding: 0; }
.swatches .sw:hover { transform: scale(1.12); }
.swatches .sw.reset { background: #fff; font-weight: 800; color: var(--ink); }
.gbtn[data-friends-build].on { background: #2bb673; color: #fff; }

/* kid dashboard extras */
.kid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 18px; }
.kid-stat { background: #fff; border: 2px solid #ece6d6; border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.kid-stat .ks-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.kid-stat b { display: block; font: 800 1.5rem/1 var(--font-fun); color: var(--ink); }
.kid-stat small { color: var(--ink-soft); font-weight: 700; }
.kid-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin: 18px 0; }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #f7f9f4; }
.mini-item .grow { flex: 1; min-width: 0; } .mini-item small { color: var(--ink-soft); display: block; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: #2bb673; box-shadow: 0 0 0 3px #dff3e6; flex: none; }
@media (max-width: 860px) { .kid-stats { grid-template-columns: repeat(2, 1fr); } .kid-row { grid-template-columns: 1fr; } }
.lc-skin .toolbox h3 { color: #fff !important; }
.lc-skin a.gbtn { color: #fff !important; text-decoration: none; }
.lc-skin a.gbtn.ghost, .lc-skin a.gbtn.sun { color: var(--ink) !important; }
.h-hero h1.h-title-long { font-size: clamp(2.1rem, 4.2vw, 3.1rem); line-height: 1.08; }

/* ---------- v12 admin People directory ---------- */
.ppl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ppl-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 0 0 14px; }
.ppl-stat { background: #fff; border: 1px solid #e3ddcc; border-radius: 14px; padding: 12px 14px; text-decoration: none; color: #1e3a2f; display: flex; flex-direction: column; gap: 2px; }
.ppl-stat b { font-size: 1.5rem; line-height: 1.1; } .ppl-stat span { font-size: .82rem; color: #5d6b63; font-weight: 600; }
a.ppl-stat:hover { border-color: #1f5fd6; } .ppl-stat.warn b { color: #c0561f; }
.ppl-grades { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.ppl-grades .chip { text-decoration: none; font-size: .82rem; } .ppl-grades .chip.on { background: #1f5fd6; border-color: #1f5fd6; color: #fff; }
.ppl-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e3ddcc; margin-bottom: 12px; }
.ppl-tabs a { padding: 9px 16px; font-weight: 800; text-decoration: none; color: #5d6b63; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.ppl-tabs a.on { color: #1e3a2f; border-color: #e8743b; }
.ppl-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px !important; }
.ppl-filters input[name=q] { flex: 1 1 280px; min-width: 200px; }
.ppl-filters select, .ppl-filters input { width: auto; margin: 0; }
.ppl-table td { vertical-align: middle; } .ppl-table tr:hover td { background: #fbf8ef; }
.ppl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2f8a4f; box-shadow: 0 0 0 3px #d9efdc; }
.ppl-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ppl-avatar { width: 64px; height: 64px; border-radius: 18px; background: #1f5fd6; color: #fff; font-size: 30px; font-weight: 900; display: grid; place-items: center; }
.ppl-line { padding: 7px 0; border-bottom: 1px solid #efe9da; } .ppl-line:last-child { border-bottom: 0; }
.grid.two > div > .card + .card { margin-top: 14px; }
.ppl-act input, .ppl-more input, .ppl-more select { margin: 0 0 8px; }
.ppl-more { margin-top: 10px; border-top: 1px solid #efe9da; padding-top: 10px; }
.ppl-more summary { cursor: pointer; font-weight: 800; } .ppl-more form { margin-top: 10px; }
.ppl-more.danger summary { color: #b3261e; }

/* ---------- v13 Fun Park rides ---------- */
body.riding { overflow: hidden; }
.ride-ov { position: fixed; inset: 0; z-index: 400; background: #7fd0ff; font-family: Nunito, system-ui, sans-serif; color: #1b1840; }
.ride-ov > canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.ride-top { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ride-top b { background: rgba(255,255,255,.92); border-radius: 999px; padding: 8px 16px; font-size: 1.05rem; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ride-top [data-x] { margin-left: auto; background: #fff; }
.ride-meter { background: #1b1840; color: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ride-say { position: absolute; left: 50%; top: 66px; transform: translate(-50%, -8px); max-width: min(560px, calc(100% - 32px)); background: rgba(255,255,255,.95); border-radius: 18px;
  padding: 10px 16px; font-weight: 800; text-align: center; opacity: 0; transition: opacity .25s, transform .25s; box-shadow: 0 6px 20px rgba(0,0,0,.15); pointer-events: none; }
.ride-say.on { opacity: 1; transform: translate(-50%, 0); }
.ride-ctl { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 10px; }
.ride-end, .ride-design { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow: auto;
  background: #fff; border-radius: 24px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.ride-end h3, .ride-design h3 { margin: 0 0 6px; font-size: 1.5rem; }
.ride-end .row, .ride-design .row { justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ride-fact { background: #fff6d6; border-radius: 14px; padding: 10px 12px; font-weight: 700; }
.ride-preview { width: 100%; height: auto; border-radius: 14px; margin: 8px 0; }
.ride-hills { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ride-hills label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; font-size: .85rem; background: #f6f1ff; border-radius: 14px; padding: 8px 10px; }
.ride-hills input[type=range] { width: 110px; accent-color: #ff5c8a; }
@media (max-width: 560px) { .ride-top b { font-size: .9rem; padding: 6px 12px; } .ride-say { top: 104px; font-size: .9rem; } }

/* ---------- v14 Water Park ---------- */
.slide-pieces { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; min-height: 34px; align-items: center; }
.slide-chip { border: 0; border-radius: 999px; background: #dff6fc; color: #0d5f74; font: inherit; font-weight: 800; padding: 6px 12px; cursor: pointer; }
.slide-chip:hover { background: #ffe0e0; color: #9b1c1c; }
.slide-sum { font-weight: 900; font-size: 1.1rem; margin: 6px 0; color: #9a5b00; }
.slide-sum.ok { color: #1e7a46; } .slide-sum.over { color: #c0392b; }
.ride-times { margin: 6px auto 10px; border-collapse: collapse; } .ride-times td { padding: 4px 10px; text-align: left; }

/* ---------- v15 Turbo Town ---------- */
.tt-hero { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(120deg, #1e1e28, #3a2a5a); color: #fff; border-radius: 24px; padding: 26px 28px; margin-bottom: 18px; }
.tt-hero h1 { color: #fff; margin: 4px 0 8px; font-size: clamp(1.6rem, 4vw, 2.4rem); } .tt-hero p { color: #e6e3f5; max-width: 560px; }
.tt-kicker { font-weight: 900; letter-spacing: .12em; font-size: .8rem; color: #f6b81a !important; margin: 0; }
.tt-mycar { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.1); border-radius: 18px; padding: 12px 16px; }
.tt-mycar-icon { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 36px; }
.tt-tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tt-track { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 18px; background: #fff; border: 2px solid #e3ddcc; text-decoration: none; color: #1e3a2f; min-height: 150px; }
a.tt-track:hover { border-color: #e8432f; transform: translateY(-2px); }
.tt-ticon { font-size: 34px; } .tt-meta { margin-top: auto; font-size: .85rem; font-weight: 700; }
.tt-go { position: absolute; right: 12px; bottom: 12px; background: #e8432f; color: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 900; font-size: .85rem; }
.tt-locked { opacity: .65; background: #f4f1e8; }
.tt-city { background: linear-gradient(160deg, #fff, #e6eefb); } .tt-forest { background: linear-gradient(160deg, #fff, #e3f2df); } .tt-desert { background: linear-gradient(160deg, #fff, #fbeed6); } .tt-coastal { background: linear-gradient(160deg, #fff, #dff2fb); }
.tt-mountain { background: linear-gradient(160deg, #fff, #e7ecf3); } .tt-snow { background: linear-gradient(160deg, #fff, #eef5fc); } .tt-space { background: linear-gradient(160deg, #e9e3ff, #c9bdf5); } .tt-stunt { background: linear-gradient(160deg, #fff, #ffe5d4); }
.tt-missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tt-mission { display: flex; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid #e3ddcc; border-radius: 16px; text-decoration: none; color: #1e3a2f; }
.tt-mission > span { font-size: 26px; } .tt-mission.done { background: #f0f9f1; } .tt-unlocks { color: #9a5b00; font-weight: 700; }
/* garage */
.tt-garage { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .tt-garage { grid-template-columns: 1fr; } }
.tt-preview { height: 300px; border-radius: 22px; background: radial-gradient(circle at 50% 35%, #fff, #e8edf5 70%); touch-action: none; cursor: grab; }
.tt-preview canvas { width: 100% !important; height: 100% !important; display: block; }
.tt-stats { background: #fff; border-radius: 18px; padding: 14px 16px; margin-top: 12px; border: 1px solid #e3ddcc; }
.tt-stat { display: grid; grid-template-columns: 120px 1fr 80px 80px; gap: 8px; align-items: center; margin: 8px 0; font-weight: 700; font-size: .9rem; }
.tt-statbar { height: 12px; background: #efe9da; border-radius: 8px; overflow: hidden; } .tt-statbar i { display: block; height: 100%; background: linear-gradient(90deg, #f6b81a, #e8432f); border-radius: 8px; transition: width .3s; }
.tt-stat em { font-style: normal; font-size: .8rem; } .tt-up { color: #1e7a46; } .tt-down { color: #c0392b; } .tt-same { color: #8a8f99; }
.tt-formula { background: #fff6d6; border-radius: 12px; padding: 8px 10px; } .tt-tips { margin: 4px 0 0; padding-left: 18px; }
.tt-slot { border: 0; padding: 0; margin: 0 0 14px; } .tt-slot legend { font-weight: 900; font-size: 1.05rem; margin-bottom: 6px; }
.tt-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.tt-part { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 8px; background: #fff; border: 2px solid #e3ddcc; border-radius: 14px; cursor: pointer; }
.tt-part input { position: absolute; opacity: 0; } .tt-part:has(input:checked) { border-color: #e8432f; background: #fff3ef; box-shadow: 0 0 0 3px rgba(232,67,47,.18); }
.tt-part:has(input:focus-visible) { outline: 3px solid #1f5fd6; } .tt-picon { font-size: 28px; } .tt-part.locked { opacity: .55; cursor: not-allowed; }
.tt-lockline { font-size: .72rem; color: #9a5b00; font-weight: 700; }
.tt-colors { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .tt-colors input { position: absolute; opacity: 0; }
.tt-colors span { display: block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #d6d0c0; cursor: pointer; }
.tt-colors input:checked + span { box-shadow: 0 0 0 3px #1e1e28; } .tt-colors input:focus-visible + span { outline: 3px solid #1f5fd6; }
/* race */
body.tt-race-page main.wrap { max-width: none; padding: 0; } body.tt-race-page footer { display: none; } body.tt-race-page { overflow: hidden; }
.tt-stage { position: fixed; left: 0; right: 0; bottom: 0; top: 66px; background: #111; user-select: none; -webkit-user-select: none; overflow: hidden; }
.tt-canvas { width: 100%; height: 100%; display: block; }
.tt-hud { position: absolute; inset: 0; pointer-events: none; font-family: Nunito, system-ui, sans-serif; color: #fff; }
.tt-hud button { pointer-events: auto; }
.tt-panel { position: absolute; top: 12px; background: rgba(20,18,40,.72); border-radius: 16px; padding: 8px 14px; backdrop-filter: blur(4px); }
.tt-left { left: 12px; display: flex; gap: 16px; } .tt-left div { display: flex; flex-direction: column; } .tt-left small, .tt-right small { font-size: .7rem; letter-spacing: .1em; opacity: .8; font-weight: 800; }
.tt-left b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.tt-right { right: 12px; text-align: right; min-width: 120px; } .tt-right b { font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; display: block; }
.tt-bar { height: 6px; background: rgba(255,255,255,.2); border-radius: 4px; margin-top: 4px; overflow: hidden; } .tt-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3ec28f, #f6b81a, #e8432f); }
.tt-top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.tt-chip { border: 0; border-radius: 999px; background: rgba(255,255,255,.92); color: #1e1e28; font: inherit; font-weight: 800; padding: 7px 12px; cursor: pointer; }
.tt-map { position: absolute; left: 12px; bottom: 12px; width: 150px; height: 150px; background: rgba(20,18,40,.55); border-radius: 18px; }
.tt-msg { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); background: rgba(255,255,255,.95); color: #1b1840; border-radius: 16px; padding: 9px 16px; font-weight: 800; max-width: min(560px, calc(100% - 32px)); text-align: center; opacity: 0; transition: opacity .25s; }
.tt-msg.on { opacity: 1; }
.tt-keys { position: absolute; right: 12px; bottom: 12px; background: rgba(20,18,40,.6); border-radius: 12px; padding: 6px 10px; font-size: .8rem; font-weight: 700; }
.tt-touch { display: none; position: absolute; left: 0; right: 0; bottom: 14px; justify-content: space-between; padding: 0 14px; }
.tt-touch div { display: flex; gap: 12px; } .tt-touch button { pointer-events: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; font-size: 30px; background: rgba(255,255,255,.85); color: #1e1e28; touch-action: none; }
.tt-touch button.on { background: #f6b81a; transform: scale(.94); } .tt-touch .gas { background: rgba(62,194,143,.9); } .tt-touch .brake { background: rgba(232,67,47,.85); }
.tt-touchy .tt-touch { display: flex; } .tt-touchy .tt-keys { display: none; } .tt-touchy .tt-map { bottom: 104px; width: 110px; height: 110px; }
.tt-count { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; pointer-events: none; color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,.5); }
.tt-count b { font-size: 120px; font-weight: 900; line-height: 1; } .tt-lights { font-size: 44px; background: rgba(0,0,0,.6); padding: 6px 14px; border-radius: 999px; }
.tt-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,8,30,.45); padding: 16px; overflow: auto; }
.tt-card { background: #fff; border-radius: 24px; padding: 22px 24px; width: min(620px, 100%); max-height: calc(100% - 20px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.tt-card h1 { margin: 0 0 6px; font-size: 1.8rem; } .tt-blurb { margin: 0 0 8px; } .tt-learn, .tt-math { background: #fff6d6; border-radius: 14px; padding: 10px 12px; font-weight: 700; }
.tt-carline { background: #f4f1e8; border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: .92rem; }
.tt-opt { display: flex; gap: 8px; align-items: center; padding: 6px 2px; font-weight: 700; cursor: pointer; } .tt-opt input { width: 20px; height: 20px; }
.tt-card .row { margin-top: 14px; gap: 8px; flex-wrap: wrap; }
.tt-results { width: 100%; border-collapse: collapse; margin: 8px 0; } .tt-results td { padding: 6px 8px; border-bottom: 1px solid #efe9da; } .tt-results tr.me td { background: #fff3ef; font-weight: 900; }
.tt-quiz { margin-top: 10px; background: #eef4ff; border-radius: 14px; padding: 10px 12px; } .tt-quiz .ok { background: #3ec28f !important; color: #fff !important; } .tt-quiz .no { background: #f3c0b8 !important; }
.tt-nogl { color: #fff; text-align: center; padding: 60px 20px; }
@media (max-width: 640px) { .tt-left { gap: 10px; padding: 6px 10px; } .tt-left b { font-size: 1.05rem; } .tt-right b { font-size: 1.8rem; } .tt-right { min-width: 90px; } .tt-top { top: 64px; } .tt-chip { padding: 5px 9px; font-size: .85rem; } .tt-msg { top: 106px; } }
.tt-banner { display: flex; gap: 14px; align-items: center; background: linear-gradient(120deg, #1e1e28, #3a2a5a); color: #fff; border-radius: 18px; padding: 12px 16px; margin-bottom: 12px; text-decoration: none; }
.tt-banner > span:first-child { font-size: 34px; } .tt-banner div { flex: 1; } .tt-banner b { color: #fff; } .tt-banner .small { color: #e6e3f5; }
@media (min-width: 861px) { .tt-garage-left { position: sticky; top: 80px; } }
