:root { color-scheme: dark; font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #fff; background: #0d1424; --background: #0d1424; --surface: #131a2a; --muted: #aeb4c0; --line: #ffffff1a; --accent: #61d9ff; --red: #ff5766; --green: #7aff99; --blue: #6bd6ff; --yellow: #fff25c; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); }
[hidden] { display: none !important; }
main { max-width: 720px; margin: auto; padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
button, input { font: inherit; }
button { min-height: 44px; border: 1px solid #61d9ffbf; border-radius: 16px; padding: 11px 18px; background: #61d9ff0f; color: var(--accent); font-weight: 650; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:hover:not(:disabled) { filter: brightness(1.1); }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.brand a { font-size: 32px; font-weight: 700; letter-spacing: -1px; text-decoration: none; }
.brand-dot { color: var(--accent); }
.intro { position: relative; padding: 4px 0 30px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 650; color: var(--accent); }
h1 { font-size: clamp(52px, 11vw, 80px); line-height: .97; letter-spacing: -4px; margin: 20px 0; font-weight: 740; }
h1 span { color: var(--accent); }
p { line-height: 1.6; color: var(--muted); }
.intro p:last-child { font-size: 16px; margin-bottom: 5px; }
h2 { font-size: 17px; letter-spacing: -.4px; margin: 0; }
.section-heading { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin: 18px 0 15px; }
.section-heading > span { font-size: 11px; color: var(--muted); }
.chart-list { display: grid; gap: 10px; }
.chart-card { display: flex; text-align: left; gap: 16px; align-items: center; width: 100%; min-height: 86px; color: #fff; background: #ffffff06; border: 1px solid var(--line); padding: 16px; }
.chart-card .chart-number { font-size: 24px; color: var(--accent); font-weight: 400; font-variant-numeric: tabular-nums; }
.chart-card .chart-info { min-width: 0; flex: 1; }
.chart-card strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.chart-card small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 6px; }
.chart-card .arrow { font-size: 20px; color: var(--accent); }
.community { margin-top: 28px; padding-top: 0; }
.section-heading h1 { font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: -.5px; margin: 0; }
.app-links { display: flex; flex-wrap: wrap; gap: 12px; }
.app-store-link { display: inline-flex; align-items: center; gap: 16px; min-height: 48px; padding: 12px 18px; border: 1px solid #61d9ffbf; border-radius: 16px; color: var(--accent); background: #61d9ff0f; font-size: 15px; font-weight: 650; text-decoration: none; }
.app-store-link:hover { background: #61d9ff1a; }
.community p { font-size: 14px; }
.secondary { background: #61d9ff0f; border-color: #61d9ff80; color: var(--accent); }
.small { font-size: 12px; color: var(--muted); }
.quiet { background: transparent; border-color: transparent; color: var(--accent); padding: 8px 0; font-size: 13px; }
.tools { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; font-size: 13px; color: var(--muted); }
summary { cursor: pointer; padding: 8px 0; min-height: 36px; }
footer { display: flex; gap: 15px; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 36px; padding-top: 22px; font-size: 11px; color: var(--muted); }
footer nav { display: flex; align-items: center; gap: 18px; }
footer { align-items: center; }
footer .social-links { gap: 4px; margin-left: -10px; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; }
.social-links svg { width: 18px; height: 18px; fill: currentColor; }
.social-links a:hover { color: var(--accent); background: #ffffff06; }

/* Active gameplay has one viewport budget. The board receives all remaining height. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body.in-game { background: var(--background); }
body.in-game .brand, body.in-game footer { display: none; }
body.in-game main { max-width: 540px; height: 100vh; height: 100dvh; padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
#game { height: 100%; display: flex; flex-direction: column; }
.game-toolbar { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; min-height: 44px; }
.game-toolbar .quiet { flex: 0 0 auto; min-width: 50px; font-size: 13px; padding: 8px 4px; }
#game h1 { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; line-height: 1.3; letter-spacing: -.25px; text-align: center; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard { display: flex; flex: 0 0 auto; justify-content: space-around; text-align: center; padding: 2px 0 7px; }
.scoreboard > div { flex: 1; }
.scoreboard span { display: block; font-size: 9px; letter-spacing: 1.5px; color: var(--muted); }
.scoreboard strong { display: block; font-size: 23px; font-variant-numeric: tabular-nums; line-height: 1.3; font-weight: 650; }
.video-host { flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; min-width: 200px; min-height: 200px; background: #000; }
.video-host iframe { display: block; width: 100%; height: 100%; border: 0; }
.board { position: relative; flex: 1 1 0; min-height: 160px; isolation: isolate; }
canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
/* Preserve the page-tap surface without showing pixels from a previous Canvas run. */
html[data-renderer="browser"] #canvas { opacity: 0; }
:is(.targets, .recording-targets) { position: absolute; left: 0; right: 0; height: var(--target-size, 76px); top: var(--target-top, calc(100% - 88px)); }
:is(.targets, .recording-targets) button { position: absolute; left: var(--target-left); top: 0; --lane-color: var(--red); width: var(--target-size, 76px); height: var(--target-size, 76px); min-height: 44px; padding: 0; border-radius: 50%; border: var(--target-ring, 7px) solid var(--lane-color); background: transparent; box-shadow: 0 0 11px color-mix(in srgb, var(--lane-color) 24%, transparent), inset 0 0 9px color-mix(in srgb, var(--lane-color) 10%, transparent); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
:is(.targets, .recording-targets) button:disabled { opacity: .6; }
:is(.targets, .recording-targets) button.pressed { background: color-mix(in srgb, var(--lane-color) 8%, transparent); }
.recording-targets button { --tap-flash: color-mix(in srgb, var(--lane-color) 35%, transparent); }
:is(.targets, .recording-targets) button.hit { background: color-mix(in srgb, var(--lane-color) 20%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--lane-color) 55%, transparent); }
:is(.targets, .recording-targets) button.miss { border-color: #ffad47; background: #ffad471f; box-shadow: 0 0 22px #ffad478c; }
/* Extend each target rim outward to preserve its opening on both boards. */
:is(.targets, .recording-targets) button::before {
  content: ""; position: absolute; pointer-events: none;
  inset: calc(0px - var(--target-ring, 7px) - var(--target-rim, 2px));
  /* Overlap the original stroke by 1px to avoid a hairline between the two circles. */
  border: calc(var(--target-rim, 2px) + 1px) solid currentColor; border-radius: inherit;
  color: var(--lane-color);
  box-shadow: 0 0 14px 1px color-mix(in srgb, currentColor 38%, transparent);
}
.targets button.miss::before { color: #ffad47; }
.hit-effects { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.note-hit-effect { position: absolute; width: 0; height: 0; }
.note-hit-ring { position: absolute; width: var(--note-size); height: var(--note-size); left: calc(var(--note-size) / -2); top: calc(var(--note-size) / -2); border: var(--note-stroke) solid var(--note-color); border-radius: 50%; background: color-mix(in srgb, var(--note-color) 24%, transparent); box-shadow: 0 0 var(--note-glow) var(--note-color), inset 0 0 var(--note-glow) var(--note-color); }
.judgment, #recording-status.is-recording { position: absolute; inset: auto 0 5px; margin: 0; text-align: center; font-size: 15px; line-height: 1.4; font-weight: 700; letter-spacing: 3px; pointer-events: none; text-shadow: 0 1px 5px #000; }
#recording-status.is-recording { color: var(--red); text-transform: uppercase; }
.held-panel { position: absolute; z-index: 2; top: 16px; left: 10px; right: 10px; padding: 12px 16px; background: #131a2afa; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 24px #0006; text-align: center; }
.held-panel p { font-size: 12px; margin: 0 0 4px; line-height: 1.4; }
.run-tools { display: flex; justify-content: center; gap: 24px; }
#restart-canvas { margin: 8px 0; }
.result h2 { margin: 4px 0 8px; }.result p { margin-bottom: 12px; }.result button { margin-bottom: 4px; }
dialog { max-width: min(430px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: #fff; } dialog::backdrop { background: #000b; } dialog p { font-size: 14px; } dialog form { display: inline-block; margin-left: 12px; }
#viewport-notice { display: none; }
@media (max-height: 490px) { body.in-game main { height: auto; min-height: 100dvh; } #game { min-height: 580px; } #viewport-notice { display: block; margin: 4px 8px; font-size: 12px; } .video-host { height: 200px; aspect-ratio: auto; } }
@media (min-width: 800px) { body:not(.in-game) main { padding-top: 36px; }.intro { padding-top: 20px; }.chart-card { min-height: 94px; } }
@media (max-width: 380px) { body:not(.in-game) main { padding-left: 12px; padding-right: 12px; }.section-heading > span { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { :is(.targets, .recording-targets) button.pressed, :is(.targets, .recording-targets) button.hit { box-shadow: none; } }


/* The candidate layer shares the board's coordinates; taps retain their original hit surface. */
.browser-notes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.ready-status { position: absolute; top: 10px; left: 12px; right: 12px; text-align: center; pointer-events: none; }
#load-catalog { margin-top: 16px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

#combo-multiplier { display: inline; letter-spacing: 0; }
.scoreboard strong { font-size: clamp(15px, 4.5vw, 23px); }
#share-url { display: block; width: 100%; margin-top: 6px; padding: 10px; color: inherit; background: var(--background); border: 1px solid var(--line); border-radius: 8px; }
#sequence-link-state { padding: 24px 0; }
#sequence-link-library { margin-left: 16px; }

/* The one-sequence creator shares the player's palette and target geometry. */
.creator-entry, .creator-take { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.creator-entry p, .creator-take p { font-size: 14px; margin: 8px 0 16px; overflow-wrap: anywhere; }
.creator-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#creator-confirm form { margin: 0; }
#creator-confirm-detail { overflow-wrap: anywhere; }
#creator-export { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
#creator-export:hover, #creator-export:focus-visible { text-decoration: underline; }
#creator h1 { font-size: 22px; line-height: 1.3; letter-spacing: -.5px; margin: 0; flex: 1; }
#creator-form { display: grid; gap: 10px; margin: 24px 0 16px; }
#creator-form label { margin-top: 6px; font-size: 14px; }
#creator-form input { width: 100%; min-width: 0; padding: 13px; font-size: 16px; color: #fff; background: var(--surface); border: 1px solid #ffffff40; border-radius: 10px; }
#creator-form button { justify-self: start; }
body.in-creator .brand, body.in-creator footer { display: none; }
body.in-creator main { max-width: 540px; height: 100vh; height: 100dvh; padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
body.in-creator #creator { height: 100%; display: flex; flex-direction: column; }
body.in-creator #creator h1 { font-size: 16px; }
#creator-recorder { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.recording-toolbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
#recording-count { flex: 1; font-size: clamp(20px, 5vw, 24px); font-weight: 650; font-variant-numeric: tabular-nums; }
.recording-toolbar button { padding: 9px 14px; font-size: 14px; }
#recording-storage { position: absolute; top: calc(var(--target-top) + var(--target-size) + 4px); left: 4px; right: 4px; margin: 0; text-align: center; line-height: 1.4; }
#recording-storage:empty { display: none; }
#local-playback-notice { margin: 0 0 5px; text-align: center; line-height: 1.4; }
@media (max-height: 490px) { body.in-creator main { height: auto; min-height: 100dvh; } body.in-creator #creator { min-height: 580px; } #creator-recorder { min-height: 530px; } }
