/* Karaoke Battle site. Colours come from the app: its dark surfaces, the
   lavender notes, the icon's violet and magenta, and the yellow of SSS. */
:root {
  --bg: #131317;
  --surface: #1d1c20;
  --surface-2: #2a292e;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3f1f8;
  --muted: #aaa6ba;
  --lav: #c8befa;
  --violet: #24103e;
  --magenta: #9e266c;
  --pink: #ff4fa3;
  --yellow: #f9d84a;
  --ink: #1a1030;
  --radius: 18px;
  --wrap: 1120px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* 日文與英文用各自的字型順序；英文標題字較長，縮小一級 */
:root:lang(ja) { --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif; }
:root:lang(en) { --font: system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: var(--lav); text-underline-offset: 3px; }
a:hover { color: #fff; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; background: rgba(255, 255, 255, 0.08); padding: 0.1em 0.4em; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: 0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 12px; }

/* 頂端列 */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 10px max(20px, (100% - var(--wrap)) / 2);
  background: rgba(19, 19, 23, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { border-radius: 9px; }
.wordmark { font-family: system-ui, -apple-system, "Segoe UI", Inter, sans-serif; font-weight: 900; font-style: italic; letter-spacing: 0.08em; font-size: 18px; white-space: nowrap; }
.wordmark .k { background: linear-gradient(90deg, #b48cff, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.08em; }
.nav { display: flex; gap: 22px; margin-left: auto; }
/* 頂端列放不下時，先收起星星，再收起選單 */
@media (max-width: 1180px) { .top { gap: 14px; } .nav { gap: 14px; } .top .star-top { display: none; } }
@media (max-width: 1080px) { .nav { display: none; } .top .lang { margin-left: auto; } }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 2px; }
.nav a:hover { color: #fff; }

/* 星星按鈕：數字由 main.js 從 GitHub API 讀取 */
.star {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 10px;
  color: #fff; font-weight: 700; font-size: 14px; line-height: 1; text-decoration: none; white-space: nowrap;
  padding: 7px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.star:hover { border-color: var(--yellow); background: rgba(249, 216, 74, 0.1); color: #fff; }
.star svg { color: var(--yellow); flex: none; }
.star-n { background: rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 3px 9px; font-variant-numeric: tabular-nums; }
.star-n[hidden] { display: none; }
.star-big { font-size: 17px; padding: 13px 22px; border-radius: 14px; gap: 10px; }
.star-big svg { width: 22px; height: 22px; }
.star-row { margin-top: 28px; }

/* 語言切換 */
.lang { display: flex; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 3px; }
.lang button {
  font: inherit; font-size: 14px; font-weight: 700; line-height: 1;
  color: var(--muted); background: none; border: 0; border-radius: 8px;
  padding: 7px 11px; cursor: pointer; white-space: nowrap;
}
.lang button:hover { color: #fff; }
.lang button[aria-pressed="true"] { background: var(--lav); color: var(--ink); }

/* 按鈕 */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--yellow); color: var(--ink);
  font-weight: 800; font-size: 19px; line-height: 1.25; text-decoration: none;
  padding: 14px 30px; border-radius: 14px; min-width: 220px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: #ffe573; color: var(--ink); transform: translateY(-2px); }
.btn small { font-weight: 600; font-size: 13px; opacity: 0.72; }
.btn-small { flex-direction: row; min-width: 0; font-size: 15px; padding: 8px 18px; border-radius: 10px; }
/* 下載按鈕：平台標誌加上各自的品牌色（Apple 白底黑標誌、Windows 藍） */
.btn-os { flex-direction: row; gap: 14px; padding: 13px 28px 13px 24px; color: #fff; }
.btn-os .btn-text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.btn-os small { opacity: 0.88; }
.os-logo { flex: none; width: 30px; height: 30px; fill: currentColor; }
.os-apple { margin-top: -4px; }
.btn-mac { background: #fff; color: #000; }
.btn-mac:hover { background: #e8e8ed; color: #000; }
.btn-win { background: #0078d4; }
.btn-win:hover { background: #006cbe; color: #fff; }

/* 主視覺：洋紅色塊，影片跨在色塊與深色之間 */
.hero { background: linear-gradient(to bottom, var(--magenta) 0, var(--magenta) calc(100% - 220px), var(--bg) calc(100% - 220px)); padding-top: 72px; }
.hero-text { text-align: left; padding-bottom: 48px; }
.eyebrow { font-weight: 800; color: #ffd9ec; font-size: clamp(14px, 4.4vw, 22px); margin-bottom: 14px; white-space: nowrap; }
:lang(en) .eyebrow { font-size: clamp(12px, 3.8vw, 22px); }
h1 { font-size: clamp(24px, 7.8vw, 104px); font-weight: 900; letter-spacing: 0.02em; }
:lang(en) h1 { font-size: clamp(36px, 6.4vw, 84px); letter-spacing: -0.02em; max-width: 14em; }
:lang(ja) h1 { font-size: clamp(24px, 7.4vw, 88px); letter-spacing: 0; }
:lang(en) body { line-height: 1.65; }
:lang(en) .section h2 { letter-spacing: -0.01em; }
.lead { font-size: clamp(17px, 1.6vw, 20px); max-width: 34em; margin-top: 24px; color: #ffeaf4; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.cta.center { justify-content: center; }
.fine { font-size: 14px; color: #f6cfe2; margin-top: 16px; }
.fine.center { text-align: center; color: var(--muted); }
.film { margin: 0; }
.film video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.film figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; text-align: center; }
.demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 40px; }
/* One card per take: the video on top, its result below. */
.demo { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); transition: border-color 0.3s, transform 0.3s; }
.demo:hover { border-color: rgba(249, 216, 74, 0.35); transform: translateY(-3px); }
.demo-video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.demo-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.demo-play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 0 0 0 5px; color: var(--ink); background: var(--yellow); cursor: pointer; box-shadow: 0 0 0 10px rgba(249, 216, 74, 0.18), 0 12px 34px rgba(0, 0, 0, 0.5); transition: transform 0.2s, box-shadow 0.2s; }
.demo-play[hidden] { display: none; }
.demo-play:hover { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(249, 216, 74, 0.16), 0 12px 34px rgba(0, 0, 0, 0.5); }
.demo-score { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.demo-song { display: flex; flex-direction: column; min-width: 0; }
.demo-song b { font-size: 17px; line-height: 1.35; overflow-wrap: break-word; }
.demo-song span { color: var(--muted); font-size: 14px; }
.demo-song em { white-space: nowrap; display: inline-block; font-style: normal; font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.tag-vb { color: #7fd8ff; background: rgba(127, 216, 255, 0.12); border: 1px solid rgba(127, 216, 255, 0.45); }
.tag-live { color: var(--pink); background: rgba(255, 79, 163, 0.12); border: 1px solid rgba(255, 79, 163, 0.45); }
.demo-total { display: flex; align-items: center; gap: 10px; margin: 0; flex: none; }
.demo-total b { font-size: 52px; font-weight: 900; line-height: 1; color: var(--yellow); font-variant-numeric: tabular-nums; text-shadow: 0 0 28px rgba(249, 216, 74, 0.35); }
.rank-sss { background: linear-gradient(135deg, #fff3a6, var(--yellow) 45%, #f2a93b); color: #111; font-weight: 900; font-size: 17px; letter-spacing: 0.04em; padding: 4px 11px; border-radius: 8px; box-shadow: 0 0 18px rgba(249, 216, 74, 0.45); }
/* The six sub-scores in the app's colours (app/lib/ui/widgets/score_colors.dart):
   pitch, rhythm, stability, vibrato, expression, long notes, in that order. */
.demo-bars li, .scores li { --c: var(--lav); }
.demo-bars li:nth-child(1), .scores li:nth-child(1) { --c: #bf5af2; }
.demo-bars li:nth-child(2), .scores li:nth-child(2) { --c: #ff4fa3; }
.demo-bars li:nth-child(3), .scores li:nth-child(3) { --c: #64d2ff; }
.demo-bars li:nth-child(4), .scores li:nth-child(4) { --c: #30d158; }
.demo-bars li:nth-child(5), .scores li:nth-child(5) { --c: #ff9f0a; }
.demo-bars li:nth-child(6), .scores li:nth-child(6) { --c: #f9d84a; }
.demo-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.demo-bars li { display: grid; grid-template-columns: 4.6em 1fr 2.4em; align-items: center; gap: 12px; font-size: 14px; }
:root:lang(en) .demo-bars li { grid-template-columns: 6.4em 1fr 2.4em; }
:root:lang(ja) .demo-bars li { grid-template-columns: 6.6em 1fr 2.4em; }
.demo-bars span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-bars em { font-style: normal; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.demo-bars i { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.demo-bars i::after { content: ""; display: block; width: var(--w, 0); height: 100%; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, transparent), var(--c)); transform-origin: 0 50%; }
/* A full 100 shows in gold; what lost points stays lavender so it stands out. */
.demo-bars li.full em { color: var(--c); }
.demo-bars li.na i { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px); }
.demo-bars li.na em { color: var(--muted); font-weight: 400; }
.demo-judge { margin-top: 20px; }
.demo-judge-title { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.demo-judge-title span + span { font-variant-numeric: tabular-nums; }
.judge-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; }
.judge-bar i { display: block; min-width: 4px; transform-origin: 0 50%; }
.judge-legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; font-variant-numeric: tabular-nums; }
.judge-legend li { display: flex; align-items: center; gap: 6px; color: var(--text); }
.judge-legend li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.judge-legend b { font-size: 11.5px; letter-spacing: 0.04em; }
.judge-legend li { color: var(--jc); }
.j-perfect { --jc: #ffd60a; }
.j-great { --jc: #ff4fa3; }
.j-good { --jc: #30d158; }
.j-miss { --jc: #8e8e93; }
.judge-bar i { background: var(--jc); }
.demo-ai { position: relative; margin-top: 20px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, rgba(158, 38, 108, 0.24), rgba(36, 16, 62, 0.55)); border: 1px solid rgba(200, 190, 250, 0.2); }
.demo-ai b { display: flex; align-items: center; gap: 6px; color: var(--lav); font-size: 13px; letter-spacing: 0.04em; }
.demo-ai svg { color: var(--yellow); }
.demo-ai p { margin: 8px 0 0; font-size: 15px; line-height: 1.75; color: #e6e1f2; }
/* main.js adds .anim, then .in on scroll: bars grow in turn, the judge bar fills, the comment fades in. */
.demo-score.anim .demo-bars i::after, .demo-score.anim .judge-bar i { transform: scaleX(0); }
.demo-score.anim .demo-ai { opacity: 0; transform: translateY(10px); }
.demo-score.anim.in .demo-bars i::after { transform: scaleX(1); transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.demo-score.anim.in .demo-bars li:nth-child(2) i::after { transition-delay: 0.1s; }
.demo-score.anim.in .demo-bars li:nth-child(3) i::after { transition-delay: 0.2s; }
.demo-score.anim.in .demo-bars li:nth-child(4) i::after { transition-delay: 0.3s; }
.demo-score.anim.in .demo-bars li:nth-child(5) i::after { transition-delay: 0.4s; }
.demo-score.anim.in .demo-bars li:nth-child(6) i::after { transition-delay: 0.5s; }
.demo-score.anim.in .judge-bar i { transform: scaleX(1); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.7s; }
.demo-score.anim.in .demo-ai { opacity: 1; transform: none; transition: opacity 0.7s ease 1.2s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.2s; }

/* Replay downloads under the demos */
.replay-dl { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px 30px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(158, 38, 108, 0.18), rgba(36, 16, 62, 0.6)); border: 1px solid rgba(200, 190, 250, 0.18); }
.replay-dl h3 { font-size: 22px; }
.replay-dl p { color: #d6d2e3; margin: 8px 0 0; font-size: 15.5px; }
.replay-steps { list-style: none; counter-reset: rs; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: 14.5px; color: var(--text); }
.replay-steps li { counter-increment: rs; display: flex; align-items: center; gap: 10px; }
.replay-steps li::before { content: counter(rs); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--magenta); color: #fff; font-size: 12.5px; font-weight: 800; display: grid; place-items: center; }
.replay-files { display: grid; gap: 12px; }
.replay-file { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color 0.2s, transform 0.2s, background 0.2s; }
.replay-file:hover { border-color: var(--yellow); background: #19181d; transform: translateY(-2px); }
.replay-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--yellow); background: rgba(249, 216, 74, 0.12); }
.replay-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.replay-meta b { font-size: 16px; }
.replay-meta span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.replay-dl-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--ink); }

/* "Your turn": the sample song, under the demos */
.challenge { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; border-radius: var(--radius); overflow: hidden; background: var(--bg); border: 1px solid rgba(249, 216, 74, 0.28); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.challenge { align-items: stretch !important; }
/* The cover, whole, over a blurred copy of itself that fills the column. */
.challenge-art { position: relative; display: flex; align-items: center; overflow: hidden; background: #1d1838; }
.challenge-art::before { content: ""; position: absolute; inset: -40px; background: url("assets/fantasy-island.jpg") center / cover; filter: blur(28px) brightness(0.7) saturate(1.2); }
.challenge-cover { position: relative; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.challenge-body { padding: 24px 28px; display: flex; flex-direction: column; justify-content: center; }
.challenge-eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; color: var(--yellow); }
.challenge h3 { font-size: clamp(24px, 2.6vw, 32px); margin-top: 6px; }
.challenge-body > p:not([class]) { color: #d6d2e3; margin: 10px 0 0; font-size: 15.5px; }
.challenge-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; margin: 14px 0 0; }
.challenge-meta div { min-width: 0; }
.challenge-meta dt { font-size: 12.5px; color: var(--muted); }
.challenge-meta dd { margin: 0; font-weight: 700; font-size: 15px; }
.challenge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.challenge-actions .btn { gap: 8px; flex: 1 1 100%; }
.challenge-actions .btn small { font-size: 12.5px; }
.ch-file { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.18); color: var(--text); font-size: 14.5px; font-weight: 700; text-decoration: none; }
.ch-file small { color: var(--muted); font-weight: 600; }
.ch-file:hover { border-color: var(--yellow); color: #fff; background: rgba(249, 216, 74, 0.08); }
.challenge-how { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.challenge-link { margin-top: 8px; font-size: 14px; font-weight: 700; width: fit-content; }
.challenge-link::after { content: " →"; }

/* 區塊 */
.section { padding: 96px 0; }
.section.alt { background: var(--surface); }
.section h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 900; }
.section-lead { color: var(--muted); margin-top: 14px; max-width: 40em; }

/* 三步驟 */
.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.steps li { display: flex; flex-direction: column; }
.steps .num { width: 48px; height: 48px; border-radius: 50%; background: var(--magenta); color: #fff; font-weight: 900; font-size: 22px; display: grid; place-items: center; margin-bottom: 16px; }
.steps h3 { font-size: 24px; }
.steps p { color: var(--muted); margin: 8px 0 18px; flex: 1; }

/* 循環播放的畫面 */
.loop { width: 100%; aspect-ratio: 960 / 582; object-fit: cover; background: #000; border-radius: 14px; border: 1px solid var(--line); }

/* 功能 */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; margin-top: 88px; }
.feature.flip .feature-text { order: 2; }
.feature-text .feature-note { font-size: 14px; color: var(--muted); }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.feature-actions .btn { gap: 8px; }
.feature-actions .btn small { font-size: 12.5px; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature h3 { font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 14px; }
.feature p + p { margin-top: 12px; }
.feature p { color: #d6d2e3; }
.feature.note { display: block; background: var(--surface-2); border-radius: var(--radius); padding: 32px 36px; }
.feature.note p { max-width: 46em; }

/* 評分 */
.scores { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 40px; }
.scores li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; padding: 14px 0; }
.scores b { font-size: 20px; }
.scores em { font-style: normal; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.scores i { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.scores i::after { content: ""; display: block; width: var(--w); height: 100%; border-radius: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, transparent), var(--c)); transform-origin: 0 50%; }
.scores b::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent); vertical-align: 2px; }
/* main.js adds .anim, then .in once the list scrolls into view: the bars grow to the right. */
.scores.anim i::after { transform: scaleX(0); }
.scores.anim.in i::after { transform: scaleX(1); transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.scores.anim.in li:nth-child(2) i::after { transition-delay: 0.08s; }
.scores.anim.in li:nth-child(3) i::after { transition-delay: 0.16s; }
.scores.anim.in li:nth-child(4) i::after { transition-delay: 0.24s; }
.scores.anim.in li:nth-child(5) i::after { transition-delay: 0.32s; }
.scores.anim.in li:nth-child(6) i::after { transition-delay: 0.4s; }
.scores span { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }
.sc-more { grid-column: 1 / -1; margin-top: 4px; font-size: 15px; }
.sc-more summary { cursor: pointer; color: var(--lav); width: fit-content; list-style: none; }
.sc-more summary::-webkit-details-marker { display: none; }
.sc-more summary:hover { text-decoration: underline; }
.sc-more h4 { margin: 12px 0 2px; font-size: 15px; color: #fff; }
.sc-more p { color: #d6d2e3; line-height: 1.7; }
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 56px; }
.points div { border-top: 3px solid var(--magenta); padding-top: 18px; }
.points h3 { font-size: 21px; margin-bottom: 8px; }
.points p { color: var(--muted); }
.more { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.more a { font-weight: 700; }
.more a::after { content: " →"; }

/* 技術 */
.tech { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; }
.tech li { padding: 20px 0; border-top: 1px solid var(--line); color: #d6d2e3; }
.tech b { display: block; color: #fff; font-size: 19px; margin-bottom: 2px; }

/* 下載 */
.download { background: var(--violet); text-align: center; }
.download img { margin: 0 auto 20px; border-radius: 22px; }
.download .section-lead { margin-inline: auto; }
.download .more { justify-content: center; }
.install { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 48px 0 0; text-align: left; }
.install div { background: rgba(255, 255, 255, 0.06); border-radius: 14px; padding: 20px 22px; }
.install dt { font-weight: 800; color: var(--lav); margin-bottom: 4px; }
.install dd { margin: 0; color: #e3def0; font-size: 15.5px; }

/* 致謝 */
.thx-sub { font-size: 22px; font-weight: 800; color: var(--lav); margin-top: 44px; }
.thx-sub + .section-lead { margin-top: 6px; }
.thx-people { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.thx-people li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; }
.thx-people h3 { font-size: 20px; color: #fff; }
.thx-who { display: flex; align-items: center; gap: 14px; }
.thx-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid rgba(255, 255, 255, 0.16); background: var(--line); }
.thx-issues { margin-top: 20px; font-size: 15.5px; }
.thx-initial { display: grid; place-items: center; font-size: 21px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--magenta), var(--lav)); }
.thx-people p { color: #d6d2e3; font-size: 15.5px; margin-top: 6px; flex: 1; }
.thx-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px !important; flex: none !important; }
.thx-links a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); color: var(--text); font-size: 14px; font-weight: 700; text-decoration: none; }
.thx-links a:hover { border-color: var(--lav); background: rgba(200, 190, 250, 0.1); color: #fff; }
.thx-libs { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.thx-libs a, .thx-libs div { display: flex; flex-direction: column; height: 100%; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.thx-libs a:hover { border-color: var(--lav); background: rgba(200, 190, 250, 0.08); }
.thx-libs b { font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; }
.lib-role { font-size: 12.5px; font-weight: 700; color: var(--lav); margin-bottom: 3px; }
.lib-by { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 版權聲明 */
.legal { background: var(--surface); }
.legal-list { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 40px; }
.legal-list li { border-left: 3px solid var(--magenta); padding: 4px 0 4px 18px; color: #d6d2e3; font-size: 16px; }
.legal-list b { display: block; color: #fff; font-size: 18px; margin-bottom: 4px; }

/* 頁尾 */
.foot { padding: 44px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 18px; }
.foot nav a { color: var(--text); font-size: 15px; }
.foot p + p { margin-top: 6px; }

/* 窄螢幕 */
@media (max-width: 860px) {
  .nav, .top .star-top { display: none; }
  .top { gap: 10px; }
  .top .lang { margin-left: auto; }
  .hero { padding-top: 48px; background: linear-gradient(to bottom, var(--magenta) 0, var(--magenta) calc(100% - 110px), var(--bg) calc(100% - 110px)); }
  .section { padding: 64px 0; }
  .steps, .points, .install, .scores, .tech, .legal-list, .thx-people, .demos, .replay-dl, .challenge { grid-template-columns: 1fr; }
  .thx-libs { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .thx-libs a, .thx-libs div { padding: 10px 12px; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 22px; margin-top: 56px; }
  .feature.flip .feature-text { order: 0; }
  .feature.note { padding: 24px 22px; }
  .btn { flex: 1 1 100%; }
  .btn-small { flex: 0 0 auto; }
}

/* 手機：頂端列放不下字標，只留圖示 */
@media (max-width: 520px) {
  .demo-score { padding: 18px 16px 20px; }
  .demo-head { flex-wrap: wrap; row-gap: 10px; }
  .demo-song { flex: 1 1 10em; }
  .demo-total b { font-size: 42px; }
  .demo-play { width: 64px; height: 64px; }
  .replay-dl { padding: 22px 18px; }
  .challenge-body { padding: 22px 18px 24px; }
  .wordmark { display: none; }
  .lang button { padding: 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .star { transition: none; }
}
