/* ============ LebotLab 奇趣实验室 · 设计系统 ============ */
:root {
  --bg: #0e1124;
  --bg-2: #151a35;
  --card: rgba(255, 255, 255, 0.055);
  --card-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #9aa3c7;
  --cyan: #4de3ff;
  --yellow: #ffd166;
  --pink: #ff6b9d;
  --green: #7bf1a8;
  --purple: #9b8cff;
  --orange: #ff9f5a;
  --red: #ff5c7a;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-size: 16px;
}

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

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html.scroll-reset { scroll-behavior: auto !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(155, 140, 255, 0.16), transparent 60%),
    radial-gradient(900px 420px at -10% 15%, rgba(77, 227, 255, 0.10), transparent 55%),
    radial-gradient(700px 500px at 60% 110%, rgba(255, 107, 157, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100svh;
  line-height: 1.65;
  overflow-x: hidden;
}

/* ---------- 实验室气泡背景 ---------- */
.lab-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.lab-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 50% 20%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 20%, #000 30%, transparent 100%);
}
.bubble {
  position: absolute; bottom: -140px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.35), rgba(255,255,255,.06) 45%, transparent 70%);
  border: 1px solid rgba(255,255,255,.14);
  animation: floatUp linear infinite;
}
.b1 { left: 6%;  width: 26px; height: 26px; animation-duration: 19s; animation-delay: 0s; }
.b2 { left: 18%; width: 14px; height: 14px; animation-duration: 14s; animation-delay: 3s; }
.b3 { left: 33%; width: 34px; height: 34px; animation-duration: 24s; animation-delay: 6s; }
.b4 { left: 50%; width: 18px; height: 18px; animation-duration: 16s; animation-delay: 1s; }
.b5 { left: 64%; width: 12px; height: 12px; animation-duration: 13s; animation-delay: 8s; }
.b6 { left: 76%; width: 28px; height: 28px; animation-duration: 21s; animation-delay: 4s; }
.b7 { left: 88%; width: 16px; height: 16px; animation-duration: 17s; animation-delay: 2s; }
.b8 { left: 44%; width: 10px; height: 10px; animation-duration: 12s; animation-delay: 9s; }
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  8%   { opacity: .8; }
  92%  { opacity: .5; }
  100% { transform: translateY(-115vh) translateX(30px); opacity: 0; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px;
  background: rgba(14, 17, 36, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--text); }
.logo-flask {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; filter: drop-shadow(0 0 12px rgba(77,227,255,.6));
  animation: wob 3.4s ease-in-out infinite;
}
.logo-flask .ai-icon { width: 100%; height: 100%; }
@keyframes wob { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
.logo-text { font-weight: 800; font-size: 22px; letter-spacing: .5px; display: flex; align-items: baseline; gap: 6px; }
.logo-text em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--purple) 55%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-text small { font-size: 12px; color: var(--muted); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 44px; font-size: 19px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; text-decoration: none; transition: .18s;
}
.icon-btn .ai-icon { width: 23px; height: 23px; }
.icon-btn:hover { background: var(--card-2); transform: translateY(-2px); }
.player-badge {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px;
  min-height: 44px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer; transition: .18s;
}
.player-badge:hover { background: var(--card-2); }
.player-avatar {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: 50%; overflow: hidden; padding: 2px; flex: 0 0 30px;
}
.player-avatar .ai-icon { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- 通用 ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 34px 22px 60px; }
.screen { display: none; animation: screenIn .35s ease both; }
.screen.active { display: block; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.section-title { font-size: 22px; margin: 46px 0 18px; display: flex; align-items: center; gap: 8px; }
.grad-text {
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 14px; padding: 12px 22px;
  font-size: 15px; font-weight: 800; cursor: pointer; color: #101331;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 8px 24px rgba(77, 227, 255, 0.28);
  transition: .16s; text-decoration: none; white-space: nowrap;
  min-height: 44px; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn-lg { padding: 15px 28px; font-size: 17px; border-radius: 16px; }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--card-2); }
