:root {
  --ink: #5B3A1F;
  --ink-soft: #7D5838;
  --paper: #FFFBF2;
  --paper-warm: #FDF2DA;
  --sun: #FFD859;
  --sun-deep: #F5B841;
  --sky: #7BB4E3;
  --sky-soft: #E5F3FC;
  --meadow: #C8E29A;
  --meadow-deep: #7AA753;
  --terracotta: #E88B5A;
  --berry: #E4604F;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-crayon: 0 6px 0 #5B3A1F;
  --shadow-crayon-sm: 0 4px 0 #5B3A1F;
  --font-storybook: 'Zen Maru Gothic', 'Noto Sans TC', 'Yuanti TC', 'Microsoft JhengHei', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-storybook);
  color: var(--ink);
  background: var(--paper);
  user-select: none;
}

/* 繪本細膩紙紋覆蓋 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.25;
  background-image: radial-gradient(rgba(91, 58, 31, 0.08) 1px, transparent 0);
  background-size: 16px 16px;
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.screen.active {
  display: flex;
}

/* =========================================================
   按鈕與繪本卡片通用樣式
   ========================================================= */
.crayon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 800;
  color: var(--ink);
  background: var(--sun);
  border: 4px solid var(--ink);
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: var(--shadow-crayon);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.crayon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--ink);
  background: #FFE37D;
}

.crayon-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.crayon-btn.secondary {
  background: var(--paper);
}

.crayon-btn.secondary:hover {
  background: var(--paper-warm);
}

.crayon-btn.accent {
  background: var(--terracotta);
  color: #FFFDF8;
  text-shadow: 0 2px 0 rgba(91, 58, 31, 0.35);
}

.crayon-btn.accent:hover {
  background: #F09B6D;
}

.crayon-btn.lg {
  font-size: 1.38rem;
  padding: 15px 40px;
}

.crayon-btn.sm {
  font-size: 0.95rem;
  padding: 8px 16px;
  border-width: 3px;
  box-shadow: 0 3px 0 var(--ink);
}

.crayon-btn.sm:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.crayon-card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-crayon);
}

/* =========================================================
   1. 標題封面頁 (#screen-title)
   ========================================================= */
#screen-title {
  background: url('../assets/bg-meadow.jpg') center bottom / cover no-repeat;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 28px;
  overflow: hidden;
}

.title-top-bar {
  width: 100%;
  max-width: 1120px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.ep-pill {
  background: var(--paper);
  border: 3.5px solid var(--ink);
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow-crayon-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ep-pill img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.title-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
  margin-top: -8px;
}

.title-logo-box {
  background: var(--paper);
  border: 5px solid var(--ink);
  border-radius: 32px;
  padding: 16px 40px 14px;
  box-shadow: 0 10px 0 var(--ink);
  position: relative;
  transform: rotate(-1deg);
}

.title-logo-box::before {
  content: "🏁 EP01 繪本大獎賽 🏁";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--berry);
  color: #FFFDF8;
  border: 3.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--ink);
}

.game-title {
  margin: 4px 0 4px;
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--sun);
}

.game-subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  color: var(--ink-soft);
}

.title-parade {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 2vw, 24px);
  width: 100%;
  max-width: 960px;
  margin: 10px 0;
  z-index: 2;
}

.parade-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: gentleBounce 2.2s ease-in-out infinite;
}

.parade-char:nth-child(2) { animation-delay: 0.25s; }
.parade-char:nth-child(3) { animation-delay: 0.5s; }
.parade-char:nth-child(4) { animation-delay: 0.75s; }
.parade-char:nth-child(5) { animation-delay: 1s; }

.parade-char img {
  height: clamp(105px, 21vh, 195px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 0 rgba(91, 58, 31, 0.22));
}

.parade-char.featured img {
  height: clamp(120px, 24vh, 220px);
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  z-index: 2;
}

/* =========================================================
   2. 選角色與選賽道頁 (#screen-select)
   ========================================================= */
#screen-select {
  background: linear-gradient(180deg, #FFFBF2 0%, #F7F1DF 58%, #E1F0BD 100%);
  padding: 18px 20px 20px;
  overflow-y: auto;
}

.select-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.select-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 900;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
  font-weight: 900;
  margin: 0 0 10px;
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 16px;
  box-shadow: 0 3px 0 var(--ink);
}

