:root {
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-heading: "Ma Shan Zheng", "Kaiti SC", "STKaiti", "KaiTi", "楷体", "BiauKai", serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --game-page-bg:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(180deg, #fbf7f0 0%, #f4eede 100%);
  --game-shell-bg:
    radial-gradient(circle at top right, rgba(236, 176, 97, 0.22), transparent 30%),
    radial-gradient(circle at left bottom, rgba(166, 58, 43, 0.09), transparent 28%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(248, 242, 230, 0.98) 100%);
  --game-panel-bg: rgba(255, 253, 248, 0.9);
  --game-card-bg: rgba(255, 253, 248, 0.96);
  --game-card-bg-strong: linear-gradient(180deg, rgba(255, 254, 251, 0.98) 0%, rgba(247, 238, 223, 0.98) 100%);
  --game-text: #261c17;
  --game-text-muted: #6f655c;
  --game-line: rgba(124, 98, 72, 0.16);
  --game-line-strong: rgba(166, 58, 43, 0.22);
  --game-kicker-bg: rgba(166, 58, 43, 0.08);
  --game-kicker-text: #9f3627;
  --game-primary: #a63a2b;
  --game-primary-strong: #8f2f23;
  --game-primary-soft: rgba(166, 58, 43, 0.1);
  --game-success: #2f7d57;
  --game-success-soft: rgba(47, 125, 87, 0.1);
  --game-warning: #c57a2a;
  --game-warning-soft: rgba(197, 122, 42, 0.12);
  --game-danger: #b6453a;
  --game-danger-soft: rgba(182, 69, 58, 0.12);
  --game-shadow: 0 22px 48px rgba(73, 49, 29, 0.12);
  --game-shadow-soft: 0 14px 30px rgba(73, 49, 29, 0.08);
  --game-hero-ring: rgba(255, 255, 255, 0.52);
  --shell-width: min(1480px, calc(100vw - 28px));
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

/* 2026-04 standalone polish pass: align closer to the main site, keep the board larger. */

.match-hub-shell {
  padding: 20px 22px 24px;
}

.match-hub-hero {
  margin-bottom: 18px;
  padding: 14px 16px 12px;
  border: 1px solid rgba(251, 146, 60, 0.14);
  background:
    radial-gradient(circle at top right, rgba(253, 186, 116, 0.3), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.9) 0%, rgba(255, 248, 238, 0.82) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.match-hub-overview-compact {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.match-hub-overview-compact .match-hub-header {
  align-items: flex-start;
}

.match-hub-overview-compact .match-hub-copy {
  max-width: 34rem;
}

.match-hub-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.match-hub-stat-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(166, 58, 43, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #8b5e3c;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.match-hub-quick-btn {
  min-height: 36px;
  padding-inline: 16px;
}

.match-hub-grid {
  gap: 14px;
}

.match-module-card {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 18px 18px 16px;
  border-radius: 20px;
}

.match-module-card-head {
  justify-content: flex-start;
}

.match-module-summary {
  margin: 0;
  min-height: 0;
  line-height: 1.55;
}

.match-module-fields,
.match-module-facts {
  gap: 8px;
}

.match-module-field,
.match-module-fact {
  min-height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.78);
}

.module-actions {
  margin-top: 2px;
}

.module-actions .btn {
  min-height: 44px;
  border-radius: 999px;
  box-shadow: none;
}

.match-module-card[data-match-module="herb"] .module-actions .btn {
  background: linear-gradient(135deg, #4a8f57 0%, #5ca46a 100%);
  border-color: rgba(74, 143, 87, 0.32);
}

.match-module-card[data-match-module="formula"] .module-actions .btn {
  background: linear-gradient(135deg, #d4664a 0%, #df7e5f 100%);
  border-color: rgba(212, 102, 74, 0.32);
}

.match-module-card[data-match-module="acupoint"] .module-actions .btn {
  background: linear-gradient(135deg, #c78b1e 0%, #d69d34 100%);
  border-color: rgba(199, 139, 30, 0.32);
}

.match-module-card[data-match-module="internal"] .module-actions .btn {
  background: linear-gradient(135deg, #5479df 0%, #6b8df0 100%);
  border-color: rgba(84, 121, 223, 0.32);
}

.match-duration-btn {
  min-width: 72px;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 247, 237, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.match-duration-btn.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 225, 0.2),
    0 10px 20px rgba(166, 58, 43, 0.18);
}

.match-theme-btn,
.match-hub-audio-btn,
.match-audio-toggle {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.match-mode-panel {
  width: min(100%, 920px);
  padding: 18px 18px 20px;
}

.match-mode-panel-head {
  position: relative;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.match-mode-panel-head > .btn {
  position: absolute;
  top: 0;
  right: 0;
}

.match-mode-panel-title-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.match-mode-sheet-title {
  margin: 0;
}

.match-mode-group {
  padding: 14px;
  border-radius: 20px;
}

.match-mode-group-speed {
  background: linear-gradient(180deg, rgba(255, 250, 247, 0.96) 0%, rgba(255, 253, 251, 0.94) 100%);
  border: 1px solid rgba(220, 38, 38, 0.12);
}

.match-mode-group-classify {
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.96) 0%, rgba(252, 254, 255, 0.94) 100%);
  border: 1px solid rgba(59, 130, 246, 0.12);
}

.match-mode-group-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-mode-option {
  min-height: 92px;
  padding: 12px 14px;
  border-radius: 18px;
}

.match-mode-option-speed {
  border-color: rgba(220, 38, 38, 0.12);
  background: linear-gradient(180deg, rgba(255, 250, 248, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.match-mode-option-classify {
  border-color: rgba(59, 130, 246, 0.12);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.match-mode-option-title {
  color: #7c2d12;
  font-size: 0.95rem;
}

.match-mode-option-copy {
  color: #8a6a52;
}

.match-stage-shell {
  padding: 18px 18px 20px;
}

.match-stage-hero {
  gap: 12px;
  margin-bottom: 14px;
}

.match-stage-nav {
  gap: 12px;
}

.match-stage-nav > .btn {
  min-width: 96px;
  min-height: 40px;
  padding-inline: 16px;
}

.match-stage-summary {
  grid-template-columns: repeat(3, minmax(104px, 1fr));
}

.match-stage-summary-item {
  padding: 12px 14px;
}

.match-stage-panel {
  padding: 14px;
}

.quiz-question {
  margin-bottom: 12px;
}

.match-question-top strong {
  font-size: 0.92rem;
  color: #9f3627;
}

.question-card {
  padding: 14px 18px;
  border-radius: 18px;
}

.match-game-shell {
  padding: 18px;
  border-radius: 22px;
}

.match-game-topbar {
  gap: 8px;
}

.match-chip,
.match-timer {
  min-height: 32px;
  padding: 0 11px;
  font-size: 0.84rem;
}

.match-timer {
  min-width: 88px;
}

.game-overlay.is-passive {
  background:
    radial-gradient(circle at center, rgba(255, 249, 238, 0.04) 0%, rgba(33, 25, 21, 0.08) 70%),
    rgba(33, 25, 21, 0.04);
  backdrop-filter: none;
}

.game-overlay.is-passive.is-resolved {
  background:
    radial-gradient(circle at center, rgba(245, 158, 11, 0.06) 0%, rgba(33, 25, 21, 0.12) 72%),
    rgba(33, 25, 21, 0.08);
}

.match-stage-actions {
  margin-top: 14px;
}

[data-theme="dark"] .match-hub-hero {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(30, 24, 20, 0.86) 0%, rgba(20, 16, 14, 0.88) 100%);
  border-color: rgba(214, 161, 90, 0.12);
}

[data-theme="dark"] .match-hub-copy,
[data-theme="dark"] .match-stage-subcopy,
[data-theme="dark"] .match-mode-group-copy,
[data-theme="dark"] .match-mode-option-copy,
[data-theme="dark"] .match-board-hint {
  color: #dbc6af;
}

[data-theme="dark"] .match-hub-stat-pill,
[data-theme="dark"] .match-duration-btn,
[data-theme="dark"] .match-theme-btn,
[data-theme="dark"] .match-hub-audio-btn,
[data-theme="dark"] .match-audio-toggle {
  background: linear-gradient(180deg, rgba(58, 42, 34, 0.94) 0%, rgba(34, 24, 20, 0.98) 100%);
  border-color: rgba(214, 161, 90, 0.18);
  color: #f3dbc2;
}

[data-theme="dark"] .match-duration-btn.is-active,
[data-theme="dark"] .match-theme-btn.is-active,
[data-theme="dark"] .match-hub-audio-btn.is-on,
[data-theme="dark"] .match-audio-toggle.is-on {
  color: #fff7ed;
}

[data-theme="dark"] .match-mode-group-speed {
  background: linear-gradient(180deg, rgba(70, 24, 22, 0.72) 0%, rgba(31, 15, 14, 0.76) 100%);
  border-color: rgba(220, 38, 38, 0.16);
}

[data-theme="dark"] .match-mode-group-classify {
  background: linear-gradient(180deg, rgba(18, 32, 62, 0.72) 0%, rgba(10, 16, 31, 0.76) 100%);
  border-color: rgba(59, 130, 246, 0.16);
}

[data-theme="dark"] .match-mode-option-speed {
  background: linear-gradient(180deg, rgba(74, 24, 24, 0.82) 0%, rgba(36, 14, 14, 0.86) 100%);
}

[data-theme="dark"] .match-mode-option-classify {
  background: linear-gradient(180deg, rgba(18, 35, 76, 0.82) 0%, rgba(10, 18, 38, 0.86) 100%);
}

[data-theme="dark"] .match-mode-option-title,
[data-theme="dark"] .question-card,
[data-theme="dark"] .match-stage-summary-item strong,
[data-theme="dark"] .match-hub-stat-pill {
  color: #f8f2e8;
}

[data-theme="dark"] .question-card,
[data-theme="dark"] .match-stage-summary-item,
[data-theme="dark"] .match-module-field,
[data-theme="dark"] .match-module-fact {
  background: rgba(24, 18, 16, 0.72);
  border-color: rgba(214, 161, 90, 0.12);
}

[data-theme="dark"] .game-overlay.is-passive {
  background:
    radial-gradient(circle at center, rgba(196, 91, 73, 0.06) 0%, rgba(9, 7, 6, 0.14) 68%),
    rgba(9, 7, 6, 0.08);
}

@media (max-width: 720px) {
  .match-hub-shell,
  .match-stage-shell {
    padding: 14px;
    border-radius: 20px;
  }

  .match-hub-overview-compact .match-hub-header {
    flex-direction: column;
    align-items: stretch;
  }

  .match-hub-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  .match-duration-group {
    flex: 1 1 auto;
  }

  .match-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .match-stage-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .match-stage-nav {
    align-items: center;
  }

  .match-stage-copy {
    width: 100%;
  }

  .match-stage-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .match-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-module-card {
    padding: 12px;
  }

  .match-module-mark {
    gap: 10px;
  }

  .match-module-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .match-module-card h3 {
    font-size: 1rem;
  }

  .match-module-summary {
    font-size: 0.86rem;
  }

  .match-module-field,
  .match-module-fact {
    min-height: 24px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .module-actions .btn {
    min-height: 40px;
    font-size: 0.84rem;
  }

  .match-hub-summary-strip {
    gap: 8px;
  }

  .match-hub-stat-pill {
    min-height: 30px;
    padding: 0 11px;
    font-size: 0.74rem;
  }

  .match-stage-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .match-stage-summary-item {
    padding: 10px;
  }

  .match-stage-summary-item span {
    font-size: 0.7rem;
  }

  .match-stage-summary-item strong {
    margin-top: 4px;
    font-size: 0.88rem;
  }

  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-mode-option {
    min-height: 76px;
    padding: 10px;
  }

  .match-game-topbar {
    flex-wrap: wrap;
  }

  .match-timer {
    margin-left: auto;
    width: auto;
  }
}

@media (max-width: 360px) {
  .match-hub-grid {
    grid-template-columns: 1fr;
  }

  .match-mode-group-grid {
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] {
  --game-page-bg:
    radial-gradient(circle at top center, rgba(89, 102, 118, 0.16), transparent 36%),
    linear-gradient(180deg, #171c21 0%, #111519 100%);
  --game-shell-bg:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.12), transparent 30%),
    radial-gradient(circle at left bottom, rgba(78, 156, 119, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(26, 32, 39, 0.98) 0%, rgba(20, 24, 28, 0.98) 100%);
  --game-panel-bg: rgba(32, 40, 49, 0.9);
  --game-card-bg: rgba(32, 40, 49, 0.96);
  --game-card-bg-strong: linear-gradient(180deg, rgba(35, 44, 54, 0.98) 0%, rgba(26, 32, 39, 0.98) 100%);
  --game-text: #eee6da;
  --game-text-muted: #b5aa9d;
  --game-line: rgba(238, 230, 218, 0.08);
  --game-line-strong: rgba(196, 91, 73, 0.22);
  --game-kicker-bg: rgba(196, 91, 73, 0.1);
  --game-kicker-text: #f0b2a6;
  --game-primary: #c45b49;
  --game-primary-strong: #d27768;
  --game-primary-soft: rgba(196, 91, 73, 0.14);
  --game-success: #4e9c77;
  --game-success-soft: rgba(78, 156, 119, 0.14);
  --game-warning: #d29a4c;
  --game-warning-soft: rgba(210, 154, 76, 0.16);
  --game-danger: #c86a60;
  --game-danger-soft: rgba(200, 106, 96, 0.16);
  --game-shadow: 0 28px 56px rgba(0, 0, 0, 0.34);
  --game-shadow-soft: 0 16px 32px rgba(0, 0, 0, 0.24);
  --game-hero-ring: rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--game-text);
  background: var(--game-page-bg);
}

.hidden {
  display: none !important;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

#match-game-audio {
  display: none;
}

.app-shell {
  width: var(--shell-width);
  margin: 0 auto;
  padding: 18px 0 32px;
}

.page-section {
  margin-top: 18px;
}

.loading,
.error-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loading-card,
.error-card {
  width: min(760px, 100%);
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--game-card-bg);
  border: 1px solid var(--game-line);
  box-shadow: var(--game-shadow);
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 44px;
  padding: 0.68rem 1.05rem;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover,
.btn:focus-visible,
.match-duration-btn:hover,
.match-theme-btn:hover,
.match-hub-audio-btn:hover,
.match-audio-toggle:hover,
.match-mode-option:hover,
.match-card:hover,
.group-card:hover,
.point-card:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff7ed;
  background: linear-gradient(135deg, var(--game-primary) 0%, #f59e0b 100%);
  border-color: rgba(166, 58, 43, 0.34);
  box-shadow: 0 12px 24px rgba(166, 58, 43, 0.2);
}

.btn-secondary {
  color: var(--game-text);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--game-line);
}

.btn-danger {
  color: var(--game-danger);
  background: var(--game-danger-soft);
  border-color: rgba(182, 69, 58, 0.16);
}

.match-hub-shell {
  margin: 12px 0 24px;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(253, 186, 116, 0.55), transparent 32%),
    radial-gradient(circle at left bottom, rgba(248, 113, 113, 0.2), transparent 30%),
    linear-gradient(165deg, #fff7ed 0%, #fffbeb 58%, #ffffff 100%);
  border: 1px solid rgba(251, 146, 60, 0.18);
  box-shadow: 0 18px 40px rgba(120, 53, 15, 0.12);
}

.match-hub-hero {
  position: relative;
  overflow: hidden;
  display: block;
  margin-bottom: 20px;
  padding: 12px 12px 6px;
  border-radius: 28px;
}

.match-hub-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.98;
}

.match-hub-overview {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.match-hub-intro {
  display: grid;
  gap: 14px;
}

.match-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.match-hub-header-main {
  min-width: 0;
  flex: 1 1 420px;
}

.match-hub-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--game-kicker-bg);
  color: var(--game-kicker-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.match-hub-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.12;
  color: #7c2d12;
}

.match-hub-copy {
  margin: 0;
  max-width: 760px;
  color: #7c5a40;
  line-height: 1.7;
}

.match-hub-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.match-hub-stat,
.match-stage-summary-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(249, 115, 22, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 249, 240, 0.72) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.match-hub-stat span,
.match-stage-summary-item span {
  display: block;
  color: #8a6a52;
  font-size: 0.82rem;
}

.match-hub-stat strong,
.match-stage-summary-item strong {
  display: block;
  margin-top: 6px;
  color: #7c2d12;
  font-size: 1.14rem;
}

.match-hub-toolbar {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  margin-top: 0;
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68) 0%, rgba(255, 248, 235, 0.58) 100%);
  border: 1px solid rgba(251, 146, 60, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.match-hub-side-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 249, 0.98) 0%, rgba(255, 245, 232, 0.94) 100%);
  box-shadow: 0 14px 30px rgba(120, 53, 15, 0.08);
}

.match-hub-side-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(166, 58, 43, 0.08);
  color: #9f3627;
  font-size: 0.78rem;
  font-weight: 800;
}

.match-hub-side-card h3 {
  margin: 0;
  font-size: 1.08rem;
  color: #7c2d12;
}

.match-hub-side-card p {
  margin: 0;
  color: #7c5a40;
  line-height: 1.65;
}

.match-duration-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
}

.match-duration-btn,
.match-theme-btn,
.match-hub-audio-btn,
.match-audio-toggle {
  border-radius: 999px;
  border: 1px solid var(--game-line);
  min-height: 40px;
  padding: 0.6rem 0.95rem;
}

.match-duration-btn,
.match-theme-btn {
  background: rgba(255, 255, 255, 0.72);
  color: var(--game-text);
}

.match-duration-btn.is-active {
  background: linear-gradient(135deg, var(--game-primary) 0%, #f59e0b 100%);
  color: #fff7ed;
  border-color: rgba(166, 58, 43, 0.34);
}

.match-theme-btn.is-active {
  background: linear-gradient(135deg, var(--game-primary) 0%, #f59e0b 100%);
  color: #fff7ed;
  border-color: rgba(166, 58, 43, 0.34);
  box-shadow: 0 10px 20px rgba(166, 58, 43, 0.18);
}

.match-hub-audio-btn,
.match-audio-toggle,
.match-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  min-width: 42px;
  padding: 0;
  margin-left: 6px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.match-theme-btn {
  margin-left: 8px;
}

.match-game-topbar .match-theme-btn {
  margin-left: 0;
}

.match-game-topbar .match-audio-toggle {
  margin-left: 0;
}

.match-hub-audio-btn.is-on,
.match-audio-toggle.is-on {
  background: linear-gradient(135deg, var(--game-primary) 0%, #f59e0b 100%);
  border-color: rgba(166, 58, 43, 0.3);
  color: #fff7ed;
  box-shadow: 0 10px 20px rgba(166, 58, 43, 0.18);
}

.match-hub-audio-btn.is-off,
.match-audio-toggle.is-off {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 247, 237, 0.92) 100%);
  border-color: rgba(166, 58, 43, 0.16);
  color: #9f3627;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.match-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.match-module-card {
  position: relative;
  padding: 20px 20px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(251, 146, 60, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 12px 24px rgba(120, 53, 15, 0.07);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.match-module-card.is-live {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 247, 237, 0.98) 100%);
  border-color: rgba(249, 115, 22, 0.28);
}

.match-module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 18px 34px rgba(120, 53, 15, 0.12);
}

.match-module-card[data-match-module="herb"].is-live {
  background:
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 253, 242, 0.98) 100%);
  border-color: rgba(132, 204, 22, 0.24);
}

.match-module-card[data-match-module="formula"].is-live {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 248, 245, 0.98) 100%);
  border-color: rgba(196, 91, 73, 0.24);
}

