:root{color-scheme:light;--paper:#f6f3e9;--ink:#201f2b;--blue:#2939c6;--line:#d9d4c8;--yellow:#fbd960;font-family:"Space Grotesk","Avenir Next",system-ui,sans-serif}
*{box-sizing:border-box}
body{margin:0;color:var(--ink);background:var(--paper)}
button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}
[hidden]{display:none!important}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.shell{width:min(1056px,calc(100% - 64px));margin:auto}
header{height:79px;border-bottom:1px solid var(--line)}
header .shell{height:100%;display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:9px;font-weight:950;letter-spacing:-.05em;white-space:nowrap}
.brand-name span{color:var(--blue)}
.mark{display:block;flex:none;width:36px;height:36px;object-fit:contain;transform:scale(1.24)}
.header-controls{display:flex;gap:8px}
.sound,.screen-button,.leaderboard-button,.account-entry{border:1px solid var(--line);background:transparent;padding:8px 12px;border-radius:6px;font:750 11px ui-monospace,monospace;letter-spacing:.04em;white-space:nowrap}
.leaderboard-button{display:inline-flex;align-items:center;gap:6px}
/* Lucide trophy icon (1.17.0), ISC License.
   Copyright (c) 2026 Lucide Icons and Contributors

   Permission to use, copy, modify, and/or distribute this software for any
   purpose with or without fee is hereby granted, provided that the above
   copyright notice and this permission notice appear in all copies.
   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
.leaderboard-icon{
  flex:none;width:16px;height:16px;background:currentColor;forced-color-adjust:none;
  mask:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978 M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978 M18 9h1.5a1 1 0 0 0 0-5H18 M4 22h16 M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z M6 9H4.5a1 1 0 0 1 0-5H6"/%3E%3C/svg%3E') center/contain no-repeat;
}
.sound,.screen-button{display:inline-flex;align-items:center;justify-content:center;inline-size:34px;min-block-size:34px;padding:0}
.sound-icon{position:relative;font-size:18px;line-height:1}
.sound[aria-pressed="false"] .sound-icon::after{content:"";position:absolute;top:50%;left:50%;width:17px;height:1.5px;background:currentColor;transform:translate(-50%,-50%) rotate(-45deg)}
.sound-retry-label{display:none}
.sound[data-audio-locked="true"]{inline-size:auto;gap:5px;padding-inline:8px}
.sound[data-audio-locked="true"] .sound-retry-label{display:inline}
.sound[aria-pressed="true"]{background:#a9ebbf;border-color:var(--ink);box-shadow:0 2px 0 var(--ink)}
.screen-button-icon{font-size:16px;line-height:11px}
.screen-button[aria-pressed="true"]:not(:focus-visible){border-color:var(--ink)}
.sound,.screen-button,.action{
  transition:transform 120ms ease-out;
  -webkit-tap-highlight-color:transparent;
}
.sound:active,.screen-button:active{transform:translateY(1px)}
.sound[aria-pressed="true"]:active{box-shadow:0 1px 0 var(--ink)}
main.shell{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:58px;align-items:center;padding-block:55px 58px}
body:not(.full-view) main.shell{width:min(1120px,calc(100% - 64px))}
.intro{padding-bottom:11px}
h1{font-size:clamp(62px,8.4vw,109px);font-weight:950;line-height:.81;letter-spacing:-.09em;margin:0 0 27px;text-transform:uppercase}
h1 span{display:block;color:var(--blue)}
.lead{font-size:18px;line-height:1.5;max-width:290px;margin:0;color:#484653}
.instruments{list-style:none;margin:30px 0 0;padding:20px 0 0;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(3,max-content);gap:8px 18px;width:max-content;max-width:100%}
.instruments li{display:flex;align-items:center;gap:6px;font:800 11px ui-monospace,monospace;text-transform:uppercase}
.creator-credit{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;width:fit-content;max-width:calc(100% - 3px);
  margin-top:22px;padding:8px 9px 9px 12px;background:#fffaf0;
  border:1px solid var(--ink);border-radius:10px;box-shadow:3px 3px 0 var(--ink);
}
.creator-byline{display:grid;gap:2px}
.creator-byline span{color:#56515c;font:750 .75rem/1.15 ui-monospace,monospace;letter-spacing:.07em;text-transform:uppercase}
.creator-byline strong{font-size:1rem;font-weight:850;line-height:1.2;letter-spacing:-.025em}
.creator-credit nav{display:flex;gap:8px}
.creator-credit a{
  display:grid;place-items:center;width:36px;height:36px;color:var(--ink);background:var(--yellow);
  border:1px solid var(--ink);border-radius:6px;box-shadow:0 2px 0 var(--ink);
}
.creator-credit .creator-linkedin{background:var(--blue);color:#fffaf0}
@media (hover:hover){.creator-credit a:hover{box-shadow:0 3px 0 var(--ink);transform:translateY(-1px)}}
.creator-credit a:active{box-shadow:none;transform:translateY(2px)}
.creator-credit a:focus-visible{outline:2px solid var(--blue);outline-offset:3px}
.creator-credit svg{width:18px;height:18px;fill:currentColor}
.chip{width:25px;height:25px;padding:3px;border:1px solid var(--ink);border-radius:5px}
.run-panel{display:grid;gap:16px;max-width:390px}
.cheer{
  display:flex;align-items:center;gap:16px;min-height:105px;padding:18px;
  border:1.5px solid var(--ink);border-radius:12px;background:var(--blue);color:#fff9e6;
  box-shadow:4px 4px 0 var(--ink);
}
.cheer strong{font-size:clamp(20px,3vw,36px);line-height:1.05;letter-spacing:-.055em}
.cheer-bars{display:flex;flex:none;align-items:center;gap:4px}
.cheer-bars i{width:5px;height:12px;border-radius:2px;background:currentColor}
.cheer-bars i:nth-child(2){height:27px}
.cheer-bars i:nth-child(3){height:19px}
.run-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.run-stats div{display:grid;gap:5px;padding:10px 12px;border:1px solid var(--line);border-radius:8px}
.run-stats dt{font:750 11px ui-monospace,monospace;letter-spacing:.06em;text-transform:uppercase}
.run-stats dd{margin:0;color:var(--blue);font:850 32px/1 ui-monospace,monospace;letter-spacing:-.07em}
.machine{min-width:0;padding:15px;background:#eae6da;border:1.5px solid var(--ink);border-radius:20px;box-shadow:5px 6px 0 var(--ink)}
.scoreboard,.loop{display:flex;align-items:center;justify-content:space-between}
.scoreboard{height:45px;padding:0 7px 12px}
.scoreboard div{display:flex;align-items:center;gap:9px}
.scoreboard>div:first-child{position:relative}
.score-bonus{position:absolute;left:calc(100% + 8px);color:#85390d;font:850 13px ui-monospace,monospace;pointer-events:none}
.label,.loop>span,.hint{font:750 11px ui-monospace,monospace;letter-spacing:.1em}
.scoreboard strong{font:850 23px ui-monospace,monospace;letter-spacing:-.09em}
.stage{position:relative;background:linear-gradient(#3548da,#2434af);border:1.5px solid var(--ink);border-radius:10px;overflow:hidden;aspect-ratio:510/360;touch-action:manipulation;cursor:pointer}
.rush-tint{position:absolute;inset:0;background:linear-gradient(#864726,#42261d);opacity:0;pointer-events:none}
.rush-status,.rush-ready{
  position:absolute;top:8px;left:50%;transform:translateX(-50%);margin:0;
  border:1px solid #ffcc8880;border-radius:8px;background:#351e15;color:#fff7ed;pointer-events:none;
}
.rush-status{width:min(232px,calc(100% - 24px));padding:5px 9px 6px;box-shadow:0 2px 0 #26130d}
.rush-status-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.rush-status strong{font-size:14px;line-height:1.2;font-weight:850}
.rush-countdown{min-width:3ch;text-align:right;font:850 15px/1.1 ui-monospace,monospace;color:#ffd58a}
.rush-meter{height:3px;margin-top:4px;border-radius:4px;background:#79513b;overflow:hidden}
.rush-meter span{display:block;width:100%;height:100%;transform-origin:left;background:#ffb56c}
.rush-status.ending .rush-meter span{background:#fff0ac}
.rush-ready{padding:4px 8px;white-space:nowrap;font:750 11px/1.3 ui-monospace,monospace}
@media(max-width:680px), (max-height:540px){
  .rush-status{top:5px;padding:3px 8px 4px}
  .rush-status strong{font-size:12px}
  .rush-countdown{font-size:13px}
  .rush-meter{height:2px;margin-top:3px}
}
canvas{display:block;width:100%;height:100%}
.stage>canvas{position:absolute;inset:0;pointer-events:none}
.stage>#arena-block{inset:auto;top:0;left:0;will-change:transform}
.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#17247ac9;text-align:center;color:#fff9e6;padding:16px}
.overlay:not([hidden]){animation:reveal-result 180ms ease-out both}
.overlay:not([hidden])>div{animation:lift-result 230ms cubic-bezier(.2,.72,.3,1) both}
@keyframes reveal-result{from{opacity:0}to{opacity:1}}
@keyframes lift-result{from{transform:translateY(8px)}to{transform:translateY(0)}}
.overlay strong{display:block;font-size:clamp(32px,5vw,52px);line-height:.95;letter-spacing:-.065em;margin:10px 0 12px}
.overlay p{margin:0;font-size:14px}
.loop{padding:13px 5px 12px;gap:14px}
.steps{display:grid;grid-template-columns:repeat(8,1fr);gap:5px;flex:1}
.step{
  height:11px;background:#d4cfc0;border:1px solid #c2bcac;border-radius:3px;
}
.step.filled{border-color:var(--ink)}
.step.current{filter:brightness(.72)}
@media(forced-colors:active){
  .step.current{filter:none;background-image:linear-gradient(Highlight,Highlight);forced-color-adjust:none}
}
.action{display:block;width:100%;border:1.5px solid var(--ink);border-radius:8px;background:var(--yellow);box-shadow:0 3px 0 var(--ink);padding:13px 8px;font-weight:900;font-size:17px}
.action:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink);background:#f3c749}
.stage,.action{-webkit-tap-highlight-color:transparent}
.hint{text-align:center;margin:13px 0 0;font-size:10px;color:#56515c}
@media (hover:hover){
  .sound[aria-pressed="false"]:hover:not(:focus-visible),.screen-button:hover:not(:focus-visible){background:#eae6da}
  .sound[aria-pressed="true"]:hover:not(:focus-visible){background:#bdf3d0}
  .action:hover:not(:active,:focus-visible){background:#ffe37c}
}
@media (prefers-reduced-motion:reduce){
  .sound,.screen-button,.action{transition:none}
  .sound:active,.screen-button:active,.action:active{transform:none}
  .overlay:not([hidden]),.overlay:not([hidden])>div{animation:none}
}
@media(max-width:900px){main.shell{gap:30px}}
@media(width > 680px){
  body:not(.full-view) main.shell{
    min-height:calc(100svh - 79px);
    padding-block:clamp(14px,3svh,32px);
    align-items:stretch;
  }
  body:not(.full-view) .intro{align-self:center}
  body:not(.full-view) .machine{display:grid;grid-template-rows:auto minmax(300px,1fr) auto auto auto}
  body:not(.full-view) .stage{aspect-ratio:auto}
}
@media(max-width:680px){.shell{width:calc(100% - 36px)}header{height:56px}main.shell{display:block;padding-block:24px 30px}.intro{padding:0 0 17px}h1{font-size:clamp(42px,11vw,68px);margin:0 0 9px;line-height:.95}h1 span{display:inline}.lead{font-size:15px;max-width:none}.instruments{margin:10px 0 0;padding:0;border:0;gap:6px 13px}.chip{width:20px;height:20px;padding:2px}.machine{padding:11px;border-radius:15px;box-shadow:4px 4px 0 var(--ink)}.scoreboard{height:37px;padding-bottom:8px}.stage{aspect-ratio:510/370}.action{min-height:47px}.hint{display:none}}
@media(max-width:680px){
  .creator-credit{margin-top:10px;padding-block:5px 6px}
  .run-panel{gap:8px;max-width:none}
  .cheer{min-height:46px;gap:11px;padding:8px 11px;border-radius:8px;box-shadow:2px 2px 0 var(--ink)}
  .run-stats{gap:8px}
  .run-stats div{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 9px}
  .run-stats dt{letter-spacing:0}
  .run-stats dd{font-size:20px}
  body:not(.full-view) main.shell{
    display:flex;flex-direction:column;align-items:stretch;gap:0;width:calc(100% - 24px);
    min-height:calc(100vh - 56px);min-height:calc(100svh - 56px);
    padding-block:12px 18px;
  }
  body:not(.full-view) .intro{padding-bottom:10px}
  body:not(.full-view) .machine{display:grid;flex:1;grid-template-rows:auto minmax(max(310px,48svh),1fr) auto auto}
  body:not(.full-view) .stage{aspect-ratio:auto}
}
@media(max-width:540px){
  header .shell{width:calc(100% - 24px)}
  .header-controls{gap:5px}
  .brand{gap:6px}
  .brand .mark{width:29px;height:29px}
  .leaderboard-button,.account-entry{padding-inline:8px}
  .leaderboard-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
}
@media(max-width:360px){
  header .brand-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
}

body.full-view{
  height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.full-view header{flex:none}
.full-view main.shell{display:flex;flex:1;align-items:stretch;min-height:0;margin:0 auto;padding:0 0 26px}
.full-view .intro{display:none}
.full-view .machine{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;flex:1;min-height:0}
.full-view .stage{aspect-ratio:auto;min-height:0}
@media(max-width:680px){
  .full-view main.shell{padding-bottom:15px}
}
@media(max-height:460px){
  .full-view header{height:56px}
  .full-view main.shell{padding-bottom:12px}
  .full-view .hint{display:none}
}
.leaderboard-dialog{width:min(420px,calc(100% - 32px));max-height:calc(100% - 32px);padding:0;border:1.5px solid var(--ink);border-radius:18px;background:var(--paper);color:var(--ink);box-shadow:5px 6px 0 var(--ink)}
.leaderboard-dialog::backdrop{background:#151838b3}
.leaderboard-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 19px 15px;background:var(--blue);color:#fff9e6}
.leaderboard-heading :is(h2,h3){margin:0;font-size:clamp(32px,8vw,42px);font-weight:950;line-height:1;letter-spacing:-.07em}
.leaderboard-close{width:44px;height:44px;flex:none;border:1px solid #fff9e680;border-radius:7px;background:transparent;font-size:24px;line-height:1}
.account-entry{color:var(--blue);border-color:var(--blue)}
.account-entry.account-avatar{display:grid;place-items:center;align-self:center;flex:none;width:36px;height:36px;padding:2px;border-radius:50%}
.account-avatar-placeholder,.account-avatar-photo{width:30px;height:30px;border-radius:50%}
.account-avatar-placeholder{position:relative;background:var(--blue)}
.account-avatar-placeholder>span{
  position:absolute;inset:5px 6px auto;height:15px;background:var(--yellow);
  clip-path:polygon(2px 0,calc(100% - 2px) 0,calc(100% - 2px) 2px,100% 2px,100% 100%,0 100%,0 2px,2px 2px);
}
.account-avatar-placeholder>span::before{
  content:"";position:absolute;left:4px;top:4px;width:2px;height:3px;background:var(--ink);box-shadow:8px 0 var(--ink);
}
.account-avatar-placeholder>span::after{
  content:"";position:absolute;left:6px;top:9px;width:6px;height:3px;background:var(--ink);border-radius:0 0 2px 2px;
}
.account-avatar-placeholder::after{
  content:"";position:absolute;left:8px;top:22px;width:6px;height:3px;background:#a9ebbf;box-shadow:8px 0 #e0d8ff;
}
.account-avatar-photo{object-fit:cover}
:root .account-entry.account-avatar:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.account-content{padding:16px 19px 19px}
.account-reason{margin:0 0 12px;font-size:14px;font-weight:800}
.account-content fieldset{display:grid;gap:12px;margin:0;padding:0;border:0;min-width:0}
.account-content label{display:grid;gap:4px;font-size:13px;font-weight:800}
.account-content input{width:100%;min-height:44px;padding:8px 10px;border:1px solid var(--line);border-radius:6px;background:#fffdf7;color:var(--ink);font:inherit;font-size:16px}
.account-primary,.account-option{width:100%;min-height:44px;padding:8px 10px;border:1px solid var(--ink);border-radius:7px;font-weight:800}
.account-primary{background:var(--yellow);box-shadow:0 2px 0 var(--ink)}
.account-option{background:#fffdf7}
.account-content button:disabled{opacity:.55;cursor:default}
.account-divider{display:flex;align-items:center;gap:10px;margin:13px 0;color:#5d5868;font-size:13px}
.account-divider::before,.account-divider::after{content:"";flex:1;border-top:1px solid var(--line)}
.account-links{display:flex;justify-content:space-between;flex-wrap:wrap;gap:4px 8px;margin-top:8px}
.account-links button{min-height:40px;padding:4px;background:transparent;border:0;border-radius:4px;color:var(--blue);font-size:13px;font-weight:800;text-decoration:underline}
#account-status{margin:12px 0 0;color:#5d5868;font-size:13px;line-height:1.4}
#account-status:empty{margin:0}
#account-email{margin:0 0 12px;font-weight:800;overflow-wrap:anywhere}
.leaderboard-content{padding:12px 16px}
.leaderboard-columns{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 8px 5px;color:#5d5868;font:750 10px ui-monospace,monospace;letter-spacing:.06em;text-transform:uppercase}
.leaderboard-list{list-style:none;margin:0;padding:0}
.leaderboard-row{display:grid;grid-template-columns:32px 1fr auto;gap:6px;align-items:center;min-height:40px;padding:0 8px;border-bottom:1px solid var(--line)}
.leaderboard-rank{color:#676273;font:750 12px ui-monospace,monospace}
.leaderboard-name{font-weight:750}
.leaderboard-score{font:850 18px ui-monospace,monospace}
.leaderboard-row.player{position:relative;z-index:1;margin:3px 0;border:1px solid var(--ink);border-radius:7px;background:#fff0a8;box-shadow:0 2px 0 var(--ink)}
.leaderboard-row.player .leaderboard-rank,.leaderboard-gain{color:var(--blue)}
.leaderboard-gain{margin-left:6px;font:800 11px ui-monospace,monospace}
.leaderboard-footer{padding:10px 19px 13px;border-top:1px solid var(--line)}
.leaderboard-footer p{margin:0;color:#5d5868;font-size:12px;line-height:1.4}
.leaderboard-footer .leaderboard-empty{margin-bottom:4px;color:var(--ink);font-weight:750}
.best-result{position:absolute;inset:0;overflow:auto;overscroll-behavior:contain;padding:9px 12px;background:var(--paper);cursor:default}
.best-result:has(> .best-board-signin:not([hidden])){display:grid;align-content:safe center;text-align:center}
.confetti{position:sticky;top:0;height:0;z-index:5;pointer-events:none}
.confetti-piece{
  position:absolute;top:-16px;left:var(--x);width:7px;height:11px;border-radius:2px;
  background:var(--color);opacity:0;animation:confetti-fall var(--duration) var(--delay) ease-in forwards;
}
@keyframes confetti-fall{
  0%{opacity:0;transform:translate3d(0,-12px,0) rotate(0deg)}
  12%{opacity:1}
  85%{opacity:1}
  100%{opacity:0;transform:translate3d(var(--drift),210px,0) rotate(var(--spin))}
}
@media (prefers-reduced-motion:reduce){.confetti-piece{display:none;animation:none}}
.best-result>h2{margin:0;color:var(--blue);font-size:clamp(22px,5vw,32px);font-weight:950;letter-spacing:-.065em;line-height:1}
.best-summary{margin:4px 0 8px;color:#55515e;font-size:13px;line-height:1.3}
.best-summary strong{color:var(--ink)}
.best-board-signin{justify-self:center;min-height:44px;margin-top:8px;padding:8px 12px;border:1px solid var(--blue);border-radius:6px;background:var(--paper);color:var(--blue);font-weight:800}
.best-board{border:1.5px solid var(--ink);border-radius:9px;background:var(--paper);box-shadow:0 2px 0 var(--ink);overflow:hidden}
.best-board .leaderboard-heading{padding:8px 12px}
.best-board .leaderboard-heading h3{font-size:22px}
.best-rank{font:800 11px ui-monospace,monospace;white-space:nowrap}
.best-board .leaderboard-content{padding:5px 7px 4px}
.best-board .leaderboard-columns{padding-bottom:0}
.best-board .leaderboard-row{min-height:28px;font-size:13px}
.best-board .leaderboard-score{font-size:14px}
.leaderboard-lights{position:relative;width:85px;height:6px;border-radius:2px;overflow:hidden;background:var(--line);mask:repeating-linear-gradient(to right,#000 0 8px,transparent 8px 11px)}
.leaderboard-lights-fill{position:absolute;inset:0;background:var(--blue);transform-origin:left}
.best-board .leaderboard-footer{padding:5px 12px}
@media(min-width:681px){
  .best-result{container-type:size;display:grid;align-content:safe center}
  /* Split the stage height left after the result heading and leaderboard chrome across six rows. */
  .best-board .leaderboard-row{min-height:clamp(28px,calc((100cqh - 162px) / 6),72px)}
}

:root :is(button,a,input,select):focus-visible{
  outline:none;background-color:var(--blue);color:#fff9e6;
}
:root #action:focus-visible,
:root :is(input,select,.leaderboard-close):focus-visible{background-color:var(--yellow);color:var(--ink)}
#action:focus-visible:not(:active){box-shadow:0 5px 0 var(--ink)}

@media(forced-colors:active){
  :root #action:focus-visible,
  :root :is(button,a,input,select,.leaderboard-close):focus-visible{
    forced-color-adjust:none;background-color:Highlight;color:HighlightText;border-color:Highlight;
  }
}
