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

:root {
  --bg: #1a0d0d;
  --bg2: #2a1414;
  --gold: #e8b84b;
  --gold-dim: #a3823a;
  --red: #b8352f;
  --cream: #f2e8dc;
  --green: #6fd08c;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  display: flex;
  justify-content: center;
}

.screen {
  display: none;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
.screen.active { display: flex; }
.screen > * { flex-shrink: 0; }

/* 首頁 */
.hero { text-align: center; padding: 48px 0 28px; }
.hero-badge {
  display: inline-block;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: 44px;
  letter-spacing: 8px;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(232, 184, 75, .25);
}
.tagline { margin-top: 14px; line-height: 1.7; color: var(--cream); opacity: .85; }

.song-list { display: flex; flex-direction: column; gap: 12px; }
.song-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid #4a2a22;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: transform .1s;
}
.song-card:active { transform: scale(.98); }
.song-cover {
  width: 64px; height: 64px;
  border-radius: 10px;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  overflow: hidden;
}
.song-cover img { width: 100%; height: 100%; object-fit: cover; }
.song-info h3 { color: var(--gold); font-size: 18px; margin-bottom: 4px; }
.song-info p { font-size: 13px; opacity: .7; line-height: 1.5; }

.home-foot { margin-top: auto; text-align: center; padding: 24px 0; font-size: 13px; opacity: .6; line-height: 2; }
.tsu { letter-spacing: 3px; color: var(--gold); }

/* 遊戲頁 */
.game-top { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.game-title { color: var(--gold); font-size: 17px; letter-spacing: 2px; }

#stage, #lg-stage {
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #120909;
  border: 1px solid #4a2a22;
}

.lyrics {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0 6px;
  font-size: 26px;
  letter-spacing: 2px;
  min-height: 56px;
}
.lyrics .ch { opacity: .45; transition: all .15s; }
.lyrics .ch.active { opacity: 1; color: var(--gold); transform: scale(1.2); }
.lyrics .ch.done { opacity: .8; }
.lyrics .sep { width: 100%; height: 0; }

.status { text-align: center; font-size: 14px; min-height: 22px; opacity: .8; padding: 4px 0; }

.lg-hint { text-align: center; font-size: 14px; opacity: .7; padding: 6px 0; }
#lg-stage { touch-action: manipulation; user-select: none; -webkit-user-select: none; }

.sync-row { display: flex; align-items: center; gap: 10px; font-size: 13px; opacity: .7; padding: 2px 4px; }
.sync-row input { flex: 1; accent-color: var(--gold); }
.sync-row span:last-child { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

.controls { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 24px; margin-top: auto; }
.btn {
  border: 1px solid var(--gold-dim);
  background: var(--bg2);
  color: var(--cream);
  font-size: 17px;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn-danger { background: #7a1f1a; border-color: #7a1f1a; color: #fff; }
.btn-ghost { background: none; border: none; color: var(--cream); opacity: .7; font-size: 16px; padding: 8px; cursor: pointer; font-family: inherit; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* 結果頁 */
.result-card { display: flex; flex-direction: column; text-align: center; padding-top: 40px; flex: 1; }
.result-score { font-size: 72px; font-weight: 700; color: var(--gold); }
.result-grade { font-size: 26px; letter-spacing: 4px; margin: 8px 0; }
.result-comment { font-size: 15px; opacity: .75; line-height: 1.8; margin-bottom: 18px; }
#result-video {
  width: 100%;
  max-height: 44dvh;
  border-radius: 14px;
  background: #000;
  margin-bottom: 8px;
}
.result-controls { padding-bottom: 12px; }