/* 角色卡片網格 */
.char-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.char-card {
  position: relative;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 20px;
  padding: 12px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-crayon-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.char-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 0 var(--ink);
}

.char-card.selected {
  background: #FFF7D6;
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 0 0 4px var(--sun), 0 8px 0 var(--ink);
}

.char-card.selected::after {
  content: "✓ 已選";
  position: absolute;
  top: -12px;
  right: 10px;
  background: var(--berry);
  color: #FFFDF8;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.char-avatar-wrap {
  height: 118px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  margin-bottom: 8px;
  padding: 6px;
}

.char-avatar-wrap img {
  max-height: 108px;
  max-width: 100%;
  object-fit: contain;
}

.char-name {
  font-size: 1.08rem;
  font-weight: 900;
  margin: 0;
}

.char-kart-pill {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  margin: 4px 0 6px;
  color: var(--ink);
  background: var(--paper-warm);
}

.char-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.stat-row span {
  width: 30px;
  text-align: left;
  color: var(--ink-soft);
}

.stat-pips {
  flex: 1;
  display: flex;
  gap: 3px;
}

.stat-pip {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  border: 1.8px solid var(--ink);
  background: #EFE7D4;
}

.stat-pip.on {
  background: var(--sun-deep);
}

/* 角色台詞與賽道選擇區 */
.select-bottom-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.quote-banner {
  background: var(--paper);
  border: 3.5px solid var(--ink);
  border-radius: 18px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-crayon-sm);
}

.quote-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quote-left img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.quote-text {
  font-weight: 800;
  font-size: 1rem;
}

.quote-tag {
  background: var(--meadow);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.track-card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-crayon-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.track-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 var(--ink);
}

.track-card.selected {
  background: #FFF7D6;
  box-shadow: 0 0 0 4px var(--sun), 0 7px 0 var(--ink);
}

.track-preview {
  width: 112px;
  height: 82px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  flex-shrink: 0;
  background: var(--meadow);
}

.track-meta {
  flex: 1;
  min-width: 0;
}

.track-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.track-name {
  font-weight: 900;
  font-size: 1.02rem;
  margin: 0;
}

.track-diff {
  font-size: 0.74rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--sky-soft);
}

.track-desc {
  margin: 4px 0 6px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.3;
}

.track-record {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 4px;
}

/* =========================================================
   3. 比賽畫面 (#screen-race)
   ========================================================= */
#screen-race {
  background: #DFF0B9;
  position: fixed;
  inset: 0;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.race-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-pill {
  background: rgba(255, 251, 242, 0.95);
  border: 3.5px solid var(--ink);
  border-radius: 18px;
  padding: 7px 14px;
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.hud-pos-num {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--berry);
}

