:root {
  --bg: #f3f5fc; --card: #ffffff; --text: #1b1f3b; --muted: #6b7190; --line: #e4e7f3;
  --brand: #5b4bff; --brand-2: #8f7bff; --accent: #ff7a59; --ok: #00b894; --bad: #e74c3c; --gold: #f9c846;
  --radius: 18px; --shadow: 0 6px 24px rgba(27, 31, 59, .08);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #12142a; --card: #1c1f3d; --text: #f1f2ff; --muted: #a2a7c9; --line: #2c3057; --shadow: 0 6px 24px rgba(0, 0, 0, .35); }
}
:root[data-theme="dark"] { --bg: #12142a; --card: #1c1f3d; --text: #f1f2ff; --muted: #a2a7c9; --line: #2c3057; --shadow: 0 6px 24px rgba(0, 0, 0, .35); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--card); padding: 8px; z-index: 99; }
[hidden] { display: none !important; }

/* Layout */
.main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo { font-weight: 900; font-size: 1.2rem; color: var(--brand); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.chip.gold { background: color-mix(in srgb, var(--gold) 25%, var(--card)); border-color: var(--gold); }
.chip.fire { background: color-mix(in srgb, var(--accent) 18%, var(--card)); border-color: var(--accent); }
.avatar-btn { display: flex; align-items: center; gap: 6px; font-weight: 700; padding: 4px 8px; border-radius: 999px; }
.avatar-btn:hover { background: var(--bg); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card.tight { padding: 14px 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 14px; font-weight: 800; background: var(--brand); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--brand) 70%, black); transition: transform .06s, box-shadow .06s; font-size: 1rem; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--brand) 70%, black); }
.btn.big { padding: 16px 28px; font-size: 1.15rem; border-radius: 18px; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--bg); color: var(--text); box-shadow: 0 4px 0 var(--line); }
.btn.ghost:active:not(:disabled) { box-shadow: 0 1px 0 var(--line); }
.btn.ok { background: var(--ok); box-shadow: 0 4px 0 #00896e; }
.btn.accent { background: var(--accent); box-shadow: 0 4px 0 #c8553a; }
.btn.sm { padding: 8px 14px; font-size: .9rem; border-radius: 10px; box-shadow: 0 3px 0 color-mix(in srgb, var(--brand) 70%, black); }
.btn.link { background: none; box-shadow: none; color: var(--brand); padding: 6px 8px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .9rem; }
.field input, .field select { padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); outline: none; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--brand); }
.field .help { font-size: .8rem; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin-bottom: 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; }
.error { background: color-mix(in srgb, var(--bad) 12%, var(--card)); border: 1px solid var(--bad); color: var(--bad); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.success { background: color-mix(in srgb, var(--ok) 12%, var(--card)); border: 1px solid var(--ok); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.pw-meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pw-meter > div { height: 100%; width: 0; transition: width .2s; background: var(--bad); }

/* Auth hero */
.hero { text-align: center; padding: 28px 0 12px; }
.hero .big-logo { font-size: 4rem; line-height: 1; }
.hero h1 { font-size: 2.2rem; margin: 8px 0 4px; background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth { max-width: 440px; margin: 0 auto; }

/* Players */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.player { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 10px; text-align: center; border: 3px solid transparent; transition: transform .1s; }
.player:hover { transform: translateY(-3px); border-color: var(--brand-2); }
.player .av { font-size: 3rem; line-height: 1; }
.player .nm { font-weight: 800; margin-top: 8px; }
.player.add { border: 3px dashed var(--line); background: transparent; box-shadow: none; color: var(--muted); }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-pick button { font-size: 1.6rem; padding: 6px; border-radius: 10px; border: 2px solid transparent; }
.avatar-pick button.on { border-color: var(--brand); background: var(--bg); }
.pin { display: flex; gap: 10px; justify-content: center; }
.pin input { width: 54px; height: 64px; text-align: center; font-size: 2rem; font-weight: 800; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); }

/* Home */
.rank-card { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.rank-card .muted { color: rgba(255,255,255,.8); }
.bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; background: var(--gold); border-radius: 5px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.dark { background: var(--line); } .bar.dark > div { background: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { background: rgba(255,255,255,.14); border-radius: 12px; padding: 8px; text-align: center; }
.stat b { display: block; font-size: 1.3rem; }
.stat span { font-size: .75rem; opacity: .85; }
.quest { display: flex; gap: 8px; }
.quest .q { flex: 1; text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--bg); border: 2px solid var(--line); font-size: .8rem; font-weight: 700; }
.quest .q.done { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, var(--card)); }
.quest .q .i { font-size: 1.6rem; display: block; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.game { position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 12px; text-align: left; border-top: 6px solid var(--g, var(--brand)); transition: transform .1s; display: flex; flex-direction: column; gap: 4px; }
.game:hover { transform: translateY(-3px); }
.game .i { font-size: 2.2rem; line-height: 1; }
.game .n { font-weight: 800; }
.game .t { font-size: .78rem; color: var(--muted); min-height: 2.3em; }
.game .lv { font-size: .75rem; font-weight: 700; color: var(--g, var(--brand)); margin-top: auto; }
.game .pip { position: absolute; top: 8px; right: 10px; font-size: .7rem; background: var(--gold); color: #3a2d00; padding: 2px 7px; border-radius: 999px; font-weight: 800; }
.week { display: flex; gap: 6px; align-items: flex-end; height: 70px; }
.week .d { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .7rem; color: var(--muted); }
.week .d > i { width: 100%; background: var(--brand-2); border-radius: 6px 6px 0 0; min-height: 3px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 10px 6px; border-radius: 14px; background: var(--bg); border: 2px solid var(--line); font-size: .72rem; }
.badge .i { font-size: 1.9rem; display: block; }
.badge.locked { opacity: .35; filter: grayscale(1); }
.badge b { display: block; font-size: .78rem; }

/* Play screen */
.play-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.play-head h2 { margin: 0; flex: 1; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 54px; text-align: right; }
.timer.low { color: var(--bad); animation: pulse .6s infinite alternate; }
@keyframes pulse { to { transform: scale(1.1); } }
.instructions { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.board { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; max-width: 440px; }
.opt { padding: 16px 10px; border-radius: 14px; background: var(--bg); border: 3px solid var(--line); font-weight: 800; font-size: 1.15rem; transition: transform .06s; }
.opt:hover:not(:disabled) { border-color: var(--brand-2); transform: scale(1.02); }
.opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, var(--card)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--card)); }
.seq { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.seq .n { min-width: 56px; padding: 12px 10px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 1.3rem; text-align: center; }
.seq .n.q { background: var(--brand); color: #fff; }
.prompt { font-size: 1.5rem; font-weight: 800; text-align: center; }

.grid { display: grid; gap: 4px; touch-action: manipulation; }
.cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 800; user-select: none; }
.memory .cell { background: var(--line); transition: background .15s, transform .1s; }
.memory .cell.on { background: var(--brand); transform: scale(1.05); }
.memory .cell.pick { background: var(--brand-2); }
.memory .cell.hit { background: var(--ok); } .memory .cell.miss { background: var(--bad); } .memory .cell.missed { background: var(--gold); }
.lights .cell { background: #3a3d5c; transition: background .12s; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.lights .cell.on { background: var(--gold); box-shadow: 0 0 18px var(--gold); }
.sudoku { gap: 0; border: 3px solid var(--text); border-radius: 6px; overflow: hidden; }
.sudoku .cell { border: 1px solid var(--line); border-radius: 0; background: var(--card); font-size: 1.1rem; min-width: 34px; }
.sudoku .cell.given { background: var(--bg); color: var(--muted); }
.sudoku .cell.sel { outline: 3px solid var(--brand); outline-offset: -3px; }
.sudoku .cell.bad { color: var(--bad); }
.sudoku .cell.bR { border-right: 3px solid var(--text); } .sudoku .cell.bB { border-bottom: 3px solid var(--text); }
.numpad { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.numpad button { width: 44px; height: 44px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 1.1rem; }
.numpad button.erase { width: auto; padding: 0 12px; }

.quiz-q { font-size: 1.2rem; font-weight: 700; text-align: center; }
.subject { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card)); padding: 3px 10px; border-radius: 999px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--brand); } .dots i.ok { background: var(--ok); } .dots i.no { background: var(--bad); }
.math-q { font-size: 2.2rem; font-weight: 900; text-align: center; letter-spacing: .02em; }
.math-in { font-size: 1.8rem; font-weight: 800; text-align: center; width: 180px; padding: 10px; border: 3px solid var(--line); border-radius: 14px; background: var(--card); }
.math-in:focus { border-color: var(--brand); outline: none; }

.letters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.letters button { width: 48px; height: 56px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; border: 3px solid transparent; }
.letters button.used { opacity: .25; }
.letters.answer button { background: var(--bg); border-color: var(--line); }
.letters.answer button.filled { background: var(--brand); color: #fff; }

.pegs { display: flex; gap: 8px; justify-content: center; }
.peg { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); background: var(--bg); transition: transform .08s; }
.peg.on { border-color: transparent; }
.peg:hover { transform: scale(1.1); }
.peg.small { width: 26px; height: 26px; }
.guesses { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.guess { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 6px 10px; box-shadow: var(--shadow); }
.guess .fb { margin-left: auto; display: flex; gap: 4px; }
.guess .fb i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.guess .fb i.b { background: var(--text); } .guess .fb i.w { background: #fff; border: 2px solid var(--text); box-sizing: border-box; }
.palette { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.hanoi { display: flex; gap: 8px; width: 100%; max-width: 520px; }
.tower { flex: 1; display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start; min-height: 220px; background: var(--bg); border-radius: 12px; border: 3px solid var(--line); padding: 6px 4px; position: relative; gap: 3px; }
.tower.sel { border-color: var(--brand); }
.tower.target { border-style: dashed; border-color: var(--ok); }
.tower .pole { position: absolute; left: 50%; bottom: 6px; width: 8px; height: 80%; background: var(--line); border-radius: 4px; transform: translateX(-50%); }
.disk { height: 22px; border-radius: 11px; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; z-index: 1; }
.disk.top { background: var(--accent); }

/* Result modal */
.modal { position: fixed; inset: 0; background: rgba(10, 12, 40, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; backdrop-filter: blur(4px); }
.modal .box { background: var(--card); border-radius: 24px; padding: 28px 22px; max-width: 420px; width: 100%; text-align: center; animation: pop .3s cubic-bezier(.2,.9,.3,1.3); max-height: 92dvh; overflow: auto; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.result-ico { font-size: 4rem; line-height: 1; }
.xp-pop { font-size: 2rem; font-weight: 900; color: var(--ok); }
.xp-pop.zero { color: var(--muted); }
.levelup { background: linear-gradient(90deg, var(--gold), var(--accent)); color: #2d1b00; font-weight: 900; padding: 8px 14px; border-radius: 999px; display: inline-block; margin: 6px 0; animation: pop .4s; }
.new-badge { display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--gold) 20%, var(--card)); border: 2px solid var(--gold); border-radius: 14px; padding: 8px 12px; text-align: left; margin-top: 8px; }
.new-badge .i { font-size: 2rem; }
.confetti { position: fixed; top: -10px; width: 10px; height: 14px; z-index: 60; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* Parent dashboard */
.kid { border-left: 6px solid var(--brand-2); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; }
.kv div { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: .8rem; color: var(--muted); }
.kv div b { display: block; color: var(--text); font-size: 1.05rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl td, .tbl th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; transition: .25s; z-index: 70; max-width: 90vw; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { padding: 8px 14px; border-radius: 999px; font-weight: 700; background: var(--bg); border: 2px solid var(--line); }
.tabs button.on { border-color: var(--brand); color: var(--brand); }
footer.foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 20px 0; }

@media (max-width: 480px) {
  .options { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .btn.big { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Tidal Waters */
.water { width: 100%; max-width: 480px; height: 150px; border-radius: 18px; position: relative; overflow: hidden; background: linear-gradient(180deg, #7dd3fc 0%, #0ea5e9 45%, #0369a1 100%); box-shadow: inset 0 -20px 40px rgba(0,0,0,.2); }
.water .wave { position: absolute; left: -50%; width: 200%; height: 30px; top: 18px; background: radial-gradient(circle at 10px -6px, transparent 14px, rgba(255,255,255,.45) 15px, rgba(255,255,255,.45) 17px, transparent 18px) 0 0 / 40px 30px repeat-x; animation: wave 3s linear infinite; opacity: .7; }
.water .wave.w2 { top: 34px; animation-duration: 5s; opacity: .35; }
@keyframes wave { to { transform: translateX(40px); } }
.water .bob { position: absolute; left: 50%; top: 22px; font-size: 1.8rem; transform: translateX(-50%); animation: bob 1.6s ease-in-out infinite; }
.water .bob.bite { animation: shake .25s linear infinite; }
@keyframes bob { 50% { transform: translateX(-50%) translateY(6px); } }
@keyframes shake { 0%,100% { transform: translateX(-50%) rotate(-12deg); } 50% { transform: translateX(-50%) rotate(12deg) translateY(8px); } }
.water .line { position: absolute; left: 50%; top: 0; width: 2px; height: 36px; background: rgba(255,255,255,.7); }
.water .glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 60%, rgba(255,255,255,.55), transparent 55%); animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .3; } to { opacity: 1; } }
.cast-msg { font-size: 1.2rem; font-weight: 800; text-align: center; min-height: 1.6em; }
.tension { width: 100%; max-width: 480px; }
.tension .lbl { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.tension .bar { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 0; }
.tension .bar > div { height: 100%; background: linear-gradient(90deg, var(--ok), var(--gold), var(--bad)); transition: width 1s linear; }
.tension.low .lbl { color: var(--bad); animation: pulse .5s infinite alternate; }
.inner-board { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 10px; border-top: 2px dashed var(--line); }
.fish-card { border: 3px solid var(--rc, var(--line)); border-radius: 18px; padding: 14px; background: color-mix(in srgb, var(--rc, var(--line)) 12%, var(--card)); margin-top: 8px; }
.fish-card .big { font-size: 3.4rem; line-height: 1; }
.fish-card .rar { display: inline-block; font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--rc); padding: 3px 10px; border-radius: 999px; margin: 6px 0; }
.fish-card .nm { font-size: 1.3rem; font-weight: 900; }
.fish-card .tag { display: inline-block; font-size: .78rem; font-weight: 800; background: var(--gold); color: #3a2d00; padding: 2px 8px; border-radius: 999px; margin: 2px; }
.spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.spot { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.spot.locked { opacity: .55; }
.spot .ttl { font-weight: 900; font-size: 1.05rem; }
.spot .dex { display: flex; flex-wrap: wrap; gap: 4px; }
.spot .dex span { font-size: 1.25rem; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 2px solid var(--rc, var(--line)); background: var(--bg); }
.spot .dex span.unk { opacity: .35; filter: grayscale(1); }
.rod-card { background: linear-gradient(135deg, #0ea5e9, #6366f1); color: #fff; }
.rod-card .muted { color: rgba(255,255,255,.8); }

/* Marketplace, Bucks, developer portal */
.chip.bucks { background: color-mix(in srgb, #f59e0b 22%, var(--card)); border-color: #f59e0b; text-decoration: none; color: var(--text); }
.market-banner { display: block; text-decoration: none; color: var(--text); border-left: 6px solid #f59e0b; margin: 16px 0 0; }
.market-banner .btn.sm { pointer-events: none; }
.wallet-box { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.mgames { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mgame { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 12px; text-align: left; border-top: 6px solid var(--g, var(--brand)); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); transition: transform .1s; }
.mgame:hover { transform: translateY(-3px); }
.mgame .i { font-size: 2.2rem; line-height: 1; } .mgame .n { font-weight: 800; } .mgame .t { font-size: .78rem; color: var(--muted); min-height: 2.3em; }
.mgame .meta { font-size: .72rem; color: var(--muted); margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.tag.ok { background: color-mix(in srgb, var(--ok) 18%, var(--card)); border-color: var(--ok); }
.tag.warn { background: color-mix(in srgb, var(--gold) 30%, var(--card)); border-color: var(--gold); }
.tag.bad { background: color-mix(in srgb, var(--bad) 14%, var(--card)); border-color: var(--bad); }
.game-frame { width: 100%; height: min(78vh, 720px); border: 0; border-radius: 16px; background: #000; display: block; }
.frame-wrap { position: relative; }
.frame-wrap .frame-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pack { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 12px; text-align: center; border: 3px solid transparent; }
.pack.on { border-color: #f59e0b; }
.pack .b { font-size: 1.5rem; font-weight: 900; } .pack .p { color: var(--muted); } .pack .bonus { color: var(--ok); font-weight: 800; font-size: .8rem; }
.ledger { font-size: .85rem; } .ledger div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ledger .plus { color: var(--ok); font-weight: 800; } .ledger .minus { color: var(--bad); font-weight: 800; }
.items-editor { display: flex; flex-direction: column; gap: 6px; }
.items-editor .row input { padding: 8px 10px; border: 2px solid var(--line); border-radius: 8px; background: var(--bg); }
.items-editor .row input.sku { width: 130px; } .items-editor .row input.nm { flex: 1; min-width: 120px; } .items-editor .row input.bk { width: 80px; }
textarea.ta { width: 100%; min-height: 90px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; color: inherit; resize: vertical; }
.confirm-buy { font-size: 1.1rem; }
.confirm-buy .big { font-size: 2.6rem; }
pre.code { background: var(--bg); border-radius: 12px; padding: 12px; font-size: .78rem; overflow: auto; }

/* Case Files */
.case-head { text-align: center; width: 100%; }
.stamp { display: inline-block; border: 3px solid var(--bad); color: var(--bad); font-weight: 900; letter-spacing: .15em; padding: 2px 10px; transform: rotate(-4deg); border-radius: 6px; font-size: .8rem; margin-bottom: 6px; }
.clues { padding-left: 0; list-style: none; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.clue { display: flex; gap: 8px; align-items: flex-start; background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: .9rem; cursor: pointer; }
.clue .cn { background: var(--brand); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 800; flex: none; }
.clue.done { opacity: .45; text-decoration: line-through; }
.cf-grid { border-collapse: collapse; width: 100%; font-size: .85rem; }
.cf-grid th, .cf-grid td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.cf-grid .nm { font-weight: 800; } .cf-grid tr.culprit td { background: color-mix(in srgb, var(--bad) 14%, var(--card)); }
.cf-sel { padding: 6px 8px; border: 2px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; max-width: 120px; }
.question { font-weight: 800; font-size: 1.05rem; text-align: center; margin-top: 8px; }

/* Shadow Cipher */
.cipher-text { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .12em; background: #0f172a; color: #a5f3fc; padding: 12px 14px; border-radius: 12px; width: 100%; word-break: break-word; }
.cipher-out { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .12em; width: 100%; min-height: 1.6em; color: var(--ok); font-weight: 800; word-break: break-word; }
.cipher-map { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cipher-map .cl { display: flex; flex-direction: column; align-items: center; background: var(--bg); border-radius: 8px; padding: 4px; width: 40px; }
.cipher-map .c { font-weight: 900; } .cipher-map .f { font-size: .65rem; color: var(--muted); }
.cipher-map input { width: 30px; text-align: center; font-weight: 800; text-transform: uppercase; border: 2px solid var(--line); border-radius: 6px; background: var(--card); padding: 2px; }
.cipher-map input:disabled { background: color-mix(in srgb, var(--ok) 20%, var(--card)); border-color: var(--ok); }

/* Truth & Lies */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; width: 100%; }
.person { background: var(--bg); border-radius: 14px; padding: 12px; }
.person .pn { font-weight: 900; } .person .say { font-style: italic; margin: 6px 0 10px; }
.person .opt { padding: 8px; font-size: .9rem; flex: 1; }

/* Word Trail */
.wordgrid { gap: 2px; user-select: none; touch-action: none; }
.wordgrid .cell { background: var(--card); box-shadow: var(--shadow); font-size: 1rem; cursor: pointer; }
.wordgrid .cell.sel { background: var(--brand); color: #fff; }
.wordgrid .cell.found { background: color-mix(in srgb, var(--ok) 35%, var(--card)); }
.wt-list { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.wt-list .tag.ok { text-decoration: line-through; }

/* Trade Winds */
.trade td, .trade th { padding: 6px 6px; } .trade input { padding: 4px; border: 2px solid var(--line); border-radius: 6px; background: var(--bg); color: inherit; }
.opt.here { opacity: .7; }
