/* ==================== 游戏通用 ==================== */
.game-wrap { max-width: 900px; margin: 0 auto; }
.game-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.game-title { font-size: 20px; font-weight: 700; }
.game-card { position: relative; }
.setup-panel { max-width: 420px; margin: 0 auto; }
.shake { animation: shake .3s; }

.big-speaker {
  width: 92px; height: 92px; border-radius: 50%; font-size: 38px;
  border: 2px solid var(--line); background: var(--card); cursor: pointer;
  display: grid; place-items: center; margin: 0 auto; transition: .15s;
}
.big-speaker:hover { border-color: var(--gold); transform: scale(1.04); }

/* 选择题 */
.quiz-box { min-height: 220px; }
.quiz-prompt { font-size: 30px; font-weight: 600; text-align: center; margin: 18px 0 4px; font-family: Georgia, serif; }
.quiz-prompt-sm { font-size: 17px; text-align: center; margin: 18px 0 4px; }
.quiz-options { display: grid; gap: 9px; margin-top: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.quiz-opt {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); cursor: pointer; font-size: 15px; transition: .14s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--card)); }
.quiz-opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--card)); }
.quiz-key {
  width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 12px; color: var(--text-dim);
}

/* 拖拽块（拼图 / 句子排序） */
.jigsaw-tray {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 18px auto; min-height: 60px; padding: 12px;
  border: 1px dashed var(--line); border-radius: 14px; max-width: 700px;
}
.drag-item { cursor: grab; touch-action: none; user-select: none; }
.drag-item.dragging { opacity: .5; }
.jigsaw-tile {
  width: 46px; height: 52px; display: grid; place-items: center;
  font-family: Georgia, serif; font-size: 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.sent-tray { max-width: 760px; }
.sent-tile {
  padding: 9px 14px; font-family: Georgia, serif; font-size: 17px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}

/* 单词炸弹 */
.bomb-stage { min-height: 420px; }
.bomb-icon { font-size: 66px; transition: transform .2s; margin: 8px 0; }
.bomb-icon.danger { animation: pulse .4s infinite alternate; }
.bomb-icon.boom { animation: none; font-size: 80px; }
@keyframes pulse { to { filter: drop-shadow(0 0 12px var(--bad)); } }
.fuse > i { background: linear-gradient(90deg, var(--bad), var(--warn)); }
.lives { font-size: 18px; letter-spacing: 2px; }

/* 卡牌翻翻 */
.memory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.mem-card { aspect-ratio: 3/4; perspective: 900px; cursor: pointer; }
.mem-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.mem-card.flipped .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px;
  display: grid; place-items: center; padding: 8px; text-align: center; font-size: 14px;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.mem-front { background: var(--bg-soft); font-size: 26px; }
.mem-back { transform: rotateY(180deg); }
.mem-back.ru { font-family: Georgia, serif; font-size: 16px; }
.mem-card.matched .mem-face { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--card)); }
.mem-card.bad .mem-face { border-color: var(--bad); }