.match-module-card[data-match-module="acupoint"].is-live {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 251, 243, 0.98) 100%);
  border-color: rgba(245, 158, 11, 0.24);
}

.match-module-card[data-match-module="internal"].is-live {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
  border-color: rgba(96, 165, 250, 0.24);
}

.match-module-card-head,
.match-module-fields,
.match-module-facts,
.module-actions,
.match-stage-toolbar,
.match-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.match-module-card-head {
  justify-content: space-between;
  align-items: center;
}

.match-module-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.match-module-mark-copy {
  display: grid;
  gap: 2px;
}

.match-module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(166, 58, 43, 0.12) 0%, rgba(245, 158, 11, 0.18) 100%);
  color: #9f3627;
  font-size: 1.08rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.match-module-card[data-match-module="herb"] .match-module-icon,
.match-stage-shell[data-match-module="herb"] .match-hub-kicker {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.14) 0%, rgba(245, 158, 11, 0.18) 100%);
  color: #4d7c0f;
}

.match-module-card[data-match-module="formula"] .match-module-icon,
.match-stage-shell[data-match-module="formula"] .match-hub-kicker {
  background: linear-gradient(135deg, rgba(196, 91, 73, 0.14) 0%, rgba(245, 158, 11, 0.18) 100%);
  color: #9f3627;
}

.match-module-card[data-match-module="acupoint"] .match-module-icon,
.match-stage-shell[data-match-module="acupoint"] .match-hub-kicker {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(251, 191, 36, 0.18) 100%);
  color: #b45309;
}

.match-module-card[data-match-module="internal"] .match-module-icon,
.match-stage-shell[data-match-module="internal"] .match-hub-kicker {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.14) 0%, rgba(59, 130, 246, 0.18) 100%);
  color: #1d4ed8;
}

.match-module-cue {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--game-kicker-text);
}

.match-module-card[data-match-module="herb"] .match-module-cue {
  color: #4d7c0f;
}

.match-module-card[data-match-module="formula"] .match-module-cue {
  color: #9f3627;
}

.match-module-card[data-match-module="acupoint"] .match-module-cue {
  color: #b45309;
}

.match-module-card[data-match-module="internal"] .match-module-cue {
  color: #1d4ed8;
}

.match-module-badge,
.match-module-field,
.board-col-head {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  font-size: 0.76rem;
  font-weight: 700;
}

.match-module-field.is-muted {
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
}

.match-module-card h3 {
  margin: 0;
  color: #7c2d12;
  font-size: 1.18rem;
}

.match-module-summary {
  margin: 12px 0 0;
  color: #7c5a40;
  line-height: 1.65;
  min-height: 52px;
}

.module-actions {
  margin-top: 14px;
}

.module-actions .btn {
  flex: 1 1 auto;
  min-height: 46px;
}

.match-module-facts {
  margin-top: 2px;
}

.match-module-fact {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(120, 53, 15, 0.06);
  color: #8a6a52;
  font-size: 0.76rem;
  font-weight: 700;
}

.match-mode-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
  overflow-y: auto;
  padding: max(14px, env(safe-area-inset-top)) 10px calc(14px + env(safe-area-inset-bottom));
}

.match-mode-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
}

.match-mode-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 18px 18px 22px;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.14), transparent 28%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid rgba(249, 115, 22, 0.1);
  box-shadow: 0 -16px 34px rgba(15, 23, 42, 0.1);
}

.match-mode-sheet[data-match-module="herb"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.14), transparent 28%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(250, 253, 242, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(132, 204, 22, 0.16);
}

.match-mode-sheet[data-match-module="formula"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.14), transparent 28%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 245, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(196, 91, 73, 0.16);
}

.match-mode-sheet[data-match-module="acupoint"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 28%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(245, 158, 11, 0.16);
}

.match-mode-sheet[data-match-module="internal"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 28%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(180deg, rgba(246, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(96, 165, 250, 0.16);
}

.match-mode-panel-head {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 76px;
  min-height: 44px;
}

.match-mode-panel-head > div {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 2px;
}

.match-mode-panel-head > .btn {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.match-mode-sheet-title {
  margin: 0;
  color: #8b4a24;
  font-size: 1.45rem;
  line-height: 1.08;
}

.match-mode-sheet-copy {
  margin: 0;
  color: #7c5a40;
  line-height: 1.65;
}

.match-mode-sheet-options {
  display: grid;
  gap: 12px;
}

.match-mode-group {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 252, 247, 0.7) 100%);
  border: 1px solid rgba(251, 146, 60, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.match-mode-group:first-child {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 250, 244, 0.9) 0%, rgba(255, 255, 255, 0.82) 100%);
}

.match-mode-group:last-child {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(255, 248, 245, 0.9) 0%, rgba(255, 255, 255, 0.82) 100%);
}

.match-mode-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.match-mode-group-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #9b5330;
}

.match-mode-group-copy {
  color: #8a6a52;
  font-size: 0.86rem;
}

.match-mode-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.match-mode-option {
  width: 100%;
  min-height: 112px;
  padding: 12px 13px 10px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(249, 115, 22, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 250, 244, 0.96) 100%);
  color: #8b4a24;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 6px 14px rgba(120, 53, 15, 0.05);
}

.match-mode-group:first-child .match-mode-option {
  border-color: rgba(245, 158, 11, 0.14);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96) 0%, rgba(255, 247, 237, 0.98) 100%);
}

.match-mode-group:last-child .match-mode-option {
  border-color: rgba(196, 91, 73, 0.14);
  background: linear-gradient(180deg, rgba(255, 250, 248, 0.96) 0%, rgba(255, 245, 242, 0.98) 100%);
}

.match-mode-option-title {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
}

.match-mode-option-copy {
  display: block;
  margin-top: 4px;
  color: #7c5a40;
  font-size: 0.84rem;
  line-height: 1.45;
}

.match-stage-shell {
  margin: 12px 0 24px;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.28), transparent 30%),
    radial-gradient(circle at left bottom, rgba(185, 28, 28, 0.08), transparent 32%),
    linear-gradient(155deg, #fff7ed 0%, #fffdf7 55%, #ffffff 100%);
  border: 1px solid rgba(249, 115, 22, 0.16);
  box-shadow: 0 22px 44px rgba(120, 53, 15, 0.12);
}

.match-stage-shell[data-match-module="herb"] {
  background:
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.22), transparent 30%),
    radial-gradient(circle at left bottom, rgba(245, 158, 11, 0.08), transparent 32%),
    linear-gradient(155deg, #fbfcee 0%, #fffdf7 55%, #ffffff 100%);
  border-color: rgba(132, 204, 22, 0.18);
}

.match-stage-shell[data-match-module="formula"] {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.2), transparent 30%),
    radial-gradient(circle at left bottom, rgba(245, 158, 11, 0.08), transparent 32%),
    linear-gradient(155deg, #fff7f2 0%, #fffdf9 55%, #ffffff 100%);
  border-color: rgba(196, 91, 73, 0.18);
}

.match-stage-shell[data-match-module="acupoint"] {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.22), transparent 30%),
    radial-gradient(circle at left bottom, rgba(251, 191, 36, 0.1), transparent 32%),
    linear-gradient(155deg, #fffaf1 0%, #fffdf8 55%, #ffffff 100%);
  border-color: rgba(245, 158, 11, 0.18);
}

.match-stage-shell[data-match-module="internal"] {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.2), transparent 30%),
    radial-gradient(circle at left bottom, rgba(196, 91, 73, 0.06), transparent 32%),
    linear-gradient(155deg, #f7fbff 0%, #fffdfb 55%, #ffffff 100%);
  border-color: rgba(96, 165, 250, 0.18);
}

.match-stage-shell[data-match-module="herb"] .match-hub-title {
  color: #3f6212;
}

.match-stage-shell[data-match-module="formula"] .match-hub-title {
  color: #7f1d1d;
}

.match-stage-shell[data-match-module="acupoint"] .match-hub-title {
  color: #92400e;
}

.match-stage-shell[data-match-module="internal"] .match-hub-title {
  color: #1e3a8a;
}

.match-stage-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.match-stage-nav {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.match-stage-copy {
  min-width: 0;
}

.match-stage-subcopy {
  margin: 8px 0 0;
  color: #7c5a40;
  line-height: 1.6;
}

.match-stage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.match-stage-toolbar {
  justify-content: flex-end;
  align-items: center;
}

.match-stage-panel {
  padding: 18px;
  border-radius: 24px;
  background: var(--game-panel-bg);
  border: 1px solid var(--game-line);
  box-shadow: var(--game-shadow-soft);
}

.match-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.match-status-chip {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--game-card-bg);
  border: 1px solid var(--game-line);
}

.match-status-chip span {
  display: block;
  color: var(--game-text-muted);
  font-size: 0.82rem;
}

.match-status-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
}

.quiz-question {
  margin-bottom: 14px;
}

.match-question-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.match-question-top strong {
  font-size: 1rem;
}

.match-question-top span {
  color: var(--game-text-muted);
  font-size: 0.88rem;
  text-align: right;
}

.question-card,
.feedback-strip,
.empty-state,
.match-card,
.group-card,
.point-card {
  background: var(--game-card-bg);
  border: 1px solid var(--game-line);
}

.question-card {
  padding: 18px 20px;
  border-radius: 20px;
  line-height: 1.72;
  box-shadow: var(--game-shadow-soft);
}

.quiz-input {
  position: relative;
}

.match-game-shell {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(180, 83, 9, 0.08), transparent 32%),
    linear-gradient(160deg, #fffdf7 0%, #f7efe1 100%);
  border: 1px solid rgba(148, 84, 33, 0.16);
  box-shadow: 0 18px 40px rgba(106, 64, 29, 0.14);
}

.match-stage-fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.96;
}

.match-game-layer {
  position: relative;
  z-index: 1;
}

.match-game-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.match-chip,
.match-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.match-chip {
  background: rgba(255, 255, 255, 0.72);
  color: #8a4b20;
  border: 1px solid rgba(138, 75, 32, 0.1);
}

.match-chip.is-progress {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.96) 0%, rgba(254, 215, 170, 0.88) 100%);
  color: #9a3412;
  border-color: rgba(217, 119, 6, 0.18);
}

.match-chip.is-combo {
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.96) 0%, rgba(251, 191, 36, 0.94) 100%);
  color: #854d0e;
  border-color: rgba(217, 119, 6, 0.18);
  box-shadow: 0 10px 18px rgba(217, 119, 6, 0.14);
}

.match-chip.is-idle {
  background: rgba(255, 255, 255, 0.62);
  color: #7c5a40;
}

.match-timer {
  margin-left: auto;
  color: #fff7ed;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 10px 22px rgba(180, 83, 9, 0.24);
}

.match-timer.is-waiting {
  color: #8a4b20;
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.95) 0%, rgba(254, 215, 170, 0.92) 100%);
  box-shadow: 0 10px 22px rgba(217, 119, 6, 0.14);
}

.match-progress-track {
  position: relative;
  height: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(138, 75, 32, 0.12);
}

.match-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a 0%, #f59e0b 100%);
  transition: width 0.18s linear;
}

.match-board {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 12px;
  align-items: start;
}

.match-board-aligned {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.match-board-row {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  align-items: stretch;
}

.match-board-row-head {
  align-items: end;
}

.match-board-cell,
.match-board-cell-left,
.match-board-cell-right {
  min-width: 0;
}

.match-board-cell-left,
.match-board-cell-right {
  display: grid;
}

.match-board-row .match-card {
  height: 100%;
}

.match-board-cell-left > .match-card,
.match-board-cell-right > .match-card {
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
  align-self: stretch;
}

.match-board-classify-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
}

.match-board-classify-stack .match-board-row-head,
.match-board-classify-columns {
  display: grid;
  grid-template-columns: minmax(108px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  width: 100%;
}

.match-board-classify-columns {
  align-items: stretch;
}

.match-board-cell-stack-left {
  position: relative;
  display: grid;
  gap: 14px;
  height: 100%;
}

.match-board-cell-stack-left::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.22) 0%, rgba(245, 158, 11, 0.08) 100%);
  pointer-events: none;
}

.match-board-cell-stack-right {
  position: relative;
  display: grid;
  gap: 12px;
  align-content: start;
}

.match-board-cell-stack-right::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.16) 0%, rgba(180, 83, 9, 0.06) 100%);
  pointer-events: none;
}

.match-column-title {
  padding: 0 4px;
  color: #7c4a1c;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.match-card,
.group-card,
.point-card {
  width: 100%;
  min-height: 74px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 18px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  font-size: 0.92rem;
  line-height: 1.34;
  font-weight: 600;
  word-break: normal;
  overflow-wrap: break-word;
  box-shadow: 0 10px 24px rgba(71, 85, 105, 0.08);
}

.match-card-left {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 244, 234, 0.96) 100%);
}

.match-card-right {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 248, 242, 0.95) 100%);
}

.match-card strong,
.group-card strong,
.point-card strong {
  display: block;
  color: var(--game-text);
  font-size: 1rem;
}

.match-card span,
.group-card span,
.point-card span {
  display: block;
  margin-top: 8px;
  color: var(--game-text-muted);
  line-height: 1.55;
}

.match-card-left-classify {
  align-items: stretch;
  justify-content: space-between;
  text-align: left;
  gap: 10px;
  padding-left: 18px;
  overflow: hidden;
  min-height: 92px;
  border-color: rgba(245, 158, 11, 0.28);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.24), transparent 40%),
    linear-gradient(160deg, rgba(255, 251, 235, 0.98) 0%, rgba(255, 237, 213, 0.96) 100%);
  color: #7c2d12;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 16px 30px rgba(217, 119, 6, 0.14);
}

