:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Noto Sans", sans-serif;
  font-synthesis: none;
  color: #252525;
  background: #fff;
  --blue: #E3F3FF;
  --blue-shadow: #CFEAFF;
  --pink: #FFE5F0;
  --pink-shadow: #FFD3E5;
  --duo: linear-gradient(115deg, var(--blue), var(--pink));
  --duo-shadow: -4px 5px 0 var(--blue-shadow), 4px 5px 0 var(--pink-shadow);
  --line: #e5e5e5;
  --muted: #707070;
  --panel: #fafafa;
  --shadow: 0 4px 18px rgb(0 0 0 / 4%);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button {
  color: inherit; cursor: pointer; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 18px; min-height: 44px; touch-action: manipulation;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
button:hover:enabled { border-color: #bcbcbc; background: #f7f7f7; }
button:active:enabled { background: #eee; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible { outline: 3px solid #888; outline-offset: 3px; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 20px; margin-bottom: 20px; }
h3 { font-size: 15px; font-weight: 500; margin-bottom: 14px; }
p { line-height: 1.5; }
#app { max-width: 920px; margin: auto; padding: 56px 24px 72px; }
.topline { text-align: center; margin-bottom: 38px; }
.topline h1 {
  max-width: 780px; margin: 0 auto; line-height: 1.2; letter-spacing: -.025em;
  font-size: clamp(27px, 4.5vw, 40px); text-wrap: balance;
}
.game-subtitle { margin: 22px auto 0; max-width: 720px; font-size: clamp(19px, 3vw, 24px); line-height: 1.45; font-weight: 500; text-wrap: balance; }
.difficulty-subtitle { display: block; margin-top: 9px; font-size: 22px; color: var(--muted); font-weight: 500; }
.introduction { max-width: 620px; margin: 20px auto 0; font-size: 15px; line-height: 1.7; color: var(--muted); text-wrap: pretty; }
.quiet { font-size: 13px; color: var(--muted); }
.mode-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
.mode-row { display: flex; align-items: stretch; width: 100%; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.mode-choice { flex: 1; border: 0; border-radius: 0; padding: 30px; font-size: 23px; font-weight: 500; min-width: 0; line-height: 1.5; text-align: center; text-wrap: balance; }
.video-source { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 208px; flex-shrink: 0; padding: 15px; color: var(--muted); text-decoration: none; font-size: 12px; border-left: 1px solid #eee; background: var(--panel); transition: background-color .15s; }
.video-source img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.video-source:hover { background: #f1f1f1; color: #252525; }
.video-source:focus-visible { outline: 3px solid #888; outline-offset: -3px; }
.difficulty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.large-option { min-height: 160px; padding: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font-size: 17px; border-radius: 18px; box-shadow: var(--shadow); }
.large-option strong { font-size: 42px; font-weight: 500; }
.primary { background: #252525; color: #fff; border-color: #252525; box-shadow: 0 2px 6px rgb(0 0 0 / 8%); }
.primary:hover:enabled { background: #444; border-color: #444; }
.primary:active:enabled { background: #151515; }
.actions, .player, .picker-heading { display: flex; align-items: center; gap: 16px; }
.actions { justify-content: flex-end; margin-top: 26px; }
.actions .back { margin-right: auto; }
.icon-button { font-size: 24px; line-height: 1; min-width: 48px; min-height: 48px; padding: 10px 14px; }
.question-number { text-align: center; color: var(--muted); font-size: 17px; font-weight: 500; letter-spacing: .06em; }
.player { flex-wrap: wrap; padding: 20px; margin-bottom: 26px; background: var(--panel); border: 1px solid #ededed; border-radius: 16px; }
.play { min-width: 144px; }
.volume { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 13px; color: var(--muted); }
.volume input { width: 125px; accent-color: #252525; min-height: 44px; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 26px; }
.slot { padding: 12px; min-width: 0; min-height: 112px; text-align: left; display: flex; align-items: center; gap: 10px; border-radius: 14px; }
.slot.active { border: 2px solid #555; padding: 11px; background: #f6f6f6; box-shadow: 0 2px 8px rgb(0 0 0 / 3%); }
.slot img { width: 60px; height: 60px; flex-shrink: 0; object-fit: cover; border-radius: 7px; }
.slot span { font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.slot.empty { justify-content: center; font-size: 24px; color: #929292; border-style: dashed; }
.slot.empty.active { border-style: solid; }
.picker { border: 1px solid #e9e9e9; border-radius: 18px; padding: 20px; background: var(--panel); }
.picker-heading { margin-bottom: 18px; }
.picker-heading h3 { margin: 0; }
.picker-heading .clear { margin-left: auto; font-size: 24px; }
.albums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.album { padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 12px; align-items: stretch; min-width: 0; }
.album img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.album span { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.songs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.song { display: flex; align-items: center; gap: 16px; padding: 14px; text-align: left; min-width: 0; min-height: 96px; }
.song img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.song .title { font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.song.picked { border-color: #999; background: #f0f0f0; box-shadow: inset 0 0 0 1px #999; }
.result { border-top: 1px solid #eee; padding-top: 26px; margin-top: 26px; }
.result-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.result-head h2 { margin: 0; }
.score { font-size: 26px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 24px; }
.answer-song { display: flex; gap: 12px; align-items: center; border: 2px solid; border-radius: 14px; padding: 12px; min-width: 0; }
.answer-song img { width: 46px; height: 46px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.answer-song .title { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.answer-song.good { border-color: #26834a; background: #f5fbf6; }
.answer-song.bad { border-color: #c64141; background: #fff7f7; }
.answer-song small { display: block; font-size: 11px; margin-top: 4px; color: #555; }
.summary { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.summary h2 { margin: 0; }
.summary-result { padding-top: 16px; margin-top: 16px; }
.summary-result .result-head { margin-bottom: 10px; }
.summary-result .answers { margin-bottom: 0; }
.error { padding: 12px 16px; border: 1px solid #c64141; border-radius: 12px; color: #943030; margin: 20px 0; font-size: 14px; }
dialog { max-width: min(400px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 18px; color: #252525; background: #fff; box-shadow: 0 16px 60px rgb(0 0 0 / 12%); }
dialog::backdrop { background: rgb(0 0 0 / 28%); }
dialog p { color: var(--muted); font-size: 14px; }
dialog .actions { margin-top: 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 650px) {
  #app { padding: 32px 16px 48px; }
  .topline { margin-bottom: 30px; }
  .introduction { font-size: 14px; margin-top: 16px; }
  .game-subtitle { margin-top: 18px; }
  .difficulty-subtitle { font-size: 20px; }
  .mode-choice { font-size: 18px; padding: 16px; }
  .video-source { width: 140px; padding: 10px; gap: 6px; }
  .mode-grid { gap: 14px; }
  .difficulty-grid { gap: 8px; }
  .large-option { font-size: 13px; padding: 16px 6px; min-height: 140px; border-radius: 14px; }
  .large-option strong { font-size: 28px; }
  .player { gap: 10px; padding: 14px; }
  .play { min-width: 100px; padding: 12px; }
  .volume { gap: 8px; }
  .volume input { width: 90px; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .slot { flex-direction: column; align-items: flex-start; padding: 8px; min-height: 110px; }
  .slot.active { padding: 7px; }
  .slot img { width: 52px; height: 52px; }
  .slot span { font-size: 15px; line-height: 1.5; }
  .slot.empty { align-items: center; }
  .picker { padding: 12px; }
  .picker-heading { gap: 10px; }
  .picker-heading h3 { font-size: 13px; }
  .albums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .songs, .answers { grid-template-columns: 1fr; }
  .song { padding: 12px; gap: 14px; min-height: 88px; }
  .song img { width: 60px; height: 60px; }
  .song .title { font-size: 16px; }
  .actions { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Shared pink-blue surfaces; controls use neutral colors. */
body {
  min-height: 100vh;
  background: repeating-linear-gradient(135deg, var(--blue) 0 96px, var(--pink) 96px 192px);
}
#app { background: rgb(255 255 255 / 72%); min-height: 100vh; }
.mode-row { background: #fff; box-shadow: var(--shadow); }
.mode-choice, .large-option, .slot, .album, .song, .icon-button {
  background: #fff;
  box-shadow: none;
}
.mode-choice:hover:enabled, .large-option:hover:enabled,
.slot:hover:enabled, .album:hover:enabled, .song:hover:enabled,
.icon-button:hover:enabled { background: #f7f7f7; box-shadow: none; }
.mode-choice:active:enabled, .large-option:active:enabled { background: #eee; box-shadow: none; }
.video-source { background: #fafafa; border-left-color: #eee; }
.video-source:hover { background: #f1f1f1; }
.player, .picker { background: var(--duo); }
.player { box-shadow: -2px 3px 0 var(--blue-shadow), 2px 3px 0 var(--pink-shadow); }
.primary { color: #fff; background: #252525; border-color: #252525; box-shadow: none; }
.primary:hover:enabled { color: #fff; background: #444; border-color: #444; box-shadow: none; }
.primary:active:enabled { background: #151515; box-shadow: none; }
.slot.active { background: #f6f6f6; border-color: #555; box-shadow: none; }
.song.picked { background: #f0f0f0; border-color: #999; box-shadow: inset 0 0 0 1px #999; }
dialog { box-shadow: 0 16px 60px rgb(0 0 0 / 12%); }