.btn-warm { background: linear-gradient(135deg, var(--yellow), var(--orange)); box-shadow: 0 8px 24px rgba(255, 209, 102, .25); }
.btn-pink { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; box-shadow: 0 8px 24px rgba(255, 107, 157, .28); }
.btn-danger { background: linear-gradient(135deg, #ff8095, var(--red)); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

.input {
  width: 100%; padding: 13px 16px; font-size: 16px; color: var(--text);
  background: rgba(0,0,0,.25); border: 1.5px solid var(--line); border-radius: 13px;
  outline: none; transition: .18s; font-family: inherit;
}
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(77,227,255,.14); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px;
  font-size: 12px; font-weight: 700; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
}

/* ---------- AI 卡通图标系统 ---------- */
.ai-icon {
  display: block; width: 100%; height: 100%; max-width: 100%;
  object-fit: contain; object-position: center;
  flex: none; pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.inline-icon {
  display: inline-block; width: 1.22em; height: 1.22em;
  margin-right: .28em; vertical-align: -.23em; object-fit: contain;
}
.section-icon {
  display: inline-block; width: 1.45em; height: 1.45em;
  flex: 0 0 1.45em; object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.28));
}
.ai-icon--nav { width: 23px; height: 23px; }
.ai-icon--avatar { border-radius: 50%; object-fit: cover; }
.ai-icon--feedback { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; }
.hero-chip-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.footer-icon { width: 24px; height: 24px; flex: 0 0 24px; }
.modal-title-icon { width: 38px; height: 38px; flex: 0 0 38px; }
.ai-icon--heading { width: 34px; height: 34px; flex: 0 0 34px; }
.ai-icon--section-mini { width: 24px; height: 24px; flex: 0 0 24px; }
.ai-icon--tab { width: 20px; height: 20px; flex: 0 0 20px; }
.ai-icon--note { width: 22px; height: 22px; flex: 0 0 22px; }
.ai-icon--score-mini { display: inline-block; width: 14px; height: 14px; flex: 0 0 14px; }
.ai-icon--micro { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; }
.ai-icon--qtag { width: 24px; height: 24px; flex: 0 0 24px; }
.title-with-art, .modal-title, .footer-brand {
  display: flex; align-items: center; gap: 9px;
}
.modal-title, .footer-brand { justify-content: center; }
.perfect-note {
  margin-top: 16px; color: var(--green); font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* 交互容器的图标换成图片后，仍保留明确的键盘焦点 */
:where(.logo, .icon-btn, .player-badge, .btn, .game-card,
       .mode-btn, .script-card, .board-tab, .avatar-pick, .opt, .key):focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(255, 209, 102, .20);
}
:where(.icon-btn, .player-badge, .btn, .game-card, .mode-btn,
       .script-card, .board-tab, .avatar-pick, .opt, .key) {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.25fr .75fr; gap: 30px; align-items: center;
  padding: 26px 8px 8px;
}
.hero-eyebrow { color: var(--cyan); font-weight: 700; font-size: 14px; letter-spacing: 1px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.25; margin: 10px 0 14px; }
.hero-sub { color: var(--muted); font-size: 16.5px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 26px; }
.hero-stats { display: flex; gap: 26px; }
.stat b { font-size: 26px; display: block; background: linear-gradient(90deg, var(--cyan), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 12.5px; color: var(--muted); }

.hero-flask { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.flask { position: relative; width: 200px; height: 230px; animation: bob 4.5s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.flask-glass {
  position: absolute; inset: 0;
  background:
    linear-gradient(105deg, transparent 44%, rgba(255,255,255,.22) 47%, rgba(255,255,255,.05) 53%, transparent 56%),
    linear-gradient(to top, rgba(77,227,255,.10), transparent 55%);
  clip-path: polygon(38% 0, 62% 0, 62% 30%, 96% 92%, 88% 100%, 12% 100%, 4% 92%, 38% 30%);
  border-radius: 10px;
}
.flask-liquid {
  position: absolute; left: 8%; right: 8%; bottom: 3%; height: 46%;
  background: linear-gradient(180deg, rgba(255,107,157,.85), rgba(155,140,255,.9));
  clip-path: polygon(2% 12%, 98% 12%, 94% 100%, 6% 100%);
  border-radius: 0 0 26px 26px;
  box-shadow: 0 0 44px rgba(255,107,157,.5);
  animation: slosh 3.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes slosh { 0%,100% { border-radius: 0 0 26px 26px; } 50% { border-radius: 18px 0 26px 26px; } }
.flask-bubbles i {
  position: absolute; bottom: 8%; left: 50%; border-radius: 50%;
  background: rgba(255,255,255,.75); opacity: 0; animation: rise 2.6s ease-in infinite;
}
.flask-bubbles i:nth-child(1) { width: 8px;  height: 8px;  animation-delay: 0s;   margin-left: -14px; }
.flask-bubbles i:nth-child(2) { width: 5px;  height: 5px;  animation-delay: .5s;  margin-left: 4px; }
.flask-bubbles i:nth-child(3) { width: 10px; height: 10px; animation-delay: 1s;  margin-left: -22px; }
.flask-bubbles i:nth-child(4) { width: 6px;  height: 6px;  animation-delay: 1.6s; margin-left: 12px; }
.flask-bubbles i:nth-child(5) { width: 4px;  height: 4px;  animation-delay: 2.1s; margin-left: -4px; }
@keyframes rise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  25% { opacity: .95; }
  100% { transform: translateY(-88px) scale(1.15); opacity: 0; }
}
.hero-tags { display: flex; gap: 10px; }
.hero-tags span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  background: var(--card); border: 1px solid var(--line);
}

/* ---------- 游戏卡片 ---------- */
.games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.game-card {
  position: relative; overflow: hidden; cursor: pointer;
  padding: 24px 22px 20px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line);
  transition: .22s; display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: var(--text);
}
.game-card:hover { transform: translateY(-6px); background: var(--card-2); }
.game-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 21px; padding: 1.5px;
  background: linear-gradient(135deg, var(--g1, var(--cyan)), var(--g2, var(--purple)));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .75; pointer-events: none;
}
.game-card::after {
  content: ""; position: absolute; width: 150px; height: 150px;
  right: -22px; bottom: -30px;
  background-image: var(--card-art, none);
  background-position: center; background-repeat: no-repeat; background-size: contain;
  opacity: .16; pointer-events: none; transition: transform .25s ease, opacity .25s ease;
  mix-blend-mode: normal;
  filter: saturate(.88) drop-shadow(0 12px 26px rgba(0,0,0,.34));
  will-change: transform;
}
.game-card:hover::after { transform: rotate(-8deg) scale(1.1); opacity: .24; }
.game-card > * { position: relative; z-index: 1; }
.game-icon {
  width: 54px; height: 54px; border-radius: 16px; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--g1), var(--g2)); filter: saturate(1.1);
  box-shadow: 0 10px 26px rgba(0,0,0,.35); padding: 5px; overflow: hidden;
}
.game-icon .ai-icon { width: 44px; height: 44px; border-radius: 11px; }
.game-card h3 { font-size: 20px; margin-top: 4px; }
.game-card .en { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-top: -8px; }
.game-card p { color: var(--muted); font-size: 14px; flex: 1; }
.game-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.game-tags .badge { color: var(--text); }
.game-play { font-weight: 800; font-size: 14.5px; color: var(--g1); display: flex; align-items: center; gap: 6px; }