.match-card-left-classify::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.92) 0%, rgba(245, 158, 11, 0.68) 100%);
  opacity: 0.92;
}

.match-board-classify-stack .match-card-right {
  min-height: 58px;
  padding-top: 11px;
  padding-bottom: 11px;
  padding-left: 30px;
  border-radius: 20px;
  border-color: rgba(217, 119, 6, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 248, 235, 0.96) 100%);
  color: #7c2d12;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 22px rgba(180, 83, 9, 0.08);
}

.match-board-classify-stack .match-card-right::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.96) 0%, rgba(245, 158, 11, 0.96) 100%);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.08);
  pointer-events: none;
}

.match-card.selected,
.group-card.selected,
.point-card.selected {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(180, 83, 9, 0.55);
  box-shadow: 0 16px 26px rgba(180, 83, 9, 0.18);
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}

.group-card.completed {
  border-color: var(--game-success);
  background: var(--game-success-soft);
}

.match-card.mismatch,
.point-card.mismatch {
  border-color: rgba(220, 38, 38, 0.5);
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  color: #b91c1c;
}

.feedback-strip,
.empty-state {
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.65;
}

.feedback-strip {
  margin-top: 14px;
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 0.92rem;
}

.match-board-hint {
  margin-top: 14px;
  color: #7c4a1c;
  font-size: 0.86rem;
  line-height: 1.45;
}

.feedback-strip.is-success {
  color: var(--game-success);
  border-color: rgba(47, 125, 87, 0.24);
  background: var(--game-success-soft);
}

.feedback-strip.is-error {
  color: var(--game-danger);
  border-color: rgba(182, 69, 58, 0.24);
  background: var(--game-danger-soft);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(33, 25, 21, 0.14);
  z-index: 5;
}

.game-overlay.is-passive {
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 249, 238, 0.04) 0%, rgba(33, 25, 21, 0.1) 70%),
    rgba(33, 25, 21, 0.05);
  backdrop-filter: none;
}

.game-overlay.is-passive.is-resolved {
  background:
    radial-gradient(circle at center, rgba(245, 158, 11, 0.06) 0%, rgba(33, 25, 21, 0.12) 72%),
    rgba(33, 25, 21, 0.08);
}

.overlay-panel {
  width: min(420px, calc(100% - 32px));
  padding: 28px 24px;
  border-radius: 24px;
  text-align: center;
  background: var(--game-card-bg-strong);
  border: 1px solid var(--game-line);
  box-shadow: var(--game-shadow);
}

.overlay-panel h3 {
  margin: 10px 0 8px;
  font-size: 1.8rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--game-kicker-bg);
  color: var(--game-kicker-text);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.match-stage-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.match-stage-actions .btn {
  min-width: 132px;
}

[data-theme="dark"] body {
  background: var(--game-page-bg);
}

[data-theme="dark"] .loading-card,
[data-theme="dark"] .error-card,
[data-theme="dark"] .match-hub-shell,
[data-theme="dark"] .match-stage-shell,
[data-theme="dark"] .match-stage-panel {
  color: var(--game-text);
}

[data-theme="dark"] .match-hub-shell,
[data-theme="dark"] .match-stage-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 28%),
    radial-gradient(circle at left bottom, rgba(196, 91, 73, 0.16), transparent 32%),
    var(--game-shell-bg);
  border-color: var(--game-line);
}

[data-theme="dark"] .match-module-card[data-match-module="herb"].is-live {
  background:
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(32, 39, 25, 0.94) 0%, rgba(24, 28, 21, 0.96) 100%);
  border-color: rgba(132, 204, 22, 0.2);
}

[data-theme="dark"] .match-module-card[data-match-module="formula"].is-live {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(44, 30, 27, 0.94) 0%, rgba(27, 20, 18, 0.96) 100%);
  border-color: rgba(196, 91, 73, 0.2);
}

[data-theme="dark"] .match-module-card[data-match-module="acupoint"].is-live {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(43, 33, 22, 0.94) 0%, rgba(27, 22, 17, 0.96) 100%);
  border-color: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .match-module-card[data-match-module="internal"].is-live {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(26, 33, 45, 0.94) 0%, rgba(18, 22, 30, 0.96) 100%);
  border-color: rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .match-stage-shell[data-match-module="herb"] {
  background:
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.14), transparent 28%),
    radial-gradient(circle at left bottom, rgba(245, 158, 11, 0.12), transparent 32%),
    var(--game-shell-bg);
}

[data-theme="dark"] .match-stage-shell[data-match-module="formula"] {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.16), transparent 28%),
    radial-gradient(circle at left bottom, rgba(245, 158, 11, 0.1), transparent 32%),
    var(--game-shell-bg);
}

[data-theme="dark"] .match-stage-shell[data-match-module="acupoint"] {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 28%),
    radial-gradient(circle at left bottom, rgba(251, 191, 36, 0.1), transparent 32%),
    var(--game-shell-bg);
}

[data-theme="dark"] .match-stage-shell[data-match-module="internal"] {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 28%),
    radial-gradient(circle at left bottom, rgba(196, 91, 73, 0.1), transparent 32%),
    var(--game-shell-bg);
}

[data-theme="dark"] .match-hub-title,
[data-theme="dark"] .match-module-card h3,
[data-theme="dark"] .match-mode-sheet-title,
[data-theme="dark"] .match-mode-group-title {
  color: var(--game-text);
}

[data-theme="dark"] .match-hub-copy,
[data-theme="dark"] .match-stage-subcopy,
[data-theme="dark"] .match-module-card p,
[data-theme="dark"] .match-mode-sheet-copy,
[data-theme="dark"] .match-mode-group-copy,
[data-theme="dark"] .match-mode-option-copy,
[data-theme="dark"] .match-question-top span {
  color: #e5e7eb;
}

[data-theme="dark"] .match-module-card,
[data-theme="dark"] .match-hub-side-card,
[data-theme="dark"] .match-stage-panel,
[data-theme="dark"] .question-card,
[data-theme="dark"] .board-shell,
[data-theme="dark"] .match-status-chip,
[data-theme="dark"] .overlay-panel,
[data-theme="dark"] .loading-card,
[data-theme="dark"] .error-card {
  background: rgba(33, 25, 21, 0.82);
  border-color: var(--game-line);
}

[data-theme="dark"] .game-overlay.is-passive {
  background:
    radial-gradient(circle at center, rgba(196, 91, 73, 0.06) 0%, rgba(9, 7, 6, 0.18) 68%),
    rgba(9, 7, 6, 0.1);
}

[data-theme="dark"] .game-overlay.is-passive.is-resolved {
  background:
    radial-gradient(circle at center, rgba(196, 91, 73, 0.1) 0%, rgba(9, 7, 6, 0.2) 72%),
    rgba(9, 7, 6, 0.14);
}

[data-theme="dark"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 34%),
    radial-gradient(circle at left bottom, rgba(196, 91, 73, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(39, 30, 25, 0.96) 0%, rgba(22, 16, 13, 0.98) 100%);
  border-color: rgba(214, 161, 90, 0.18);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .match-mode-group,
[data-theme="dark"] .match-mode-option {
  background: rgba(39, 30, 25, 0.62);
  border-color: var(--game-line);
}

[data-theme="dark"] .match-mode-option,
[data-theme="dark"] .match-card strong,
[data-theme="dark"] .group-card strong,
[data-theme="dark"] .point-card strong,
[data-theme="dark"] .question-card,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .match-theme-btn {
  color: #f8fafc;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .match-theme-btn {
  background: linear-gradient(180deg, rgba(58, 44, 35, 0.94) 0%, rgba(35, 26, 22, 0.96) 100%);
  border-color: rgba(214, 161, 90, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 225, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .match-hub-side-card,
[data-theme="dark"] .match-hub-stat,
[data-theme="dark"] .match-stage-summary-item {
  background: rgba(39, 30, 25, 0.66);
  border-color: var(--game-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .match-hub-side-kicker,
[data-theme="dark"] .match-module-icon {
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

[data-theme="dark"] .match-module-card[data-match-module="herb"] .match-module-icon,
[data-theme="dark"] .match-stage-shell[data-match-module="herb"] .match-hub-kicker {
  background: rgba(132, 204, 22, 0.14);
  color: #d9f99d;
}

[data-theme="dark"] .match-module-card[data-match-module="formula"] .match-module-icon,
[data-theme="dark"] .match-stage-shell[data-match-module="formula"] .match-hub-kicker {
  background: rgba(196, 91, 73, 0.16);
  color: #fecaca;
}

[data-theme="dark"] .match-module-card[data-match-module="acupoint"] .match-module-icon,
[data-theme="dark"] .match-stage-shell[data-match-module="acupoint"] .match-hub-kicker {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

[data-theme="dark"] .match-module-card[data-match-module="internal"] .match-module-icon,
[data-theme="dark"] .match-stage-shell[data-match-module="internal"] .match-hub-kicker {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

[data-theme="dark"] .match-hub-stat span,
[data-theme="dark"] .match-stage-summary-item span,
[data-theme="dark"] .match-module-fact {
  color: #dbc6af;
}

[data-theme="dark"] .match-hub-stat strong,
[data-theme="dark"] .match-stage-summary-item strong,
[data-theme="dark"] .match-hub-side-card h3 {
  color: #f8fafc;
}

[data-theme="dark"] .match-module-fact {
  background: rgba(52, 39, 32, 0.92);
  border: 1px solid rgba(214, 161, 90, 0.12);
}

[data-theme="dark"] .match-duration-btn {
  color: #f1dfc9;
  background: linear-gradient(180deg, rgba(62, 46, 37, 0.94) 0%, rgba(36, 27, 22, 0.98) 100%);
  border-color: rgba(214, 161, 90, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 225, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .match-duration-btn.is-active {
  color: #fff7ed;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  border-color: rgba(251, 191, 36, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 235, 0.16),
    0 10px 20px rgba(217, 119, 6, 0.26);
}

[data-theme="dark"] .match-theme-btn.is-active {
  color: #fff7ed;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  border-color: rgba(251, 191, 36, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 235, 0.16),
    0 10px 20px rgba(217, 119, 6, 0.26);
}

[data-theme="dark"] .match-card span,
[data-theme="dark"] .group-card span,
[data-theme="dark"] .point-card span,
[data-theme="dark"] .match-status-chip span {
  color: #dbc6af;
}

[data-theme="dark"] .match-game-shell {
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.2), transparent 34%),
    radial-gradient(circle at bottom right, rgba(196, 91, 73, 0.14), transparent 32%),
    linear-gradient(165deg, #2c211b 0%, #1b1411 100%);
  border-color: rgba(214, 161, 90, 0.16);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .match-chip {
  background: linear-gradient(180deg, rgba(61, 45, 36, 0.92) 0%, rgba(38, 28, 23, 0.96) 100%);
  color: #f8e8cf;
  border-color: rgba(214, 161, 90, 0.16);
}

[data-theme="dark"] .match-chip.is-progress {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.96) 0%, rgba(146, 64, 14, 0.94) 100%);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] .match-chip.is-combo {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.96) 0%, rgba(180, 83, 9, 0.94) 100%);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.22);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.24);
}

[data-theme="dark"] .match-chip.is-idle {
  background: linear-gradient(180deg, rgba(54, 40, 32, 0.82) 0%, rgba(34, 26, 21, 0.9) 100%);
  color: #dbc6af;
}

[data-theme="dark"] .match-timer.is-waiting {
  color: #fde68a;
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.96) 0%, rgba(146, 64, 14, 0.94) 100%);
}

[data-theme="dark"] .match-column-title,
[data-theme="dark"] .match-board-hint {
  color: #ddc6a7;
}

[data-theme="dark"] .match-board-cell-stack-left::before {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%);
}

[data-theme="dark"] .match-board-cell-stack-right::before {
  background: linear-gradient(180deg, rgba(196, 91, 73, 0.18) 0%, rgba(245, 158, 11, 0.08) 100%);
}

[data-theme="dark"] .match-progress-track {
  background: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .match-card,
[data-theme="dark"] .group-card,
[data-theme="dark"] .point-card {
  background: linear-gradient(180deg, rgba(46, 34, 28, 0.94) 0%, rgba(28, 21, 17, 0.96) 100%);
  color: #fff7ed;
  border-color: rgba(214, 161, 90, 0.14);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .match-card.selected,
[data-theme="dark"] .group-card.selected,
[data-theme="dark"] .point-card.selected {
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.96) 0%, rgba(154, 52, 18, 0.94) 100%);
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 16px 26px rgba(120, 53, 15, 0.3);
}

[data-theme="dark"] .match-card-left-classify {
  border-color: rgba(214, 161, 90, 0.18);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(50, 37, 29, 0.94) 0%, rgba(28, 21, 17, 0.9) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 26px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .match-card-left-classify::before {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.88) 0%, rgba(245, 158, 11, 0.55) 100%);
}

[data-theme="dark"] .match-board-classify-stack .match-card-right {
  border-color: rgba(214, 161, 90, 0.16);
  background: linear-gradient(180deg, rgba(44, 33, 27, 0.92) 0%, rgba(27, 20, 17, 0.96) 100%);
  color: #fff7ed;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .match-board-classify-stack .match-card-right::before {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.92) 0%, rgba(196, 91, 73, 0.88) 100%);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.08);
}

[data-theme="dark"] .match-card.matched,
[data-theme="dark"] .group-card.completed {
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.96) 0%, rgba(21, 128, 61, 0.88) 100%);
  color: #dcfce7;
  border-color: rgba(74, 222, 128, 0.42);
}

[data-theme="dark"] .match-card.mismatch,
[data-theme="dark"] .point-card.mismatch {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.92) 0%, rgba(153, 27, 27, 0.88) 100%);
  color: #fee2e2;
  border-color: rgba(248, 113, 113, 0.32);
}

[data-theme="dark"] .match-hub-audio-btn.is-off,
[data-theme="dark"] .match-audio-toggle.is-off {
  background: linear-gradient(180deg, rgba(60, 45, 37, 0.94) 0%, rgba(35, 26, 22, 0.96) 100%);
  border-color: rgba(214, 161, 90, 0.2);
  color: #f3dcc0;
  box-shadow: inset 0 0 0 1px rgba(255, 244, 225, 0.05);
}

[data-theme="dark"] .match-hub-toolbar {
  background: linear-gradient(180deg, rgba(56, 42, 34, 0.72) 0%, rgba(32, 24, 19, 0.68) 100%);
  border-color: rgba(214, 161, 90, 0.16);
}

@media (max-width: 1100px) {
  .classify-board {
    grid-template-columns: 1fr;
  }

  .match-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 10px;
  }

  .match-hub-shell,
  .match-stage-shell,
  .match-stage-panel {
    padding: 18px;
  }

  .match-hub-overview,
  .match-stage-hero {
    grid-template-columns: 1fr;
  }

  .match-hub-stats,
  .match-stage-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .match-stage-hero {
    gap: 14px;
  }

  .match-hub-toolbar {
    flex-wrap: wrap;
    border-radius: 24px;
    width: 100%;
  }

  .match-duration-group {
    flex-wrap: wrap;
    flex: 1 1 100%;
  }

  .match-mode-group-grid,
  .point-list,
  .speed-row,
  .speed-row-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .match-hub-toolbar,
  .module-actions,
  .match-stage-actions {
    align-items: stretch;
  }

  .match-hub-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .match-duration-group {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .match-hub-grid {
    grid-template-columns: 1fr;
  }

  .match-duration-btn,
  .match-hub-audio-btn {
    width: 100%;
    margin-left: 0;
  }

  .match-theme-btn {
    width: 42px;
    min-width: 42px;
    margin-left: 0;
    justify-self: start;
  }

  .match-hub-audio-btn {
    width: 42px;
    min-width: 42px;
    justify-self: end;
  }

  .match-stage-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-status-grid {
    grid-template-columns: 1fr;
  }

  .match-hub-stats,
  .match-stage-summary {
    grid-template-columns: 1fr;
  }

  .match-stage-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .match-question-top {
    flex-direction: column;
  }

  .match-question-top span {
    text-align: left;
  }

  .match-mode-panel-head {
    padding-top: 42px;
    padding-right: 0;
  }

  .match-mode-panel-head > .btn {
    top: 0;
    right: 0;
    min-width: 60px;
    min-height: 32px;
    padding: 0.32rem 0.74rem;
    font-size: 0.78rem;
  }

  .match-game-topbar {
    gap: 8px;
  }

  .match-game-topbar .match-chip {
    min-height: 32px;
    font-size: 0.82rem;
    padding: 0 10px;
  }

  .match-game-topbar .match-theme-btn,
  .match-game-topbar .match-audio-toggle {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .match-timer {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .match-board-aligned .match-board-row,
  .match-board-aligned .match-board-row-head {
    grid-template-columns: minmax(96px, 0.76fr) minmax(0, 1.24fr);
    gap: 8px;
  }

  .match-board-aligned .match-card {
    min-height: 64px;
    padding: 10px 12px;
  }

  .match-board-aligned .match-card-left {
    font-size: 0.92rem;
  }

  .match-board-aligned .match-card-right {
    font-size: 0.76rem;
    line-height: 1.28;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(92px, 0.78fr) minmax(0, 1.22fr);
    gap: 8px;
  }
}

/* Final mobile overrides: keep the game and module grid from collapsing into single columns. */
@media (max-width: 520px) {
  .match-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .match-stage-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .match-stage-nav {
    flex-direction: row !important;
    align-items: flex-start !important;
  }

  .match-timer {
    width: auto !important;
    margin-left: auto !important;
  }
}

@media (max-width: 360px) {
  .match-hub-grid {
    grid-template-columns: 1fr !important;
  }

  .match-stage-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Final gameplay polish: compact brief, stronger HUD, resolved sheet, and clearer state cards. */
.match-chip.is-goal {
  background: linear-gradient(135deg, rgba(255, 244, 225, 0.98) 0%, rgba(255, 225, 188, 0.94) 100%);
  color: #9a3412;
  border: 1px solid rgba(217, 119, 6, 0.18);
}

.match-question-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 249, 238, 0.94) 100%);
  border: 1px solid var(--game-line);
  box-shadow: var(--game-shadow-soft);
}

