* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 0 15px; background: #eee url('background/ESBRASS.jpg'); color: #333; font: 14px/1.42857143 Arial, sans-serif; }
a { color: #337ab7; text-decoration: none; }
a:hover, a:focus-visible { color: #23527c; text-decoration: underline; }
button { font: inherit; padding: 5px; color: #333; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 2px solid #337ab7; outline-offset: 3px; }
.game-card { width: 100%; max-width: 400px; margin: 0 auto; overflow: hidden; background: white; border-radius: 20px; text-align: center; }
.game-card.long-rhythm { max-width: 1000px; }
header { position: relative; padding: 10px 10px 24px; }
.game-caption { color: grey; font-size: 12px; }
h1 { font-size: 18px; font-weight: 500; line-height: 1.1; margin: 2px 0 0; }
.task-number { position: absolute; right: 30px; bottom: 4px; }
.task-navigation { display: grid; grid-template-columns: 1fr 1fr; min-height: 20px; background: #ddd; }
.task-navigation a { font-size: 12px; padding: 2px 5px; }
#previous { grid-column: 1; }
#next { grid-column: 2; }
.task-navigation a[aria-disabled="true"] { color: #777; pointer-events: none; text-decoration: none; }
.notation { min-height: 200px; padding: 10px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.long-rhythm .notation { min-height: 140px; }
.notation-line { position: relative; width: 100%; max-width: 520px; margin: 0; }
.notation canvas { display: block; width: 100%; height: auto; }
.notation-playback { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.playback-cursor { position: absolute; left: 0; width: 100%; will-change: transform; opacity: .85; }
.playback-cursor::before { content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: #e11d2e; }
.notation-details { position: absolute; inset: 0; list-style: none; padding: 0; margin: 0; pointer-events: none; }
.notation-description { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.note-error { position: absolute; transform: translateX(-50%); color: #b42318; font: 11px/13px Arial, sans-serif; white-space: nowrap; }
.note-error-label, .note-error-label > span { display: block; }
.multibar .note-error { font-size: 10px; line-height: 12px; }
.analysis-note { margin: 0 14px 10px; color: #666; font-size: 11px; }
.listen-controls { padding: 0 10px 10px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
#listen, #generate { min-height: 30px; padding: 4px 10px; font-size: 12px; border: 1px solid #bbb; border-radius: 4px; background: #f5f5f5; }
#listen[aria-pressed="true"] { background: #e5e5e5; }
.play-controls { display: grid; grid-template-columns: 1fr 1fr; min-height: 100px; background: #ddd; align-items: center; }
.start-cell, .play-cell { padding: 10px; }
#tap { width: 95px; min-height: 70px; user-select: none; touch-action: none; }
#tap.hit { background: #bbb; }
.countdown { display: inline-block; font-size: 28px; line-height: 1; }
#results { line-height: 1.5; }
#score { display: block; font-size: 20px; }
.result-value { display: flex; align-items: center; justify-content: center; gap: 6px; }
#analysis-toggle { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; padding: 0; border: 1px solid #999; border-radius: 50%; background: #fff; font-size: 13px; }
#analysis-toggle[aria-expanded="true"] { color: #b42318; border-color: #b42318; }
.game-options { padding: 9px 12px; border-top: 1px solid #ccc; background: #f5f5f5; font-size: 12px; }
.sound-options { display: flex; justify-content: center; gap: 8px; }
.sound-options button { min-height: 32px; padding: 4px 9px; border: 1px solid #bbb; border-radius: 4px; background: #fff; font-size: 12px; }
.sound-state { margin-left: 3px; color: #337ab7; }
.sound-options button[aria-pressed="false"] { background: #eee; color: #777; }
.sound-options button[aria-pressed="false"] .sound-state { color: #777; }
.tempo-control { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tempo-control > span:last-child { min-width: 57px; text-align: right; white-space: nowrap; }
.tempo-control input { min-width: 0; flex: 1; margin: 0; accent-color: #337ab7; cursor: pointer; }
.tempo-control input:disabled { cursor: default; opacity: .5; }
.status { margin: 9px 12px 0; min-height: 32px; font-size: 12px; color: #666; }
.result-detail { margin: 4px 12px 0; font-size: 11px; color: #777; }
.retry-button { margin: 8px 0; }
footer { padding: 18px 10px 0; }
.copyright { margin: 24px 0 20px; color: #999; font: 10px 'Times New Roman', serif; }
@media (max-width: 420px) { .task-navigation a { font-size: 11px; } }
@media (orientation: landscape) and (max-height: 600px) {
  .long-rhythm { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: 'heading heading' 'nav nav' 'notes notes' 'analysis analysis' 'listen listen' 'play options' 'status status' 'detail detail' 'retry retry' 'footer footer'; }
  .long-rhythm > * { min-width: 0; }
  .long-rhythm header { grid-area: heading; padding: 2px 10px 12px; }
  .long-rhythm .game-caption { display: block; font-size: 9px; line-height: 10px; }
  .long-rhythm h1 { margin: 0; font-size: 16px; line-height: 18px; }
  .long-rhythm .task-navigation { grid-area: nav; }
  .long-rhythm .notation { grid-area: notes; min-height: 0; padding: 4px 10px; }
  .long-rhythm .analysis-note { grid-area: analysis; }
  .long-rhythm .listen-controls { grid-area: listen; padding-bottom: 4px; }
  .long-rhythm .play-controls { grid-area: play; min-height: 92px; }
  .long-rhythm .game-options { grid-area: options; display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; }
  .long-rhythm .status { grid-area: status; min-height: 0; margin-top: 4px; font-size: 11px; line-height: 14px; }
  .long-rhythm .result-detail { grid-area: detail; }
  .long-rhythm .retry-button { grid-area: retry; }
  .long-rhythm footer { grid-area: footer; padding-top: 6px; }
  .long-rhythm .copyright { margin: 4px 0 6px; }
}