.future-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.future-card {
  min-height: 188px; padding: 20px 17px; text-align: left; border-radius: 20px;
  display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 15px;
  background: var(--card);
  background:
    radial-gradient(circle at 7% 18%, color-mix(in srgb, var(--future1) 18%, transparent), transparent 42%),
    linear-gradient(145deg, var(--card), color-mix(in srgb, var(--future2) 9%, var(--card)));
  border: 1px dashed var(--line);
  border-color: color-mix(in srgb, var(--future1) 45%, var(--line));
  transition: .2s; position: relative; overflow: hidden;
}
.future-card:hover { transform: translateY(-3px); border-style: solid; box-shadow: 0 16px 38px rgba(0,0,0,.2); }
.future-card .fi {
  width: 82px; height: 82px; display: flex; align-items: center; justify-content: center;
  padding: 5px; border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 1px rgba(255,255,255,.08);
  font-size: 38px; overflow: hidden;
}
.future-card .fi .ai-icon { width: 100%; height: 100%; border-radius: 16px; }
.future-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.future-en {
  max-width: calc(100% - 66px); color: color-mix(in srgb, var(--future1) 70%, white);
  font-size: 10.5px; font-weight: 800; letter-spacing: .7px; line-height: 1.25; text-transform: uppercase;
}
.future-card h3 { font-size: 17px; line-height: 1.35; margin-top: 3px; }
.future-card small { color: var(--text); font-size: 12px; font-weight: 650; line-height: 1.45; margin-top: 2px; }
.future-card p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 6px; }
.future-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.future-tags span {
  padding: 3px 7px; border-radius: 999px; color: var(--text); font-size: 10.5px; font-weight: 700;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08);
}
.soon-pill {
  position: absolute; top: 10px; right: 10px; font-size: 10px; padding: 3px 9px;
  border-radius: 999px; background: rgba(255, 209, 102, .15); color: var(--yellow);
  border: 1px solid rgba(255, 209, 102, .3); font-weight: 700;
}

/* ---------- 游戏页通用 ---------- */
.game-shell { max-width: 760px; margin: 0 auto; }
.game-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.game-head-actions { display: flex; gap: 8px; align-items: center; }
.game-title { display: flex; align-items: center; gap: 12px; }
.game-title .gi {
  width: 46px; height: 46px; font-size: 25px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  padding: 4px; overflow: hidden; flex: 0 0 46px;
}
.game-title .gi .ai-icon { width: 38px; height: 38px; border-radius: 10px; }
.game-title h2 { font-size: 21px; }
.game-title small { color: var(--muted); display: block; font-size: 12px; font-weight: 600; }

.hud {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px;
}
.hud .cell {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 8px; text-align: center;
}
.hud b { font-size: 21px; display: block; font-variant-numeric: tabular-nums; }
.hud span { font-size: 11.5px; color: var(--muted); }
.hud .timer b.hot { color: var(--red); animation: pulse .5s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.16); } }
.timebar { height: 9px; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); }
.timebar i {
  display: block; height: 100%; border-radius: 99px; width: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width .2s linear;
}
.timebar i.warn { background: linear-gradient(90deg, var(--orange), var(--red)); }