.match-question-card.is-compact {
  gap: 8px;
  padding: 13px 15px;
}

.match-question-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.match-question-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(166, 58, 43, 0.08);
  color: #9f3627;
  font-size: 0.78rem;
  font-weight: 800;
}

.match-question-tag.is-goal {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.match-question-tag.is-combo {
  background: rgba(251, 191, 36, 0.16);
  color: #92400e;
}

.match-question-tag.is-soft {
  background: rgba(120, 53, 15, 0.06);
  color: #8a6a52;
}

.match-question-body {
  display: grid;
  gap: 8px;
}

.match-question-body.is-compact {
  gap: 6px;
}

.match-question-title {
  margin: 0;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.45;
  color: #2f2219;
}

.match-question-body p {
  margin: 0;
  color: var(--game-text-muted);
  line-height: 1.56;
  font-size: 0.92rem;
}

.match-stage-actions,
.match-resolved-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.match-resolved-panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--game-line);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(255, 246, 232, 0.96) 100%);
  box-shadow: var(--game-shadow-soft);
}

.match-resolved-panel.is-success {
  border-color: rgba(22, 163, 74, 0.18);
}

.match-resolved-panel.is-danger {
  border-color: rgba(196, 91, 73, 0.2);
}

.match-resolved-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.match-resolved-copy {
  display: grid;
  gap: 8px;
}

.match-resolved-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  color: #7c2d12;
}

.match-resolved-text,
.match-resolved-note {
  margin: 0;
  line-height: 1.58;
}

.match-resolved-text {
  color: #5b4738;
}

.match-resolved-note {
  color: #8a6a52;
  font-size: 0.92rem;
}

.match-resolved-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 64px;
  padding: 0 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--game-primary) 0%, #f59e0b 100%);
  color: #fff8ef;
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 0 14px 24px rgba(166, 58, 43, 0.18);
}

.match-resolved-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.match-resolved-stat {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(166, 58, 43, 0.1);
}

.match-resolved-stat span {
  display: block;
  color: #8a6a52;
  font-size: 0.76rem;
}

.match-resolved-stat strong {
  display: block;
  margin-top: 6px;
  color: #7c2d12;
  font-size: 1.02rem;
}

.match-card.matched,
.match-card-left-classify.matched {
  transform: translateY(-1px) scale(1.01);
  border-color: rgba(34, 197, 94, 0.32);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.98) 0%, rgba(220, 252, 231, 0.96) 100%);
  box-shadow: 0 16px 28px rgba(34, 197, 94, 0.12);
}

.match-card.matched strong,
.match-card-left-classify.matched strong,
.match-card.matched span,
.match-card-left-classify.matched span {
  color: #166534;
}

[data-theme="dark"] .match-chip.is-goal {
  background: linear-gradient(180deg, rgba(76, 49, 28, 0.94) 0%, rgba(44, 27, 18, 0.98) 100%);
  color: #fde7c0;
  border-color: rgba(214, 161, 90, 0.22);
}

[data-theme="dark"] .match-question-card,
[data-theme="dark"] .match-resolved-panel {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(28, 21, 18, 0.94) 0%, rgba(18, 14, 12, 0.96) 100%);
  border-color: rgba(214, 161, 90, 0.14);
}

[data-theme="dark"] .match-question-title,
[data-theme="dark"] .match-resolved-title,
[data-theme="dark"] .match-resolved-stat strong {
  color: #fff7ed;
}

[data-theme="dark"] .match-question-body p,
[data-theme="dark"] .match-resolved-text,
[data-theme="dark"] .match-resolved-note,
[data-theme="dark"] .match-resolved-stat span {
  color: #dbc6af;
}

[data-theme="dark"] .match-question-tag {
  background: rgba(90, 55, 42, 0.76);
  color: #ffd4ca;
}

[data-theme="dark"] .match-question-tag.is-goal {
  background: rgba(122, 80, 26, 0.76);
  color: #fde2a7;
}

[data-theme="dark"] .match-question-tag.is-combo {
  background: rgba(96, 63, 18, 0.78);
  color: #fde68a;
}

[data-theme="dark"] .match-question-tag.is-soft {
  background: rgba(52, 38, 32, 0.76);
  color: #dbc6af;
}

[data-theme="dark"] .match-resolved-stat {
  background: rgba(38, 27, 23, 0.84);
  border-color: rgba(214, 161, 90, 0.12);
}

[data-theme="dark"] .match-card.matched,
[data-theme="dark"] .match-card-left-classify.matched {
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.96) 0%, rgba(21, 128, 61, 0.88) 100%);
  border-color: rgba(74, 222, 128, 0.42);
  box-shadow: 0 14px 26px rgba(20, 83, 45, 0.24);
}

[data-theme="dark"] .match-card.matched strong,
[data-theme="dark"] .match-card-left-classify.matched strong,
[data-theme="dark"] .match-card.matched span,
[data-theme="dark"] .match-card-left-classify.matched span {
  color: #dcfce7;
}

@media (max-width: 720px) {
  .match-resolved-head {
    grid-template-columns: 1fr;
  }

  .match-resolved-grade {
    justify-self: start;
  }

  .match-resolved-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .match-question-card {
    padding: 13px 14px;
  }

  .match-question-tag {
    min-height: 24px;
    padding: 0 9px;
    font-size: 0.72rem;
  }

  .match-question-title {
    font-size: 0.98rem;
  }

  .match-question-body p {
    font-size: 0.84rem;
  }

  .match-stage-actions,
  .match-resolved-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-stage-actions .btn:nth-child(3),
  .match-resolved-actions .btn:nth-child(3) {
    grid-column: 1 / -1;
  }

  .match-resolved-panel {
    padding: 14px;
  }

  .match-resolved-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .match-resolved-stat {
    padding: 10px 11px;
  }
}

/* Final stage layout pass: compact the HUD and preserve a playable two-column board on phones. */
.match-game-topbar {
  justify-content: space-between;
}

.match-game-status {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.match-game-tools {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.match-game-tools .match-theme-btn,
.match-game-tools .match-audio-toggle {
  margin-left: 0;
}

.match-game-tools .match-timer {
  margin-left: 0;
}

@media (max-width: 720px) {
  .match-stage-shell {
    padding: 14px 14px 16px;
  }

  .match-stage-hero {
    gap: 10px;
    margin-bottom: 10px;
  }

  .match-stage-summary-item {
    padding: 10px 12px;
  }

  .match-question-card {
    margin-bottom: 10px;
  }

  .match-game-shell {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .match-stage-shell {
    padding: 10px 10px 14px;
    border-radius: 18px;
  }

  .match-stage-hero {
    gap: 8px;
    margin-bottom: 8px;
  }

  .match-stage-nav > .btn {
    min-width: 84px;
    min-height: 42px;
    padding-inline: 12px;
  }

  .match-stage-copy {
    gap: 4px;
  }

  .match-hub-title {
    font-size: clamp(1.7rem, 7vw, 2.1rem);
  }

  .match-stage-subcopy {
    font-size: 0.9rem;
  }

  .match-stage-summary-item {
    min-height: 0;
    padding: 8px 10px;
    border-radius: 16px;
  }

  .match-stage-summary-item span {
    font-size: 0.68rem;
  }

  .match-stage-summary-item strong {
    font-size: 0.92rem;
  }

  .match-question-card {
    gap: 8px;
    margin-bottom: 8px;
    padding: 11px 12px;
    border-radius: 18px;
  }

  .match-question-topline {
    gap: 6px;
  }

  .match-question-title {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .match-question-body p {
    display: none;
  }

  .match-game-shell {
    padding: 12px;
    border-radius: 20px;
  }

  .match-game-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  .match-game-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .match-game-status .match-chip {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .match-game-tools {
    display: grid;
    grid-template-columns: 40px 40px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  .match-game-tools .match-theme-btn,
  .match-game-tools .match-audio-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .match-game-tools .match-timer {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    justify-content: center;
    font-size: 0.88rem;
  }

  .match-progress-track {
    margin-bottom: 10px;
  }

  .match-board-aligned {
    gap: 8px;
  }

  .match-board-aligned .match-board-row,
  .match-board-aligned .match-board-row-head {
    grid-template-columns: minmax(74px, 0.58fr) minmax(0, 1.42fr);
    gap: 6px;
  }

  .match-board-aligned .match-column-title,
  .match-board-classify-stack .match-column-title {
    padding: 0 2px;
    font-size: 0.76rem;
    letter-spacing: 0.01em;
  }

  .match-board-aligned .match-card {
    min-height: 56px;
    padding: 8px 9px;
    border-radius: 15px;
  }

  .match-board-aligned .match-card strong {
    line-height: 1.28;
  }

  .match-board-aligned .match-card-left {
    font-size: 0.9rem;
  }

  .match-board-aligned .match-card-right {
    font-size: 0.74rem;
    line-height: 1.2;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(76px, 0.62fr) minmax(0, 1.38fr);
    gap: 6px;
  }

  .match-board-cell-stack-left {
    gap: 8px;
  }

  .match-board-cell-stack-right {
    gap: 8px;
  }

  .match-board-classify-columns .match-card {
    min-height: 56px;
    padding: 8px 9px;
    border-radius: 15px;
  }

  .match-board-hint {
    margin-top: 10px;
    font-size: 0.78rem;
  }
}

/* 2026-04 visual consolidation:
   align closer to the main-site match style, keep standalone stage larger,
   and stabilize mobile dual-column playability. */
.match-hub-shell {
  background:
    radial-gradient(circle at top right, rgba(253, 186, 116, 0.48), transparent 34%),
    radial-gradient(circle at left bottom, rgba(248, 113, 113, 0.14), transparent 32%),
    linear-gradient(165deg, #fff7ed 0%, #fffbeb 56%, #ffffff 100%);
  border-color: rgba(251, 146, 60, 0.16);
  box-shadow: 0 18px 38px rgba(120, 53, 15, 0.1);
}

.match-stage-shell {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.2), transparent 34%),
    radial-gradient(circle at left bottom, rgba(14, 165, 233, 0.09), transparent 34%),
    linear-gradient(155deg, #fff7ed 0%, #fffdf7 58%, #ffffff 100%);
  border-color: rgba(249, 115, 22, 0.14);
  box-shadow: 0 20px 42px rgba(120, 53, 15, 0.1);
}

.match-mode-panel {
  width: min(100%, 980px);
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(249, 115, 22, 0.1);
  box-shadow: 0 -14px 30px rgba(15, 23, 42, 0.1);
}

.match-mode-group {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 252, 247, 0.74) 100%);
  border-color: rgba(251, 146, 60, 0.1);
}

.match-mode-group:first-child {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.94) 0%, rgba(255, 247, 237, 0.95) 100%);
}

.match-mode-group:last-child {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 248, 0.94) 0%, rgba(255, 245, 242, 0.95) 100%);
}

.match-mode-option {
  border-color: rgba(249, 115, 22, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 250, 244, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 6px 12px rgba(120, 53, 15, 0.05);
}

.match-game-shell {
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.14), transparent 38%),
    radial-gradient(circle at bottom right, rgba(21, 128, 61, 0.09), transparent 34%),
    linear-gradient(160deg, #fffdf7 0%, #f7f2e8 100%);
  border-color: rgba(148, 84, 33, 0.14);
  box-shadow: 0 16px 34px rgba(106, 64, 29, 0.12);
}

.match-duration-btn {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--game-text-muted);
  box-shadow: none;
}

.match-duration-btn.is-active {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.96) 0%, rgba(180, 83, 9, 0.92) 100%);
  color: #fffaf0;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(180, 83, 9, 0.18);
}

.match-theme-btn,
.match-hub-audio-btn,
.match-audio-toggle {
  border-color: rgba(148, 84, 33, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 248, 235, 0.68) 100%);
  color: #7c4a1c;
  box-shadow:
    inset 0 0 0 1px rgba(148, 84, 33, 0.08),
    0 6px 14px rgba(120, 53, 15, 0.08);
}

.match-theme-btn.is-active,
.match-hub-audio-btn.is-on,
.match-audio-toggle.is-on {
  background: linear-gradient(135deg, var(--game-primary) 0%, var(--game-primary-strong) 100%);
  color: #fffdf8;
  border-color: transparent;
  box-shadow:
    0 0 0 2px rgba(251, 191, 36, 0.18),
    0 10px 22px rgba(180, 83, 9, 0.22);
}

.match-hub-audio-btn.is-off,
.match-audio-toggle.is-off {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 248, 235, 0.76) 100%);
  color: #8a4b20;
  border-color: rgba(148, 84, 33, 0.14);
  opacity: 1;
}

.match-card,
.group-card,
.point-card {
  box-shadow: 0 10px 20px rgba(71, 85, 105, 0.08);
}

.match-card-left {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 247, 239, 0.96) 100%);
}

.match-card-right {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 248, 242, 0.96) 100%);
}

.match-board-cell-stack-left::before {
  width: 1px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.16) 0%, rgba(245, 158, 11, 0.04) 100%);
}

.match-board-cell-stack-right::before {
  width: 1px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.14) 0%, rgba(59, 130, 246, 0.06) 100%);
}

.match-card-left-classify {
  border-color: rgba(245, 158, 11, 0.2);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 251, 235, 0.96) 0%, rgba(255, 243, 224, 0.94) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 20px rgba(217, 119, 6, 0.1);
}

.match-card-left-classify::before {
  width: 3px;
  opacity: 0.78;
}

.match-board-classify-stack .match-card-right {
  border-color: rgba(34, 197, 94, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 250, 255, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(30, 64, 175, 0.06);
}

.match-board-classify-stack .match-card-right::before {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.92) 0%, rgba(59, 130, 246, 0.92) 100%);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.08);
}

.game-overlay {
  background: rgba(33, 25, 21, 0.1);
}

.game-overlay.is-passive {
  background: rgba(33, 25, 21, 0.03);
}

.game-overlay.is-passive.is-resolved {
  background: rgba(33, 25, 21, 0.06);
}

[data-theme="dark"] .match-hub-shell,
[data-theme="dark"] .match-stage-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 34%),
    radial-gradient(circle at left bottom, rgba(34, 197, 94, 0.08), transparent 34%),
    linear-gradient(165deg, #172033 0%, #101827 100%);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.38);
}

[data-theme="dark"] .match-game-shell {
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 36%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.1), transparent 34%),
    linear-gradient(165deg, #172033 0%, #101827 100%);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.38);
}

[data-theme="dark"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(23, 32, 51, 0.98) 0%, rgba(16, 24, 39, 0.98) 100%);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 -16px 30px rgba(2, 6, 23, 0.34);
}

