/* Soft enamel pieces and a shallow ceramic board, lit from the upper left. */
:root{color-scheme:light;font-family:ui-rounded,'Hiragino Kaku Gothic ProN','Yu Gothic',system-ui,sans-serif;color:#334d43;background:#f3f4e9;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-height:100svh;background:radial-gradient(ellipse at 0 0,#fbf5e8,transparent 60%),#e5eee5;padding:10px max(10px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
.shell{width:min(100%,430px);margin:auto}header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px}.eyebrow{display:block;font-size:9px;letter-spacing:.08em;font-weight:800;color:#62536d}h1{font-size:clamp(22px,6vw,29px);letter-spacing:-.045em;line-height:1.1;margin:2px 0;color:#a5413d}h1 em{color:#86570b;font-style:normal}.settings{display:flex;gap:5px}.settings button{font-size:11px;min-width:47px;padding:8px 6px;color:#4d536c}
button{font:inherit;font-size:14px;font-weight:800;color:#4a4c65;background:linear-gradient(#fffdf8,#eef0e7);border:1px solid #b8c8b9;border-radius:11px;min-height:44px;cursor:pointer;touch-action:manipulation;box-shadow:0 2px 0 #b3c3b3,inset 0 1px #fffdf5}button:hover{filter:brightness(.99)}button:active{transform:translateY(1px);box-shadow:0 1px 0 #b3c3b3}button:disabled{opacity:.4;cursor:default}button:focus-visible,canvas:focus-visible,input:focus-visible{outline:3px solid #216eaa;outline-offset:2px}
canvas:focus-visible{outline-offset:-4px}
.companion{display:flex;align-items:center;gap:6px;min-height:25px;margin:0 2px 4px}.mascot{width:24px;height:25px;flex:none;background:url('mascot.png') no-repeat left center;background-size:200% 100%}.mascot.happy{background-position:right center;animation:small-hop .35s ease-out}.bubble{font-size:12px;line-height:1.4;color:#584c61;font-weight:700}.bubble small{display:none;color:#62536d}
.hud{display:grid;grid-template-columns:1fr 1.25fr .7fr;align-items:center;gap:6px;padding:6px 10px;background:#fffdf5;border:1px solid #c6d2c3;border-radius:13px;box-shadow:0 2px 0 #c1cfc0}.hud>div{display:flex;flex-direction:column}.hud span{font-size:10px;line-height:1.25;color:#62536d;font-weight:700}.hud strong{font-size:23px;font-weight:900;line-height:1.15;font-variant-numeric:tabular-nums}.hud strong span{font-size:11px}.chain-box{text-align:center}.hud .chain-box strong{color:#17676a}.timer{text-align:right}.timer strong{color:#8b4522}
.goal-line{display:flex;justify-content:space-between;align-items:baseline;gap:3px 8px;flex-wrap:wrap;margin:7px 2px 0}.goal-count{font-size:13px;font-weight:800;color:#50445f;margin:0}.goal-score{font-size:12px;white-space:nowrap}.stage-info b,.goal-score b{color:#754222}.goal-progress{height:4px;margin:5px 2px 3px;border-radius:8px;background:#cfdbce;overflow:hidden}.goal-progress>div{width:0;height:100%;background:#547364;transition:width .16s ease-out}.stage-info{font-size:12px;line-height:1.4;color:#625b73;margin:3px 2px 7px}
.play-area{width:min(100%,calc((100svh - 192px - env(safe-area-inset-bottom))*.75 + 8px));margin:auto}.arena-wrap{position:relative;width:100%;border:4px solid #b4c5b6;border-radius:21px;overflow:hidden;background:#e5eee5;box-shadow:inset 0 1px #fffdf5,0 3px 0 #839e8e,0 10px 25px #334d4317}canvas{width:100%;aspect-ratio:3/4;height:auto;display:block;touch-action:none;user-select:none;-webkit-user-select:none;scroll-margin-top:max(8px,env(safe-area-inset-top))}
.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#f5f4e8cc;backdrop-filter:blur(4px);padding:10px}.overlay[hidden],*[hidden]{display:none!important}.panel{width:100%;max-height:100%;overflow:auto;text-align:center;background:linear-gradient(155deg,#fffefd,#fff2e6);border:1px solid #fffdf5;border-radius:18px;padding:12px;box-shadow:0 3px 0 #b8c7b8,0 9px 24px #334d4321}.badge{display:inline-block;font-size:12px;font-weight:800;color:#754222;background:#ffdfae70;border-radius:8px;padding:5px 9px}h2{font-size:clamp(22px,6vw,29px);line-height:1.35;color:#974535;letter-spacing:-.02em;margin:10px 0 6px}.panel p{font-size:14px;line-height:1.65;color:#67617a;margin:8px 0 12px;white-space:pre-line}.panel button{display:block;width:100%;min-height:44px;margin-top:8px;font-size:14px}.primary{color:#6a471f;background:linear-gradient(#ffd869,#ffbc4d);border-color:#c5a44d;box-shadow:0 3px 0 #bd9842,inset 0 1px #fff2b5}.secondary{color:#396c74;background:#e5f2f0;border-color:#abc3b7}.panel small{display:block;font-size:12px;margin-top:10px;color:#62536d}.panel #panel-close{font-size:14px}
.overlay.clear .panel{border:2px solid #547364;animation:result-settle .24s ease-out}.overlay.clear h2{color:#974535}.overlay.clear .badge{color:#235b50;background:#d7f0df}.overlay.clear .badge::before{content:'✓ ';font-weight:900}.banner{position:absolute;top:10px;left:50%;transform:translateX(-50%);white-space:nowrap;padding:5px 11px;border-radius:9px;border:1px solid #94ac99;background:#fffdf5e6;color:#9b4933;font-size:16px;font-weight:900;pointer-events:none;box-shadow:0 2px 0 #94ac9933}#chain-flash{position:absolute;inset:2px;pointer-events:none;border-radius:15px}#chain-flash.pop{animation:chain-rim .34s ease-out}
#result-stats{display:flex;flex-wrap:wrap;justify-content:center;gap:9px 18px;margin:10px 0}#result-stats strong{display:block;font-size:29px;font-variant-numeric:tabular-nums;color:#8b4522}#result-stats span{font-size:12px;color:#665672}#result-stats .breakdown{flex-basis:100%;display:grid}.breakdown{grid-template-columns:1fr auto;gap:5px;padding:8px 10px;border-radius:10px;background:#f1eaf333;text-align:left;line-height:1.5}.breakdown strong{font-size:12px!important;color:#705268!important}.precision-note{grid-column:1/-1;color:#50445f!important}
.aim-control{display:grid;grid-template-columns:44px minmax(0,1fr) 44px 64px;gap:0 6px;align-items:center;margin:8px 0 0}.aim-control label{grid-column:1/4;color:#5c6075;font-size:13px;line-height:1.5}.aim-control input{grid-column:2;grid-row:2;width:100%;margin:0;min-height:44px;accent-color:#547364;touch-action:pan-y}.aim-control button{grid-row:2;min-width:44px;min-height:44px}.aim-control #aim-left{grid-column:1}.aim-control #aim-right{grid-column:3}.aim-control #fire{grid-column:4;grid-row:1/3;min-height:52px;background:linear-gradient(#ffd869,#ffbc4d);color:#6a471f;border-color:#c5a44d}
.instruction{display:flex;flex-wrap:wrap;gap:5px 7px;margin:5px 0 0}.instruction>span{flex:1 1 100%;font-size:14px;line-height:1.45;color:#5c6075;min-height:2.9em}.instruction button{flex:1;padding:7px 10px;color:#70637c}.stages{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;margin:13px 0}.stages button{min-width:0;font-size:13px;padding:8px 0;color:#635180;background:#e9e2f5}.stages button[aria-pressed="true"]{color:#153f48;background:#56c7bd;border-color:#547364;box-shadow:0 2px 0 #547364}
footer{display:flex;justify-content:space-between;gap:6px;border-top:1px solid #c6d2c3;padding-top:9px;font-size:12px;color:#62536d}footer b{color:#584b72}.daily-card{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:13px 0;padding:11px;background:linear-gradient(110deg,#ffedcd,#e5f5ed);border:1px solid #c6d2c3;border-radius:13px}.daily-card>div{flex:1}.daily-card strong{display:block;font-size:14px}.daily-card span,.daily-card small{display:block;font-size:12px;margin-top:3px;color:#62536d}.daily-card p{flex-basis:100%;font-size:12px;line-height:1.5;margin:0;color:#62536d}.daily-card button{font-size:12px;padding:7px 9px}.score-note,.keyboard{font-size:12px;line-height:1.5;color:#62536d;text-align:center;margin:8px 0}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@keyframes small-hop{50%{transform:translateY(-2px)}}@keyframes result-settle{from{transform:translateY(4px)}to{transform:translateY(0)}}@keyframes chain-rim{0%{box-shadow:inset 0 0 0 2px #54736438}100%{box-shadow:inset 0 0 0 0 #54736400}}
.reduced *,.reduced *::before,.reduced *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:350px){.settings{gap:4px}.settings button{min-width:45px;padding:7px 5px}.goal-count{font-size:12px}.goal-score{font-size:11px}.stages{gap:4px}.hud strong{font-size:21px}}
@media(orientation:landscape) and (max-height:500px) and (min-width:480px){body{padding-top:8px}.shell{width:100%;max-width:760px}.play-area{width:100%;display:grid;grid-template-columns:minmax(0,min(46%,calc((100svh - max(32px,env(safe-area-inset-top) + env(safe-area-inset-bottom) + 24px))*.75 + 8px))) minmax(0,1fr);gap:0 18px;align-items:start}.arena-wrap{grid-column:1;grid-row:1/3}.aim-control{grid-column:2;grid-row:1;margin:0;align-self:end}.instruction{grid-column:2;grid-row:2;margin-top:10px;align-self:start}.overlay{padding:6px}.panel{padding:8px}.panel h2{font-size:20px;margin:6px 0}.panel p{line-height:1.5;margin:6px 0}.panel button{margin-top:6px}.hud{max-width:430px}}

/* One short transition per state change; controls are immediately usable. */
.overlay:not([hidden]) .panel{animation:panel-arrive .18s ease-out}
.overlay.clear .panel{animation:result-settle .24s ease-out}
.mascot[data-mood="watch"]{transform:rotate(-6deg)}
.mascot[data-mood="celebrate"]{animation:celebrate .45s ease-out}
.mascot[data-mood="retry"]{animation:retry-nod .24s ease-out}
.mascot{transition:transform .14s ease-out}
@keyframes panel-arrive{from{opacity:.65;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@keyframes celebrate{25%{transform:translateY(-4px) rotate(-6deg)}65%{transform:translateY(-2px) rotate(4deg)}}
@keyframes retry-nod{50%{transform:rotate(5deg)}}
.reduced .mascot{transform:none!important}
@media(prefers-reduced-motion:reduce){.mascot{transform:none!important;transition:none!important}}

.result-total strong{display:block;color:#8b4522;font-size:32px;font-weight:900;font-variant-numeric:tabular-nums}.result-total span{font-size:12px;color:#665672}

.progress-summary{font-size:13px;font-weight:800;color:#334d43;margin:13px 0 0}.progress-legend,.save-status{font-size:12px;color:#62536d;line-height:1.5;margin:6px 0}.stages{margin-top:7px}.stages button{font-size:12px}

/* Keep the focused outcome below the viewport edge after its 3px entrance settles. */
#panel-title{scroll-margin-top:12px}

/* Aim information describes only the first impact; the player reads the next chain. */
.aim-readout{grid-column:1/-1;background:#fffdf5;border:1px solid #acbfb1;border-left:4px solid #397b69;border-radius:11px;padding:8px 10px;margin-bottom:7px;min-width:0}
.aim-readout>div{display:flex;justify-content:space-between;gap:6px;align-items:baseline;flex-wrap:wrap}
.aim-readout strong{font-size:13px;color:#24564b}.aim-readout output{font-size:14px;font-weight:850;font-variant-numeric:tabular-nums;color:#334d43}
.aim-readout span{font-size:11px;line-height:1.55;color:#526358}.aim-readout #aim-precision{font-weight:800;white-space:nowrap}
.aim-readout[data-kind="blocked"]{border-left-color:#a24d35}.aim-readout[data-kind="blocked"] strong{color:#8e412d}
.aim-control label{grid-row:2}.aim-control input,.aim-control button{grid-row:3}.aim-control #fire{grid-row:2/4}
.attempt-comparison{flex-basis:100%;font-size:12px!important;font-weight:750;color:#24564b!important;background:#e5f2ea;border-radius:8px;padding:7px 8px;margin:0!important}

/* Round 2: warm arcade cabinet, clearer hierarchy, and tactile controls. */
body{background:radial-gradient(ellipse at 10% 0,#fff1db 0,transparent 48%),radial-gradient(ellipse at 100% 65%,#daf1ec 0,transparent 60%),#edf3ed}
header{padding:4px 0 6px}.eyebrow{color:#526b63;font-size:8px;letter-spacing:.16em}h1{color:#a5483d;text-shadow:0 2px #fffaf0;font-weight:950}h1 em{color:#936311}
.hud{background:linear-gradient(115deg,#fffef8,#f7fbf2);border-color:#b3ccba;box-shadow:0 3px 0 #bccfbd,0 7px 16px #34594a0a;padding:8px 12px}
.hud strong{font-size:25px;letter-spacing:-.04em}.hud .chain-box strong{color:#196b63}.hud .chain-box{border-inline:1px solid #dde6d8}
.goal-progress{height:6px;background:#d5e3d6}.goal-progress>div{background:linear-gradient(90deg,#267c68,#6ab69c)}
.arena-wrap{border:4px solid #a4c5b2;box-shadow:inset 0 1px #fffdf5,0 4px 0 #719680,0 14px 30px #34594a1c}
.aim-control #fire{background:linear-gradient(#ffdf78,#ffc44c);border-color:#bd8b24;box-shadow:0 3px 0 #b78d35,inset 0 1px #fff0b0;letter-spacing:.06em}
.aim-control #fire:not(:disabled){color:#523b12}.stages button{background:#faf9f0;color:#4f635a;border-color:#b7c8b9}.stages button[aria-pressed="true"]{background:#cbece0;color:#174a3d}
.panel{border:1px solid #e8eddb;background:linear-gradient(145deg,#fffffa,#fff4df)}.overlay.clear .panel{border-color:#2f886f}.banner{color:#245e4b;border-color:#83b397;background:#fffdf3f5}
@media(max-width:350px){.hud strong{font-size:22px}.aim-readout{padding:7px 8px}.aim-readout strong{font-size:12px}}

.music-controls{display:grid;grid-template-columns:auto minmax(0,1fr) 88px;align-items:center;gap:9px;margin:0 0 7px;padding:3px 8px 3px 4px;background:#fffdf58c;border:1px solid #c1d3c2;border-radius:13px}
.music-controls button{min-width:76px;font-size:11px;padding:7px 9px}.music-controls button[aria-pressed="true"]{background:#d8efe3;color:#215a49;border-color:#7ba98f}.music-controls label{font-size:11px;color:#4d6559;font-weight:700}.music-controls label span{display:block;font-variant-numeric:tabular-nums}.music-controls input{min-width:0;width:100%;min-height:44px;margin:0;accent-color:#3b8068}
.play-area{width:min(100%,max(280px,calc((100svh - 248px - env(safe-area-inset-bottom))*.75 + 8px)))}
@media(orientation:landscape) and (max-height:500px) and (min-width:480px){.music-controls{max-width:430px}.play-area{width:100%}}

/* Round 3: accessible sound setup and quick back-to-last-angle comparison. */
.panel .panel-audio{width:auto;min-width:116px;margin:12px auto 0;color:#2e6251;background:#ecf5e9;border-color:#b4cbb5;font-size:12px}
.panel .panel-audio[aria-pressed="true"]{background:#d1ebdc;border-color:#7eac91}.panel #panel-audio-note{margin:4px 0 0;font-size:11px;color:#4f6759}
.aim-control .aim-restore{display:block;grid-row:auto;width:100%;min-height:44px;padding:6px 10px;margin-top:6px;font-size:12px;color:#345e50;background:#e9f3e9;border-color:#b8cebd;box-shadow:none}
.aim-readout>div{min-width:0}.aim-readout #aim-detail{flex:1 1 150px}
@media(max-width:350px){.music-controls{grid-template-columns:76px minmax(0,1fr) 82px;gap:7px}.settings button{font-size:10px}.panel p{font-size:13px}.panel h2{font-size:23px}}

/* Keep toggled settings and the selected stage distinct without relying on enamel color. */
button[aria-pressed="true"]{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.2em}
a:focus-visible{outline:3px solid #216eaa;outline-offset:3px;border-radius:3px}
.panel label[for="panel-music-volume"]{display:block;margin:10px 0 0;font-size:12px;line-height:1.5;color:#4f6759;font-weight:700}
.panel #panel-music-volume{display:block;width:100%;min-height:44px;margin:0;accent-color:#3b8068;touch-action:pan-y}
.panel #panel-music-volume-value{font-variant-numeric:tabular-nums}
@media(forced-colors:active){
  button{border:1px solid ButtonText;box-shadow:none}
  button[aria-pressed="true"]{border:3px double ButtonText}
  button:disabled{color:GrayText;border-color:GrayText;opacity:1}
  button:focus-visible,canvas:focus-visible,input:focus-visible,a:focus-visible{outline-color:Highlight}
  .overlay{background:Canvas;backdrop-filter:none}
  .panel,.hud,.aim-readout{border-color:CanvasText;box-shadow:none}
  .goal-progress{border:1px solid CanvasText}
  .goal-progress>div{background:Highlight}
}

/* iPhone feedback: portrait uses width independently of browser chrome height.
   Short screens scroll; the game retains its 3:4 coordinate space. */
body{padding-top:max(6px,env(safe-area-inset-top));padding-bottom:max(14px,env(safe-area-inset-bottom))}
header{margin-bottom:4px;padding:0;min-height:44px}.eyebrow{display:none}h1{font-size:24px;white-space:nowrap}
.quick-settings{display:flex;gap:6px}.quick-settings button{font-size:12px;padding:7px 10px;min-width:44px;min-height:44px}
.settings-drawer{margin:7px 0 10px;padding:10px;background:#fffdf5;border:1px solid #b7cbb9;border-radius:12px}
.settings-drawer .settings{flex-wrap:wrap;margin-bottom:8px}.settings-drawer .settings button{flex:1;min-height:44px}
.settings-drawer p{font-size:12px;line-height:1.6;margin:8px 0}.settings-drawer #settings-close{width:100%;min-height:44px}
.companion{display:none}.hud{padding:4px 9px;box-shadow:0 2px 0 #bccfbd}.hud strong{font-size:21px}.hud span{font-size:9px}
.goal-line{margin-top:5px}.goal-count{font-size:12px}.goal-score{font-size:11px}.goal-progress{height:4px;margin-top:4px}.stage-info{margin:3px 2px 5px;font-size:11px;line-height:1.35}
.play-area{width:100%}.arena-wrap{border-radius:17px}
.aim-control{margin-top:6px}.aim-readout{padding:5px 8px;margin-bottom:4px}.aim-readout strong{font-size:12px}.aim-readout output{font-size:13px}.aim-control label{font-size:12px}
.instruction>span{min-height:0;font-size:12px;line-height:1.5}.instruction button{min-height:44px}
.panel p{font-size:13px;line-height:1.55}.panel h2{font-size:25px}.panel #start-audio{margin-top:10px}.panel #start{margin-top:6px}
.panel #panel-audio-note{line-height:1.5}
@media(max-width:350px){h1{font-size:21px}.quick-settings{gap:4px}.quick-settings button{padding:7px 8px;font-size:11px}.hud strong{font-size:20px}}
@media(orientation:landscape) and (max-height:500px) and (min-width:480px){
  .play-area{width:100%;grid-template-columns:minmax(0,min(46%,calc((100svh - max(32px,env(safe-area-inset-top) + env(safe-area-inset-bottom) + 24px))*.75 + 8px))) minmax(0,1fr)}
  .aim-readout{padding:4px 7px}.aim-control label{font-size:11px}.instruction{margin-top:6px}.panel h2{font-size:20px}
}
.audio-notice{font-size:12px;line-height:1.5;color:#754222;background:#fff1d8;padding:6px 8px;border-radius:8px;margin:5px 0}
/* 2026-11 Phase 1: developer notes live in a collapsed settings section. */
.settings-drawer .keyboard{margin:6px 0 0;text-align:left}
.dev-info{margin:8px 0 0;border-top:1px solid #d8e2d6;font-size:12px;color:#4f6759}
.dev-info>summary{min-height:44px;display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:700;list-style:none}
.dev-info>summary::-webkit-details-marker{display:none}
.dev-info>summary::before{content:'▸'}.dev-info[open]>summary::before{content:'▾'}
.dev-info p{margin:4px 0;line-height:1.5;text-align:left}
/* 2026-11 Phase 1: compact result panel so the main actions fit inside the board on phones. */
.overlay[data-panel="result"] .badge{display:none}
.overlay[data-panel="result"] .panel h2{font-size:24px;line-height:1.25;margin:2px 0}
.overlay[data-panel="result"] #panel-copy{font-size:13px;line-height:1.45;margin:4px 0 6px}
.overlay[data-panel="result"] .result-total strong{font-size:28px;line-height:1.15}
.overlay[data-panel="result"] #result-stats{gap:4px 16px;margin:6px 0}
.overlay[data-panel="result"] #result-stats strong{font-size:22px;line-height:1.2}
.overlay[data-panel="result"] .attempt-comparison{padding:4px 8px}
.overlay[data-panel="result"] .breakdown{gap:2px 8px;padding:5px 8px;line-height:1.35}
.overlay[data-panel="result"] .precision-note{font-size:11px!important}

/* Keep the first two actions above the breakdown on narrow failed results. */
@media(max-width:350px){
  .overlay[data-panel="result"]:not(.clear) .panel{display:flex;flex-direction:column;padding-inline:8px}
  .overlay[data-panel="result"]:not(.clear) .panel > *{flex-shrink:0}
  .overlay[data-panel="result"]:not(.clear) #panel-copy{line-height:1.4}
  .overlay[data-panel="result"]:not(.clear) #result-stats{order:1}
  /* Practice fills the second slot when Share and Next Board are hidden. */
  .overlay[data-panel="result"]:not(.clear) :is(
    :is(#panel-share,#next-stage):not([hidden]) ~ #practice,
    #panel-retry, #panel-retry ~ *
  ){order:2}
}

/* 2026-11 daily share */
.share-status{display:block;margin:6px 0 0;font-size:12px;line-height:1.5;color:#24564b;white-space:pre-line;text-align:left;user-select:text;-webkit-user-select:text}
.daily-card #daily-share{min-height:44px}
