.cspg-high-low .cspg-mode-tools { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.cspg-high-low .cspg-mode-select { width: auto; flex: 0 0 auto; height: 42px; min-width: 118px; padding: 8px 28px 8px 12px; font-size: 14px; }
.cspg-high-low .cspg-leaderboard-toggle { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; min-height: 42px; padding: 0; }
.cspg-high-low .cspg-leaderboard-toggle svg, .cspg-high-low .cspg-dialog-close svg { width: 20px; height: 20px; }
.cspg-high-low .cspg-dialog-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0; }
.cspg-high-low .cspg-scoreboard { inset: 0; margin: auto; width: min(520px, calc(100% - 32px)); height: fit-content; max-height: calc(100% - 32px); padding: 28px; overflow: auto; }
.cspg-high-low dialog.cspg-scoreboard.has-leaderboard[open] { display: block; }
.cspg-high-low .cspg-scoreboard .cspg-leaderboard { max-width: none; max-height: none; padding: 0; border: 0; overflow: visible; }
.cspg-high-low .cspg-scoreboard .cspg-leaderboard h3 { padding-right: 32px; }
.cspg-high-low .cspg-scoreboard .cspg-rank-list { min-height: 0; align-content: start; }
.cspg-high-low .cspg-board-tabs { gap: 24px; }
.cspg-high-low .cspg-stat-timer { min-width: 128px; padding-right: 28px; }
.cspg-high-low .cspg-stat-timer > .cspg-label { display: block; }
.cspg-high-low .cspg-timer-reading { position: relative; display: inline-block; min-width: 2.5em; font-size: 38px; }
.cspg-high-low .cspg-time-bonus { position: absolute; left: calc(100% + 4px); top: 2px; color: var(--cspg-success, #69dca1); font-size: 16px; font-weight: 700; line-height: 1; opacity: 0; pointer-events: none; white-space: nowrap; }
.cspg-high-low .cspg-time-bonus.is-active { opacity: 1; }
.cspg-high-low .cspg-time-bonus.is-active:not([data-animated]) { animation: cspg-time-bonus 650ms ease-out both; }
.cspg-high-low[data-variant="timed"] .cspg-speed-toggle:disabled { opacity: 1; cursor: default; }
@keyframes cspg-time-bonus { 0% { opacity: 0; transform: translateY(5px); } 20% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-16px); } }
.cspg-high-low [data-run-timer] { font-variant-numeric: tabular-nums; font-size: 38px; }
.cspg-high-low [data-run-timer].is-low { color: var(--cspg-error, #ff766f); }
.cspg-high-low[data-variant="timed"] .cspg-stat:nth-child(2) .cspg-stat-value { color: var(--cspg-text, #f4f2ee); }
.cspg-high-low[data-variant="timed"] .cspg-stat-timer [data-run-timer].is-low { color: var(--cspg-error, #ff766f); }
.cspg-high-low[data-variant="timed"] .cspg-stat:nth-child(3) .cspg-stat-value { color: var(--cspg-accent, #ff9b2f); }
.cspg-high-low dialog.cspg-game-over.cspg-end-dialog { inset: 0; margin: auto; width: min(720px, calc(100% - 40px)); height: fit-content; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); padding: clamp(24px, 4vw, 40px); overflow-y: auto; overscroll-behavior: contain; }
.cspg-high-low dialog.cspg-end-dialog[open] { display: flex; align-items: stretch; justify-content: center; }
.cspg-high-low .cspg-end-screen { max-width: none; align-items: stretch; gap: 22px; text-align: left; }
.cspg-high-low .cspg-end-screen .cspg-game-over-title { margin: 0; text-align: center; font-size: clamp(38px, 5vw, 60px); line-height: 1; }
.cspg-high-low .cspg-end-screen .cspg-run-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; text-align: center; }
.cspg-high-low .cspg-end-screen .cspg-run-stats > div { padding: 2px 12px; }
.cspg-high-low .cspg-end-screen .cspg-run-stats dt { margin-bottom: 8px; font-size: 12px; }
.cspg-high-low .cspg-end-screen .cspg-run-stats dd { font-size: clamp(40px, 5vw, 58px); }
.cspg-high-low .cspg-end-screen .cspg-run-rank dd { color: var(--cspg-success, #69dca1); }
.cspg-high-low .cspg-run-rank small { display: block; min-height: 17px; margin-top: 5px; color: var(--cspg-muted, #a4a9b2); font-size: 12px; line-height: 1.3; }
.cspg-high-low .cspg-end-leaderboard { min-width: 0; padding-top: 18px; border-top: 1px solid var(--cspg-border, #41464c); }
.cspg-high-low .cspg-end-actions { display: flex; }
.cspg-high-low .cspg-end-screen .cspg-play-again { width: 100%; min-width: 0; padding: 13px 20px; font-size: 18px; }
.cspg-high-low .cspg-end-screen .cspg-play-again svg { width: 22px; height: 22px; }
.cspg-high-low .cspg-leaderboard { position: relative; min-width: 0; min-height: 0; width: 100%; max-width: none; overflow: visible; }
.cspg-high-low .cspg-leaderboard h3 { font-size: 28px; margin: 0 0 12px; }
.cspg-high-low .cspg-placement { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; }
.cspg-high-low .cspg-placement strong { color: var(--cspg-accent, #ff9b2f); font-size: 30px; }
.cspg-high-low .cspg-placement span { color: var(--cspg-success, #69dca1); font-size: 14px; }
.cspg-high-low .cspg-ranking-tabs { display: flex; gap: 14px; margin-bottom: 10px; }
.cspg-high-low .cspg-ranking-tabs button { background: none; color: var(--cspg-muted, #a4a9b2); border: 0; padding: 4px 0; font: inherit; font-size: 13px; cursor: pointer; }
.cspg-high-low .cspg-ranking-tabs button[aria-pressed="true"] { color: var(--cspg-text, #f4f2ee); border-bottom: 2px solid var(--cspg-accent, #ff9b2f); }
.cspg-high-low .cspg-ranking-tabs button:disabled { opacity: .4; cursor: default; }
.cspg-high-low .cspg-rank-list { display: grid; gap: 3px; list-style: none; margin: 0 0 12px; padding: 0; min-height: 160px; }
.cspg-high-low .cspg-rank-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr) 40px; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 5px; font-size: 14px; }
.cspg-high-low .cspg-rank-list li.is-you { background: #ff9b2f14; outline: 1px solid var(--cspg-accent, #ff9b2f); }
.cspg-high-low .cspg-rank-list li > span { color: var(--cspg-muted, #a4a9b2); }
.cspg-high-low .cspg-rank-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cspg-high-low .cspg-rank-list b { text-align: right; }
.cspg-high-low .cspg-end-screen .cspg-leaderboard h3 { font-size: 20px; margin: 0 0 12px; }
.cspg-high-low .cspg-end-screen .cspg-rank-list { min-height: 0; margin-bottom: 0; }
.cspg-high-low .cspg-end-screen .cspg-rank-list li { min-height: 34px; }
.cspg-high-low .cspg-own-rank { min-height: 0; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--cspg-border, #41464c); }
.cspg-high-low .cspg-end-screen .cspg-score-form { margin-top: 16px; }
.cspg-high-low .cspg-rank-list .cspg-rank-empty { display: block; color: var(--cspg-muted, #a4a9b2); }
.cspg-high-low .cspg-score-form { display: flex; gap: 8px; }
.cspg-high-low .cspg-score-form input { min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid var(--cspg-border, #41464c); border-radius: 6px; color: var(--cspg-text, #f4f2ee); background: var(--cspg-surface, #141719); font: inherit; font-size: 14px; }
.cspg-high-low .cspg-score-form .cspg-button { padding: 9px 12px; font-size: 14px; }
.cspg-high-low .cspg-end-screen .cspg-score-form .cspg-button { background: var(--cspg-surface, #141719); color: var(--cspg-text, #f4f2ee); border: 1px solid var(--cspg-border, #41464c); }
.cspg-high-low .cspg-end-screen .cspg-score-form .cspg-button:hover { border-color: var(--cspg-accent, #ff9b2f); }
.cspg-high-low .cspg-score-status { font-size: 12px; margin: 6px 0 0; color: var(--cspg-error, #ff766f); min-height: 16px; }
.cspg-high-low .cspg-score-status:empty { display: none; }
@media (max-width: 700px) {
  body:has(.cspg-high-low dialog.cspg-game-over[open]) { overflow: hidden; }
  .cspg-high-low dialog.cspg-game-over { inset: 0; width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; padding: calc(24px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left)); overflow-y: auto; overscroll-behavior: contain; }
  .cspg-high-low dialog.cspg-game-over[open] { animation-name: cspg-fullscreen-in; }
  .cspg-high-low .cspg-dialog-close { top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
  .cspg-high-low .cspg-mode-select { font-size: 12px; }
  .cspg-high-low .cspg-stat-timer { min-width: 0; padding: 0 10px; }
  .cspg-high-low [data-run-timer] { font-size: 26px; }
  .cspg-high-low .cspg-timer-reading { font-size: 26px; }
  .cspg-high-low[data-variant="timed"] .cspg-stat { padding: 0 12px; }
  .cspg-high-low[data-variant="timed"] .cspg-stat-timer { padding-right: 20px; }
  .cspg-high-low .cspg-time-bonus { font-size: 12px; top: 1px; }
  .cspg-high-low dialog.cspg-game-over.has-leaderboard[open] { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 20px; }
  .cspg-high-low dialog.cspg-game-over.cspg-end-dialog { inset: 0; width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; padding: calc(24px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left)); }
  .cspg-high-low dialog.cspg-game-over .cspg-game-over-content { flex-shrink: 0; margin: auto 0; }
  .cspg-high-low dialog.cspg-game-over .cspg-leaderboard { flex-shrink: 0; border: 0; padding: 0; max-height: none; overflow: visible; }
  .cspg-high-low dialog.cspg-game-over .cspg-rank-list { min-height: 0; align-content: start; }
  .cspg-high-low .cspg-end-screen { gap: 20px; }
  .cspg-high-low .cspg-end-screen .cspg-game-over-title { font-size: 40px; }
  .cspg-high-low .cspg-end-screen .cspg-run-stats dd { font-size: 40px; }
  .cspg-high-low .cspg-end-screen .cspg-run-stats .cspg-run-rank dd { font-size: clamp(24px, 7vw, 40px); letter-spacing: -.025em; }
  .cspg-high-low .cspg-end-screen .cspg-run-stats dt { font-size: 10px; margin-bottom: 6px; }
  .cspg-high-low .cspg-end-screen .cspg-run-stats > div { padding-inline: 6px; }
  .cspg-high-low .cspg-end-screen .cspg-play-again { padding: 13px 18px; font-size: 17px; }
  .cspg-high-low .cspg-leaderboard h3 { font-size: 22px; margin-bottom: 6px; }
  .cspg-high-low .cspg-placement { margin-bottom: 4px; }
  .cspg-high-low .cspg-placement strong { font-size: 24px; }
  .cspg-high-low .cspg-rank-list { min-height: 110px; margin-bottom: 8px; }
  .cspg-high-low .cspg-rank-list li { padding: 3px 6px; font-size: 12px; }
  .cspg-high-low .cspg-end-screen .cspg-rank-list li { min-height: 32px; font-size: 14px; }
}
@media (max-width: 700px) and (max-height: 650px) {
  .cspg-high-low dialog.cspg-game-over { padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .cspg-high-low dialog.cspg-game-over.cspg-end-dialog { padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .cspg-high-low dialog.cspg-game-over.has-leaderboard[open] { gap: 14px; }
  .cspg-high-low .cspg-end-screen { gap: 12px; }
  .cspg-high-low .cspg-end-screen .cspg-game-over-title { font-size: 32px; }
  .cspg-high-low .cspg-end-screen .cspg-run-stats dd { font-size: 32px; }
  .cspg-high-low .cspg-end-screen .cspg-end-leaderboard { padding-top: 12px; }
  .cspg-high-low .cspg-leaderboard h3 { font-size: 20px; }
}
@keyframes cspg-fullscreen-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cspg-high-low .cspg-time-bonus.is-active { animation: none !important; opacity: 1; } }