/* 模式选择卡 */
.mode-grid { display: grid; gap: 12px; }
.mode-btn {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: 16px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); color: var(--text);
  font-family: inherit; transition: .18s; width: 100%;
}
.mode-btn:hover { border-color: var(--g1); background: var(--card-2); transform: translateX(4px); }
.mode-btn .mi {
  font-size: 27px; width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 4px; background: rgba(255,255,255,.055); border: 1px solid rgba(77,227,255,.13); border-radius: 12px; overflow: hidden;
}
.mode-btn .mi .ai-icon { width: 36px; height: 36px; border-radius: 9px; }
.mode-btn b { font-size: 16px; display: block; }
.mode-btn small { color: var(--muted); font-size: 12.5px; display: block; }
.mode-btn .go { margin-left: auto; font-size: 18px; color: var(--muted); }

.intro-card { padding: 26px; }
.intro-card h3 { font-size: 22px; margin-bottom: 6px; }
.intro-card .desc { color: var(--muted); margin-bottom: 18px; font-size: 14.5px; }
.coach {
  display: flex; gap: 12px; align-items: flex-start; margin: 16px 0;
  padding: 13px 15px; border-radius: 14px;
  background: rgba(77, 227, 255, .07); border: 1px solid rgba(77, 227, 255, .22);
}
.coach .cavatar {
  width: 48px; height: 48px; flex: 0 0 48px;
  display: flex; align-items: center; justify-content: center;
  padding: 3px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, rgba(77,227,255,.18), rgba(155,140,255,.18));
  border: 1px solid rgba(77,227,255,.22); font-size: 26px;
}
.coach .cavatar .ai-icon { width: 100%; height: 100%; border-radius: 10px; }
.coach p { font-size: 13.5px; }
.coach b { color: var(--cyan); }

