* { box-sizing: border-box; }
:root { color-scheme: dark; font-family: system-ui, sans-serif; background: #090f1d; color: #f4f8ff; }
body { --accent: #73eafd; --dim: #abbed3; --panel: #131f33; margin: 0; min-height: 100dvh;
  background: radial-gradient(ellipse at 48% 0%, #193951, transparent 58%); }
body.bowling { --accent: #ffc784; --panel: #221b33; background: radial-gradient(ellipse at 48% 0%, #4b2943, transparent 58%); }
main { max-width: 890px; margin: auto; padding: 20px clamp(12px, 4vw, 36px) 28px; }
.sumo main { max-width: 770px; }
nav { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .8rem; font-weight: 750; letter-spacing: .07em; }
nav a { color: var(--accent); }
nav span { color: var(--dim); text-align: right; }
header { padding-block: 13px 14px; }
h1 { margin: 0; font-size: clamp(2.1rem, 7vw, 4rem); letter-spacing: -.055em; line-height: 1.03; }
p { margin: 7px 0 0; color: var(--dim); line-height: 1.45; }
.panel { border: 1px solid #91b8df48; border-radius: 18px; background: var(--panel); overflow: hidden; box-shadow: 0 16px 55px #02061088; }
.hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; padding: 9px 12px; align-items: center; }
.hud span, .hud label { display: block; color: var(--dim); font-size: .74rem; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.hud strong { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.hud .blue strong { color: #76ecff; }
.hud .orange strong { color: #ffc387; }
progress { display: block; width: 100%; max-width: 132px; height: 7px; margin: 3px auto 0; accent-color: #76ecff; }
.orange progress { accent-color: #ffc387; }
canvas { display: block; width: 100%; aspect-ratio: 900 / 420; outline-offset: -3px; }
.sumo canvas { aspect-ratio: 680 / 550; }
#status { text-align: center; margin: 0; padding: 8px 10px; min-height: 39px; color: var(--accent); font-weight: 760; }
.actions, .touch { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.actions label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--dim); font-size: .83rem; font-weight: 700; }
button, select { font: inherit; font-weight: 750; min-height: 44px; border-radius: 9px; border: 1px solid #89b7dd68;
  background: var(--panel); color: #f2f7ff; padding: 8px 13px; }
button { cursor: pointer; }
button.primary { background: var(--accent); color: #071121; border-color: transparent; }
button:disabled { opacity: .52; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.touch { display: none; }
.touch button { touch-action: none; user-select: none; flex: 1 1 auto; min-width: 0; padding-inline: 7px; font-size: .9rem; }
.touch button:active { background: var(--accent); color: #101628; }
.how { text-align: center; font-size: .88rem; padding-top: 6px; }
.frames { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; list-style: none; margin: 0; padding: 8px; }
.frames li { min-width: 0; padding: 3px 0; text-align: center; background: #100d21; border: 1px solid transparent; border-radius: 6px; }
.frames .current { border-color: var(--accent); }
.frames span, .frames strong, .frames small { display: block; font-size: clamp(.64rem, 2.5vw, .88rem); }
.frames span, .frames small { color: var(--dim); }
.frames strong { color: var(--accent); letter-spacing: -.05em; }
@media (any-pointer: coarse), (max-width: 620px) { .touch { display: flex; } }
@media (max-width: 430px) { .frames { grid-template-columns: repeat(5, 1fr); } }