/* 找单词 */
.ws-wrap { overflow-x: auto; }
.ws-grid { display: grid; gap: 2px; touch-action: none; min-width: 300px; }
.ws-cell {
  aspect-ratio: 1; display: grid; place-items: center; user-select: none;
  background: var(--card-2); border-radius: 5px; font-size: 15px;
  font-family: Georgia, serif; cursor: pointer;
}
.ws-cell.sel { background: var(--gold); color: #2d2308; }
.ws-cell.found { background: color-mix(in srgb, var(--ok) 35%, var(--card)); color: var(--text); }
.ws-list { display: flex; flex-wrap: wrap; gap: 7px; }
.ws-word {
  font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.ws-word.done { text-decoration: line-through; opacity: .55; border-color: var(--ok); }

/* 填字 */
.cw-wrap { overflow-x: auto; display: flex; justify-content: center; }
.cw-grid { display: grid; gap: 2px; }
.cw-cell { position: relative; width: 36px; height: 36px; background: var(--card-2); border-radius: 4px; }
.cw-cell.blank { background: transparent; }
.cw-no { position: absolute; top: 1px; left: 3px; font-size: 9px; color: var(--text-dim); z-index: 1; }
.cw-input {
  width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 0;
  text-align: center; font-family: Georgia, serif; font-size: 17px; background: var(--card);
}
.cw-input.bad { border-color: var(--bad); color: var(--bad); }
.cw-input.hinted { background: color-mix(in srgb, var(--gold) 20%, var(--card)); }
.cw-cluebox { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.cw-cluebox h3 { font-size: 14px; margin: 0 0 6px; }
.cw-clues { padding-left: 0; margin: 0; font-size: 14px; list-style: none; }
.cw-clues li { margin-bottom: 4px; }
@media (max-width: 620px) { .cw-cluebox { grid-template-columns: 1fr; } .cw-cell { width: 28px; height: 28px; } }

/* 大富翁 */
.mono-board { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.mono-tile {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; position: relative;
  background: var(--card-2); border: 1px solid var(--line); font-size: 15px;
}
.mono-bonus { background: color-mix(in srgb, var(--gold) 22%, var(--card)); }
.mono-trap  { background: color-mix(in srgb, var(--bad) 16%, var(--card)); }
.mono-rest  { background: color-mix(in srgb, var(--ok) 14%, var(--card)); }
.mono-start, .mono-end { background: var(--accent); color: var(--accent-text); }
.mono-tile.here { outline: 2px solid var(--gold); outline-offset: 1px; }
.mono-pawn { position: absolute; bottom: -2px; right: -2px; font-size: 13px; }
.dice { font-size: 48px; margin: 6px 0; }
.mono-stage { min-height: 200px; margin-top: 12px; }
@media (max-width: 620px) { .mono-board { grid-template-columns: repeat(8, 1fr); } }

/* PK */
.pk-head { display: flex; align-items: center; justify-content: space-around; }
.pk-side { text-align: center; }
.pk-side b { font-size: 30px; display: block; }
.pk-name { font-size: 13px; color: var(--text-dim); }
.pk-vs { font-weight: 700; color: var(--gold); }

/* 转盘 */
.wheel-wrap { position: relative; width: 210px; height: 210px; margin: 10px auto; }
.wheel { width: 100%; height: 100%; border-radius: 50%; border: 4px solid var(--card); box-shadow: var(--shadow); }
.wheel-labels { position: absolute; inset: 0; pointer-events: none; }
.wheel-label {
  position: absolute; left: 50%; top: 50%; font-size: 11px; color: #fff; font-weight: 600;
  transform-origin: 0 0; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.4);
  margin-left: -18px;
}
.wheel-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 22px; z-index: 2; color: var(--gold); }

/* 密室 */
.escape-map { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 14px 0; }
.escape-room {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center;
  background: var(--card-2); opacity: .55;
}
.escape-room.opened { opacity: 1; border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.escape-room.current { opacity: 1; border-color: var(--gold); border-width: 2px; }
.escape-emoji { font-size: 22px; }
.escape-clues { margin: 10px 0; }
.escape-clue { font-size: 13px; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--card-2); margin-bottom: 6px; border-radius: 0 8px 8px 0; }
@media (max-width: 620px) { .escape-map { grid-template-columns: repeat(3, 1fr); } }

/* 打地鼠 */
.mole-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 460px; margin: 0 auto; }
.mole-hole {
  aspect-ratio: 1.4; background: var(--bg-soft); border-radius: 50% 50% 14px 14px;
  display: grid; place-items: end center; overflow: hidden; padding-bottom: 6px;
}
.mole {
  width: 92%; padding: 10px 4px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--line); font-family: Georgia, serif; font-size: 15px;
  transform: translateY(120%); transition: transform .18s; cursor: pointer; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mole.up { transform: translateY(0); }
.mole.hit { background: color-mix(in srgb, var(--ok) 30%, var(--card)); }
.mole.miss { background: color-mix(in srgb, var(--bad) 30%, var(--card)); }

/* 听写填空 */
.cloze-sentence { font-family: Georgia, serif; font-size: 20px; line-height: 2.1; margin: 16px 0 6px; }
.cloze-input {
  display: inline-block; width: auto; min-width: 60px; padding: 2px 6px; margin: 0 2px;
  border: 0; border-bottom: 2px solid var(--text); border-radius: 0; background: transparent;
  font-family: Georgia, serif; font-size: 20px; text-align: center;
}
.cloze-input.bad { border-bottom-color: var(--bad); color: var(--bad); }
.cloze-input.good { border-bottom-color: var(--ok); color: var(--ok); }
.cloze-input.hinted { border-bottom-color: var(--gold); }

/* 听力寻宝 */
.hunt-scene { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hunt-emoji { font-size: 44px; }
.hunt-order { font-size: 17px; margin-top: 10px; }
.hunt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 16px; }
.hunt-item {
  padding: 14px 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); cursor: pointer; transition: .15s;
}
.hunt-item:hover { border-color: var(--gold); }
.hunt-item.got { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--card)); }
.hunt-item.bad { border-color: var(--bad); animation: shake .3s; }
.hunt-bag { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 26px; }

