/* Stage cards, live score and recovery own layout; rhythm/domain owners stay unchanged. */
#lobby .total small,
#lobby .stage-label small,
#lobby .stage-meta,
#game #modeStatus,
#game .hud small,
#game .controls kbd,
#game #status,
#game .result-stats,
#game #judgements,
#game #newBest,
#game #campaignSummary { font-size: 14px; line-height: 1.35; }
#lobby .stage-label { align-items: baseline; }
#lobby .stage-label strong { font-size: 17px; line-height: 1.3; }
#lobby .stage-meta { gap: 8px; flex-wrap: wrap; }
#lobby .stage-card { transform: none; transition: border-color .12s; }
#lobby .stage-card:hover { transform: none; }
#lobby .stage-card:active { box-shadow: inset 0 2px 0 #24242325; }
#lobby .stage-card:focus-visible,
#game button:focus-visible { outline: 3px solid #356856; outline-offset: 3px; }
#game .game-heading { min-height: 44px; height: auto; }
#game .game-heading h2 { min-width: 0; font-size: 18px; line-height: 1.3; text-align: center; }
#game .game-heading button { flex: 0 0 auto; font-size: 14px; min-height: 44px; padding: 8px 12px; }
#game .hud { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; text-align: left; padding: 10px 14px; }
#game .hud b { display: block; font-size: 23px; line-height: 1.15; }
#game .combo-box b { min-width: 0; }
#game .theater { display: grid; isolation: isolate; }
#game #canvas { grid-area: 1 / 1; align-self: center; }
#game .overlay { grid-area: 1 / 1; position: relative; inset: auto; overflow: visible; min-width: 0; min-height: 230px; padding: 22px 16px; }
#game .overlay.result { gap: 10px; min-height: 0; }
#game .overlay .grade { font-size: 52px; }
#game .result-stats { gap: 10px 18px; }
#game #judgements { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
#game .result-buttons { flex-wrap: wrap; justify-content: center; margin-top: 10px; }
#game .result-buttons button { min-height: 44px; font-size: 16px; }
#game:has(.overlay:not([hidden])) .controls { display: none; }
#game #status:empty { display: none; }
#game .controls button { min-height: 64px; font-size: 16px; transform: none; transition: background-color .1s,box-shadow .1s; }
body.gg-portal-game #game .controls button.pressed { background: #eef3ef !important; color: #1f352c; box-shadow: inset 0 3px 0 #24242330; }
#game .controls button:active { transform: none; }
#game .controls b { font-size: 20px; }
#recordSection #recordForm label,
#recordSection #saveStatus,
#recordSection #recordStatus,
#settings { font-size: 14px; line-height: 1.4; }
#settings summary { min-height: 44px; display: flex; align-items: center; }
#settings input[type=range] { min-height: 44px; }
@media (max-width: 650px) {
  #lobby .title-row { align-items: start; flex-wrap: wrap; }
  #lobby .total { flex: 0 0 auto; }
  #lobby .stage-label { flex-wrap: wrap; }
  #lobby .stage-label strong { font-size: 16px; }
  #game .game-heading { gap: 8px; }
  #game .game-heading h2 { font-size: 16px; }
  #game .game-heading button { padding-inline: 9px; }
  #game .hud { gap: 8px; padding: 10px; }
  #game .hud b { font-size: 22px; }
  #game .theater:has(.result:not([hidden])) { min-height: 0; }
}
@media (max-height: 520px) and (min-width: 651px) {
  #game .hud { margin-top: 5px; padding: 5px 12px; }
  #game #canvas { max-height: max(136px,calc(100svh - 225px)); }
  #game .controls button { min-height: 48px; }
  #game #pausePanel { min-height: 168px; flex-direction: row; flex-wrap: wrap; gap: 16px; }
  #game #pausePanel > strong { flex-basis: 100%; text-align: center; }
  #game .theater:has(.result:not([hidden])) { min-height: 0; }
  #game .overlay.result {
    display: grid;
    grid-template-columns: 140px minmax(0,1fr);
    grid-template-areas: "title title" "grade stats" "grade judgements" "score buttons" "best best" "campaign campaign";
    align-content: center;
    justify-items: center;
    gap: 8px 16px;
    padding: 12px 20px;
  }
  #game #resultTitle { grid-area: title; }
  #game #grade { grid-area: grade; }
  #game #finalScore { grid-area: score; }
  #game #newBest { grid-area: best; }
  #game #campaignSummary { grid-area: campaign; }
  #game #newBest:empty,#game #campaignSummary:empty { display: none; }
  #game .result-stats { grid-area: stats; }
  #game #judgements { grid-area: judgements; }
  #game .result-buttons { grid-area: buttons; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #lobby .stage-card,#game .controls button { transition: none; }
  #game .combo-box.pop { animation: none; }
}
