/* planckpixel.dev/play — the CPR rhythm game. Canvas is 360x640 game pixels, scaled by whole device pixels when it can (game.js fit()). */
html, body.play { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.play { background: var(--ground); background-image: none; }

.stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; cursor: pointer;
}
#screen { display: block; image-rendering: pixelated; image-rendering: crisp-edges; background: var(--bg); }
body.play[data-state="run"] .stage, body.play[data-state="end"] .stage { cursor: none; }

/* title-screen links: only on the title screen, pinned to the bottom of the viewport */
.play-links {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  font-size: 12px; color: var(--muted); background: rgba(16, 17, 31, 0.86);
}
.play-links a { color: var(--cyan); }
body.play:not([data-state="title"]) .play-links { display: none; }

/* result + course overlays */
.result, .course {
  position: fixed; inset: 0; z-index: 3; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  background: rgba(16, 17, 31, 0.94);
}
.course { z-index: 4; display: grid; place-items: center; padding: 16px; }
.course[hidden] { display: none; }
.res-in { max-width: 440px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); text-align: center; }
.res-h { margin: 6px 0 4px; font-size: 22px; color: var(--gold); letter-spacing: 0.04em; text-transform: uppercase; }
.res-h.fail { color: var(--pink); }
.res-card { display: block; width: min(62vw, 260px); height: auto; aspect-ratio: 9 / 16; margin: 10px auto 4px; border: 2px solid var(--line2); image-rendering: pixelated; background: var(--bg); }
.res-hint { margin-bottom: 4px; }
.res-actions { justify-content: center; }
.res-stats { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; }
.res-stats li { background: var(--panel); border: 2px solid var(--line); padding: 8px 10px; font-size: 12px; color: var(--muted); }
.res-stats b { display: block; font-size: 17px; color: var(--text); font-weight: 600; }
.res-home { margin: 6px 0 18px; text-align: left; }
.result .notify { text-align: left; margin-bottom: 14px; }
.course-in { max-width: 420px; }
.course-in h2 { margin: 0 0 10px; font-size: 16px; color: var(--gold); }
.course-in p { font-size: 13px; margin: 0 0 10px; }
.nojs { position: fixed; inset: auto 16px 40% 16px; text-align: center; color: var(--text); }

/* leaderboard */
.board { margin: 18px 0 6px; text-align: left; background: var(--panel); border: 2px solid var(--line); padding: 14px 14px 10px; }
.board-h { margin: 0 0 10px; font-size: 15px; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }
.board-form label { display: block; font-size: 13px; margin-bottom: 6px; }
.board-form .nick { flex: 1; min-width: 0; font-size: 17px; }
.board #board-msg { margin: 6px 0 10px; }
.board #board-msg.err { color: var(--pink); opacity: 1; }
.board-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.board-tabs .mini { flex: 1; min-height: 36px; background: var(--bg); color: var(--muted); border: 2px solid var(--line2); font: 13px var(--mono); cursor: pointer; }
.board-tabs .mini.on { color: var(--text); border-color: var(--gold); }
.board-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.board-list li { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto 1.6em; gap: 8px; align-items: baseline; padding: 6px 4px; border-bottom: 2px solid var(--line); font-size: 14px; }
.board-list li.muted { display: block; border: 0; }
.board-list .rk { color: var(--muted); }
.board-list .nm { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .sc { text-align: right; font-variant-numeric: tabular-nums; }
.board-list .gr { color: var(--lime); text-align: right; }
.board-list li.me { background: #2a2a1c; outline: 2px solid var(--gold); outline-offset: -2px; }
.board-list li.me .nm { color: var(--gold); }
.board-rank { margin: 8px 0 0; font-size: 13px; color: var(--gold); }
