:root {
  --bg: #07070c;
  --bg2: #0d0d16;
  --panel: #12121d;
  --panel2: #1a1a29;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.16);
  --text: #f3f3f8;
  --muted: #9c9cb4;
  --dim: #6b6b85;
  --lime: #c8ff3d;
  --violet: #8b5cf6;
  --pink: #ff4d8d;
  --cyan: #22d3ee;
  --orange: #ff9f1c;
  --green: #34d399;
  --red: #ff5c6c;
  --radius: 20px;
  --head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: -20%;
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(35% 30% at 90% 20%, rgba(255, 77, 141, 0.14), transparent 70%),
    radial-gradient(40% 40% at 60% 100%, rgba(200, 255, 61, 0.08), transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) rotate(4deg); } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--lime); }
h1, h2, h3, .head { font-family: var(--head); letter-spacing: -0.02em; margin: 0; }
.muted { color: var(--muted); }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px 16px calc(40px + var(--safe-b)); }

/* ---------- logo ---------- */
.logo { font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: -0.04em; display: inline-flex; align-items: center; gap: 8px; }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--lime), #7dff9b); color: #07070c; display: grid; place-items: center; font-size: 17px; box-shadow: 0 0 24px rgba(200, 255, 61, 0.4); }
.logo b { color: var(--lime); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 14px; font-weight: 700; background: var(--panel2); border: 1px solid var(--line2); transition: transform .12s, background .2s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--lime); color: #0a0a0f; border-color: transparent; box-shadow: 0 8px 30px -8px rgba(200, 255, 61, 0.55); }
.btn.primary:hover { box-shadow: 0 10px 40px -6px rgba(200, 255, 61, 0.7); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--panel2); border: 1px solid var(--line); font-size: 18px; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line2); outline: none; font-size: 17px; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(200, 255, 61, 0.12); }
.input.code { text-transform: uppercase; letter-spacing: .3em; font-family: var(--head); font-weight: 700; }
.input.pin { letter-spacing: .6em; font-family: var(--head); font-weight: 700; }
textarea.input { min-height: 140px; resize: vertical; }