[data-theme="dark"] .match-mode-group,
[data-theme="dark"] .match-mode-option,
[data-theme="dark"] .match-module-card,
[data-theme="dark"] .match-hub-side-card,
[data-theme="dark"] .match-stage-panel,
[data-theme="dark"] .question-card,
[data-theme="dark"] .match-status-chip,
[data-theme="dark"] .overlay-panel {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .match-duration-btn,
[data-theme="dark"] .match-theme-btn,
[data-theme="dark"] .match-hub-audio-btn,
[data-theme="dark"] .match-audio-toggle {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%);
  color: #dbe6f5;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.14),
    0 6px 14px rgba(2, 6, 23, 0.22);
}

[data-theme="dark"] .match-duration-btn.is-active,
[data-theme="dark"] .match-theme-btn.is-active,
[data-theme="dark"] .match-hub-audio-btn.is-on,
[data-theme="dark"] .match-audio-toggle.is-on {
  background: linear-gradient(135deg, var(--game-primary) 0%, var(--game-primary-strong) 100%);
  color: #fff7ed;
  border-color: transparent;
  box-shadow:
    0 0 0 2px rgba(251, 191, 36, 0.2),
    0 10px 22px rgba(180, 83, 9, 0.26);
}

[data-theme="dark"] .match-hub-audio-btn.is-off,
[data-theme="dark"] .match-audio-toggle.is-off {
  color: #dbe6f5;
  opacity: 1;
}

[data-theme="dark"] .match-card,
[data-theme="dark"] .group-card,
[data-theme="dark"] .point-card {
  background: rgba(15, 23, 42, 0.86);
  border-color: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.22);
}

[data-theme="dark"] .match-card-left-classify {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(30, 41, 59, 0.94) 0%, rgba(15, 23, 42, 0.9) 100%);
}

[data-theme="dark"] .match-board-classify-stack .match-card-right {
  border-color: rgba(96, 165, 250, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(13, 20, 35, 0.96) 100%);
}

[data-theme="dark"] .match-board-cell-stack-left::before {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%);
}

[data-theme="dark"] .match-board-cell-stack-right::before {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.16) 0%, rgba(45, 212, 191, 0.08) 100%);
}

[data-theme="dark"] .game-overlay {
  background: rgba(15, 23, 42, 0.16);
}

[data-theme="dark"] .game-overlay.is-passive {
  background: rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] .game-overlay.is-passive.is-resolved {
  background: rgba(15, 23, 42, 0.14);
}

@media (max-width: 780px) {
  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .match-board {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 10px;
  }

  .match-board-row {
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(96px, 0.86fr) minmax(0, 1.14fr);
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .match-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-stage-nav {
    flex-direction: row;
    align-items: flex-start;
  }

  .match-board-row {
    grid-template-columns: minmax(84px, 0.74fr) minmax(0, 1.26fr);
    gap: 7px;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(88px, 0.78fr) minmax(0, 1.22fr);
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .match-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
}

/* Final main-site alignment pass: keep the standalone layout larger, but pull the visual language
   back toward the main site and remove the noisy layered treatment. */
.match-stage-fx {
  display: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--game-primary) 0%, var(--game-primary-strong) 100%);
  border-color: rgba(166, 58, 43, 0.3);
  box-shadow: 0 10px 22px rgba(166, 58, 43, 0.18);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--game-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.btn-danger {
  background: linear-gradient(135deg, #b6453a 0%, #a63a2b 100%);
  color: #fff7ed;
  border-color: rgba(166, 58, 43, 0.34);
  box-shadow: 0 10px 22px rgba(166, 58, 43, 0.18);
}

.match-hub-toolbar {
  gap: 6px;
  padding: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 248, 235, 0.62) 100%);
  border-color: rgba(148, 84, 33, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.match-duration-group {
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.match-duration-btn {
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--game-text-muted);
  box-shadow: none;
}

.match-duration-btn.is-active {
  background: linear-gradient(135deg, rgba(166, 58, 43, 0.98) 0%, rgba(143, 47, 35, 0.94) 100%);
  color: #fffdf8;
  box-shadow: 0 8px 18px rgba(166, 58, 43, 0.16);
}

.match-theme-btn,
.match-hub-audio-btn,
.match-audio-toggle {
  border: 1px solid rgba(148, 84, 33, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 248, 235, 0.76) 100%);
  color: #7c4a1c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 6px 14px rgba(120, 53, 15, 0.08);
}

.match-theme-btn.is-active,
.match-hub-audio-btn.is-on,
.match-audio-toggle.is-on {
  background: linear-gradient(135deg, var(--game-primary) 0%, var(--game-primary-strong) 100%);
  color: #fffdf8;
  border-color: rgba(166, 58, 43, 0.22);
  box-shadow:
    0 0 0 3px rgba(166, 58, 43, 0.1),
    0 10px 22px rgba(166, 58, 43, 0.18);
}

.match-hub-audio-btn.is-off,
.match-audio-toggle.is-off {
  color: #8a5e39;
}

.match-module-card {
  background:
    radial-gradient(circle at top center, var(--module-accent-soft), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 248, 239, 0.94) 100%);
  border-color: rgba(124, 98, 72, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 24px rgba(73, 49, 29, 0.06);
}

.match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(249, 115, 22, 0.1);
  box-shadow: 0 -16px 34px rgba(15, 23, 42, 0.08);
}

.match-mode-group {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 250, 242, 0.78) 100%);
  border-color: rgba(124, 98, 72, 0.1);
}

.match-mode-option-speed {
  background: linear-gradient(180deg, rgba(255, 246, 239, 0.94) 0%, rgba(255, 237, 213, 0.9) 100%);
  border-color: rgba(166, 58, 43, 0.12);
}

.match-mode-option-classify {
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.94) 0%, rgba(239, 246, 255, 0.9) 100%);
  border-color: rgba(79, 70, 229, 0.1);
}

.match-game-shell {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98) 0%, rgba(247, 238, 223, 0.98) 100%);
  border-color: rgba(166, 58, 43, 0.12);
  box-shadow: 0 16px 32px rgba(73, 49, 29, 0.1);
}

.match-question-card,
.match-resolved-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 249, 238, 0.94) 100%);
  border-color: rgba(124, 98, 72, 0.12);
}

.match-card,
.group-card,
.point-card,
.match-board-classify-stack .match-card-right {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 244, 234, 0.96) 100%);
  border-color: var(--game-line);
  box-shadow: 0 8px 18px rgba(73, 49, 29, 0.08);
}

.match-card-left {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 238, 223, 0.96) 100%);
}

.match-card-right {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 248, 242, 0.96) 100%);
}

.match-card-left-classify {
  min-height: 88px;
  padding-left: 16px;
  border-color: rgba(166, 58, 43, 0.14);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.98) 0%, rgba(247, 238, 223, 0.96) 100%);
  color: var(--game-text);
  box-shadow: 0 10px 22px rgba(73, 49, 29, 0.08);
}

.match-card-left-classify::before {
  left: 10px;
  width: 3px;
  background: linear-gradient(180deg, rgba(166, 58, 43, 0.8) 0%, rgba(245, 158, 11, 0.5) 100%);
  opacity: 0.58;
}

.match-board-cell-stack-left::before,
.match-board-cell-stack-right::before,
.match-board-classify-stack .match-card-right::before {
  display: none;
}

.match-card.selected,
.group-card.selected,
.point-card.selected {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}

.match-board-hint {
  color: #7c5a40;
}

.game-overlay.is-passive {
  background: rgba(33, 25, 21, 0.04);
}

.game-overlay.is-passive.is-resolved {
  background: rgba(33, 25, 21, 0.08);
}

[data-theme="dark"] .btn-secondary {
  background: rgba(35, 44, 54, 0.96);
  color: #eee6da;
  border-color: rgba(238, 230, 218, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .btn-danger {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.96) 0%, rgba(153, 27, 27, 0.92) 100%);
  border-color: rgba(248, 113, 113, 0.22);
}

[data-theme="dark"] .match-hub-toolbar {
  background: linear-gradient(180deg, rgba(56, 42, 34, 0.72) 0%, rgba(32, 24, 19, 0.68) 100%);
  border-color: rgba(214, 161, 90, 0.16);
}

[data-theme="dark"] .match-duration-btn {
  color: #dbc6af;
}

[data-theme="dark"] .match-duration-btn.is-active,
[data-theme="dark"] .match-theme-btn.is-active,
[data-theme="dark"] .match-hub-audio-btn.is-on,
[data-theme="dark"] .match-audio-toggle.is-on {
  background: linear-gradient(135deg, #c45b49 0%, #d27768 100%);
  color: #fffaf5;
  border-color: rgba(196, 91, 73, 0.24);
  box-shadow:
    0 0 0 3px rgba(196, 91, 73, 0.12),
    0 10px 22px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .match-theme-btn,
[data-theme="dark"] .match-hub-audio-btn,
[data-theme="dark"] .match-audio-toggle {
  background: linear-gradient(180deg, rgba(56, 42, 34, 0.94) 0%, rgba(32, 24, 19, 0.98) 100%);
  color: #f3dbc2;
  border-color: rgba(214, 161, 90, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .match-hub-audio-btn.is-off,
[data-theme="dark"] .match-audio-toggle.is-off {
  color: #e7d6c2;
}

[data-theme="dark"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(32, 40, 49, 0.98) 0%, rgba(26, 32, 39, 0.98) 100%);
  border-color: rgba(196, 91, 73, 0.16);
  box-shadow: 0 -18px 34px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .match-mode-group,
[data-theme="dark"] .match-mode-option {
  border-color: rgba(238, 230, 218, 0.08);
}

[data-theme="dark"] .match-mode-group {
  background: linear-gradient(180deg, rgba(35, 44, 54, 0.82) 0%, rgba(26, 32, 39, 0.82) 100%);
}

[data-theme="dark"] .match-mode-option-speed {
  background: linear-gradient(180deg, rgba(78, 36, 30, 0.74) 0%, rgba(44, 24, 21, 0.8) 100%);
  border-color: rgba(196, 91, 73, 0.16);
}

[data-theme="dark"] .match-mode-option-classify {
  background: linear-gradient(180deg, rgba(37, 49, 70, 0.74) 0%, rgba(24, 34, 49, 0.8) 100%);
  border-color: rgba(96, 165, 250, 0.14);
}

[data-theme="dark"] .match-game-shell {
  background: linear-gradient(180deg, rgba(32, 40, 49, 0.98) 0%, rgba(26, 32, 39, 0.98) 100%);
  border-color: rgba(196, 91, 73, 0.18);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .match-question-card,
[data-theme="dark"] .match-resolved-panel {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(35, 44, 54, 0.96) 0%, rgba(26, 32, 39, 0.96) 100%);
  border-color: rgba(238, 230, 218, 0.08);
}

[data-theme="dark"] .match-card,
[data-theme="dark"] .group-card,
[data-theme="dark"] .point-card,
[data-theme="dark"] .match-board-classify-stack .match-card-right,
[data-theme="dark"] .match-card-left-classify {
  background: linear-gradient(180deg, rgba(35, 44, 54, 0.98) 0%, rgba(26, 32, 39, 0.98) 100%);
  border-color: rgba(238, 230, 218, 0.08);
  color: #eee6da;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .match-card span,
[data-theme="dark"] .group-card span,
[data-theme="dark"] .point-card span,
[data-theme="dark"] .match-board-hint {
  color: #b5aa9d;
}

[data-theme="dark"] .match-card-left-classify::before {
  background: linear-gradient(180deg, rgba(196, 91, 73, 0.78) 0%, rgba(210, 154, 76, 0.44) 100%);
}

[data-theme="dark"] .game-overlay.is-passive {
  background: rgba(17, 21, 25, 0.12);
}

[data-theme="dark"] .game-overlay.is-passive.is-resolved {
  background: rgba(17, 21, 25, 0.18);
}

@media (max-width: 720px) {
  .match-stage-hero {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 520px) {
  .match-hub-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    gap: 8px;
    align-items: center;
  }

  .match-duration-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .match-duration-btn {
    width: 100%;
    min-width: 0;
  }

  .match-theme-btn,
  .match-hub-audio-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    margin-left: 0;
  }

  .match-stage-hero {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start;
  }

  .match-stage-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .match-board-aligned .match-board-row,
  .match-board-aligned .match-board-row-head {
    grid-template-columns: minmax(78px, 0.62fr) minmax(0, 1.38fr) !important;
    gap: 6px;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(80px, 0.64fr) minmax(0, 1.36fr) !important;
    gap: 6px;
  }
}

/* Screenshot-driven stage pass: fix over-stretched left cards and let the board breathe more on desktop. */
:root {
  --shell-width: min(1720px, calc(100vw - 12px));
}

.app-shell {
  padding: 10px 0 24px;
}

.match-stage-shell {
  margin: 6px 0 16px;
  padding: 16px 20px 18px;
}

.match-stage-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.match-stage-nav {
  align-items: center;
  gap: 12px;
}

.match-stage-nav > .btn {
  min-width: 96px;
  min-height: 40px;
  padding-inline: 14px;
}

.match-stage-copy {
  display: grid;
  gap: 2px;
}

.match-stage-copy .match-hub-kicker {
  padding: 4px 9px;
  font-size: 0.74rem;
}

.match-stage-copy .match-hub-title {
  margin: 0;
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
  line-height: 1.04;
}

.match-stage-subcopy {
  display: none;
}

.match-stage-summary {
  display: none;
}

.match-stage-panel {
  padding: 16px;
}

.match-question-card {
  margin-bottom: 8px;
  padding: 10px 12px;
}

.match-question-body {
  gap: 4px;
}

.match-question-title {
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  line-height: 1.34;
}

.match-question-body p {
  display: none;
}

.match-game-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.match-game-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-game-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 248, 235, 0.68) 100%);
  border: 1px solid rgba(148, 84, 33, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.match-chip,
.match-timer {
  min-height: 38px;
  padding: 0 14px;
}

.match-board {
  gap: 14px;
}

.match-board-row {
  grid-template-columns: minmax(120px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  align-items: start;
}

.match-board-cell-left,
.match-board-cell-right,
.match-board-classify-columns,
.match-board-cell-stack-left {
  align-self: start;
}

.match-board-row .match-card,
.match-board-cell-left > .match-card,
.match-board-cell-right > .match-card {
  height: auto;
  min-height: 70px;
  align-self: start;
}

.match-card {
  padding: 14px 16px;
}

.match-card-left {
  justify-content: center;
  min-height: 70px;
  padding-inline: 16px;
  font-size: 1.02rem;
}

.match-card-left strong {
  font-size: 1.06rem;
  line-height: 1.34;
}

.match-card-right {
  align-items: flex-start;
  padding-top: 14px;
  padding-bottom: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
  line-break: auto;
}

.match-card-right strong {
  font-size: 0.98rem;
  line-height: 1.5;
}

.match-card-left-classify {
  min-height: 78px;
  gap: 8px;
  justify-content: center;
}

.match-board-classify-stack .match-card-right {
  min-height: 54px;
  padding: 12px 14px 12px 16px;
}

.match-progress-track {
  margin-bottom: 14px;
}

.match-board-hint {
  margin-top: 12px;
  padding: 0 2px;
  font-size: 0.82rem;
}

[data-theme="dark"] .match-game-tools {
  background: linear-gradient(180deg, rgba(56, 42, 34, 0.76) 0%, rgba(32, 24, 19, 0.72) 100%);
  border-color: rgba(214, 161, 90, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (max-width: 980px) {
  .match-stage-shell {
    padding: 14px 14px 16px;
  }

  .match-game-topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .match-game-tools {
    justify-content: flex-end;
  }

  .match-stage-copy .match-hub-title {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
  }

  .match-board-row {
    grid-template-columns: minmax(108px, 0.78fr) minmax(0, 1.22fr);
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .match-stage-shell {
    padding: 10px 10px 14px;
  }

  .match-stage-panel {
    padding: 14px;
  }

  .match-question-card {
    padding: 8px 10px;
  }

  .match-game-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .match-game-tools {
    display: grid;
    grid-template-columns: 40px 40px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  .match-stage-nav > .btn {
    min-width: 84px;
    min-height: 38px;
    padding-inline: 12px;
  }

  .match-stage-copy .match-hub-title {
    font-size: clamp(1.28rem, 7vw, 1.72rem);
  }

  .match-board-row {
    grid-template-columns: minmax(84px, 0.66fr) minmax(0, 1.34fr) !important;
    gap: 7px;
  }

  .match-board-row .match-card,
  .match-board-cell-left > .match-card,
  .match-board-cell-right > .match-card {
    min-height: 58px;
  }

  .match-card {
    padding: 10px 11px;
  }

  .match-card-left {
    font-size: 0.94rem;
  }

  .match-card-left strong {
    font-size: 0.96rem;
  }

  .match-card-right strong {
    font-size: 0.84rem;
    line-height: 1.38;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(82px, 0.66fr) minmax(0, 1.34fr) !important;
  }
}

/* Browser-verified final alignment: pull the standalone stage back toward the main site's game look
   while keeping the board larger and maintaining two-column play on phones. */
.match-stage-shell {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.28), transparent 30%),
    radial-gradient(circle at left bottom, rgba(14, 165, 233, 0.12), transparent 32%),
    linear-gradient(155deg, #fff7ed 0%, #fffdf7 55%, #ffffff 100%);
  border: 1px solid rgba(249, 115, 22, 0.16);
  box-shadow: 0 22px 44px rgba(120, 53, 15, 0.12);
}

.match-stage-panel {
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.76) 0%, rgba(255, 255, 255, 0.72) 100%);
  border: 1px solid rgba(148, 84, 33, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.match-question-card {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.92) 0%, rgba(255, 255, 255, 0.86) 100%);
  border: 1px solid rgba(249, 115, 22, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.match-question-body {
  gap: 4px;
}

.match-question-title {
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  line-height: 1.34;
}

.match-question-body p {
  display: none;
}

.match-game-shell {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(21, 128, 61, 0.12), transparent 32%),
    linear-gradient(160deg, #fffdf7 0%, #f7f2e8 100%);
  border: 1px solid rgba(148, 84, 33, 0.16);
  box-shadow: 0 18px 40px rgba(106, 64, 29, 0.14);
}

.match-game-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.match-game-status {
  display: flex;
  flex: 1 1 480px;
  flex-wrap: wrap;
  gap: 8px;
}

.match-game-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.match-chip,
.match-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.match-chip {
  background: rgba(255, 255, 255, 0.72);
  color: #8a4b20;
  border: 1px solid rgba(138, 75, 32, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.match-chip.is-goal {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.12);
}

.match-chip.is-progress {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.14);
}

.match-chip.is-combo {
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.96) 0%, rgba(251, 191, 36, 0.94) 100%);
  color: #854d0e;
  border-color: rgba(217, 119, 6, 0.16);
}

.match-chip.is-idle {
  background: rgba(255, 247, 237, 0.95);
  color: #9a3412;
  border-color: rgba(217, 119, 6, 0.12);
}

.match-theme-btn,
.match-audio-toggle {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.18);
}

.match-theme-btn {
  font-size: 0.88rem;
}

.match-theme-btn.is-active {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

.match-audio-toggle.is-off {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.96) 0%, rgba(254, 215, 170, 0.92) 100%);
  color: #9a3412;
  box-shadow: 0 10px 20px rgba(217, 119, 6, 0.14);
}

.match-timer {
  min-width: 90px;
  color: #fff7ed;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 0;
  box-shadow: 0 10px 22px rgba(180, 83, 9, 0.24);
}

.match-timer.is-waiting {
  color: #8a4b20;
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.95) 0%, rgba(254, 215, 170, 0.92) 100%);
  box-shadow: 0 10px 22px rgba(217, 119, 6, 0.14);
}

.match-progress-track {
  position: relative;
  height: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(138, 75, 32, 0.12);
}

.match-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a 0%, #f59e0b 100%);
}

