*{box-sizing:border-box}html,body{height:100%;margin:0;overflow:hidden;background:#080c11;color:#f4f6f7;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}body{position:relative;width:100%;max-width:480px;margin:auto;isolation:isolate}#view{position:absolute;inset:0;width:100%;height:100%;touch-action:none}#stage{position:absolute;inset:0;width:100%;height:100%;visibility:hidden;pointer-events:none}#camera{position:absolute;width:1px;height:1px;opacity:.001;pointer-events:none}#legacy-ui,#keepalive{display:none!important}button,input,select{-webkit-tap-highlight-color:transparent;font:inherit}button{cursor:pointer;color:inherit;border:1px solid #ffffff30;border-radius:12px;background:#15202bd9;padding:12px 14px;min-height:44px;font-size:12px;font-weight:600}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ffcf58;outline-offset:3px}button:disabled{opacity:.45;cursor:default}header{position:absolute;top:0;left:0;right:0;padding:calc(15px + env(safe-area-inset-top,0px)) 18px 35px;display:flex;justify-content:space-between;align-items:flex-start;gap:10px;background:linear-gradient(#0009,transparent);pointer-events:none;z-index:5}.wordmark{font-size:20px;font-weight:800;letter-spacing:-1px;line-height:.95;text-shadow:0 2px 12px #0008}.wordmark span{display:block;font-size:12px;font-weight:600;letter-spacing:0;color:#ffcf58;margin-top:5px}nav{display:flex;gap:7px;pointer-events:auto}nav button{padding:9px 11px;font-size:10px;min-height:36px;background:#111923a6;backdrop-filter:blur(16px);border-color:#ffffff26;border-radius:20px}#welcome{position:absolute;top:19%;left:26px;right:26px;z-index:4;max-width:360px}h1{font-size:45px;letter-spacing:-2.5px;line-height:1.02;margin:16px 0}#welcome>p{font-size:14px;color:#b6c3cd;line-height:1.7}.eyebrow{font-size:9px;letter-spacing:2px;font-weight:700;color:#ffcf58}.primary{background:#ffcf58;color:#16200b;border:0;width:100%;min-height:52px;font-size:12px;font-weight:750;box-shadow:0 5px 24px #0002}.text-button{border:0;background:none;width:100%;font-size:11px;margin-top:5px}.privacy{font-size:10px!important;line-height:1.6!important;text-align:center;color:#7f939f!important}footer{position:absolute;bottom:0;left:0;right:0;z-index:5;padding:28px 18px calc(13px + env(safe-area-inset-bottom,0px));background:linear-gradient(transparent,#080d16d9 18%,#080d16f5);pointer-events:auto}.material-row{display:flex;justify-content:space-between;align-items:center;gap:10px}.material-row label{font-size:10px;color:#9aaeba;display:flex;align-items:center;gap:10px}select{background:#15212ce0;color:#f0f5f8;border:1px solid #ffffff24;border-radius:9px;padding:9px 10px;font-size:12px;min-height:38px;max-width:140px}.material-row button{font-size:10px;padding:8px 10px;min-height:38px;border:0;background:#ffffff0b}.size-row{display:flex;align-items:center;gap:15px;margin:14px 0}.size-row>span{font-size:9px;color:#aebfc9;white-space:nowrap}.size-row output{color:#f0f5f8;margin-left:5px}input[type=range]{accent-color:#ffcf58;min-width:0;flex:1;width:100%;height:22px}.capture-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.record-button{background:#f6f7f4;color:#151b20;border:0;min-width:155px;border-radius:28px;min-height:49px;font-size:12px}.record-button.recording{background:#e74369;color:white}.mic-state{display:flex;align-items:center;flex-wrap:wrap;gap:7px;max-width:115px;font-size:9px;color:#aebfc9}#mic-dot{width:6px;height:6px;background:#657681;border-radius:50%}#mic-dot.on{background:#ffcf58}.meter{height:3px;width:90px;background:#ffffff18;overflow:hidden}.meter i{display:block;height:100%;width:0;background:#ffcf58}#record-status{font-size:9px;line-height:1.5;color:#92a5b2;margin:10px 0 0;min-height:14px}#move-hint{position:absolute;top:100px;left:0;right:0;text-align:center;color:#fff9;font-size:10px;pointer-events:none;text-shadow:0 1px 5px #000}#record-live{position:absolute;z-index:7;top:calc(71px + env(safe-area-inset-top,0px));left:18px;background:#c82e50;color:#fff;border:0;border-radius:20px;font-size:10px;min-height:34px}dialog{background:#101923;color:#f2f6f9;border:1px solid #4a5d6c;border-radius:20px;padding:28px 23px;width:calc(100% - 26px);max-width:430px;max-height:90svh;overflow-y:auto;touch-action:pan-y;box-shadow:0 20px 100px #0009}dialog::backdrop{background:#03080bb5;backdrop-filter:blur(9px)}dialog h2{font-size:25px;line-height:1.15;letter-spacing:-.8px;margin:18px 0}dialog p{font-size:12px;color:#a0b3bf;line-height:1.6}.small{font-size:10px!important}.dialog-close{position:absolute;right:8px;top:7px;border:0;background:none;font-size:24px;min-width:40px;padding:7px}.setting{font-size:12px;display:block;margin-top:24px}.setting output{float:right;color:#ffcf58}.setting input{display:block;margin-top:15px}.check{font-size:11px;display:flex;gap:9px;align-items:center;margin:19px 0;color:#c4d2dc}.check input{accent-color:#ffcf58}.two-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}#calibrate,#center-box,.support-link{width:100%;margin-top:7px}.support-link{color:#e1d298;border-color:#e1d29855;margin-top:18px}.support-amounts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:20px 0}.support-amounts button{font-size:26px;text-align:left}.support-amounts button[aria-pressed=true]{color:#e1d298;border-color:#e1d298}.support-amounts small{font-size:9px;display:block;font-weight:400;margin-top:10px}.support-perk{margin:20px 0}.supporter-mark{font-size:10px;color:#e1d298;letter-spacing:1px;border:1px solid #e1d29866;padding:8px;border-radius:5px}#record-preview{width:100%;max-height:46svh;border-radius:12px;background:#000}.result-actions{display:grid;gap:10px}.download-button{color:#d6e3ed;display:block;text-decoration:none;text-align:center;border:1px solid #ffffff30;border-radius:12px;padding:13px;font-size:12px}.secondary{border:0;background:none;font-size:10px}.has-camera header{background:linear-gradient(#0008,transparent)}[hidden]{display:none!important}@media(max-height:740px){#welcome{top:15%;left:22px;right:22px}h1{font-size:35px;margin:12px 0}#welcome>p{font-size:12px;margin:10px 0}.privacy{display:none}footer{padding-top:20px}.size-row{margin:7px 0}.record-button{min-height:44px}#record-status{font-size:8px}#move-hint{top:85px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
/* Camera-first arcade skin: clear view, punchy controls, feedback near the box. */
html,body{background:#060a15}.wordmark{font-style:italic;font-weight:950;text-transform:uppercase;letter-spacing:-.8px;text-shadow:2px 2px 0 #02050b}.wordmark span{font-style:normal;font-size:9px;letter-spacing:1.5px;color:#ffd76c}nav button{border-radius:6px;border-color:#5e7b914d;box-shadow:2px 3px 0 #0005;text-transform:uppercase;font-size:9px;letter-spacing:.4px}#welcome{top:17%}.eyebrow{color:#ffd76c;font-size:8px;letter-spacing:1.4px}#welcome>.eyebrow{display:inline-block;background:#ffd76c11;border-left:3px solid #ffd76c;padding:7px 10px}h1{font-family:Impact,'Arial Black',system-ui,sans-serif;font-style:italic;font-weight:950;font-size:clamp(34px,11.4vw,51px);line-height:1;letter-spacing:-.8px;margin:21px 0 16px;text-shadow:3px 4px 0 #050913}h1 span{color:#ffd76c}#welcome>p{font-size:13px;font-weight:500;color:#b8c8d8}.primary{border-radius:7px;transform:skewX(-4deg);background:linear-gradient(180deg,#dfffaa,#ffd76c 58%,#afe23e);box-shadow:0 4px 0 #577921,4px 8px 0 #0005;font-style:italic;font-weight:850;letter-spacing:.4px;font-size:11px}.primary:active{transform:skewX(-4deg) translateY(2px)}.text-button{font-size:10px;font-weight:800;letter-spacing:1px;margin-top:10px}.privacy{letter-spacing:.2px}footer{border-top:1px solid #ffffff09;background:linear-gradient(transparent,#0b1220ec 17%,#060a15fa)}.material-row label,.size-row>span{font-size:9px;font-weight:700;letter-spacing:.5px}.material-row select{font-weight:750;border-radius:6px;border-color:#5b7b9147;background:#172334}.material-row button{border:1px solid #60768b33;border-radius:6px;color:#d9e9f6;box-shadow:2px 3px 0 #0003;font-weight:800;font-style:italic;font-size:10px}.record-button{border-radius:7px;background:#f1f6fb;font-size:11px;letter-spacing:1px;box-shadow:0 4px 0 #647583,3px 7px 0 #0005;font-style:italic;font-weight:900}.record-button.recording{background:#ff426e;box-shadow:0 4px 0 #8c2043}.mic-state{font-weight:800;letter-spacing:.7px}#mic-dot.on{box-shadow:0 0 9px #ffd76c88}.meter i{background:#ffd76c}#move-hint{font-size:8px;font-weight:750;letter-spacing:1px;opacity:.7}dialog{border-radius:12px;background:linear-gradient(145deg,#1b2b40,#0e1725);border-color:#58748b77}dialog h2{font-weight:850;font-style:italic;letter-spacing:-.6px}dialog button,.download-button{border-radius:7px}.supporter-mark{color:#ffdb70}#record-live{border-radius:7px;font-weight:800;font-style:italic;font-size:9px}@media(max-height:740px){#welcome{top:14%}h1{font-size:34px;margin:14px 0 10px}#welcome>.eyebrow{font-size:7px;padding:5px 8px}#welcome>p{font-size:11px}.primary{min-height:46px;font-size:10px}.text-button{margin-top:4px}}
/* Title screen: original illustrated battle key art, separate from the camera UI. */
body.menu-open header,body.menu-open footer,body.menu-open #run-hud,body.menu-open #move-hint,body.menu-open #box-handle{visibility:hidden!important}body.menu-open #view{opacity:0}#welcome{position:absolute;inset:0;z-index:20;max-width:none;padding:0;background:linear-gradient(180deg,#05091844,transparent 45%,#060a15 98%),url('tex/title-battle-v1.png') center center/cover no-repeat;overflow:hidden}.intro-edition{position:absolute;top:calc(24px + env(safe-area-inset-top,0px));left:0;right:0;text-align:center;font-size:8px;font-weight:800;letter-spacing:3px;color:#d7e7ffb8}.intro-title{position:absolute;top:9%;left:20px;right:20px;text-align:center}.intro-title>.eyebrow{display:inline-block;background:#090f23a8;border:1px solid #a3eaff66;padding:7px 11px;color:#d5faff;font-size:8px;letter-spacing:1.7px}.intro-title h1{font-size:clamp(55px,17vw,82px);font-weight:950;font-style:italic;letter-spacing:-1px;line-height:.9;margin:18px 0 12px;transform:rotate(-4deg);color:#f2faff;text-shadow:3px 4px 0 #09385b,6px 7px 0 #040815,0 0 35px #2fe4ff66}.intro-title h1 small{display:block;font:900 11px system-ui;letter-spacing:5px;margin:11px 0 8px;color:#fff7ca}.intro-title h1 span{color:#ffd76c;text-shadow:3px 4px 0 #843319,6px 7px 0 #090b18,0 0 35px #ff912055}.intro-tag{font-size:8px!important;font-weight:800;letter-spacing:2.3px;color:#e1e8ff!important}.intro-menu{position:absolute;left:25px;right:25px;bottom:calc(26px + env(safe-area-inset-bottom,0px));text-align:center}.run-facts{display:flex;align-items:center;justify-content:center;gap:18px;margin-bottom:16px;font-size:8px;font-weight:850;letter-spacing:1px;color:#d8e4fa}.run-facts i{color:#ffd36d;font-style:normal}.intro-menu .primary{font-size:13px;min-height:57px;background:linear-gradient(#f9e8a9,#ffcf58 55%,#f5a82f);color:#291d09;box-shadow:0 4px 0 #8b4d14,4px 8px 0 #0007,0 0 30px #ffad2422;letter-spacing:1px}.intro-secondary{display:flex;justify-content:center;gap:15px;margin:10px 0 0}.intro-secondary .text-button{width:auto;font-size:8px;letter-spacing:.8px;padding:10px 4px;min-height:34px;color:#d6e3f5}#intro-status{font-size:10px;color:#adbed4;line-height:1.5;min-height:29px;margin:9px 0}.intro-menu .privacy{font-size:8px!important;color:#768ba7!important;line-height:1.5!important;margin:5px 0}#run-hud{position:absolute;z-index:4;top:78px;left:18px;display:flex;align-items:center;gap:10px;pointer-events:none;max-width:calc(100% - 36px)}#level-label{font-size:9px;color:#ffd76c;font-style:italic;letter-spacing:1px;background:#101c2bcc;padding:7px 9px;border-left:3px solid #ffd76c}#level-name{font-size:8px;font-weight:750;letter-spacing:1px;color:#d6e3f7;text-shadow:0 1px 5px #000}#move-hint{top:116px;font-size:7px}.mode-row{display:flex;gap:6px;margin-bottom:11px}.mode-row button{min-height:30px;border-radius:5px;padding:6px 9px;font-size:8px;letter-spacing:.4px;background:#152033a8;border-color:#43566e55;font-weight:800}.mode-row button[aria-pressed=true]{color:#ffd76c;border-color:#ffd76c55;background:#ffd76c10}#powers{margin-left:auto;color:#ffda75}.box-actions{display:flex;gap:4px}.material-row .box-actions button{font-size:8px;padding:7px 8px;white-space:nowrap}#move-box[aria-pressed=true]{color:#ffd76c;border-color:#ffd76c}#box-handle{position:absolute;z-index:4;border:1.5px dashed #ffd76caa;border-radius:9px;pointer-events:none;box-shadow:0 0 0 3px #0002}#box-handle span{position:absolute;bottom:-24px;left:50%;transform:translateX(-50%);font-size:8px;font-weight:800;letter-spacing:1px;color:#ffd76c;background:#0a1222dd;padding:5px 8px;border-radius:4px}.power-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:18px 0}.power-card{display:flex;align-items:center;gap:7px;padding:10px 7px;background:#ffffff04;border:1px solid #ffffff12;border-radius:8px}.power-card img{width:34px;height:34px;object-fit:contain}.power-card b{display:block;font-size:10px;font-style:italic;color:#ffd573}.power-card span{display:block;font-size:8px;line-height:1.5;color:#a7bbd1;margin-top:4px}@media(max-height:740px){.intro-title{top:9%}.intro-title h1{font-size:clamp(47px,16vw,62px);margin:11px 0}.intro-title h1 small{margin:6px 0;font-size:9px}.intro-title>.eyebrow{font-size:6px;padding:5px 8px}.intro-tag{font-size:7px!important}.intro-menu{bottom:20px}.intro-menu .primary{min-height:48px;font-size:11px}.run-facts{margin-bottom:10px;font-size:7px}.intro-menu .privacy{display:block}.intro-secondary{margin-top:5px}#intro-status{font-size:8px;min-height:24px;margin:5px 0}.mode-row{margin-bottom:7px}.mode-row button{font-size:7px;min-height:27px;padding:5px 7px}}

/* Live title scene. Only opacity and transforms animate continuously. */
#welcome{background:#060a15;isolation:isolate}
.intro-scene{position:absolute;inset:-3%;z-index:0;pointer-events:none;background:linear-gradient(180deg,#05091844,transparent 45%,#060a15 98%),url('tex/title-battle-v1.png') center/cover no-repeat;animation:intro-scene-drift 9s ease-in-out infinite;will-change:transform}
.intro-energy{position:absolute;inset:0;z-index:1;pointer-events:none;overflow:hidden;mix-blend-mode:screen}
.intro-energy::before,.intro-energy::after{content:"";position:absolute;top:30%;width:85%;height:47%;border-radius:50%;animation:intro-energy-pulse 4.8s ease-in-out infinite}
.intro-energy::before{left:-36%;background:radial-gradient(ellipse,#28caff60,transparent 68%)}
.intro-energy::after{right:-36%;background:radial-gradient(ellipse,#ff802850,transparent 68%);animation-delay:-2.4s}
.intro-sparks{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden}
.intro-sparks i{position:absolute;left:calc(8% + var(--i)*7.4%);top:76%;width:2px;height:5px;border-radius:50%;background:#ffe5a7;box-shadow:0 0 7px #ffb353;opacity:0;animation:intro-spark-rise calc(3.8s + var(--i)*.19s) linear infinite;animation-delay:calc(var(--i)*-.57s)}
.intro-sparks i:nth-child(even){background:#c5f3ff;box-shadow:0 0 7px #42cfff}
.intro-title,.intro-menu,.intro-edition{z-index:3}
.intro-title{animation:intro-ui-reveal .75s cubic-bezier(.16,1,.3,1) both}
.intro-menu{animation:intro-ui-reveal .85s .12s cubic-bezier(.16,1,.3,1) both}
.intro-menu .primary{animation:intro-start-pulse 3.4s ease-in-out infinite}
.intro-menu .primary:active{transform:translateY(3px);animation:none;box-shadow:0 1px 0 #8b4d14,0 0 22px #ffad2440}
#welcome[hidden] .intro-scene,#welcome[hidden] .intro-energy::before,#welcome[hidden] .intro-energy::after,#welcome[hidden] .intro-sparks i,#welcome[hidden] .primary{animation-play-state:paused}
@keyframes intro-scene-drift{0%,100%{transform:translate3d(0,5px,0) scale(1.01)}50%{transform:translate3d(-3px,-5px,0) scale(1.035)}}
@keyframes intro-energy-pulse{0%,100%{opacity:.25;transform:scale(.92)}50%{opacity:.8;transform:scale(1.1)}}
@keyframes intro-spark-rise{0%{opacity:0;transform:translate3d(0,25px,0) rotate(-20deg)}12%{opacity:.8}80%{opacity:.45}100%{opacity:0;transform:translate3d(calc((var(--i) - 5.5)*6px),-290px,0) rotate(25deg)}}
@keyframes intro-ui-reveal{from{opacity:0;transform:translate3d(0,16px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@keyframes intro-start-pulse{0%,100%{box-shadow:0 4px 0 #8b4d14,4px 8px 0 #0007,0 0 18px #ffad2422}50%{box-shadow:0 4px 0 #8b4d14,4px 8px 0 #0007,0 0 32px #ffad2466}}
@media(prefers-reduced-motion:reduce){#welcome *,#welcome *::before,#welcome *::after{animation:none!important;will-change:auto!important}.intro-sparks{display:none}.intro-energy{opacity:.35}}

#chain-hud{position:absolute;z-index:4;top:114px;left:18px;pointer-events:none;font:800 8px ui-monospace,monospace;letter-spacing:.55px;color:#aebfd3;background:#0c1521b8;border:1px solid #8199b92b;border-left:2px solid #8ca5c0;padding:6px 9px;border-radius:3px}#chain-hud.hot{color:#ffe2a0;border-left-color:#ffcb58;background:#382816b8}body.menu-open #chain-hud{visibility:hidden!important}#move-hint{top:147px;font-size:7px}

/* Higgsfield loop; the original artwork remains the instant poster/fallback. */
#intro-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;opacity:0;transition:opacity .65s ease;pointer-events:none}
.intro-scene::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#05091838,transparent 42%,#060a15e8 100%)}
#welcome.intro-live .intro-scene{animation:none;transform:none;will-change:auto}
#welcome.intro-live #intro-video{opacity:1}
#welcome.intro-live .intro-energy,#welcome.intro-live .intro-sparks{display:none}
@media(prefers-reduced-motion:reduce){#intro-video{display:none;transition:none}}

/* Game UI in the title-screen language: silver + gold heavy italics, cyan hairlines,
   navy glass, gold call to action. Same footprint as before, so the face stays clear. */
:root{--bb-gold:#ffd76c;--bb-gold-hi:#f9e8a9;--bb-gold-mid:#ffcf58;--bb-gold-lo:#f5a82f;--bb-gold-ink:#291d09;--bb-gold-edge:#8b4d14;--bb-cyan:#5fe3ff;--bb-line:#a3eaff4d;--bb-silver:#f2faff;--bb-glass:#090f23c4;--bb-glass-hi:#111c40e0}
header .wordmark{color:var(--bb-silver);text-shadow:2px 2px 0 #09385b,3px 4px 0 #040815,0 0 18px #2fe4ff40}
header .wordmark span{color:var(--bb-gold);text-shadow:2px 2px 0 #843319,3px 4px 0 #090b18}
header nav button,#controls button,#controls select{font-style:italic;font-weight:900;text-transform:uppercase;letter-spacing:.6px;color:var(--bb-silver);background:var(--bb-glass);border:1px solid var(--bb-line);box-shadow:2px 3px 0 #04081599;cursor:pointer;touch-action:manipulation;transition:transform .15s ease,background-color .15s ease,box-shadow .15s ease}
#controls select{font-style:normal}
header nav button:active,#controls button:active{transform:translateY(2px);box-shadow:0 1px 0 #04081599}
#controls button[aria-pressed="true"],#controls #powers{color:var(--bb-gold);border-color:#ffd76c80;background:#2a1d0acc}
#controls .record-button{color:var(--bb-gold-ink);background:linear-gradient(var(--bb-gold-hi),var(--bb-gold-mid) 55%,var(--bb-gold-lo));border:0;box-shadow:0 4px 0 var(--bb-gold-edge),3px 7px 0 #0007,0 0 24px #ffad2433;letter-spacing:1px}
#controls .record-button:active{box-shadow:0 1px 0 var(--bb-gold-edge),0 0 22px #ffad2440}
#controls{background:linear-gradient(180deg,transparent,#060a15d9 22%,#060a15f2)}
#controls label,#controls .size-row span,#controls .mic-state span{font-style:italic;font-weight:900;letter-spacing:1px;color:#d5faff}
#box-size{accent-color:var(--bb-gold-mid)}
#run-hud strong{font-style:italic;font-weight:950;color:var(--bb-gold);background:var(--bb-glass);border-left-color:var(--bb-gold)}
#run-hud span{font-style:italic;font-weight:900;letter-spacing:1.4px;color:var(--bb-silver)}
#chain-hud{font:italic 900 9px system-ui,sans-serif;letter-spacing:1px;color:#d5faff;background:var(--bb-glass);border-color:var(--bb-line);border-left-color:var(--bb-cyan)}
#move-hint{color:#d5faffb3;letter-spacing:1.4px}
#record-live{font-style:italic;font-weight:900}
@media(prefers-reduced-motion:reduce){header nav button,#controls button{transition:none}}

/* Dialogs and the share screen in the title-screen language: night sky, blue/orange
   energy at the edges, silver headline with the title's extrusion, gold CTA. */
dialog{background:radial-gradient(90% 55% at 0% 30%,#28caff1f,transparent 70%),radial-gradient(90% 55% at 100% 70%,#ff80281a,transparent 70%),linear-gradient(170deg,#1d1548 0%,#0b1029 48%,#060a15 100%);border:1px solid var(--bb-line);box-shadow:0 20px 90px #000a,0 0 0 1px #04081599 inset}
dialog::backdrop{background:#04061099;backdrop-filter:blur(9px)}
dialog h2{color:var(--bb-silver);font-weight:950;font-style:italic;letter-spacing:-.6px;text-shadow:2px 3px 0 #09385b,4px 5px 0 #040815,0 0 26px #2fe4ff40}
dialog p{color:#b9c6e6}
dialog .eyebrow{background:#090f23a8;border:1px solid #a3eaff66;color:#d5faff;padding:6px 10px;letter-spacing:1.7px}
dialog .primary{transform:none;color:var(--bb-gold-ink);background:linear-gradient(var(--bb-gold-hi),var(--bb-gold-mid) 55%,var(--bb-gold-lo));box-shadow:0 4px 0 var(--bb-gold-edge),4px 8px 0 #0007,0 0 26px #ffad2426;font-style:italic;font-weight:900;letter-spacing:1px;text-transform:uppercase}
dialog .primary:active{transform:translateY(3px);box-shadow:0 1px 0 var(--bb-gold-edge),0 0 22px #ffad2440}
dialog .primary:disabled{filter:saturate(.35) brightness(.7);box-shadow:none;cursor:not-allowed}
dialog .download-button,dialog button:not(.primary):not(.dialog-close):not(.secondary){color:var(--bb-silver);background:var(--bb-glass);border:1px solid var(--bb-line);font-style:italic;font-weight:900;text-transform:uppercase;letter-spacing:.6px}
dialog button[aria-pressed="true"]{color:var(--bb-gold)!important;border-color:#ffd76c80!important;background:#2a1d0acc!important}
dialog .dialog-close{color:var(--bb-silver)}
#result-box-art{background:radial-gradient(40% 58% at 22% 55%,#28caff40,transparent 70%),radial-gradient(40% 58% at 78% 55%,#ff802838,transparent 70%);margin-top:12px}
#record-preview{border:1px solid var(--bb-line);border-radius:10px}

/* Cover credit: a small byline under the title, on the title's angle. */
.intro-title .intro-credit{margin:-4px 0 11px;transform:rotate(-4deg);font-size:8px;font-weight:800;letter-spacing:2.6px;color:#fff7ca;text-shadow:0 1px 2px #000c,0 0 10px #0009}
.intro-credit a{color:var(--bb-gold);text-decoration:none;letter-spacing:1px;display:inline-block;padding:5px 2px}
.intro-credit a:focus-visible{outline:2px solid var(--bb-gold);outline-offset:2px;border-radius:3px}

/* Clear 9:16 view: the menu slides away on demand and always while recording. */
#controls{transition:transform .25s cubic-bezier(.2,.8,.2,1)}
body.controls-hidden #controls,body.is-recording #controls{transform:translateY(100%);pointer-events:none}
#toggle-controls{position:absolute;right:14px;top:-46px;min-height:36px;padding:0 13px;border-radius:7px;font-size:9px;pointer-events:auto}
body.controls-hidden #toggle-controls{top:calc(-56px - env(safe-area-inset-bottom,0px))}
body.is-recording #toggle-controls{display:none}
@media(prefers-reduced-motion:reduce){#controls{transition:none}}

/* How-to card */
.howto-list{list-style:none;counter-reset:step;margin:4px 0 14px;padding:0;display:grid;gap:10px}
.howto-list li{counter-increment:step;position:relative;padding-left:34px;font-size:14px;line-height:1.45;color:#d5e3ff}
.howto-list li::before{content:counter(step);position:absolute;left:0;top:-3px;font:italic 950 22px system-ui,sans-serif;color:var(--bb-gold);text-shadow:2px 2px 0 #843319}
.howto-list b{display:block}
.howto-list b{color:var(--bb-silver);font-style:italic;font-weight:900;text-transform:uppercase;letter-spacing:.4px}
#howto-status{min-height:20px}
#open-howto{display:block;margin:14px 0 0;color:var(--bb-gold)}

/* Last 10 seconds of the 60 s clip limit */
#record-live.ending{animation:rec-ending 1s ease-in-out infinite}
@keyframes rec-ending{50%{background:#ff2e63;box-shadow:0 0 18px #ff2e6380}}
@media(prefers-reduced-motion:reduce){#record-live.ending{animation:none;background:#ff2e63}}

/* Menu hidden: a compact gold RECORD in the bottom-left corner, paired with MENU on the right. */
#mini-record{display:none}
body.controls-hidden:not(.is-recording):not(.menu-open) #mini-record{display:flex;align-items:center;justify-content:center;position:absolute;z-index:6;left:14px;bottom:calc(20px + env(safe-area-inset-bottom,0px));min-height:36px;padding:0 18px;border:0;border-radius:7px;font:italic 900 10px system-ui,sans-serif;letter-spacing:1px;text-transform:uppercase;color:var(--bb-gold-ink);background:linear-gradient(var(--bb-gold-hi),var(--bb-gold-mid) 55%,var(--bb-gold-lo));box-shadow:0 3px 0 var(--bb-gold-edge),3px 6px 0 #0007;cursor:pointer;touch-action:manipulation}
body.controls-hidden #mini-record:active{transform:translateY(2px);box-shadow:0 1px 0 var(--bb-gold-edge)}

/* 3-2-1 before recording: title-screen numerals, menu out of the way. */
body.is-counting #controls{transform:translateY(100%);pointer-events:none}
body.is-counting #toggle-controls,body.is-counting #mini-record{display:none!important}
#rec-count{position:absolute;z-index:8;left:50%;top:46%;transform:translate(-50%,-50%);font:italic 950 132px/1 system-ui,sans-serif;color:var(--bb-gold);text-shadow:4px 5px 0 #843319,8px 9px 0 #090b18,0 0 40px #ff912066;cursor:pointer;user-select:none}
#rec-count[hidden]{display:none}
#rec-count.pop{animation:rec-count-pop .8s cubic-bezier(.16,1,.3,1) both}
@keyframes rec-count-pop{0%{opacity:0;transform:translate(-50%,-50%) scale(1.6)}25%{opacity:1;transform:translate(-50%,-50%) scale(1)}85%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(.9)}}
@media(prefers-reduced-motion:reduce){#rec-count.pop{animation:none}}

/* The health bar at the top of the frame now carries the level and box name. */
#run-hud{display:none!important}
#chain-hud{top:140px}
#move-hint{top:172px}

/* Share dialog: keep Share and Download on screen without scrolling on short phones.
   The preview gives up height first; the decorative box art goes on short viewports
   (!important because the canvas has an inline display:block). */
#record-preview{display:block;max-height:min(46svh,calc(90svh - 400px))}
@media(max-height:800px){#result-box-art{display:none!important}#record-preview{max-height:min(46svh,calc(90svh - 290px))}}
/* Phone held sideways (a clip stopped in landscape, or a rotate while the dialog is open):
   90svh - 290px drops to a few px there, so give the preview its old 46svh cap back.
   The dialog scrolls (overflow-y:auto), so Share and Download sit just below the fold. */
@media(orientation:landscape) and (max-height:500px) and (pointer:coarse){#record-preview{max-height:46svh}}

/* Live STOP takes the mini RECORD slot (bottom-left, free while recording) so it never
   covers the box name drawn on the top health bar. */
#record-live{top:auto;bottom:calc(20px + env(safe-area-inset-bottom,0px));left:14px}

/* iOS zooms the page when a focused select or text field is under 16px, and the game view
   eats the pinch that would undo it. 16px stops the zoom; tighter padding and gap keep the
   BOX row inside 375px. Scoped to iOS WebKit, the only engine that zooms, so others look unchanged. */
@supports(-webkit-touch-callout:none){
#controls select{font-size:16px;letter-spacing:0;padding:6px;max-width:160px}#controls .material-row label{gap:6px}
select,textarea{font-size:16px}input:where(:not([type]),[type=text],[type=search],[type=email],[type=number],[type=tel],[type=url],[type=password]){font-size:16px}
}

/* 320 px wide screens (iPhone SE / mini with Display Zoom, small Androids): the BOX row does
   not shrink and html/body clip overflow, so RETRY / NEW BOX was cut off at the right edge.
   Tighter side padding and gaps fit it. The select keeps its width and 16px font (no truncation,
   no iOS zoom). #controls prefix beats the iOS block above. Every engine; 360 px+ unchanged. */
@media(max-width:359px){#controls{padding-left:10px;padding-right:10px}#controls .material-row{gap:4px}#controls .material-row label{gap:4px}#controls select{padding:6px 4px}#controls .material-row .box-actions button{padding:7px 5px;letter-spacing:.2px}}

/* Level Run picks the box, so the BOX picker is locked there: show it. */
#controls select:disabled{opacity:.5;cursor:default;box-shadow:none}

/* Phone held sideways: the 9:16 game does not fit, so ask for portrait instead of a broken
   layout. Skipped while counting down or recording so STOP stays reachable. */
@media(orientation:landscape) and (max-height:500px) and (pointer:coarse){
body:not(.is-recording):not(.is-counting)::after{content:"Turn your phone upright to play";position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;background:#060a15;color:var(--bb-silver);font:italic 900 16px system-ui,sans-serif;letter-spacing:1px;text-transform:uppercase;pointer-events:auto}
}

/* Live recording preview while a take runs. The ~10 s freezes once blamed on an invisible canvas were WebKit bug 315091;
   recording.js avoids it with a 1 s timeslice. */
#rec-out{display:none}
body.is-recording #rec-out{display:block;position:fixed;right:14px;bottom:calc(20px + env(safe-area-inset-bottom,0px));width:54px;height:96px;border:1px solid #ffd76c99;border-radius:6px;z-index:7;pointer-events:none;box-shadow:0 4px 14px #0009;background:#000}

/* Saving state on the live pill: the clock is frozen, a small spinner shows the file is being written. */
#record-live.saving{background:#33406a;animation:none}
#record-live.saving::after{content:"";display:inline-block;width:9px;height:9px;margin-left:8px;border:2px solid #ffffff59;border-top-color:#fff;border-radius:50%;vertical-align:-1px;animation:rec-spin .8s linear infinite}
@keyframes rec-spin{to{transform:rotate(360deg)}}

/* Short notices (too short to save, backup recorder). Top of the frame, clear of the mic warning and STOP at the bottom. */
#rec-toast{position:absolute;z-index:9;left:50%;top:calc(84px + env(safe-area-inset-top,0px));transform:translateX(-50%);max-width:calc(100% - 32px);padding:9px 14px;border-radius:8px;background:var(--bb-glass-hi);border:1px solid var(--bb-line);box-shadow:0 6px 20px #0008;color:var(--bb-silver);font:italic 900 12px/1.3 system-ui,-apple-system,sans-serif;letter-spacing:.4px;text-align:center;text-transform:uppercase;pointer-events:none}
#rec-toast[hidden]{display:none}

/* Result dialog: the preview keeps one 9:16 box from poster to playback, so nothing jumps when the file is ready.
   One more row of buttons (Record again) than before, so the preview gives up 30 px more. */
.preview-wrap{position:relative}
#record-preview{aspect-ratio:9/16;object-fit:contain;max-height:min(46svh,calc(90svh - 430px))}
@media(max-height:800px){#record-preview{max-height:min(46svh,calc(90svh - 320px))}}
@media(orientation:landscape) and (max-height:500px) and (pointer:coarse){#record-preview{max-height:46svh}}
/* Two-line title or a note (recording.js sets .tall-head): the preview gives up 60 px more, so the iOS save hint under
   the buttons stays on screen at 375x667 and 390x844. Landscape keeps its 46svh and scrolls, as above. */
#record-result.tall-head #record-preview{max-height:min(46svh,calc(90svh - 490px))}
@media(max-height:800px){#record-result.tall-head #record-preview{max-height:min(46svh,calc(90svh - 380px))}}
@media(orientation:landscape) and (max-height:500px) and (pointer:coarse){#record-result.tall-head #record-preview{max-height:46svh}}
#preview-sound{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);min-height:34px;padding:0 14px;border-radius:17px;font-size:10px;background:#090f23e0!important}
#preview-sound[hidden]{display:none}
#result-prep{position:absolute;inset:0;margin:0;display:flex;align-items:center;justify-content:center;border-radius:10px;background:#04081599;color:var(--bb-silver);font:italic 900 13px/1.3 system-ui,-apple-system,sans-serif;letter-spacing:.6px;text-transform:uppercase}
#result-prep[hidden]{display:none}
#result-prep::before{content:"";width:14px;height:14px;margin-right:9px;border:2px solid #ffffff4d;border-top-color:var(--bb-gold);border-radius:50%;animation:rec-spin .8s linear infinite}
#result-title.long{font-size:19px;line-height:1.25}
#result-note{margin:-8px 0 12px;color:#d5e3ff}
#result-note[hidden]{display:none}
.result-actions{grid-template-columns:1fr 1fr}
.result-actions #share-video{grid-column:1/-1}
#download-video.is-disabled,#download-video[aria-disabled="true"]{opacity:.45;pointer-events:none}
#record-again{min-height:44px;padding:12px 10px}
/* No file (empty take, save failed): only the message and Record again. */
#record-result.is-error .preview-wrap,#record-result.is-error #video-info,#record-result.is-error #share-video,#record-result.is-error #download-video,#record-result.is-error #share-status{display:none}
#record-result.is-error #record-again{grid-column:1/-1}
#copy-diag{width:100%;margin-top:6px;min-height:36px;font-size:10px}
#copy-diag[hidden],#diag-text[hidden]{display:none}
#diag-text{display:block;width:100%;height:120px;margin-top:8px;padding:8px;border:1px solid var(--bb-line);border-radius:8px;background:#04081599;color:#d5e3ff;font:10px/1.4 ui-monospace,Menlo,monospace}
@media(prefers-reduced-motion:reduce){#record-live.saving::after,#result-prep::before{animation:none}}

/* LAST CLIP: the result dialog was closed with a finished clip; a tap reopens it. Menu open: the HIDE MENU row, left side.
   Menu hidden: the bottom row, right of the mini RECORD. Gone while counting or recording (recording.js hides it too). */
#controls #last-clip{position:absolute;left:14px;top:-46px;min-height:36px;padding:0 13px;border-radius:7px;font-size:9px;pointer-events:auto;color:var(--bb-gold);border-color:#ffd76c80;background:#2a1d0acc}
body.controls-hidden #controls #last-clip{top:calc(-56px - env(safe-area-inset-bottom,0px));left:124px}
#last-clip[hidden],body.is-recording #last-clip,body.is-counting #last-clip{display:none!important}
/* Gold Box offer (support.js): the box floats on a warm glow; perks as three short lines; restore folds open. */
#support-dialog .gold-stage{position:relative;display:grid;place-items:center;height:150px;margin:14px 0 4px}
#support-dialog .gold-stage::before{content:"";position:absolute;width:190px;height:150px;border-radius:50%;background:radial-gradient(closest-side,#ffd76c55,#ffad2418 60%,transparent);filter:blur(6px)}
#gold-art{position:relative;width:150px;height:150px;object-fit:contain;filter:drop-shadow(0 10px 14px #000a);animation:gold-float 3.2s ease-in-out infinite}
@keyframes gold-float{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-7px) rotate(2deg)}}
@media (prefers-reduced-motion:reduce){#gold-art{animation:none}}
#support-dialog h2{margin:6px 0 8px}
.gold-perks{list-style:none;margin:12px 0 18px;padding:0;display:grid;gap:7px}
.gold-perks li{position:relative;padding-left:20px;font-size:12px;line-height:1.35;color:#e4ebfa}
.gold-perks li::before{content:"★";position:absolute;left:0;top:0;color:var(--bb-gold)}
#support-checkout{width:100%}
#support-status{font-size:11px;margin:10px 0 0}
#support-retry{display:block;margin:6px auto 0;color:var(--bb-gold)}
.gold-legal{color:#93a2c4!important;line-height:1.45;margin:12px 0 0}
.gold-legal a{color:#c9d6f2}
#support-restore{display:block;margin:10px auto 0;width:auto}
.restore-row{display:flex;gap:8px;margin-top:6px}
.restore-row input{flex:1;min-width:0;font:12px/1.2 inherit;padding:10px;border-radius:7px;border:1px solid var(--bb-line);background:#090f23cc;color:#f2f6f9}
.restore-row button{flex:none;padding:0 14px}
/* Gold Box entry points (support.js), page UI only, never in the video: a gold pill in the mode row, a card after a cleared run, a strip in the result dialog. */
#gold-quick{margin-left:auto;color:#2a1a03!important;background:linear-gradient(#ffeeb0,#f5b938)!important;border-color:#ffd76c!important;font-weight:900}
#gold-quick:not([hidden])+#powers{margin-left:0}
#gold-nudge{position:absolute;z-index:9;left:50%;top:calc(176px + env(safe-area-inset-top,0px));transform:translateX(-50%);display:flex;align-items:center;gap:10px;width:max-content;max-width:calc(100% - 32px);padding:8px 14px 8px 8px;border-radius:10px;border:1px solid #ffd76c;background:linear-gradient(135deg,#3a2808f2,#16100af2);box-shadow:0 8px 26px #000a,0 0 22px #ffad2433;color:#fff3cf;text-align:left;font:800 11px/1.3 system-ui,-apple-system,sans-serif;animation:gold-pop .35s ease-out}
#gold-nudge b{display:block;color:var(--bb-gold);font-style:italic;font-weight:950;letter-spacing:.4px}
#gold-nudge img{width:34px;height:34px;flex:none}
#gold-nudge[hidden],body.is-recording #gold-nudge,body.is-counting #gold-nudge{display:none!important}
@keyframes gold-pop{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}
@media (prefers-reduced-motion:reduce){#gold-nudge{animation:none}}
#gold-cta{display:flex;align-items:center;gap:10px;margin-top:14px;padding:10px;border-radius:10px;border:1px solid #ffd76c66;background:linear-gradient(135deg,#ffd76c1f,#ffad2408)}
#gold-cta[hidden]{display:none}
#gold-cta img{width:46px;height:46px;flex:none}
#gold-cta div{flex:1;min-width:0;font-size:11px;line-height:1.35;color:#d9e2f5}
#gold-cta b{display:block;color:var(--bb-gold);font-style:italic;font-weight:950}
#gold-cta-open{flex:none;padding:9px 11px;color:#2a1a03!important;background:linear-gradient(#ffeeb0,#f5b938)!important;border-color:#ffd76c!important}
