:root { color-scheme: dark; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
html { height: 100%; overflow: hidden; }
body { height: 100vh; height: 100dvh; width: 100%; overflow: hidden; flex-direction: column; align-items: center; color: #f4f6ff; background: #17244b; }
button, input { font: inherit; }
button { cursor: pointer; color: #f4f6ff; background: #2c4382; border: 1px solid #647cb3; border-radius: 10px; padding: 9px 12px; font-weight: 650; }
button:hover { background: #3a5598; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #f7d76c; outline-offset: 3px; }
.ranking-bar { box-sizing: border-box; width: 100%; max-width: 820px; flex: 0 0 auto; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ranking-brand { font-size: 15px; font-weight: 800; white-space: nowrap; }
.ranking-bar nav { display: flex; gap: 6px; }
.ranking-bar button { font-size: 13px; min-height: 40px; padding: 8px 10px; }
#game-stage { display: flex; align-items: center; justify-content: center; width: 100%; flex: 1 1 auto; min-height: 0; padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; overflow: hidden; }
#gameCanvas { display: block; flex: 0 0 auto; }
#ranking-dialog { width: min(560px, calc(100vw - 24px)); max-width: 560px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); box-sizing: border-box; border: 1px solid #5c72a6; border-radius: 20px; padding: 0; color: #f4f6ff; background: #1b2c58; box-shadow: 0 24px 90px #0008; overflow: auto; overscroll-behavior: contain; }
#ranking-dialog::backdrop { background: #040916bb; }
.ranking-sheet { padding: 20px; }
.ranking-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ranking-heading-row h1 { font-size: 24px; margin: 0; }
.ranking-heading-row button { font-size: 14px; }
.ranking-tabs { display: flex; gap: 6px; padding: 18px 0 8px; }
.ranking-tabs button { flex: 1; padding-inline: 5px; font-size: 14px; }
.ranking-tabs button[aria-pressed="true"] { background: #f7d76c; color: #1a2444; border-color: #f7d76c; }
.ranking-note { font-size: 12px; color: #b6c6ec; line-height: 1.5; }
.ranking-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ranking-meta button { font-size: 12px; padding: 7px 9px; flex: 0 0 auto; }
#ranking-summary { font-size: 13px; color: #c8d5f1; }
#my-ranking { background: #2d477b; border-radius: 10px; padding: 12px; font-size: 14px; }
.ranking-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; table-layout: fixed; }
.ranking-table th, .ranking-table td { border-bottom: 1px solid #ffffff15; padding: 12px 6px; text-align: left; overflow-wrap: anywhere; }
.ranking-table th { color: #b7c9ef; font-size: 12px; font-weight: 600; }
.ranking-table th:first-child { width: 48px; }
.ranking-table th:last-child { width: 95px; }
.ranking-table td:last-child, .ranking-table th:last-child { text-align: right; }
.ranking-table td { font-size: 14px; }
.ranking-table .is-you { background: #345287; }
#submit-panel { border-bottom: 1px solid #ffffff24; padding-bottom: 12px; margin-top: 18px; }
.result-caption { color: #c7d4f1; margin-bottom: 2px; font-size: 13px; }
.finished-score { font-weight: 800; font-size: 40px; color: #f7d76c; margin: 0 0 15px; font-variant-numeric: tabular-nums; }
#score-form label { display: block; font-size: 14px; margin-bottom: 7px; }
.submission-row { display: flex; gap: 8px; }
#player-name { min-width: 0; flex: 1; box-sizing: border-box; background: #101e41; color: white; border: 1px solid #7189bf; border-radius: 10px; padding: 11px; font-size: 16px; }
#submission-status { font-size: 13px; color: #9ee8ba; }
.is-error, #ranking-summary.is-error, #submission-status.is-error { color: #ffb4b4; }
@media (max-width: 360px) { .ranking-brand { display: none; } .ranking-bar { justify-content: flex-end; } .ranking-sheet { padding: 15px; } .ranking-table th:last-child { width: 78px; } }