/* 对话 / 接龙日志 */
.rp-log { max-height: 260px; overflow-y: auto; padding: 4px; margin-bottom: 12px; }
.rp-line { display: flex; gap: 10px; padding: 8px; border-radius: 10px; margin-bottom: 6px; text-align: left; }
.rp-line.npc { background: var(--card-2); }
.rp-line.me { background: color-mix(in srgb, var(--gold) 12%, var(--card)); }
.rp-line.me.bad { background: color-mix(in srgb, var(--bad) 10%, var(--card)); }
.rp-who { font-size: 18px; flex: none; }

/* 看图描述 */
.describe-card {
  font-size: 88px; margin: 14px auto; width: 160px; height: 160px;
  display: grid; place-items: center; background: var(--card-2);
  border: 1px solid var(--line); border-radius: 20px;
}

/* 配音 */
.dub-strip { background: var(--card-2); border-radius: 12px; padding: 18px; }
.dub-line { font-family: Georgia, serif; font-size: 22px; margin-bottom: 6px; }

/* 句子积木 */
.blocks-sentence { font-family: Georgia, serif; font-size: 24px; min-height: 36px; text-align: center; }
.block-chip { text-align: left; }
.block-subject.on { background: #4a90d9; border-color: #4a90d9; color: #fff; }
.block-verb.on    { background: #cf4b45; border-color: #cf4b45; color: #fff; }
.block-object.on  { background: #3f9d63; border-color: #3f9d63; color: #fff; }
.block-adverb.on  { background: #7b5cc4; border-color: #7b5cc4; color: #fff; }
.blocks-made { margin-top: 16px; display: flex; flex-direction: column; gap: 5px; }
.blocks-made-item { font-size: 14px; padding: 6px 10px; background: var(--card-2); border-radius: 8px; }

/* 语法找茬 */
.gf-sentence { font-family: Georgia, serif; font-size: 21px; line-height: 1.9; margin: 14px 0; }
.gf-token { padding: 2px 4px; border-radius: 5px; cursor: pointer; transition: .12s; }
.gf-token:hover { background: var(--bg-soft); }
.gf-token.picked { background: var(--gold); color: #2d2308; }

/* 多人房间 */
.room-code {
  font-size: 40px; font-weight: 700; letter-spacing: 10px;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--gold); margin: 6px 0;
}
.lobby-players { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; }
.lobby-player {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; font-size: 14px;
}
.lobby-player.out { opacity: .45; text-decoration: line-through; }
.chairs { display: flex; gap: 10px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.chair { font-size: 30px; opacity: .5; }
.chair.taken { opacity: 1; }

.flag-track { display: flex; align-items: center; gap: 10px; }
.flag-side { font-size: 13px; font-weight: 600; white-space: nowrap; }
.flag-side.red { color: #cf4b45; }
.flag-side.blue { color: #4a90d9; }
.flag-rail {
  flex: 1; height: 10px; border-radius: 999px; position: relative;
  background: linear-gradient(90deg, #cf4b45 0%, var(--bg-soft) 50%, #4a90d9 100%);
}
.flag { position: absolute; top: -18px; transform: translateX(-50%); font-size: 22px; transition: left .4s; left: 50%; }

.spy-card { margin-bottom: 12px; }
.spy-word { font-family: Georgia, serif; font-size: 34px; margin: 4px 0; }

.pic-canvas {
  width: 100%; height: 300px; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; touch-action: none; display: block; margin: 10px 0;
}
.pic-word { font-family: Georgia, serif; font-size: 26px; color: var(--gold); }

/* 叙事 */
.story-scene { text-align: center; margin: 18px 0; }
.story-emoji { font-size: 52px; }
.story-text { font-size: 16px; line-height: 1.9; max-width: 620px; margin: 10px auto; }

/* 排行榜 */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { width: 30px; text-align: center; color: var(--text-dim); }
.lb-rank.top { font-size: 18px; }

/* 朗读慢速开关（engine.js 的 slowToggle） */
.slow-toggle { white-space: nowrap; }
.slow-toggle.on { border-color: var(--gold); color: var(--gold); font-weight: 600; }

/* ==================== 公共设计系统 · 目录前 26 项 ====================
 * 上方旧样式保留，供未纳入本轮的玩法继续使用。
 * 新变量和规则只在 .g-ui[data-game] 生效；结算 box 由 engine 单独标记。
 * 分类专属布局在后续步骤接入，本节只提供可复用的公共视觉基础。
 */
.g-ui[data-game] {
  --g-brand: #5b5bd6;
  --g-brand-2: #7474e8;
  --g-brand-text: #ffffff;
  --g-brand-soft: #eeeefe;
  --g-success: #087f70;
  --g-success-soft: #e2f5ef;
  --g-reward: #9a6200;
  --g-reward-soft: #fff3d6;
  --g-danger: #c33d59;
  --g-danger-soft: #fdeaf0;
  --g-bg: #f5f5fd;
  --g-surface: #ffffff;
  --g-surface-2: #f0f1fa;
  --g-text: #252542;
  --g-muted: #656780;
  --g-line: #dcddec;
  --g-radius: 20px;
  --g-radius-sm: 12px;
  --g-space: 16px;
  --g-shadow: 0 3px 5px rgba(43, 43, 100, .04), 0 12px 30px rgba(43, 43, 100, .07);
  --g-focus: #8c8ceb;
  --g-duration: 160ms;
  /* 兼容原组件使用的主题变量，继承范围仍只在游戏容器内。 */
  --bg: var(--g-bg);
  --bg-soft: var(--g-surface-2);
  --card: var(--g-surface);
  --card-2: var(--g-surface-2);
  --text: var(--g-text);
  --text-dim: var(--g-muted);
  --line: var(--g-line);
  --accent: var(--g-brand);
  --accent-text: var(--g-brand-text);
  --gold: var(--g-reward);
  --ok: var(--g-success);
  --bad: var(--g-danger);
  --warn: var(--g-reward);
  --radius: var(--g-radius);
  --shadow: var(--g-shadow);
  color: var(--g-text);
  color-scheme: light;
  line-height: 1.65;
}
[data-theme="dark"] .g-ui[data-game] {
  --g-brand: #8b8cf6;
  --g-brand-2: #a5a6ff;
  --g-brand-text: #17172e;
  --g-brand-soft: #292942;
  --g-success: #59d5bc;
  --g-success-soft: #183a34;
  --g-reward: #f3c466;
  --g-reward-soft: #3b301e;
  --g-danger: #ff91aa;
  --g-danger-soft: #412632;
  --g-bg: #171827;
  --g-surface: #222336;
  --g-surface-2: #2b2d43;
  --g-text: #eeeefa;
  --g-muted: #b1b3cc;
  --g-line: #41445f;
  --g-focus: #b1b2ff;
  --g-shadow: 0 3px 5px rgba(0, 0, 0, .14), 0 12px 30px rgba(0, 0, 0, .22);
  color-scheme: dark;
}
/* 明确提供静态回退，只有支持 color-mix 的浏览器才覆盖这些变量。 */
@supports (color: color-mix(in srgb, white, black)) {
  .g-ui[data-game] {
    --g-brand-soft: color-mix(in srgb, var(--g-brand) 11%, var(--g-surface));
    --g-success-soft: color-mix(in srgb, var(--g-success) 12%, var(--g-surface));
    --g-reward-soft: color-mix(in srgb, var(--g-reward) 12%, var(--g-surface));
    --g-danger-soft: color-mix(in srgb, var(--g-danger) 10%, var(--g-surface));
  }
}

/* 外壳与面板 */
.g-ui[data-game] .game-wrap { max-width: 900px; min-width: 0; }
.g-ui[data-game] .game-body { min-width: 0; }
.g-ui[data-game] .g-panel,
.g-ui[data-game] .card {
  background: var(--g-surface);
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  box-shadow: var(--g-shadow);
}
.g-ui[data-game] .g-panel,
.g-ui[data-game] .pad { padding: var(--g-space); }
.g-ui[data-game] .setup-panel { max-width: 460px; }
.g-ui[data-game] .setup-panel .field { margin-bottom: 18px; text-align: left; }
.g-ui[data-game] .field > span { color: var(--g-muted); font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.g-ui[data-game] .muted { color: var(--g-muted); }
.g-ui[data-game] .empty { overflow-wrap: anywhere; }
.g-ui[data-game] .g-enter { animation: pop 240ms ease-out; }

/* HUD 与徽记；不向游戏或答案节点添加装饰文字。 */
.g-ui[data-game] .g-hud {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px; background: var(--g-brand-soft); border-radius: var(--g-radius);
}
.g-ui[data-game] .game-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px;
  margin-bottom: 18px; border: 1px solid var(--g-line);
}
.g-ui[data-game] .game-title { font-size: 20px; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; }
.g-ui[data-game] .game-bar > .slow-toggle { justify-self: start; }
.g-ui[data-game] .g-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: var(--g-brand-soft);
  color: var(--g-brand); font-size: 13px; font-weight: 600;
}
.g-ui[data-game] .g-badge.success { color: var(--g-success); background: var(--g-success-soft); }
.g-ui[data-game] .g-badge.reward { color: var(--g-reward); background: var(--g-reward-soft); }
.g-ui[data-game] .g-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.g-ui[data-game] .g-actions > .btn { flex: 1 1 140px; }

/* 按钮、表单与可触摸控件 */
.g-ui[data-game] button,
.g-ui[data-game] a.btn,
.g-ui[data-game] .drag-item,
.g-ui[data-game] [role="button"] { min-width: 44px; min-height: 44px; }
.g-ui[data-game] .btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px;
  padding: 10px 16px; border: 1px solid var(--g-line); border-radius: var(--g-radius-sm);
  background: var(--g-surface); color: var(--g-text); font-size: 15px; font-weight: 600;
  line-height: 1.4; text-align: center; touch-action: manipulation;
  transition: background-color var(--g-duration), border-color var(--g-duration), box-shadow var(--g-duration), transform var(--g-duration);
}
.g-ui[data-game] .btn.sm { padding: 8px 12px; font-size: 14px; }
.g-ui[data-game] .btn.primary {
  color: var(--g-brand-text); border-color: transparent;
  background: var(--g-brand);
  background: linear-gradient(135deg, var(--g-brand), var(--g-brand-2));
  box-shadow: 0 3px 0 rgba(42, 42, 99, .16);
}
.g-ui[data-game] .btn.ghost { background: transparent; }
.g-ui[data-game] .btn.ok { color: var(--g-success); border-color: var(--g-success); background: var(--g-success-soft); }
.g-ui[data-game] .btn.bad { color: var(--g-danger); border-color: var(--g-danger); background: var(--g-danger-soft); }
.g-ui[data-game] .btn.warn { color: var(--g-reward); border-color: var(--g-reward); background: var(--g-reward-soft); }
.g-ui[data-game] .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.g-ui[data-game] .btn:active:not(:disabled) { transform: translateY(1px); }
.g-ui[data-game] .slow-toggle.on { color: var(--g-brand); background: var(--g-brand-soft); border-color: var(--g-brand); }
.g-ui[data-game] input,
.g-ui[data-game] select,
.g-ui[data-game] textarea {
  min-width: 0; min-height: 44px; max-width: 100%;
  font-size: 16px; color: var(--g-text);
}
.g-ui[data-game] input:focus,
.g-ui[data-game] select:focus,
.g-ui[data-game] textarea:focus,
.g-ui[data-game] button:focus,
.g-ui[data-game] a:focus,
.g-ui[data-game] [tabindex]:focus { outline: 3px solid var(--g-focus); outline-offset: 3px; }
.g-ui[data-game] .ft-answer .ft-input { flex: 1; width: 100%; min-width: 0; font-size: 20px; }
.g-ui[data-game] .ru-kb { max-width: 100%; overflow-x: auto; }
.g-ui[data-game] .kb-row { min-width: max-content; }
.g-ui[data-game] .kb-key { flex-shrink: 0; }

/* 计时与进度：保留唯一的 i 填充节点和原宽度更新方法。 */
.g-ui[data-game] .g-meter,
.g-ui[data-game] .bar {
  height: 10px; min-width: 0; overflow: hidden; border-radius: 999px;
  background: var(--g-surface-2); box-shadow: inset 0 1px 2px rgba(42, 42, 99, .08);
}
.g-ui[data-game] .g-meter > i,
.g-ui[data-game] .bar > i {
  display: block; height: 100%; border-radius: inherit; background: var(--g-brand);
  background: linear-gradient(90deg, var(--g-brand), var(--g-brand-2));
  transition: width var(--g-duration) linear;
}
.g-ui[data-game] .fuse > i { background: linear-gradient(90deg, var(--g-danger), var(--g-reward)); }

/* 选择题：列表中仍只有选项按钮，A/B/C/D 保留原节点。 */
.g-ui[data-game] .quiz-options { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; }
.g-ui[data-game] .quiz-opt {
  min-height: 64px; min-width: 0; padding: 14px; gap: 12px;
  border: 2px solid var(--g-line); border-radius: 16px;
  background: var(--g-surface); color: var(--g-text); font-size: 16px;
  line-height: 1.6; overflow-wrap: anywhere; touch-action: manipulation;
  box-shadow: 0 3px 0 var(--g-line);
  transition: border-color var(--g-duration), background-color var(--g-duration), transform var(--g-duration);
}
.g-ui[data-game] .quiz-key {
  flex: none; width: 30px; height: 30px; padding: 0; border-radius: 10px;
  background: var(--g-brand-soft); color: var(--g-brand); font-size: 13px; font-weight: 700;
}
.g-ui[data-game] .quiz-opt:disabled { opacity: 1; }
.g-ui[data-game] .quiz-opt.right { border-color: var(--g-success); background: var(--g-success-soft); box-shadow: 0 3px 0 var(--g-success); }
.g-ui[data-game] .quiz-opt.wrong { border-color: var(--g-danger); border-style: dashed; background: var(--g-danger-soft); box-shadow: none; }
.g-ui[data-game] .quiz-opt.right .quiz-key { background: var(--g-success); color: var(--g-surface); }
.g-ui[data-game] .quiz-opt.wrong .quiz-key { background: var(--g-danger); color: var(--g-surface); }
.g-ui[data-game] .quiz-prompt { font-size: 28px; font-size: clamp(24px, 6vw, 34px); line-height: 1.5; overflow-wrap: anywhere; }
.g-ui[data-game] .quiz-prompt-sm { font-size: 18px; line-height: 1.7; overflow-wrap: anywhere; }
.g-ui[data-game] .big-speaker { border-color: var(--g-line); background: var(--g-brand-soft); color: var(--g-brand); box-shadow: var(--g-shadow); }

/* 反馈不加伪元素文字，答案的 textContent 保持不变。 */
.g-ui[data-game] .g-feedback,
.g-ui[data-game] .verdict { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.g-ui[data-game] .g-feedback:not(:empty),
.g-ui[data-game] .verdict:not(:empty) {
  padding: 12px 14px; background: var(--g-surface-2); border: 1px solid var(--g-line);
  border-radius: var(--g-radius-sm); text-align: left;
}
.g-ui[data-game] .g-feedback .right,
.g-ui[data-game] .verdict .right { color: var(--g-success); font-weight: 600; }
.g-ui[data-game] .g-feedback .wrong,
.g-ui[data-game] .verdict .wrong { color: var(--g-danger); font-weight: 600; }
.g-ui[data-game] .ft-fb.ok { background: var(--g-success-soft); color: var(--g-text); }
.g-ui[data-game] .ft-fb.bad { background: var(--g-danger-soft); color: var(--g-text); }

/* 多人大厅与录音面板 */
.g-ui[data-game] .g-lobby .g-panel { max-width: 680px; margin: 0 auto; }
.g-ui[data-game] .room-code {
  font-size: 32px; font-size: clamp(28px, 7vw, 44px); letter-spacing: 5px;
  color: var(--g-brand); padding: 12px 8px; margin: 12px 0;
  background: var(--g-brand-soft); border: 1px dashed var(--g-brand); border-radius: var(--g-radius-sm);
  overflow-wrap: anywhere;
}
.g-ui[data-game] .lobby-players { gap: 10px; margin: 18px 0; }
.g-ui[data-game] .lobby-player { min-height: 44px; max-width: 100%; padding: 8px 12px; font-size: 14px; color: var(--g-text); overflow-wrap: anywhere; }
.g-ui[data-game] .g-speaking { margin-top: 16px; box-shadow: none; background: var(--g-surface-2); }
.g-ui[data-game] .g-record-status { margin-top: 12px; text-align: center; line-height: 1.7; }
.g-ui[data-game] .g-record-button.bad { border-width: 2px; }
.g-ui[data-game] .g-speaking audio { max-width: 100%; border-radius: var(--g-radius-sm); }

/* 外置结算框本身就是作用域，不修改 #modalRoot。 */
.g-ui[data-game].g-result {
  width: 100%; max-width: 520px; padding: 18px;
  background: var(--g-surface); border: 1px solid var(--g-line); border-radius: 24px;
  box-shadow: 0 20px 70px rgba(20, 20, 50, .26);
}
.g-ui[data-game].g-result h3 { min-height: 44px; margin: 0 48px 18px 0; font-size: 22px; line-height: 1.5; }
.g-ui[data-game].g-result .close { width: 44px; height: 44px; border-radius: 12px; background: var(--g-surface-2); color: var(--g-muted); }
.g-ui[data-game].g-result .stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; background: transparent; }
.g-ui[data-game].g-result .stat {
  min-width: 0; padding: 14px 6px; border: 1px solid var(--g-line); border-radius: 16px;
  background: var(--g-brand-soft); text-align: center; overflow-wrap: anywhere;
}
.g-ui[data-game].g-result .stat b { font-size: 23px; color: var(--g-brand); font-variant-numeric: tabular-nums; }
.g-ui[data-game].g-result .stat:first-child { background: var(--g-reward-soft); }
.g-ui[data-game].g-result .stat:first-child b { color: var(--g-reward); }
.g-ui[data-game].g-result .stat span { font-size: 13px; color: var(--g-muted); }

@media (min-width: 621px) {
  .g-ui[data-game] { --g-space: 24px; }
  .g-ui[data-game] .game-bar { display: flex; padding: 14px 18px; }
  .g-ui[data-game] .quiz-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-ui[data-game] .g-actions > .btn { flex: 0 1 auto; }
  .g-ui[data-game].g-result { padding: 24px; }
}
@media (hover: hover) and (pointer: fine) {
  .g-ui[data-game] .btn:hover:not(:disabled),
  .g-ui[data-game] .quiz-opt:hover:not(:disabled) { border-color: var(--g-brand); transform: translateY(-1px); }
  .g-ui[data-game] .btn.primary:hover:not(:disabled) { filter: brightness(1.05); }
  .g-ui[data-game] .big-speaker:hover { border-color: var(--g-brand); }
}
@media (prefers-reduced-motion: reduce) {
  .g-ui[data-game],
  .g-ui[data-game] *,
  .g-ui[data-game] *::before,
  .g-ui[data-game] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