.match-progress-bar.is-danger {
  background: linear-gradient(90deg, #f59e0b 0%, #dc2626 100%);
}

.match-board {
  gap: 12px;
}

.match-board-row {
  grid-template-columns: minmax(120px, 0.82fr) minmax(0, 1.18fr);
  gap: 12px;
  align-items: start;
}

.match-board-cell-left,
.match-board-cell-right,
.match-board-classify-columns,
.match-board-cell-stack-left {
  align-self: start;
}

.match-board-row .match-card,
.match-board-cell-left > .match-card,
.match-board-cell-right > .match-card {
  width: 100%;
  height: auto;
  min-height: 70px;
  align-self: start;
}

.match-card {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  border-radius: 18px;
  touch-action: manipulation;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 248, 235, 0.94) 100%);
  border: 1px solid rgba(249, 115, 22, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 8px 18px rgba(120, 53, 15, 0.06);
}

.match-card-left {
  justify-content: center;
  min-height: 70px;
  padding-inline: 16px;
  font-size: 1.02rem;
}

.match-card-left strong {
  font-size: 1.04rem;
  line-height: 1.34;
}

.match-card-right {
  align-items: flex-start;
  padding-top: 14px;
  padding-bottom: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
  line-break: auto;
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98) 0%, rgba(255, 242, 226, 0.98) 100%);
}

.match-card-right strong {
  font-size: 0.97rem;
  line-height: 1.5;
}

.match-card.selected {
  border-color: rgba(220, 38, 38, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 14px 28px rgba(220, 38, 38, 0.12);
  transform: translateY(-1px);
}

.match-card.matched {
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.98) 0%, rgba(187, 247, 208, 0.98) 100%);
  border-color: rgba(22, 163, 74, 0.18);
  box-shadow: 0 14px 26px rgba(22, 163, 74, 0.12);
}

.match-card.mismatch {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98) 0%, rgba(254, 226, 226, 0.98) 100%);
  border-color: rgba(220, 38, 38, 0.2);
}

.match-board-classify-stack .match-card-right {
  min-height: 54px;
  padding: 12px 14px 12px 16px;
}

.match-board-hint {
  margin-top: 10px;
  padding: 0 2px;
  color: #8a6a52;
  font-size: 0.81rem;
}

.btn-primary {
  background: linear-gradient(135deg, #dc2626 0%, #f59e0b 100%);
  border-color: rgba(220, 38, 38, 0.35);
  color: #fff7ed;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(148, 163, 184, 0.22);
  color: #475569;
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  border-color: rgba(127, 29, 29, 0.26);
  color: #fff7ed;
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.18);
}

.game-overlay {
  background: rgba(255, 248, 235, 0.24);
  backdrop-filter: blur(4px);
}

.match-countdown-panel {
  width: min(360px, calc(100vw - 56px));
  padding: 18px 20px 20px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(254, 215, 170, 0.36), transparent 48%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(255, 247, 237, 0.98) 100%);
  border: 1px solid rgba(249, 115, 22, 0.14);
  box-shadow: 0 24px 48px rgba(120, 53, 15, 0.18);
}

.match-countdown-panel .eyebrow {
  color: #b45309;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.match-countdown-panel h3 {
  margin: 6px 0 8px;
  font-size: clamp(3rem, 11vw, 4.8rem);
  line-height: 1;
  color: #b91c1c;
}

.match-countdown-panel p {
  color: #8a6a52;
}

[data-theme="dark"] .match-stage-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 30%),
    radial-gradient(circle at left bottom, rgba(14, 165, 233, 0.12), transparent 32%),
    linear-gradient(165deg, #172033 0%, #101827 100%);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 22px 44px rgba(2, 6, 23, 0.42);
}

[data-theme="dark"] .match-stage-panel,
[data-theme="dark"] .match-question-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(17, 24, 39, 0.68) 100%);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .match-game-shell {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 30%),
    radial-gradient(circle at left bottom, rgba(239, 68, 68, 0.1), transparent 30%),
    linear-gradient(160deg, #1f2937 0%, #111827 100%);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 22px 40px rgba(2, 6, 23, 0.32);
}

[data-theme="dark"] .match-chip {
  background: rgba(15, 23, 42, 0.72);
  color: #fdba74;
  border-color: rgba(251, 146, 60, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .match-chip.is-goal {
  background: rgba(196, 91, 73, 0.12);
  color: #f0b2a6;
  border-color: rgba(196, 91, 73, 0.18);
}

[data-theme="dark"] .match-chip.is-progress {
  background: rgba(245, 158, 11, 0.16);
  color: #fdba74;
  border-color: rgba(245, 158, 11, 0.18);
}

[data-theme="dark"] .match-chip.is-combo {
  color: #422006;
}

[data-theme="dark"] .match-chip.is-idle {
  background: rgba(30, 41, 59, 0.88);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .match-theme-btn,
[data-theme="dark"] .match-audio-toggle {
  background: linear-gradient(135deg, #c45b49 0%, #d97706 100%);
  color: #fff7ed;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .match-theme-btn.is-active {
  background: linear-gradient(135deg, #7c2d12 0%, #c2410c 100%);
}

[data-theme="dark"] .match-audio-toggle.is-off {
  background: linear-gradient(135deg, rgba(80, 42, 34, 0.92) 0%, rgba(44, 25, 20, 0.94) 100%);
  color: #fdba74;
}

[data-theme="dark"] .match-timer {
  color: #fff7ed;
  background: linear-gradient(135deg, #c45b49 0%, #d29a4c 100%);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .match-timer.is-waiting {
  color: #fdba74;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(251, 146, 60, 0.16);
  box-shadow: none;
}

[data-theme="dark"] .match-progress-track {
  background: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .match-card {
  background: linear-gradient(180deg, rgba(23, 32, 51, 0.96) 0%, rgba(16, 24, 39, 0.96) 100%);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 22px rgba(2, 6, 23, 0.22);
}

[data-theme="dark"] .match-card-right {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.94) 0%, rgba(23, 32, 51, 0.94) 100%);
}

[data-theme="dark"] .match-card.selected {
  border-color: rgba(251, 146, 60, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 30px rgba(251, 146, 60, 0.14);
}

[data-theme="dark"] .match-card.matched {
  background: linear-gradient(180deg, rgba(18, 74, 50, 0.94) 0%, rgba(20, 83, 45, 0.96) 100%);
  border-color: rgba(74, 222, 128, 0.18);
}

[data-theme="dark"] .match-card.mismatch {
  background: linear-gradient(180deg, rgba(95, 30, 34, 0.92) 0%, rgba(69, 10, 10, 0.94) 100%);
  border-color: rgba(248, 113, 113, 0.18);
}

[data-theme="dark"] .match-board-hint,
[data-theme="dark"] .match-countdown-panel p {
  color: #cdbda9;
}

[data-theme="dark"] .game-overlay {
  background: rgba(2, 6, 23, 0.28);
}

[data-theme="dark"] .match-countdown-panel {
  background:
    radial-gradient(circle at top, rgba(245, 158, 11, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(23, 32, 51, 0.98) 0%, rgba(16, 24, 39, 0.98) 100%);
  border-color: rgba(251, 146, 60, 0.16);
  box-shadow: 0 28px 52px rgba(2, 6, 23, 0.42);
}

[data-theme="dark"] .match-countdown-panel .eyebrow {
  color: #fdba74;
}

[data-theme="dark"] .match-countdown-panel h3 {
  color: #f0b2a6;
}

@media (max-width: 980px) {
  .match-stage-shell {
    padding: 14px 14px 16px;
  }

  .match-game-topbar {
    gap: 8px;
  }

  .match-game-status {
    flex-basis: 100%;
  }

  .match-stage-copy .match-hub-title {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
  }

  .match-board-row {
    grid-template-columns: minmax(108px, 0.78fr) minmax(0, 1.22fr);
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .match-stage-shell {
    padding: 10px 10px 14px;
  }

  .match-stage-panel {
    padding: 12px;
  }

  .match-question-card {
    padding: 8px 10px;
  }

  .match-game-shell {
    padding: 12px;
  }

  .match-game-topbar {
    gap: 8px;
  }

  .match-game-status {
    order: 2;
    gap: 6px;
  }

  .match-game-tools {
    order: 1;
    display: inline-grid;
    grid-template-columns: 40px 40px auto;
    justify-self: end;
  }

  .match-chip,
  .match-timer {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .match-timer {
    min-width: 82px;
  }

  .match-stage-nav > .btn {
    min-width: 84px;
    min-height: 38px;
    padding-inline: 12px;
  }

  .match-stage-copy .match-hub-title {
    font-size: clamp(1.24rem, 6vw, 1.66rem);
  }

  .match-board-row {
    grid-template-columns: minmax(96px, 0.76fr) minmax(0, 1.24fr) !important;
    gap: 8px;
  }

  .match-board-row .match-card,
  .match-board-cell-left > .match-card,
  .match-board-cell-right > .match-card {
    min-height: 58px;
  }

  .match-card {
    padding: 11px 12px;
  }

  .match-card-left {
    font-size: 0.95rem;
  }

  .match-card-left strong {
    font-size: 0.98rem;
  }

  .match-card-right strong {
    font-size: 0.88rem;
    line-height: 1.42;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(92px, 0.78fr) minmax(0, 1.22fr) !important;
    gap: 8px;
  }
}

/* Main-site parity correction: flatten the cards a bit, restore the cool classify lane,
   and keep dark mode on the slate/ink path instead of muddy bronze. */
.match-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(124, 74, 28, 0.12);
  box-shadow: 0 10px 24px rgba(71, 85, 105, 0.08);
}

.match-card-left {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 244, 234, 0.96) 100%);
}

.match-card-right {
  background: rgba(255, 255, 255, 0.96);
}

.match-board-classify-stack .match-card-right {
  border-color: rgba(59, 130, 246, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.95) 100%);
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 12px 22px rgba(37, 99, 235, 0.1);
}

.btn-danger {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(182, 69, 58, 0.22);
  color: #b6453a;
  box-shadow: none;
}

[data-theme="dark"] .match-theme-btn,
[data-theme="dark"] .match-audio-toggle {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.92);
  color: #f8fafc;
  box-shadow: none;
}

[data-theme="dark"] .match-theme-btn.is-active,
[data-theme="dark"] .match-audio-toggle.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, #c45b49 0%, #d27768 100%);
  color: #fff7ed;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .match-audio-toggle.is-off {
  color: #cbd5e1;
}

[data-theme="dark"] .match-card {
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.22);
}

[data-theme="dark"] .match-card.selected {
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.96) 0%, rgba(154, 52, 18, 0.94) 100%);
  border-color: rgba(251, 191, 36, 0.45);
}

[data-theme="dark"] .match-board-classify-stack .match-card-right {
  border-color: rgba(96, 165, 250, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(13, 20, 35, 0.96) 100%);
  color: #f8fafc;
}

[data-theme="dark"] .btn-danger {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(196, 91, 73, 0.22);
  color: #f0b2a6;
}

.match-board {
  width: 100%;
}

.match-board-aligned {
  grid-template-columns: minmax(0, 1fr);
}

.match-board-row,
.match-board-row-head {
  width: 100%;
}

/* Final UI refinement pass: cleaner hall controls, tighter module cards,
   clearer typography, and a more disciplined mobile combat HUD. */
.match-hub-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.match-hub-header-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.match-hub-title {
  margin: 0;
  font-size: clamp(2.25rem, 4.6vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.match-hub-copy {
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.72;
  color: #7b624d;
}

.match-hub-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 392px);
  padding: 8px;
  border-radius: 24px;
}

.match-duration-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.match-duration-btn {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.match-duration-btn:not(.is-active) {
  color: #786351;
}

.match-theme-btn,
.match-hub-audio-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
}

