:root { color-scheme: dark; --practice-bg:#0f1115; --practice-surface:#171a21; --practice-card:#1d212b; --practice-gold:#f6cd9b; --practice-gold-hover:#ffd9a8; --practice-muted:#b8b8b8; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; color: #fff; background: var(--practice-bg); font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
button, input { font: inherit; }
button { color: #fff; background: #12151b; border: 1px solid #343946; border-radius: 9px; cursor: pointer; }
button:hover:not(:disabled) { color: var(--practice-gold-hover); border-color: rgba(246,205,155,.62); }
button:disabled { cursor: not-allowed; opacity: .46; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 10000; padding: 8px 12px; color: #0f1115; background: var(--practice-gold); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.practice-test-page { width: min(1880px, 100%); min-height: 100vh; margin: 0 auto; padding: 18px; }
.practice-test-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.practice-test-title { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.practice-test-title > a { flex: 0 0 auto; margin-top: 4px; color: var(--practice-gold); text-decoration: none; }
.practice-test-title span { color: var(--practice-gold); font-size: .76rem; font-weight: 800; letter-spacing: .08em; }
.practice-test-title h1 { margin: 4px 0; font-size: clamp(1.45rem, 3vw, 2.35rem); line-height: 1.12; }
.practice-test-title p { margin: 0; color: var(--practice-muted); }
.practice-test-state { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 10px 13px; background: var(--practice-surface); border: 1px solid rgba(246,205,155,.22); border-radius: 999px; }
.practice-test-state-dot { width: 8px; height: 8px; background: var(--practice-gold); border-radius: 50%; box-shadow: 0 0 14px rgba(246,205,155,.45); }
.practice-test-state strong { font-size: .8rem; }
.practice-test-stage { position: relative; min-height: 240px; }
.practice-test-loading, .practice-test-error { display: grid; place-items: center; gap: 12px; min-height: 260px; padding: 28px; background: var(--practice-surface); border: 1px solid rgba(246,205,155,.22); border-radius: 14px; text-align: center; }
.practice-test-loading span { width: 34px; height: 34px; border: 3px solid rgba(246,205,155,.18); border-top-color: var(--practice-gold); border-radius: 50%; animation: practice-spin .8s linear infinite; }
.practice-test-error strong { color: #ffb4a9; font-size: 1.1rem; }
.practice-test-error p { margin: 0; color: var(--practice-muted); }
@keyframes practice-spin { to { transform: rotate(360deg); } }

[data-shared-player-mount] .hg-drummer-player { gap: 10px; }
[data-shared-player-mount] .hg-drummer-score-practice-stage { position: relative; aspect-ratio: 12 / 5; min-height: 0; overflow: hidden; background: #050608; border: 1px solid rgba(246,205,155,.48); border-radius: 12px; box-shadow: 0 0 20px rgba(246,205,155,.08); container-type: inline-size; }
[data-shared-player-mount] [data-practice-layer] { position: absolute; min-width: 5%; min-height: 5%; margin: 0; overflow: hidden; }
[data-shared-player-mount] .hg-drummer-score-background { background: #fff; border: 1px solid var(--practice-gold); border-radius: .48cqw; box-shadow: inset 0 0 0 max(1px,.12cqw) rgba(246,205,155,.7); }
[data-shared-player-mount] .hg-drummer-score-window.is-layout-score { display: block; gap: 0; padding: 0; background: transparent; }
[data-shared-player-mount] .hg-drummer-score-window.is-layout-score .hg-drummer-score-row { width: 100%; height: 100%; min-height: 0; padding: .2cqw .42cqw; background: transparent; border-radius: .45cqw; box-shadow: none; }
[data-shared-player-mount] .hg-drummer-score-window.is-layout-score .hg-drummer-score-content,
[data-shared-player-mount] .hg-drummer-score-window.is-layout-score .hg-drummer-annotated-notation { width: 100%; height: 100%; }
[data-shared-player-mount] .hg-drummer-score-window.is-layout-score svg { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
[data-shared-player-mount] .hg-drummer-score-window.is-layout-score .hg-drummer-score-cursor { top: .55cqw; bottom: .55cqw; width: max(1px,.12cqw); will-change: left; }
[data-shared-player-mount] .hg-drummer-practice-video-layer { background: #050608; border: 1px solid rgba(246,205,155,.58); border-radius: 9px; box-shadow: 0 10px 28px rgba(0,0,0,.3); }
[data-shared-player-mount] [data-hg-practice-video-slot], [data-shared-player-mount] [data-youtube-player], [data-shared-player-mount] iframe { display: block; width: 100%; height: 100%; border: 0; }
.practice-video-empty { display: grid; place-content: center; gap: 3px; width: 100%; height: 100%; padding: 12px; color: var(--practice-muted); text-align: center; }
.practice-video-empty strong { color: var(--practice-gold); }
.practice-youtube-controls { display: grid; grid-template-columns: minmax(240px,1fr) auto auto auto auto; align-items: center; gap: 10px 14px; padding: 12px; background: var(--practice-surface); border: 1px solid #303541; border-radius: 11px; }
.practice-youtube-controls > div:first-child { display: grid; gap: 3px; }
.practice-youtube-controls span { color: var(--practice-muted); font-size: .78rem; }
.practice-youtube-actions { display: flex; gap: 7px; }
.practice-youtube-actions button.is-active { color: #0f1115; background: var(--practice-gold); border-color: var(--practice-gold); font-weight: 800; }
.practice-youtube-controls button { min-height: 40px; padding: 8px 12px; }
.practice-youtube-controls button.is-primary { color: #0f1115; background: var(--practice-gold); border-color: var(--practice-gold); font-weight: 800; }
.practice-youtube-controls label { display: flex; align-items: center; gap: 7px; color: var(--practice-muted); white-space: nowrap; }
.practice-youtube-controls input { width: 108px; min-height: 40px; padding: 6px 8px; color: #fff; background: #0d1015; border: 1px solid rgba(246,205,155,.42); border-radius: 8px; font-variant-numeric: tabular-nums; }
.practice-youtube-controls output { min-width: 78px; color: var(--practice-gold); font-variant-numeric: tabular-nums; text-align: right; }
.practice-test-page.is-practice-fullscreen, .practice-test-page.is-fallback-fullscreen { width: 100%; max-width: none; min-height: 100vh; padding: 10px; overflow: auto; background: var(--practice-bg); }
.practice-test-page.is-practice-fullscreen .practice-test-head, .practice-test-page.is-fallback-fullscreen .practice-test-head { display: none; }
.practice-test-page.is-fallback-fullscreen { position: fixed; inset: 0; z-index: 99999; }
body.is-practice-fallback-fullscreen { overflow: hidden; }

@media (max-width: 860px) {
  .practice-test-page { padding: 10px; }
  .practice-test-head, .practice-test-title { flex-direction: column; }
  .practice-test-state { align-self: flex-start; }
  .practice-youtube-controls { grid-template-columns: 1fr; align-items: stretch; }
  .practice-youtube-actions { display: grid; grid-template-columns: repeat(2,1fr); }
  .practice-youtube-controls label { justify-content: space-between; }
  .practice-youtube-controls output { text-align: left; }
}

@media (max-width: 520px) {
  .practice-test-title h1 { font-size: 1.35rem; }
  .practice-youtube-actions { grid-template-columns: 1fr; }
  [data-shared-player-mount] .hg-drummer-player-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) { .practice-test-loading span { animation-duration: 1.8s; } }