.hud-pos-sub {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.hud-label {
  font-size: 0.74rem;
  color: var(--ink-soft);
  display: block;
  line-height: 1.1;
}

.hud-val {
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* 道具槽 */
.hud-item-slot {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(255, 251, 242, 0.96);
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 7px 14px;
  min-width: 158px;
  box-shadow: 0 5px 0 var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.1s ease;
}

.hud-item-slot:active {
  transform: scale(0.96);
}

.hud-item-slot.has-item {
  background: #FFF6CC;
  animation: itemReadyPulse 1.1s ease-in-out infinite;
}

@keyframes itemReadyPulse {
  0%, 100% { box-shadow: 0 5px 0 var(--ink); }
  50% { box-shadow: 0 5px 0 var(--ink), 0 0 0 5px rgba(255, 216, 89, 0.75); }
}

.item-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: 3px solid var(--ink);
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  overflow: hidden;
  flex-shrink: 0;
}

.item-icon-box img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.item-text-box {
  text-align: left;
  line-height: 1.2;
}

.item-name-hud {
  font-size: 0.9rem;
  font-weight: 900;
}

.item-hint-hud {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.hud-controls-right {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 3.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

/* 底部速度與甩尾能量條 */
.hud-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.speed-panel {
  background: rgba(255, 251, 242, 0.94);
  border: 3.5px solid var(--ink);
  border-radius: 18px;
  padding: 8px 14px;
  box-shadow: 0 4px 0 var(--ink);
  min-width: 175px;
}

.speed-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}

.speed-num {
  font-size: 1.45rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.speed-unit {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.drift-bar-bg {
  width: 100%;
  height: 11px;
  background: #EFE6D1;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.drift-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7BB4E3, #FFD859, #F07A57);
  transition: width 0.05s linear;
}

.key-hint-bar {
  background: rgba(255, 251, 242, 0.88);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-soft);
}

/* 中央倒數與圈數大提示 */
.race-banner {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.race-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.race-banner-inner {
  background: var(--sun);
  border: 5px solid var(--ink);
  border-radius: 28px;
  padding: 14px 40px;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--ink);
  box-shadow: 0 10px 0 var(--ink);
  text-align: center;
  white-space: nowrap;
}

.race-banner-inner.go {
  background: var(--meadow);
}

.race-banner-inner.final {
  background: #FFE0D8;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

/* 手機觸控鍵 */
.touch-controls {
  display: none;
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 16px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 15;
}

.touch-controls.enabled {
  display: flex;
}

.touch-pad {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.touch-btn {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  border: 4px solid var(--ink);
  background: rgba(255, 251, 242, 0.9);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 5px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.touch-btn.drift {
  background: rgba(255, 216, 89, 0.94);
  font-size: 0.95rem;
  width: 78px;
}

.touch-btn.item {
  background: rgba(232, 139, 90, 0.94);
  color: #FFFDF8;
  font-size: 0.95rem;
  width: 78px;
}

.touch-btn.pressed {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

/* =========================================================
   4. 完賽頒獎台 (#screen-finish)
   ========================================================= */
#screen-finish {
  background: url('../assets/bg-meadow.jpg') center bottom / cover no-repeat;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.finish-card {
  width: 100%;
  max-width: 820px;
  background: rgba(255, 251, 242, 0.97);
  border: 5px solid var(--ink);
  border-radius: 30px;
  padding: 22px 26px;
  box-shadow: 0 10px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.finish-top {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.finish-winner-img {
  width: 155px;
  height: 155px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 0 rgba(91, 58, 31, 0.2));
  animation: gentleBounce 2s ease-in-out infinite;
}

.finish-headline {
  flex: 1;
  min-width: 220px;
}

.finish-medal-pill {
  display: inline-block;
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 900;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.finish-title {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 900;
}

.finish-quote {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink-soft);
  background: var(--paper-warm);
  border: 2.5px dashed var(--ink-soft);
  border-radius: 14px;
  padding: 8px 12px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: var(--paper);
  font-weight: 800;
}

.result-row.is-player {
  background: #FFF6CC;
  box-shadow: 0 3px 0 var(--ink);
}

.result-rank {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2.5px solid var(--ink);
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.result-row:nth-child(1) .result-rank { background: #FFD859; }
.result-row:nth-child(2) .result-rank { background: #E3ECF5; }
.result-row:nth-child(3) .result-rank { background: #F5C396; }

.result-head {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.result-name {
  flex: 1;
}

.result-kart {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.result-time {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.finish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* =========================================================
   原生存取彈窗 (<dialog>)
   ========================================================= */
dialog.crayon-dialog {
  border: 5px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  color: var(--ink);
  padding: 22px 24px;
  max-width: 540px;
  width: calc(100% - 32px);
  box-shadow: 0 10px 0 var(--ink);
  font-family: var(--font-storybook);
}

dialog.crayon-dialog::backdrop {
  background: rgba(91, 58, 31, 0.45);
  backdrop-filter: blur(3px);
}

.dialog-title {
  margin: 0 0 14px;
  font-size: 1.45rem;
  font-weight: 900;
  text-align: center;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.help-item {
  background: var(--paper-warm);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 700;
}

.help-item img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.help-controls-box {
  background: var(--sky-soft);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.6;
  margin-bottom: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================
   響應式調整 (平板 / 手機)
   ========================================================= */
@media (max-width: 960px) {
  .char-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .track-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .char-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .help-grid {
    grid-template-columns: 1fr;
  }
  .key-hint-bar {
    display: none;
  }
  .hud-item-slot {
    min-width: 120px;
    padding: 5px 10px;
  }
  .speed-panel {
    display: none;
  }
  .parade-char img {
    height: 92px;
  }
  .parade-char.featured img {
    height: 108px;
  }
}