.match-hub-summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.match-hub-stat-pill {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.match-hub-quick-btn {
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 800;
}

.match-hub-grid {
  gap: 18px;
}

.match-module-card {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 14px;
  padding: 20px 20px 16px;
}

.match-module-mark {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.match-module-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.match-module-mark-copy {
  display: grid;
  gap: 2px;
}

.match-module-cue {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.match-module-card h3 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.match-module-summary {
  margin: 0;
  max-width: 28rem;
  font-size: 0.98rem;
  line-height: 1.68;
}

.match-module-fields,
.match-module-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-module-field,
.match-module-fact {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.module-actions {
  margin-top: 2px;
}

.module-actions .btn {
  min-height: 48px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 800;
}

.match-stage-copy .match-hub-title {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.match-stage-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.match-stage-nav > .btn {
  min-height: 52px;
  padding-inline: 20px;
  border-radius: 999px;
}

.match-stage-panel {
  padding: 14px;
}

.match-question-card {
  margin-bottom: 6px;
  padding: 8px 10px;
}

.match-question-topline {
  gap: 6px;
}

.match-question-tag {
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.match-question-body {
  gap: 2px;
}

.match-question-title {
  font-size: clamp(1rem, 1.25vw, 1.14rem);
  line-height: 1.28;
}

.match-game-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 12px;
}

.match-game-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}

.match-game-tools {
  gap: 8px;
}

.match-chip,
.match-timer {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.match-timer {
  min-width: 88px;
}

.match-card-right strong {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.56;
}

.match-stage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.match-stage-actions .btn {
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 999px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .match-hub-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .match-hub-toolbar {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .match-hub-shell {
    padding-top: 14px;
  }

  .match-hub-title {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .match-hub-copy {
    max-width: 18rem;
    font-size: 0.98rem;
    line-height: 1.64;
  }

  .match-hub-toolbar {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 8px;
  }

  .match-duration-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .match-duration-btn {
    min-height: 42px;
    font-size: 0.92rem;
  }

  .match-hub-summary-strip {
    gap: 8px;
  }

  .match-hub-quick-btn {
    width: 100%;
    justify-content: center;
  }

  .match-module-card {
    padding: 16px 16px 14px;
    gap: 12px;
  }

  .match-module-card h3 {
    font-size: 1.34rem;
  }

  .match-module-summary {
    font-size: 0.92rem;
    line-height: 1.58;
  }

  .match-stage-nav {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .match-stage-nav > .btn {
    min-height: 46px;
    padding-inline: 16px;
  }

  .match-stage-copy .match-hub-title {
    font-size: clamp(1.5rem, 8vw, 2rem);
  }

  .match-game-topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .match-game-tools {
    justify-self: end;
  }

  .match-game-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .match-game-status .match-chip {
    width: 100%;
    justify-content: center;
    padding-inline: 8px;
  }

  .match-card-right strong {
    font-size: 0.9rem;
    line-height: 1.48;
  }

  .match-stage-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .match-stage-actions .btn:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .match-hub-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .match-theme-btn,
  .match-hub-audio-btn,
  .match-audio-toggle {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .match-game-tools {
    display: grid;
    grid-template-columns: 42px 42px auto;
    gap: 8px;
    justify-self: stretch;
  }

  .match-timer {
    justify-self: end;
  }
}

/* Final hall + mobile stage refinement pass */
.match-hub-intro {
  display: grid;
  gap: 10px;
}

.match-hub-summary-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.match-hub-quick-btn-resume {
  justify-self: start;
  min-width: min(100%, 420px);
}

.match-module-start-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  letter-spacing: -0.01em;
}

.match-module-card {
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  padding: 18px 18px 16px;
}

.match-stage-panel {
  padding: 12px;
}

.match-question-card {
  margin-bottom: 4px;
}

.match-game-topbar {
  margin-bottom: 10px;
}

.match-chip {
  backdrop-filter: blur(6px);
}

.match-stage-action.is-primary {
  min-width: 132px;
}

.match-stage-action.is-secondary,
.match-stage-action.is-danger {
  min-width: 118px;
}

@media (max-width: 900px) {
  .match-hub-quick-btn-resume {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 640px) {
  .match-hub-shell {
    padding-inline: 12px;
  }

  .match-hub-hero {
    margin-bottom: 14px;
  }

  .match-hub-header {
    gap: 12px;
  }

  .match-hub-header-main {
    gap: 8px;
  }

  .match-hub-copy {
    max-width: 17rem;
  }

  .match-module-field,
  .match-module-fact {
    font-size: 0.78rem;
  }

  .match-module-card {
    gap: 10px;
    padding: 16px 16px 14px;
  }

  .match-stage-panel {
    padding: 10px;
  }

  .match-question-card {
    padding: 7px 9px;
  }

  .match-game-shell {
    padding: 10px;
  }

  .match-game-status {
    grid-auto-flow: row;
    align-items: stretch;
  }

  .match-game-status .match-chip {
    min-height: 34px;
    font-size: 0.8rem;
  }

  .match-game-tools {
    align-items: center;
  }

  .match-stage-actions {
    margin-top: 14px;
  }

  .match-stage-action.is-primary,
  .match-stage-action.is-secondary,
  .match-stage-action.is-danger {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .match-hub-summary-strip {
    gap: 10px;
  }

  .match-hub-toolbar {
    align-items: start;
  }

  .match-duration-group {
    gap: 5px;
  }

  .match-duration-btn {
    min-height: 40px;
    padding-inline: 8px;
    font-size: 0.88rem;
  }

  .match-game-topbar {
    gap: 7px;
  }

  .match-game-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .match-game-tools {
    grid-template-columns: 42px 42px minmax(82px, auto);
    width: 100%;
  }

  .match-timer {
    min-width: 82px;
    text-align: center;
  }

  .match-stage-nav {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }

  .match-stage-nav > .btn {
    min-height: 42px;
    padding-inline: 10px;
    font-size: 0.88rem;
  }

  .match-stage-copy .match-hub-title {
    font-size: clamp(1.38rem, 7vw, 1.82rem);
  }

  .match-question-title {
    font-size: 0.98rem;
  }

  .match-stage-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .match-stage-actions .btn {
    min-height: 42px;
    padding-inline: 12px;
    font-size: 0.9rem;
  }
}

/* Modal parity correction: keep the mode sheet aligned with the main-site language,
   and make light/dark fully diverge again. */
#match-mode-sheet,
.match-mode-sheet {
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
}

#match-mode-sheet .match-mode-backdrop,
.match-mode-sheet .match-mode-backdrop {
  background: rgba(15, 23, 42, 0.32) !important;
  backdrop-filter: blur(10px);
}

#match-mode-sheet .match-mode-panel,
.match-mode-sheet .match-mode-panel {
  width: min(100%, 760px);
  max-height: min(84vh, 760px);
  overflow: auto;
  padding: 18px 18px 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 30%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.4), transparent 36%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border: 1px solid rgba(249, 115, 22, 0.12) !important;
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.16) !important;
}

#match-mode-sheet[data-match-module="herb"] .match-mode-panel,
.match-mode-sheet[data-match-module="herb"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.14), transparent 30%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.4), transparent 36%),
    linear-gradient(180deg, rgba(250, 253, 242, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border-color: rgba(132, 204, 22, 0.16) !important;
}

#match-mode-sheet[data-match-module="formula"] .match-mode-panel,
.match-mode-sheet[data-match-module="formula"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.14), transparent 30%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.4), transparent 36%),
    linear-gradient(180deg, rgba(255, 248, 245, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border-color: rgba(196, 91, 73, 0.16) !important;
}

#match-mode-sheet[data-match-module="acupoint"] .match-mode-panel,
.match-mode-sheet[data-match-module="acupoint"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 30%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.4), transparent 36%),
    linear-gradient(180deg, rgba(255, 251, 243, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border-color: rgba(245, 158, 11, 0.16) !important;
}

#match-mode-sheet[data-match-module="internal"] .match-mode-panel,
.match-mode-sheet[data-match-module="internal"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 30%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.4), transparent 36%),
    linear-gradient(180deg, rgba(246, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border-color: rgba(96, 165, 250, 0.16) !important;
}

#match-mode-sheet .match-mode-panel-head,
.match-mode-sheet .match-mode-panel-head {
  margin-bottom: 14px;
  align-items: center;
}

#match-mode-sheet .match-mode-panel-head > .btn,
.match-mode-sheet .match-mode-panel-head > .btn {
  min-width: 64px;
  min-height: 36px;
  padding: 0.42rem 0.92rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(124, 98, 72, 0.12) !important;
  color: #7c2d12 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 8px 16px rgba(120, 53, 15, 0.08) !important;
}

#match-mode-sheet .match-mode-sheet-title,
.match-mode-sheet .match-mode-sheet-title {
  color: #9a3412 !important;
}

#match-mode-sheet .match-mode-group,
.match-mode-sheet .match-mode-group {
  padding: 13px;
  border-radius: 20px;
  border: 1px solid rgba(124, 98, 72, 0.1) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
}

#match-mode-sheet .match-mode-group-speed,
.match-mode-sheet .match-mode-group-speed {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 244, 0.94) 0%, rgba(255, 255, 255, 0.86) 100%) !important;
  border-color: rgba(220, 38, 38, 0.1) !important;
}

#match-mode-sheet .match-mode-group-classify,
.match-mode-sheet .match-mode-group-classify {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(248, 251, 255, 0.94) 0%, rgba(255, 255, 255, 0.86) 100%) !important;
  border-color: rgba(59, 130, 246, 0.1) !important;
}

#match-mode-sheet .match-mode-group + .match-mode-group,
.match-mode-sheet .match-mode-group + .match-mode-group {
  margin-top: 10px;
}

#match-mode-sheet .match-mode-group-title,
.match-mode-sheet .match-mode-group-title {
  color: #78350f !important;
  font-size: 0.95rem;
}

#match-mode-sheet .match-mode-group-grid,
.match-mode-sheet .match-mode-group-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

#match-mode-sheet .match-mode-option,
.match-mode-sheet .match-mode-option {
  min-height: 78px;
  padding: 12px 14px;
  border-radius: 16px;
  text-align: left;
  display: grid;
  align-content: center;
  justify-items: start;
  background: rgba(255, 255, 255, 0.76) !important;
  border: 1px solid rgba(124, 98, 72, 0.1) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 10px 18px rgba(120, 53, 15, 0.05) !important;
  color: #7c2d12 !important;
}

#match-mode-sheet .match-mode-option-speed,
.match-mode-sheet .match-mode-option-speed {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.96) 0%, rgba(255, 247, 237, 0.98) 100%) !important;
  border-color: rgba(245, 158, 11, 0.14) !important;
}

#match-mode-sheet .match-mode-option-classify,
.match-mode-sheet .match-mode-option-classify {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(243, 248, 255, 0.98) 100%) !important;
  border-color: rgba(59, 130, 246, 0.14) !important;
}

#match-mode-sheet .match-mode-option-title,
.match-mode-sheet .match-mode-option-title {
  margin: 0;
  color: #7c2d12 !important;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.18;
}

[data-theme="dark"] #match-mode-sheet .match-mode-backdrop,
[data-theme="dark"] .match-mode-sheet .match-mode-backdrop {
  background: rgba(2, 6, 23, 0.58) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-panel,
[data-theme="dark"] .match-mode-sheet .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 30%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.04), transparent 36%),
    linear-gradient(180deg, rgba(23, 32, 51, 0.96) 0%, rgba(16, 24, 39, 0.98) 100%) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.42) !important;
}

[data-theme="dark"] #match-mode-sheet[data-match-module="herb"] .match-mode-panel,
[data-theme="dark"] .match-mode-sheet[data-match-module="herb"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(78, 156, 119, 0.16), transparent 32%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.04), transparent 36%),
    linear-gradient(180deg, rgba(20, 33, 33, 0.96) 0%, rgba(12, 20, 19, 0.98) 100%) !important;
  border-color: rgba(78, 156, 119, 0.18) !important;
}

[data-theme="dark"] #match-mode-sheet[data-match-module="formula"] .match-mode-panel,
[data-theme="dark"] .match-mode-sheet[data-match-module="formula"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(196, 91, 73, 0.16), transparent 32%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.04), transparent 36%),
    linear-gradient(180deg, rgba(35, 24, 29, 0.96) 0%, rgba(20, 14, 19, 0.98) 100%) !important;
  border-color: rgba(196, 91, 73, 0.18) !important;
}

[data-theme="dark"] #match-mode-sheet[data-match-module="acupoint"] .match-mode-panel,
[data-theme="dark"] .match-mode-sheet[data-match-module="acupoint"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 32%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.04), transparent 36%),
    linear-gradient(180deg, rgba(36, 28, 18, 0.96) 0%, rgba(20, 16, 10, 0.98) 100%) !important;
  border-color: rgba(245, 158, 11, 0.18) !important;
}

[data-theme="dark"] #match-mode-sheet[data-match-module="internal"] .match-mode-panel,
[data-theme="dark"] .match-mode-sheet[data-match-module="internal"] .match-mode-panel {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 32%),
    radial-gradient(circle at left top, rgba(255, 255, 255, 0.04), transparent 36%),
    linear-gradient(180deg, rgba(18, 27, 44, 0.96) 0%, rgba(10, 15, 26, 0.98) 100%) !important;
  border-color: rgba(96, 165, 250, 0.18) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-panel-head > .btn,