/* 问答选项 */
.options { display: grid; gap: 10px; margin-top: 16px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  min-height: 52px;
  border-radius: 14px; background: var(--card); border: 1.5px solid var(--line);
  color: var(--text); font-size: 15.5px; font-weight: 600; cursor: pointer;
  transition: .15s; text-align: left; font-family: inherit; line-height: 1.45;
}
.opt:hover:not([disabled]) { border-color: var(--cyan); transform: translateY(-2px); background: var(--card-2); }
.opt .key {
  flex: none; width: 28px; height: 28px; min-height: 28px; padding: 0;
  border-radius: 9px; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1); border: 1px solid var(--line);
}
.opt.correct { border-color: var(--green); background: rgba(123, 241, 168, .14); animation: popIn .25s; }
.opt.correct .key { background: var(--green); color: #0d2818; }
.opt.wrong { border-color: var(--red); background: rgba(255, 92, 122, .13); animation: shake .3s; }
.opt.wrong .key { background: var(--red); color: #fff; }
.opt.dim { opacity: .45; }
.opt[disabled] { cursor: default; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes popIn { from { transform: scale(.96); } to { transform: scale(1); } }

/* 反馈条 */
.feedback {
  margin-top: 14px; padding: 12px 15px; border-radius: 13px; font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start; animation: screenIn .25s;
}
.feedback.ok { background: rgba(123,241,168,.12); border: 1px solid rgba(123,241,168,.3); }
.feedback.no { background: rgba(255,92,122,.12); border: 1px solid rgba(255,92,122,.3); }

/* ---------- 单词实验室 ---------- */
.word-card {
  padding: 34px 26px; text-align: center; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.word-card .pos { color: var(--yellow); font-weight: 800; font-size: 13px; letter-spacing: 2px; }
.word-card .zh { font-size: clamp(26px, 5vw, 40px); font-weight: 900; margin: 6px 0 2px; }
.word-card .hint { color: var(--muted); font-size: 13px; }
.word-card.flash-ok  { animation: cardOk .4s; }
.word-card.flash-no  { animation: cardNo .4s; }
@keyframes cardOk { 30% { box-shadow: 0 0 0 3px var(--green), 0 0 40px rgba(123,241,168,.35); border-color: var(--green); } }
@keyframes cardNo { 30% { box-shadow: 0 0 0 3px var(--red), 0 0 40px rgba(255,92,122,.3); border-color: var(--red); } }
.combo-pop {
  position: absolute; top: 14px; right: 16px; font-weight: 900; color: var(--yellow);
  animation: comboUp .8s ease-out forwards; font-size: 15px; pointer-events: none;
}
@keyframes comboUp { 0% { opacity: 0; transform: translateY(6px) scale(.7); } 30% { opacity: 1; transform: translateY(-2px) scale(1.15); } 100% { opacity: 0; transform: translateY(-16px) scale(1); } }

/* 错词实验报告 */
.review-list { display: grid; gap: 8px; margin-top: 10px; }
.review-item {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 12px; background: rgba(255,92,122,.08);
  border: 1px solid rgba(255,92,122,.22); font-size: 14px;
}
.review-item b { font-size: 16px; }
.review-item span { color: var(--muted); }

/* ---------- 数学闯关 ---------- */
.math-q {
  text-align: center; padding: 40px 20px 30px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); position: relative;
}
.math-q .expr { font-size: clamp(38px, 8vw, 64px); font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.math-q .expr .op { color: var(--cyan); padding: 0 6px; }
.math-input {
  margin: 0 auto 6px; width: 220px; text-align: center;
  font-size: 34px; font-weight: 900; letter-spacing: 6px; color: var(--green);
  background: rgba(0,0,0,.3); border: 2px solid var(--line); border-radius: 14px;
  padding: 8px; min-height: 62px; font-variant-numeric: tabular-nums;
}
.math-input.focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(77,227,255,.15); }
.math-input.no { border-color: var(--red); animation: shake .3s; color: var(--red); }
.math-input.ok { border-color: var(--green); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 340px; margin: 14px auto 0; }
.key {
  padding: 15px; font-size: 21px; font-weight: 800; border-radius: 14px;
  min-height: 48px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: .12s; font-family: inherit; user-select: none;
}
.key:hover { background: rgba(255,255,255,.16); }
.key:active { transform: scale(.94); }
.key.wide { grid-column: span 2; }
.key.ac { color: var(--red); }
.key.ok { background: linear-gradient(135deg, var(--green), var(--cyan)); color: #0d2818; border: none; }
.streak-note {
  text-align: center; color: var(--muted); font-size: 13px; margin-top: 12px; min-height: 20px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.streak-note b { color: var(--orange); }

/* ---------- 鲁迅剧场 ---------- */
.script-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.script-card {
  padding: 22px 20px; border-radius: 20px; cursor: pointer; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); color: var(--text);
  font-family: inherit; transition: .2s; display: flex; flex-direction: column; gap: 8px;
}
.script-card:hover { transform: translateY(-5px); border-color: var(--g1); background: var(--card-2); }
.script-card .si {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  padding: 3px; border-radius: 17px; overflow: hidden;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08);
  font-size: 38px;
}
.script-card .si .ai-icon { width: 100%; height: 100%; border-radius: 13px; }
.script-card h3 { font-size: 19px; }
.script-card .origin { font-size: 12px; color: var(--muted); font-weight: 700; }
.script-card p { font-size: 13.5px; color: var(--muted); flex: 1; }
.script-card .meta { display: flex; gap: 8px; }

.scene-card { padding: 28px 26px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.scene-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.scene-no { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.narr { font-size: 15.5px; line-height: 1.95; }
.narr .quote {
  display: block; margin: 12px 0; padding: 12px 16px;
  border-left: 3px solid var(--pink); background: rgba(255,107,157,.07);
  border-radius: 0 12px 12px 0; color: #ffd7e4; font-size: 14.5px;
}
.narr .quote cite { display: block; font-size: 12px; color: var(--muted); font-style: normal; margin-top: 6px; }
.role-note {
  display: flex; gap: 8px; align-items: center; margin-bottom: 14px;
  font-size: 13px; color: var(--cyan); font-weight: 700;
}
.ask-q { font-size: 16.5px; font-weight: 800; margin: 18px 0 4px; display: flex; gap: 8px; }
.ask-q .qtag { color: var(--yellow); flex: none; }

/* 结果页 */
.result-card { padding: 32px 28px; text-align: center; }
.result-emoji {
  width: 90px; height: 90px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 58px; animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,.32));
}
.result-emoji .ai-icon { width: 100%; height: 100%; border-radius: 20px; }
.result-card h2 { font-size: 26px; margin: 8px 0 4px; }
.result-score { font-size: 52px; font-weight: 900; margin: 10px 0; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--yellow));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-score small { font-size: 16px; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.result-grid .cell { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 13px; padding: 10px 6px; }
.result-grid b { font-size: 20px; display: block; }
.result-grid span { font-size: 11.5px; color: var(--muted); }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.rank-note { margin-top: 14px; font-size: 14px; color: var(--yellow); font-weight: 700; }

/* ---------- 排行榜 ---------- */
.board-tabs {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain;
  margin-bottom: 9px; padding: 7px; scroll-padding-inline: 7px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: rgba(77,227,255,.3) transparent;
}
.board-tab {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto; scroll-snap-align: start;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  min-height: 44px; cursor: pointer; transition: .18s; font-family: inherit;
}
.board-tab:hover { color: var(--text); }
.board-tab.active {
  background: linear-gradient(135deg, var(--cyan), var(--purple)); color: #101331; border-color: transparent;
}
.board-card, .board-page { padding: 22px; }
.lb-list { display: grid; gap: 8px; }
.lb-row {
  display: grid; grid-template-columns: 44px 34px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 13px; background: rgba(0,0,0,.18);
  border: 1px solid transparent; transition: .15s;
}
.lb-row:nth-child(1) { background: linear-gradient(90deg, rgba(255,209,102,.16), rgba(0,0,0,.2)); border-color: rgba(255,209,102,.35); }
.lb-row:nth-child(2) { background: linear-gradient(90deg, rgba(200,210,230,.12), rgba(0,0,0,.2)); border-color: rgba(200,210,230,.25); }
.lb-row:nth-child(3) { background: linear-gradient(90deg, rgba(255,159,90,.13), rgba(0,0,0,.2)); border-color: rgba(255,159,90,.3); }
.lb-row.me { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 20px rgba(77,227,255,.18); }
.lb-rank {
  min-width: 30px; min-height: 30px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 17px; text-align: center;
}
.lb-rank .ai-icon { width: 30px; height: 30px; }
.lb-rank .ai-icon--rank { border-radius: 50%; filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)); }
.rank-number { color: var(--muted); }
.lb-avatar {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  padding: 2px; border-radius: 50%; overflow: hidden;
  font-size: 21px; text-align: center;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.09);
}
.lb-avatar .ai-icon { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.lb-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name .bot { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.lb-name small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.lb-name .score-detail { display: flex; align-items: center; gap: 4px; }
.lb-score { font-weight: 900; font-size: 17px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.lb-empty {
  text-align: center; color: var(--muted); padding: 26px 0 14px; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ai-icon--empty { width: 48px; height: 48px; border-radius: 14px; }
.rank-note { display: flex; align-items: center; justify-content: center; gap: 8px; }
.rank-note .ai-icon--inline-rank { width: 28px; height: 28px; border-radius: 50%; }
.result-grade { margin-top: 8px; }
.result-grade b {
  display: inline-flex; padding: 6px 13px; border-radius: 999px;
  color: var(--yellow); background: rgba(255,209,102,.1); border: 1px solid rgba(255,209,102,.28);
}
.board-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.55;
}

/* ---------- 任务型学习游戏 ---------- */
.quest-shell .intro-card { position: relative; overflow: hidden; }
.quest-shell .intro-card::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -70px; bottom: -90px;
  border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--quest-1) 28%, transparent), transparent 68%);
  pointer-events: none;
}
.quest-rules {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 18px 0; position: relative; z-index: 1;
}
.quest-rules span {
  padding: 11px 8px; text-align: center; border-radius: 13px;
  background: rgba(0,0,0,.2); border: 1px solid var(--line); color: var(--muted); font-size: 12px;
}
.quest-rules b { display: block; color: var(--quest-1); font-size: 22px; }
.quest-start { position: relative; z-index: 1; }
.quest-card { padding: 26px; border-color: color-mix(in srgb, var(--quest-1) 34%, transparent); }
.quest-context {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding: 12px 14px; border-radius: 13px;
  background: color-mix(in srgb, var(--quest-1) 9%, transparent); color: var(--muted); font-size: 13.5px;
}
.quest-context span { white-space: pre-line; }
.quest-context b {
  flex: none; max-width: 42%; padding: 3px 9px; border-radius: 999px;
  color: var(--quest-1); border: 1px solid color-mix(in srgb, var(--quest-1) 35%, transparent); font-size: 11px;
}
.quest-card h3 { font-size: clamp(19px, 3vw, 24px); line-height: 1.55; }
.quest-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; color: var(--muted); font-size: 12px;
}
.quest-tools .btn { min-height: 44px; padding: 8px 13px; font-size: 13px; }
.quest-knowledge, .quest-mastery {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 11px 13px;
  border-radius: 12px; background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.2); font-size: 13px;
}
.quest-knowledge b, .quest-mastery b { color: var(--yellow); flex: none; }
.quest-next { margin-top: 14px; }
.quest-review { text-align: left; margin-top: 18px; }
.quest-exit {
  position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px;
  background: rgba(8,10,24,.78); backdrop-filter: blur(7px);
}
.quest-exit-card { width: min(430px, 100%); padding: 26px; text-align: center; }
.quest-exit-card p { color: var(--muted); margin: 8px 0 18px; }
.score-detail > span:first-child { margin-right: 2px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 24, .72); backdrop-filter: blur(6px); animation: screenIn .2s;
}
.modal { width: min(420px, 92vw); padding: 28px 26px; text-align: center; }
.modal h3 { font-size: 21px; margin-bottom: 4px; }
.modal-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.avatar-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.avatar-pick {
  width: 44px; height: 44px; font-size: 23px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 3px; overflow: hidden;
  background: var(--card-2); border: 2px solid transparent; transition: .15s;
}
.avatar-pick .ai-icon { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.avatar-pick:hover { transform: scale(1.12); }
.avatar-pick.sel { border-color: var(--cyan); background: rgba(77,227,255,.16); }
.modal-actions { margin-top: 16px; display: flex; justify-content: center; gap: 10px; }

.toast {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%);
  z-index: 120; padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: rgba(20, 24, 48, .95); border: 1px solid var(--cyan); color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .3s;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

#confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--muted); padding: 30px 16px 40px; font-size: 13.5px; }
.footer-brand { flex-wrap: wrap; row-gap: 4px; line-height: 1.5; }
.footer b { color: var(--text); }
.footer-tip { opacity: .7; margin-top: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .hero-flask { display: none; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-grid { grid-template-columns: 1fr; }
  .future-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud { grid-template-columns: repeat(4, 1fr); }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .options.two { grid-template-columns: 1fr; }
  .game-card::after { width: 138px; height: 138px; right: -18px; bottom: -26px; opacity: .11; }
}
@media (max-width: 680px) {
  .future-grid {
    display: flex; gap: 12px; overflow-x: auto;
    margin-inline: -22px; padding: 4px 22px 10px;
    scroll-snap-type: x mandatory; scroll-padding-inline: 22px;
    overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .future-grid::-webkit-scrollbar { display: none; }
  .future-card { flex: 0 0 min(82vw, 320px); scroll-snap-align: start; }
}
@media (max-width: 620px) {
  .games-grid { grid-template-columns: 1fr; gap: 12px; }
  .game-card {
    display: grid; grid-template-columns: 54px minmax(0, 1fr);
    grid-template-areas:
      "icon en"
      "icon title"
      "desc desc"
      "tags tags"
      "play play";
    gap: 5px 12px; padding: 17px 16px;
  }
  .game-icon { grid-area: icon; }
  .game-card .en { grid-area: en; align-self: end; margin: 0; }
  .game-card h3 { grid-area: title; align-self: start; margin: 0; line-height: 1.35; }
  .game-card p {
    grid-area: desc; display: -webkit-box; overflow: hidden;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  .game-tags { grid-area: tags; }
  .game-play { grid-area: play; }
}
@media (max-width: 520px) {
  .topbar {
    padding:
      calc(8px + env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      8px
      max(12px, env(safe-area-inset-left));
  }
  .logo { min-width: 0; gap: 7px; }
  .logo-text { font-size: 19px; white-space: nowrap; }
  .logo-text small { display: none; }
  .logo-flask { width: 32px; height: 32px; flex-basis: 32px; }
  .topbar-right { flex: 0 0 auto; gap: 6px; }
  #playerNameText { display: none; }
  .icon-btn, .player-badge { width: 44px; height: 44px; flex: 0 0 44px; }
  .player-badge { justify-content: center; gap: 0; padding: 6px; }
  .icon-btn .ai-icon, .ai-icon--nav { width: 21px; height: 21px; }
  main {
    padding:
      20px
      max(14px, env(safe-area-inset-right))
      calc(48px + env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }
  .hero { padding: 6px 0 0; }
  .hero-eyebrow { font-size: 12.5px; letter-spacing: .65px; }
  .hero h1 { font-size: clamp(29px, 8.5vw, 36px); line-height: 1.18; margin: 8px 0 12px; }
  .hero-sub { font-size: 15px; line-height: 1.65; }
  .hero-actions {
    display: grid; grid-template-columns: 1fr; gap: 10px;
    margin: 18px 0 21px;
  }
  .hero-actions .btn { width: 100%; min-height: 48px; padding-inline: 16px; }
  .hero-stats { justify-content: space-between; gap: 8px; }
  .hero-stats .stat { flex: 1; min-width: 0; text-align: center; }
  .stat b { font-size: 23px; }
  .stat span { font-size: 11.5px; }
  .section-title { margin: 34px 0 14px; font-size: 20px; line-height: 1.35; }
  .future-grid { margin-inline: -14px; padding-inline: 14px; scroll-padding-inline: 14px; }
  .game-card::after { width: 116px; height: 116px; right: -16px; bottom: -19px; opacity: .09; }
  .game-icon { width: 50px; height: 50px; padding: 5px; }
  .game-icon .ai-icon { width: 40px; height: 40px; }
  .future-card { min-height: 164px; grid-template-columns: 72px minmax(0, 1fr); gap: 13px; padding: 17px 14px; }
  .future-card .fi { width: 72px; height: 72px; }
  .future-card p { font-size: 12.5px; }
  .future-tags span, .soon-pill { font-size: 11px; }
  .game-head {
    align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 12px;
  }
  .game-title { flex: 1 1 195px; min-width: 0; gap: 9px; }
  .game-title > div { flex: 1; min-width: 0; }
  .game-title h2 { font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
  .game-title small { font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
  .game-head > .btn, .game-head > a.btn { flex: 0 0 auto; margin-left: auto; padding: 9px 13px; }
  .game-head-actions { max-width: 100%; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .game-title .gi { width: 43px; height: 43px; flex-basis: 43px; }
  .game-title .gi .ai-icon { width: 35px; height: 35px; }
  .mode-btn .mi { width: 42px; height: 42px; flex-basis: 42px; }
  .mode-btn .mi .ai-icon { width: 34px; height: 34px; }
  .script-card .si { width: 58px; height: 58px; }
  .coach .cavatar { width: 43px; height: 43px; flex-basis: 43px; }
  .hud { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 11px; }
  .hud .cell { min-width: 0; padding: 7px 3px; border-radius: 12px; }
  .hud b { font-size: 18px; line-height: 1.25; }
  .hud span { display: block; font-size: 10.5px; line-height: 1.35; white-space: nowrap; }
  .timebar { margin-bottom: 13px; }
  .intro-card, .scene-card, .result-card, .board-card, .board-page { padding: 18px 15px; }
  .intro-card h3 { font-size: 20px; line-height: 1.4; }
  .intro-card .desc { margin-bottom: 14px; font-size: 14px; }
  .mode-btn { gap: 11px; padding: 14px 12px; }
  .mode-btn b { font-size: 15px; }
  .mode-btn small { font-size: 12px; line-height: 1.45; }
  .coach { gap: 10px; margin: 13px 0; padding: 11px; }
  .coach p { font-size: 13px; }
  .word-card { padding: 21px 13px; }
  .word-card .zh { font-size: clamp(25px, 8vw, 34px); }
  .options { gap: 9px; margin-top: 13px; }
  .opt { min-height: 52px; padding: 12px 13px; font-size: 15px; overflow-wrap: anywhere; }
  .math-q { padding: 18px 10px 14px; }
  .math-q .expr { font-size: clamp(34px, 10vw, 46px); letter-spacing: 0; }
  .math-q .expr .op { padding-inline: 2px; }
  .math-input { width: min(190px, 100%); min-height: 54px; padding: 5px; font-size: 30px; }
  .keypad { max-width: none; gap: 8px; margin-top: 12px; }
  .key { min-height: 48px; padding: 8px; font-size: 19px; }
  .streak-note { min-height: 18px; margin-top: 8px; }
  .scene-card { border-radius: 17px; }
  .scene-head { gap: 8px; flex-wrap: wrap; }
  .narr { font-size: 15px; line-height: 1.8; }
  .narr .quote { padding: 10px 12px; font-size: 14px; }
  .result-card h2 { font-size: 23px; }
  .result-score { font-size: 44px; }
  .result-grid { gap: 7px; margin: 15px 0; }
  .result-grid .cell { padding: 9px 4px; }
  .result-grid b { font-size: 18px; }
  .result-actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .result-actions .btn { width: 100%; min-width: 0; min-height: 48px; }
  .result-emoji { width: 78px; height: 78px; }
  .section-icon { width: 1.3em; height: 1.3em; flex-basis: 1.3em; }
  .board-tabs { margin-inline: -7px; padding-inline: 7px; -webkit-overflow-scrolling: touch; }
  .board-tab { min-height: 44px; padding-inline: 14px; }
  .lb-row { grid-template-columns: 36px 32px minmax(0, 1fr) auto; gap: 7px; padding-inline: 9px; }
  .lb-rank .ai-icon { width: 27px; height: 27px; }
  .lb-avatar { width: 31px; height: 31px; }
  .lb-name { font-size: 13.5px; }
  .lb-name small { font-size: 12px; }
  .lb-name .bot { display: block; margin-left: 0; }
  .lb-score { font-size: 15.5px; white-space: nowrap; }
  .quest-card { padding: 20px 16px; }
  .quest-context { flex-direction: column; }
  .quest-context b { max-width: 100%; }
  .quest-tools { align-items: flex-start; flex-direction: column; }
  .quest-rules { gap: 7px; }
  .quest-rules span { padding-inline: 4px; }
  .modal-mask, .quest-exit {
    overflow-y: auto; overscroll-behavior: contain;
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
  .modal-mask { align-items: flex-start; }
  .quest-exit { place-items: start center; }
  .modal, .quest-exit-card {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain; margin-block: auto;
  }
  .modal { width: min(420px, 100%); padding: 21px 18px; }
  .avatar-row { gap: 6px; }
  .toast {
    width: max-content;
    max-width: calc(100vw - 28px - env(safe-area-inset-left) - env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    white-space: normal; text-align: center; line-height: 1.4;
  }
  .footer {
    padding:
      24px
      max(16px, env(safe-area-inset-right))
      calc(32px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
}

@media (hover: none) {
  .icon-btn:hover, .btn:hover, .game-card:hover, .future-card:hover,
  .mode-btn:hover, .script-card:hover, .opt:hover:not([disabled]) {
    transform: none;
  }
  .game-card:hover::after { transform: none; opacity: .11; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .logo-flask, .result-emoji, .flask, .flask-liquid, .flask-bubbles i,
  .bubble, .hud .timer b.hot, .screen, .feedback, .toast {
    animation: none !important;
  }
  .game-card::after, .game-card, .future-card, .mode-btn, .script-card,
  .avatar-pick, .icon-btn, .btn, .opt, .key {
    transition: none !important;
  }
  .game-card:hover::after { transform: none; }
}