/* ---------- auth ---------- */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floaters span { position: absolute; font-family: var(--head); font-weight: 700; color: rgba(255,255,255,.07); white-space: nowrap; animation: floatUp linear infinite; }
@keyframes floatUp { from { transform: translateY(110vh) rotate(var(--r)); } to { transform: translateY(-20vh) rotate(var(--r)); } }
.auth-card { width: 100%; max-width: 420px; position: relative; }
.hero-title { font-size: clamp(40px, 11vw, 64px); line-height: .95; font-weight: 700; margin: 26px 0 12px; }
.hero-title .hl { background: linear-gradient(90deg, var(--lime), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.glass { background: rgba(18, 18, 29, 0.72); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.auth-form { padding: 22px; margin-top: 22px; }
.note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 18px; }
.chips { display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 14px; font-family: var(--head); }
.chip.fire { color: var(--orange); }
.chip.fire.off { color: var(--dim); }
.chip.xp { color: var(--lime); }

/* ---------- home ---------- */
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .grid2 { grid-template-columns: 1.25fr 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.unit-card { position: relative; overflow: hidden; padding: 22px; background: linear-gradient(140deg, #1d1640 0%, #12121d 55%); }
.unit-card::after { content: '🍳'; position: absolute; right: -10px; top: -14px; font-size: 120px; opacity: .14; transform: rotate(12deg); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.unit-row { display: flex; gap: 18px; align-items: center; margin-top: 14px; }
.ring { width: 104px; height: 104px; flex: none; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-family: var(--head); font-weight: 700; font-size: 24px; line-height: 1; }
.ring .val small { display: block; font-size: 11px; color: var(--muted); font-family: var(--body); font-weight: 600; margin-top: 3px; }
.goal { margin-top: 16px; }
.goal-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 10px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--pink), var(--orange)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar .mark80 { position: absolute; left: 80%; top: -3px; bottom: -3px; width: 2px; background: var(--lime); border-radius: 2px; }
.cta { margin-top: 18px; width: 100%; font-size: 18px; padding: 18px; }
.cta small { font-weight: 600; opacity: .7; }

.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
@media (min-width: 620px) { .modes { grid-template-columns: repeat(3, 1fr); } }
.mode { position: relative; text-align: left; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; min-height: 128px; display: flex; flex-direction: column; justify-content: flex-end; transition: transform .15s, border-color .2s; }
.mode:hover { transform: translateY(-2px); border-color: var(--line2); }
.mode:active { transform: scale(.97); }
.mode .ic { position: absolute; top: 12px; left: 14px; font-size: 30px; }
.mode .tag { position: absolute; top: 14px; right: 12px; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 4px 7px; border-radius: 6px; background: rgba(255,255,255,.08); color: var(--muted); }
.mode h3 { font-size: 18px; }
.mode p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.mode::before { content: ''; position: absolute; width: 120px; height: 120px; right: -40px; bottom: -50px; border-radius: 50%; background: var(--c, var(--violet)); filter: blur(40px); opacity: .35; }

.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; }
.section-title h2 { font-size: 20px; }
.tabs { display: inline-flex; padding: 4px; background: var(--bg2); border-radius: 12px; border: 1px solid var(--line); }
.tabs button { padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--panel2); color: var(--text); }
.lb { display: grid; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid transparent; }
.lb-row.me { border-color: var(--lime); background: rgba(200,255,61,.06); }
.lb-row .rk { font-family: var(--head); font-weight: 700; color: var(--muted); text-align: center; }
.lb-row:nth-child(1) .rk { color: #ffd54a; }
.lb-row:nth-child(2) .rk { color: #cfd8e3; }
.lb-row:nth-child(3) .rk { color: #e7a16b; }
.lb-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .nm small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.lb-row .sc { font-family: var(--head); font-weight: 700; color: var(--lime); }
.empty { color: var(--muted); text-align: center; padding: 18px; font-size: 14px; }

.bank-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line2); font-size: 13px; font-weight: 600; color: var(--muted); }
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.bank { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wchip { text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 2px; position: relative; }
.wchip b { font-family: var(--head); font-size: 15px; }
.wchip span { font-size: 12px; color: var(--muted); }
.lv { display: flex; gap: 3px; margin-top: 6px; }
.lv i { width: 100%; height: 4px; border-radius: 3px; background: rgba(255,255,255,.08); }
.lv i.on { background: var(--lime); }
.lv.l1 i.on, .lv.l2 i.on { background: var(--orange); }

.foot { margin-top: 34px; text-align: center; font-size: 12px; color: var(--dim); }
.foot button { color: var(--muted); text-decoration: underline; font-size: 12px; }

/* ---------- game shell ---------- */
.game { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; animation: slideUp .25s cubic-bezier(.2,.8,.2,1); }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } }
.game-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.game-top .bar { flex: 1; }
.game-top .bar i { background: linear-gradient(90deg, var(--lime), var(--cyan)); }
.game-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 8px 16px calc(20px + var(--safe-b)); max-width: 640px; width: 100%; margin: 0 auto; }
.timer { font-family: var(--head); font-weight: 700; font-size: 18px; min-width: 52px; text-align: right; }
.timer.low { color: var(--red); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { opacity: .45; } }
.combo { font-family: var(--head); font-weight: 700; color: var(--orange); min-width: 56px; text-align: right; }

.q-kicker { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 8px 0 14px; }
.prompt { text-align: center; padding: 26px 10px; }
.prompt .emo { font-size: 64px; line-height: 1; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.prompt .big { font-family: var(--head); font-size: clamp(30px, 8vw, 44px); font-weight: 700; margin-top: 12px; line-height: 1.1; }
.prompt .sub { color: var(--muted); margin-top: 6px; }
.sentence { font-size: 21px; line-height: 1.5; font-weight: 500; text-align: center; padding: 18px 6px 26px; }
.sentence .blank { display: inline-block; min-width: 90px; border-bottom: 3px solid var(--lime); color: var(--lime); font-weight: 700; }
.opts { display: grid; gap: 10px; margin-top: auto; }
.opt { padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1.5px solid var(--line2); text-align: left; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 12px; transition: transform .1s, background .2s, border-color .2s; }
.opt .k { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 800; color: var(--muted); flex: none; }
.opt:active { transform: scale(.98); }
.opt.right { background: rgba(52,211,153,.14); border-color: var(--green); }
.opt.right .k { background: var(--green); color: #05130d; }
.opt.wrong { background: rgba(255,92,108,.12); border-color: var(--red); animation: shake .35s; }
.opt.picked { border-color: var(--violet); background: rgba(139,92,246,.12); }
.opt[disabled] { pointer-events: none; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.shake { animation: shake .35s; }

.feedback { margin-top: 14px; padding: 14px 16px; border-radius: 16px; font-size: 15px; animation: slideUp .2s; }
.feedback.good { background: rgba(52,211,153,.1); color: #b6f5dc; }
.feedback.bad { background: rgba(255,92,108,.1); color: #ffd0d5; }
.feedback b { color: var(--text); }
.feedback .ex { margin-top: 6px; color: var(--muted); font-size: 14px; }

.type-box { margin-top: auto; }
.slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin: 6px 0 18px; }
.slots i { width: 24px; height: 34px; border-bottom: 3px solid var(--line2); font-style: normal; font-family: var(--head); font-weight: 700; font-size: 22px; display: grid; place-items: center; text-transform: lowercase; transition: border-color .2s, color .2s; }
.slots i.f { border-color: var(--lime); }
.slots i.sp { border: 0; width: 12px; }
.slots i.h { color: var(--violet); }
.type-row { display: flex; gap: 8px; }
.type-row .input { font-size: 20px; text-align: center; font-family: var(--head); }
.ok-flash { animation: okflash .45s; }
@keyframes okflash { 30% { box-shadow: 0 0 0 6px rgba(52,211,153,.35); border-color: var(--green); } }

/* match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile { min-height: 64px; padding: 10px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line2); font-weight: 700; font-size: 15px; transition: transform .15s, opacity .3s, background .2s, border-color .2s; }
.tile.en { font-family: var(--head); font-size: 17px; }
.tile.sel { border-color: var(--lime); background: rgba(200,255,61,.08); transform: scale(1.03); }
.tile.done { opacity: 0; transform: scale(.7); pointer-events: none; }
.tile.no { border-color: var(--red); animation: shake .35s; }

/* reels */
.reels { flex: 1; min-height: 0; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
.reel { height: 100%; min-height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px 22px 40px; position: relative; overflow: hidden; }
.reel::before { content: ''; position: absolute; width: 70vmin; height: 70vmin; border-radius: 50%; background: var(--c); filter: blur(90px); opacity: .28; top: 10%; }
.reel > * { position: relative; }
.reel .emo { font-size: 96px; animation: bob 3s ease-in-out infinite; }
.reel .w { font-family: var(--head); font-size: clamp(42px, 13vw, 72px); font-weight: 700; line-height: 1; margin-top: 18px; letter-spacing: -0.03em; }
.reel .grp { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 12px; }
.reveal { margin-top: 22px; padding: 12px 20px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px dashed var(--line2); font-size: 20px; font-weight: 700; min-width: 200px; transition: filter .3s, background .3s; }
.reveal.hid { filter: blur(9px); }
.reveal-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.reel .exs { margin-top: 26px; max-width: 460px; font-size: 18px; }
.reel .exs mark { background: none; color: var(--lime); font-weight: 700; }
.reel .exs small { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.reel .side { position: absolute; right: 14px; bottom: 90px; display: grid; gap: 14px; }
.reel .side button { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); font-size: 22px; border: 1px solid var(--line); }
.swipe-hint { position: absolute; bottom: 24px; left: 0; right: 0; font-size: 13px; color: var(--muted); animation: bob 1.6s infinite; }
.reel.quiz .opts { width: 100%; max-width: 420px; margin-top: 24px; }

/* boss */
.passage { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; font-size: 16px; line-height: 1.6; margin-bottom: 16px; }
.passage h4 { margin: 0 0 6px; font-family: var(--head); font-size: 17px; color: var(--lime); }
.qnum { font-family: var(--head); font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.qtext { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.review { display: grid; gap: 10px; margin-top: 16px; }
.review .card { padding: 14px; font-size: 14px; }

/* results */
.result { text-align: center; padding-top: 20px; }
.result .trophy { font-size: 84px; animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } }
.result h2 { font-size: 34px; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 6px; }
.stat b { display: block; font-family: var(--head); font-size: 26px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.lime b { color: var(--lime); }
.result .actions { display: grid; gap: 10px; margin-top: auto; }
.learned-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.learned-list span { padding: 6px 10px; border-radius: 99px; background: rgba(200,255,61,.1); color: var(--lime); font-weight: 700; font-size: 13px; }

/* fx */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.conf { position: absolute; width: 9px; height: 14px; border-radius: 2px; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }
.xpfloat { position: absolute; font-family: var(--head); font-weight: 700; color: var(--lime); font-size: 26px; animation: rise 1s ease-out forwards; text-shadow: 0 0 20px rgba(200,255,61,.6); }
@keyframes rise { to { transform: translateY(-80px); opacity: 0; } }
#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 140%); background: var(--panel2); border: 1px solid var(--line2); padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 120; transition: transform .3s cubic-bezier(.2,.8,.2,1); max-width: calc(100vw - 32px); }
#toast.on { transform: translate(-50%, 0); }

/* ---------- teacher ---------- */
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--panel); }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(255,255,255,.03); }
.code-badge { font-family: var(--head); font-weight: 700; letter-spacing: .14em; color: var(--lime); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.kpi b { display: block; font-family: var(--head); font-size: 28px; }
.kpi span { font-size: 12px; color: var(--muted); }
.minibar { width: 90px; height: 6px; background: rgba(255,255,255,.08); border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.minibar i { display: block; height: 100%; background: var(--lime); }
.hard { display: grid; gap: 6px; }
.hard div { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 10px; background: var(--bg2); font-size: 14px; }
.hard b { font-family: var(--head); }
.hard span { color: var(--red); font-weight: 700; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 460px; padding: 22px; }
.modal h3 { margin-bottom: 14px; }
.proj { min-height: 100svh; padding: 28px; }
.proj .code-huge { font-family: var(--head); font-size: clamp(60px, 12vw, 150px); font-weight: 700; letter-spacing: .12em; color: var(--lime); line-height: 1; }
.proj .lb-row { font-size: 20px; padding: 14px 18px; }
.proj-grid { display: grid; gap: 22px; grid-template-columns: 1fr; margin-top: 22px; }
@media (min-width: 900px) { .proj-grid { grid-template-columns: 1fr 1fr; } }
.print-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
@media print {
  body { background: #fff; color: #000; }
  body::before, .noprint { display: none !important; }
  .card, .print-codes > div { border: 1px solid #000 !important; background: #fff !important; color: #000; }
  .code-badge { color: #000; }
}

/* --- v1.1 polish --- */
.cta { flex-direction: column; gap: 2px; }
.cta small { font-size: 13px; }
.type-box { margin-top: 4px; }
.game-body .prompt { padding: 14px 10px; }
.opts { padding-bottom: 8px; }
[data-fb]:not(:empty) { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 14px 16px calc(16px + var(--safe-b)); background: var(--bg2); border-top: 1px solid var(--line2); box-shadow: 0 -20px 40px rgba(0,0,0,.5); animation: slideUp .22s cubic-bezier(.2,.8,.2,1); }
[data-fb] > * { max-width: 608px; margin-left: auto; margin-right: auto; }
[data-fb] .feedback { margin-top: 0; }
.wrap.wide { max-width: 1240px; }
@media (min-width: 820px) { .tgrid { grid-template-columns: 1fr 340px; } }
mark { background: none; color: var(--lime); font-weight: 700; }
.mode { min-height: 140px; }

/* login cards */
.cards-print { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lcard { border: 1.5px dashed var(--line2); border-radius: 14px; padding: 14px 16px; background: var(--panel); break-inside: avoid; page-break-inside: avoid; }
.lc-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 700; }
.lc-name { font-family: var(--head); font-size: 19px; font-weight: 700; margin: 10px 0 8px; }
.lc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; border-top: 1px solid var(--line); }
.lc-row span { color: var(--muted); }
.lc-row b { font-family: var(--head); letter-spacing: .02em; }
@media print {
  .wrap { max-width: none; padding: 0; }
  .cards-print { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .lcard { border: 1px dashed #999 !important; border-radius: 0; background: #fff !important; color: #000; padding: 10px 12px; }
  .lcard .logo b, .lcard .lc-row span, .lc-top { color: #000 !important; }
  .lcard .mark { box-shadow: none; }
  .lc-row { border-top-color: #ddd; }
}
.tgrid > * { min-width: 0; }
@media print { #toast, #fx { display: none !important; } }