[data-theme="dark"] .match-mode-sheet .match-mode-panel-head > .btn {
  background: rgba(15, 23, 42, 0.78) !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  color: #f8fafc !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 20px rgba(2, 6, 23, 0.2) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-sheet-title,
[data-theme="dark"] .match-mode-sheet .match-mode-sheet-title,
[data-theme="dark"] #match-mode-sheet .match-mode-group-title,
[data-theme="dark"] .match-mode-sheet .match-mode-group-title {
  color: #fdba74 !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-group,
[data-theme="dark"] .match-mode-sheet .match-mode-group {
  border-color: rgba(148, 163, 184, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-group-speed,
[data-theme="dark"] .match-mode-sheet .match-mode-group-speed {
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(39, 21, 26, 0.88) 0%, rgba(24, 15, 19, 0.92) 100%) !important;
  border-color: rgba(220, 38, 38, 0.16) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-group-classify,
[data-theme="dark"] .match-mode-sheet .match-mode-group-classify {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(20, 31, 54, 0.88) 0%, rgba(11, 18, 32, 0.92) 100%) !important;
  border-color: rgba(96, 165, 250, 0.16) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-option,
[data-theme="dark"] .match-mode-sheet .match-mode-option {
  background: rgba(15, 23, 42, 0.74) !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 20px rgba(2, 6, 23, 0.18) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-option-speed,
[data-theme="dark"] .match-mode-sheet .match-mode-option-speed {
  background: linear-gradient(180deg, rgba(68, 24, 21, 0.84) 0%, rgba(28, 15, 16, 0.88) 100%) !important;
  border-color: rgba(220, 38, 38, 0.18) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-option-classify,
[data-theme="dark"] .match-mode-sheet .match-mode-option-classify {
  background: linear-gradient(180deg, rgba(18, 34, 67, 0.84) 0%, rgba(10, 17, 32, 0.88) 100%) !important;
  border-color: rgba(96, 165, 250, 0.18) !important;
}

[data-theme="dark"] #match-mode-sheet .match-mode-option-title,
[data-theme="dark"] .match-mode-sheet .match-mode-option-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .match-duration-btn:not(.is-active) {
  color: #d8cab9;
}

@media (max-width: 520px) {
  #match-mode-sheet,
  .match-mode-sheet {
    padding: 10px;
  }

  #match-mode-sheet .match-mode-panel,
  .match-mode-sheet .match-mode-panel {
    width: min(100%, 392px);
    max-height: min(84vh, 680px);
    padding: 14px 14px 16px;
    border-radius: 24px;
  }

  #match-mode-sheet .match-mode-panel-head,
  .match-mode-sheet .match-mode-panel-head {
    padding-right: 70px;
    min-height: 40px;
  }

  #match-mode-sheet .match-mode-sheet-title,
  .match-mode-sheet .match-mode-sheet-title {
    font-size: 1.18rem;
  }

  #match-mode-sheet .match-mode-group-grid,
  .match-mode-sheet .match-mode-group-grid {
    gap: 8px;
  }

  #match-mode-sheet .match-mode-option,
  .match-mode-sheet .match-mode-option {
    min-height: 74px;
    padding: 10px 11px;
    border-radius: 15px;
  }

  #match-mode-sheet .match-mode-option-title,
  .match-mode-sheet .match-mode-option-title {
    font-size: 0.93rem;
  }
}

/* Final mobile board/action balance:
   widen the left lane, calm the right card density, and keep the three bottom actions
   in a stable 1 + 2 layout instead of 1 + 1 + 1 broken rows. */
@media (max-width: 640px) {
  .match-board-row {
    grid-template-columns: minmax(108px, 0.94fr) minmax(0, 1.06fr);
    gap: 10px;
    align-items: stretch;
  }

  .match-board-cell-left,
  .match-board-cell-right {
    display: flex;
    align-self: stretch;
  }

  .match-board-row .match-card,
  .match-board-cell-left > .match-card,
  .match-board-cell-right > .match-card {
    min-height: 74px;
    height: 100%;
  }

  .match-card-left {
    min-height: 74px;
    padding-inline: 14px;
  }

  .match-card-left strong {
    font-size: 0.98rem;
    line-height: 1.28;
  }

  .match-card-right {
    padding: 12px 14px;
  }

  .match-card-right strong {
    font-size: 0.88rem;
    line-height: 1.42;
  }

  .match-stage-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    margin-top: 12px;
  }

  .match-stage-actions .btn {
    width: 100%;
    min-height: 42px;
    padding-inline: 10px;
    border-radius: 15px;
    font-size: 0.88rem;
    justify-content: center;
  }

  .match-stage-actions .btn:first-child {
    grid-column: 1 / -1;
  }

  .match-stage-actions .btn:nth-child(3) {
    grid-column: auto;
  }

  .match-stage-action.is-primary,
  .match-stage-action.is-secondary,
  .match-stage-action.is-danger {
    min-width: 0;
  }

  .match-stage-action.is-secondary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 249, 240, 0.98) 100%);
    border-color: rgba(124, 98, 72, 0.12);
    color: #7c2d12;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  .match-stage-action.is-danger {
    background: linear-gradient(180deg, rgba(255, 251, 247, 0.98) 0%, rgba(255, 245, 241, 0.98) 100%);
    border-color: rgba(196, 91, 73, 0.24);
    color: #b6453a;
  }

  [data-theme="dark"] .match-stage-action.is-secondary {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(148, 163, 184, 0.16);
    color: #f8fafc;
    box-shadow: none;
  }

  [data-theme="dark"] .match-stage-action.is-danger {
    background: linear-gradient(180deg, rgba(62, 23, 24, 0.92) 0%, rgba(42, 17, 18, 0.96) 100%);
    border-color: rgba(248, 113, 113, 0.22);
    color: #fecaca;
  }
}

@media (max-width: 520px) {
  .match-board-row {
    grid-template-columns: minmax(104px, 0.9fr) minmax(0, 1.1fr) !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(100px, 0.88fr) minmax(0, 1.12fr) !important;
    gap: 8px !important;
  }

  .match-card-left {
    min-width: 104px;
  }

  .match-card-right {
    padding: 11px 12px;
  }

  .match-card-right strong {
    line-height: 1.38;
  }

  .match-stage-actions {
    gap: 7px;
    margin-top: 10px;
  }

  .match-stage-actions .btn {
    min-height: 40px;
    border-radius: 14px;
    font-size: 0.86rem;
  }
}

/* Final typography pass:
   keep display titles in a restrained serif stack, and return cards/buttons to
   a crisper reading texture instead of handwritten styling. */
:root {
  --font-heading: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
}

.match-hub-title,
.match-stage-copy .match-hub-title,
.match-mode-sheet-title,
.match-module-card h3,
.match-resolved-title {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.match-mode-sheet-title,
.match-module-card h3 {
  line-height: 1.12;
}

.match-card-left,
.match-card-left strong {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.match-mode-option-title,
.match-duration-btn,
.match-stage-actions .btn,
.match-stage-nav > .btn,
.match-chip,
.match-timer {
  font-family: var(--font-body);
  letter-spacing: 0;
}

.match-mode-sheet .match-mode-option,
#match-mode-sheet .match-mode-option {
  justify-items: center;
  text-align: center;
}

.match-mode-sheet .match-mode-option-title,
#match-mode-sheet .match-mode-option-title {
  margin-inline: auto;
}

/* Final title + card copy tightening:
   shrink the hall masthead slightly, make left cards read like compact term cards,
   and make right cards feel like explanation blocks rather than oversized labels. */
.match-hub-header-main .match-hub-title {
  font-size: clamp(1.92rem, 4vw, 2.76rem);
  line-height: 1.02;
}

.match-card-left {
  text-align: center;
}

.match-card-left strong {
  max-width: 5.2em;
  margin-inline: auto;
  font-size: 0.98rem;
  line-height: 1.24;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.match-card-right {
  align-items: flex-start;
}

.match-card-right strong {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.48;
  font-weight: 700;
  letter-spacing: 0;
  color: #2f241d;
  text-wrap: pretty;
}

.match-card-right span {
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.52;
}

[data-theme="dark"] .match-card-right strong {
  color: #f8fafc;
}

@media (max-width: 640px) {
  .match-hub-header-main .match-hub-title {
    font-size: clamp(1.72rem, 7.2vw, 2.24rem);
  }

  .match-card-left strong {
    font-size: 0.94rem;
    line-height: 1.2;
  }

  .match-card-right strong {
    font-size: 0.86rem;
    line-height: 1.42;
  }

  .match-card-right span {
    font-size: 0.78rem;
    line-height: 1.46;
  }

  .match-board-classify-columns {
    align-items: start;
  }

  .match-board-cell-stack-left {
    display: grid;
    align-content: start;
    grid-auto-rows: minmax(74px, 1fr);
    height: 100%;
  }

  .match-board-cell-stack-right {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: start;
    gap: 8px;
  }

  .match-board-classify-stack .match-card-right {
    width: 100%;
    min-height: 58px;
    padding: 10px 12px 10px 16px;
  }

  .match-board-classify-stack .match-card-right strong {
    white-space: normal;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .match-card-left-classify {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    padding-left: 12px;
    height: 100%;
  }

  .match-card-left-classify strong {
    max-width: none;
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.16;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }

  .match-card-left-classify span {
    margin-top: 0;
    font-family: var(--font-body);
    font-size: 0.76rem;
    line-height: 1.18;
    font-weight: 700;
    color: #9a6a3a;
    white-space: nowrap;
  }

  [data-theme="dark"] .match-card-left-classify span {
    color: #f4c88f;
  }

  .match-card-left-classify::before {
    display: none;
  }
}

@media (max-width: 520px) {
  .match-card-left strong {
    max-width: 5em;
    font-size: 0.92rem;
  }

  .match-card-right strong {
    font-size: 0.84rem;
    line-height: 1.38;
  }

  .match-card-right span {
    margin-top: 5px;
    font-size: 0.76rem;
    line-height: 1.42;
  }

  .match-board-cell-stack-right {
    gap: 7px;
  }

  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    grid-template-columns: minmax(108px, 0.94fr) minmax(0, 1.06fr) !important;
  }

  .match-board-cell-stack-left {
    grid-auto-rows: minmax(78px, 1fr);
  }

  .match-board-classify-stack .match-card-right {
    min-height: 54px;
    padding: 9px 10px 9px 15px;
  }

  .match-card-left-classify {
    min-height: 78px;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 8px;
  }

  .match-card-left-classify strong {
    align-self: center;
    font-size: 0.92rem;
    line-height: 1.12;
  }

  .match-card-left-classify span {
    align-self: center;
    font-size: 0.72rem;
  }
}

/* Final classify-left selection polish:
   make the active group read clearly without shouting. */
.match-card-left-classify.selected {
  border-color: rgba(217, 119, 6, 0.38);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.3), transparent 42%),
    linear-gradient(160deg, rgba(255, 244, 223, 0.98) 0%, rgba(255, 227, 186, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 28px rgba(217, 119, 6, 0.18);
}

.match-card-left-classify.selected::before {
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.98) 0%, rgba(245, 158, 11, 0.82) 100%);
  opacity: 1;
}

.match-card-left-classify.selected strong {
  color: #6b2d06;
}

.match-card-left-classify.selected span {
  color: #8a4b10;
}

[data-theme="dark"] .match-card-left-classify.selected {
  border-color: rgba(251, 191, 36, 0.34);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.14), transparent 42%),
    linear-gradient(160deg, rgba(74, 38, 17, 0.94) 0%, rgba(52, 26, 14, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 26px rgba(2, 6, 23, 0.22);
}

[data-theme="dark"] .match-card-left-classify.selected::before {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.96) 0%, rgba(245, 158, 11, 0.78) 100%);
}

[data-theme="dark"] .match-card-left-classify.selected strong {
  color: #fff7ed;
}

[data-theme="dark"] .match-card-left-classify.selected span {
  color: #fcd34d;
}

/* Final speed-right alignment:
   keep reading left-aligned, but stop pinning copy to the top-left corner on mobile. */
.match-board-aligned .match-card-right {
  display: grid;
  align-content: center;
  justify-items: start;
}

.match-board-aligned .match-card-right strong {
  width: 100%;
}

@media (max-width: 640px) {
  .match-board-aligned .match-card-right {
    padding: 12px 12px 12px 14px;
  }
}

@media (max-width: 520px) {
  .match-board-aligned .match-card-right {
    padding: 11px 11px 11px 13px;
  }
}

/* Stabilize the board during rapid match rerenders:
   reserve feedback space, avoid anchor-based scroll jumps, and stop mobile focus scrolling
   from chasing the tapped card. */
.quiz-feedback {
  min-height: 54px;
}

.quiz-feedback.hidden {
  display: block !important;
  visibility: hidden;
}

.match-stage-shell,
.match-stage-panel,
.match-game-shell,
.match-board,
.quiz-feedback {
  overflow-anchor: none;
}

.match-card,
.match-card:focus,
.match-card:focus-visible {
  -webkit-tap-highlight-color: transparent;
}

.match-card:focus-visible,
.match-card-left-classify:focus-visible {
  outline: 2px solid rgba(217, 119, 6, 0.42);
  outline-offset: 2px;
}

/* Final interaction polish:
   keep feedback and action controls visually stable, remove gray-button drift,
   and tighten the in-game control rhythm across light/dark themes. */
.quiz-feedback {
  display: grid;
  align-items: center;
  min-height: 56px;
}

.feedback-strip {
  margin-top: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 22px rgba(120, 53, 15, 0.08);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.quiz-feedback.hidden .feedback-strip {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.quiz-feedback:not(.hidden) .feedback-strip {
  opacity: 1;
  transform: translateY(0);
}

.match-stage-actions,
.match-resolved-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.match-stage-actions .btn,
.match-resolved-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  padding-inline: 16px;
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(255, 246, 236, 0.96) 100%);
  border-color: rgba(180, 83, 9, 0.14);
  color: #8a4b20;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 8px 18px rgba(148, 84, 33, 0.08);
}

.btn-danger {
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.98) 0%, rgba(255, 241, 238, 0.98) 100%);
  border-color: rgba(182, 69, 58, 0.2);
  color: #b6453a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 8px 18px rgba(166, 58, 43, 0.08);
}

[data-theme="dark"] .feedback-strip {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 24px rgba(2, 6, 23, 0.22);
}

[data-theme="dark"] .btn-secondary {
  background: linear-gradient(180deg, rgba(67, 45, 31, 0.94) 0%, rgba(40, 28, 21, 0.96) 100%);
  border-color: rgba(245, 158, 11, 0.16);
  color: #f7e6cf;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .btn-danger {
  background: linear-gradient(180deg, rgba(88, 34, 36, 0.94) 0%, rgba(58, 24, 26, 0.96) 100%);
  border-color: rgba(248, 113, 113, 0.2);
  color: #ffd7d2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 20px rgba(0, 0, 0, 0.22);
}

@media (max-width: 640px) {
  .match-stage-actions,
  .match-resolved-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .match-stage-actions .btn:first-child,
  .match-resolved-actions .btn:first-child {
    grid-column: 1 / -1;
  }
}

/* Final repair pass:
   restore the mode sheet rhythm on mobile and keep gameplay polish restrained. */
#match-mode-sheet .match-mode-panel,
.match-mode-sheet .match-mode-panel {
  width: min(100%, 720px);
}

.match-game-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.match-game-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.match-game-tools {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.match-game-status .match-chip,
.match-timer {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.86rem;
}

.match-game-tools .match-theme-btn,
.match-game-tools .match-audio-toggle {
  width: 40px;
  min-width: 40px;
  height: 40px;
}

.match-timer {
  min-width: 92px;
  margin-left: 0;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

@keyframes hub-fade-rise {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hub-soft-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes hub-glow-sweep {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

.match-hub-hero,
.match-hub-summary-strip,
.match-hub-grid {
  animation: hub-fade-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.match-hub-summary-strip {
  animation-delay: 0.06s;
}

.match-hub-grid {
  animation-delay: 0.1s;
}

.match-module-card {
  animation: hub-fade-rise 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

.match-hub-grid > .match-module-card:nth-child(1) {
  animation-delay: 0.12s;
}

.match-hub-grid > .match-module-card:nth-child(2) {
  animation-delay: 0.18s;
}

.match-hub-grid > .match-module-card:nth-child(3) {
  animation-delay: 0.24s;
}

.match-hub-grid > .match-module-card:nth-child(4) {
  animation-delay: 0.3s;
}

.match-module-card:hover {
  transform: translateY(-4px);
}

.match-module-icon {
  animation: hub-soft-float 3.2s ease-in-out infinite;
}

.match-hub-quick-btn,
.match-module-card .module-actions .btn {
  background-size: 200% auto;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-position 0.3s ease;
}

.match-hub-quick-btn:hover,
.match-module-card .module-actions .btn:hover {
  transform: translateY(-2px);
  background-position: right center;
  animation: hub-glow-sweep 2.8s linear infinite;
}

.match-mode-sheet {
  animation: hub-fade-rise 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.match-mode-panel {
  transform-origin: center bottom;
  animation: hub-fade-rise 0.3s cubic-bezier(0.2, 0.9, 0.24, 1) both;
}

@media (max-width: 640px) {
  .match-module-card {
    animation-duration: 0.38s;
  }

  .match-module-icon {
    animation-duration: 3.6s;
  }
}

@keyframes match-card-confirm {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.022);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes match-card-wobble {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.match-card,
.group-card,
.point-card {
  transition:
    transform 0.14s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.match-card.selected,
.group-card.selected,
.point-card.selected {
  transform: translateY(-1px) scale(1.012);
}

.match-card.matched,
.group-card.completed {
  animation: match-card-confirm 0.28s ease;
}

.match-card.mismatch,
.point-card.mismatch {
  animation: match-card-wobble 0.22s ease;
}

.match-resolved-panel {
  padding: 20px 22px 18px;
}

.match-resolved-head {
  align-items: start;
  gap: 16px;
}

.match-resolved-copy {
  display: grid;
  gap: 6px;
}

.match-resolved-title,
.match-resolved-text,
.match-resolved-note {
  margin: 0;
}

.match-resolved-text {
  max-width: 40rem;
  line-height: 1.58;
}

.match-resolved-note {
  font-size: 0.9rem;
  line-height: 1.48;
  opacity: 0.9;
}

.match-resolved-grade {
  min-width: 90px;
  text-align: center;
}

.match-resolved-stats {
  gap: 10px;
}

.match-resolved-stat {
  padding: 12px 14px;
}

.match-resolved-actions .btn {
  min-height: 44px;
}

@media (max-width: 640px) {
  .match-mode-panel-head {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-right: 72px;
    margin-bottom: 12px;
  }

  .match-mode-panel-head > div,
  .match-mode-panel-title-wrap {
    justify-items: center;
    text-align: center;
  }

  .match-mode-sheet-title {
    font-size: 1.26rem;
    line-height: 1.12;
  }

  .match-mode-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .match-mode-option {
    min-height: 74px;
    padding: 10px 11px;
  }

  .match-game-status {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-self: center;
  }

  .match-game-status .match-chip {
    max-width: 100%;
    justify-content: center;
  }

  .match-game-tools {
    grid-template-columns: 40px 40px auto;
    justify-self: end;
  }

  .match-resolved-panel {
    padding: 18px 16px 16px;
  }

  .match-resolved-head {
    gap: 12px;
  }

  .match-resolved-grade {
    min-width: 76px;
  }
}

@media (max-width: 380px) {
  .match-mode-sheet-title {
    font-size: 1.18rem;
  }

  .match-mode-option-title {
    font-size: 0.9rem;
  }

  .match-game-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    align-items: start;
  }

  .match-game-status {
    gap: 5px;
  }

  .match-game-status .match-chip,
  .match-timer {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .match-game-tools {
    grid-template-columns: 38px 38px auto;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .match-hub-hero,
  .match-hub-summary-strip,
  .match-hub-grid,
  .match-module-card,
  .match-module-icon,
  .match-mode-sheet,
  .match-mode-panel,
  .match-card,
  .group-card,
  .point-card,
  .feedback-strip {
    transition: none;
    animation: none;
  }
}

@media (max-width: 640px) {
  .match-hub-header {
    position: relative;
    display: block;
  }

  .match-hub-header-main {
    display: block;
    min-height: 48px;
    padding-right: 118px;
    margin-bottom: 14px;
  }

  .match-hub-toolbar {
    position: static;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 8px;
  }

  .match-duration-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .match-hub-toolbar .match-theme-btn {
    position: absolute;
    top: 6px;
    right: 54px;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    margin-left: 0;
  }

  .match-hub-toolbar .match-hub-audio-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    margin-left: 0;
  }

  .match-board-row,
  .match-board-classify-stack .match-board-row-head,
  .match-board-classify-columns {
    gap: 10px !important;
  }

  .match-board-cell-left {
    padding-right: 2px;
  }

  .match-board-cell-right {
    padding-left: 2px;
  }
}

@media (max-width: 640px) {
  .match-mode-panel-head {
    padding-left: 72px;
    padding-right: 72px;
  }

  .match-mode-panel-head > div,
  .match-mode-panel-title-wrap {
    width: 100%;
  }
}

.site-notice {
  margin: 8px 0 0;
  padding: 10px 14px 0;
  text-align: center;
  color: #8a6a52;
  font-size: 0.84rem;
  line-height: 1.6;
}

.site-notice p {
  margin: 0;
}

.site-notice p + p {
  margin-top: 2px;
}

[data-theme="dark"] .site-notice {
  color: #cbb7a1;
}

@media (max-width: 640px) {
  .site-notice {
    padding-top: 8px;
    font-size: 0.78rem;
    line-height: 1.55;
  }
}
