/* Live arcade dashboard. Each row owns its space; no absolute-positioned tabs. */
#hud{display:flex!important;flex-direction:column;gap:6px!important;max-width:520px;top:calc(env(safe-area-inset-top) + 10px)!important;left:max(10px,env(safe-area-inset-left))!important;right:max(10px,env(safe-area-inset-right))!important;pointer-events:none;--hud-metal:#a89aa9}
#hud .topbar{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:8px;padding:0;border:0;background:none;box-shadow:none;overflow:visible;filter:none;min-height:0}
#hud .score-stat,#hud .coin-stat{position:relative;min-width:0;padding:8px 10px 7px;border:2px solid var(--hud-metal);border-radius:9px 3px 9px 3px;background:linear-gradient(125deg,#202342f5,#0e101df5 70%);box-shadow:inset 0 1px #eee2c855,0 3px 0 #08070e,0 5px 0 #d8167b;overflow:hidden}
#hud .score-stat:before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#4569ff,#ff279d);pointer-events:none}
#hud .score-stat:after{content:'';position:absolute;right:5px;bottom:5px;width:13px;height:5px;background:repeating-linear-gradient(90deg,#6b6883 0 2px,transparent 2px 4px);pointer-events:none}
#hud .px-label{font:700 8px/1.2 Silkscreen,monospace;letter-spacing:.8px;color:#bbb8d8;margin:0 0 4px;min-height:10px}
#hud .score-kicker{display:flex;align-items:center;gap:5px;white-space:nowrap}
.score-kicker>i{width:5px;height:5px;background:#7ae9bd;box-shadow:0 0 5px #7ae9bd77;flex:none}
#hud #hud-milestone-pop{margin-left:auto;font:700 7px Silkscreen,monospace;letter-spacing:0;color:#ffdc70;opacity:0}
#hud #score{font:600 clamp(31px,8.6vw,40px)/.9 Rajdhani,sans-serif;letter-spacing:.5px;color:#eee2c8;text-shadow:0 2px #050409;transform-origin:left center;font-variant-numeric:tabular-nums}
#hud .meter-row{display:flex;align-items:center;gap:5px;margin-top:7px;padding-right:15px}
#hud .meter-track{flex:1;width:auto;height:6px;min-width:20px;border:1px solid #514460;background:#090912;overflow:hidden}
#hud .meter-track i{position:relative;height:100%;display:block;background:linear-gradient(90deg,#e61580,#ff65b2);transition:width .1s linear;overflow:hidden}
#hud .meter-track i:before{content:'';position:absolute;inset:0;width:25px;background:linear-gradient(90deg,transparent,#ffe7f388,transparent);animation:hud-meter-sweep 2.4s linear infinite}
#hud .meter-track:after{background:repeating-linear-gradient(90deg,transparent 0 7px,#0c0b17 7px 9px)}
#hud .meter-caption{display:block;font:600 8px/1 Rajdhani,sans-serif;color:#b6abc5;white-space:nowrap}
#hud .meter-caption b{font:600 8px/1 Rajdhani,sans-serif;color:#eee2c8}
#hud .coin-stat{border-color:#c2a36a;border-radius:3px 10px 3px 10px;background:linear-gradient(135deg,#493419f5,#201827f5 70%);box-shadow:inset 0 1px #ffe2a366,0 3px 0 #08070e,0 5px 0 #886023;padding:8px 9px 6px}
#hud .coin-kicker{display:flex;justify-content:space-between;gap:3px;color:#f4d28b;letter-spacing:.5px}
#hud #hud-coin-pop{opacity:0;color:#ffe9a1;font:700 12px/.9 Rajdhani,sans-serif}
#hud .coin-total{gap:6px;min-height:35px}
#hud .coin-total img{width:30px;height:30px;flex:none;filter:drop-shadow(0 2px 1px #08050a88)}
#hud #tokens{font:600 clamp(27px,7.5vw,35px)/1 Rajdhani,sans-serif;color:#ffe18b;letter-spacing:0;min-width:0}
#hud .world-badge{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;position:relative;inset:auto;min-height:27px;max-width:none;margin:2px 0 0!important;padding:4px 34px 4px 8px;border:1px solid #645480;border-left:3px solid #ff2c9a;border-radius:3px 14px 14px 3px;background:linear-gradient(90deg,#261635ef,#12152be8);box-shadow:0 2px #08070a;overflow:hidden;align-self:stretch}
#hud .world-badge strong{font:700 12px/1.1 Rajdhani,sans-serif;letter-spacing:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;order:2;flex:1;color:#eee2c8}
#hud .world-badge span{font:700 7px/1.2 Silkscreen,monospace;letter-spacing:0;white-space:nowrap;order:1;margin:0;color:#ff9aca;padding-right:8px;border-right:1px solid #6d3f70}
#hud .hud-portal-ring{position:absolute;right:10px;top:5px;width:13px;height:15px;border:2px solid #ff71c5;border-radius:50%;box-shadow:0 0 5px #ff269f66,inset 0 0 3px #ff269f66;transform:rotate(20deg)}
#hud .hud-portal-ring:after{content:'';position:absolute;width:4px;height:4px;right:-4px;top:-2px;background:#ffe6ae;border:1px solid #fff0cf;transform:rotate(45deg)}
#hud #letter-tracker{display:flex!important;align-items:center;justify-content:center;width:100%;padding:4px 6px;min-height:25px;border:1px solid #655b75;border-radius:4px;background:#15131fe8;box-shadow:inset 0 1px #aaa2b322,0 2px #08070e;gap:2px!important}
#hud #letter-tracker[hidden]{display:none!important}
#hud #letter-tracker .px-label{display:block;flex:none;margin:0 7px 0 0;font-size:7px;letter-spacing:0;color:#8bdce6;min-height:0}
#hud #letter-tracker .collection-word{gap:2px}
#hud #letter-tracker .collection-word+.collection-word{margin-left:5px}
#hud #letter-tracker .collection-word b{width:clamp(11px,3.3vw,16px);height:17px;display:grid;place-items:center;font:700 12px/1 Rajdhani,sans-serif;background:#272231;border:1px solid #5f536b;color:#a99ab5;border-radius:2px;box-shadow:inset 0 -2px #15101e}
#hud #letter-tracker .collection-word b.collected{background:#ffdd67;border-color:#fff0a9;color:#261924;box-shadow:inset 0 -2px #b7842f}
#hud #letter-tracker.complete{border-color:#73d7d3}
#hud #power-stack{position:static;display:flex;flex-direction:row;align-items:stretch;justify-content:flex-start;gap:6px;width:100%;margin:0;pointer-events:none}
#hud #power-stack:not(:has(.px-meter:not([hidden]))){display:none}
#hud #power-stack .px-meter{display:grid;grid-template-columns:26px minmax(0,1fr);grid-template-rows:13px 15px 4px;column-gap:6px;row-gap:1px;align-items:center;flex:1;min-width:0;max-width:160px;width:auto!important;padding:5px 7px!important;border:1px solid #72647d!important;border-left:3px solid var(--accent)!important;border-top:1px solid #b6a8bb!important;border-radius:4px 9px 4px 4px!important;background:linear-gradient(120deg,#292139f5,#14111ff0)!important;box-shadow:inset 0 1px #eee2c822,0 2px #08070e!important;text-align:left}
#hud #power-stack .px-meter[hidden]{display:none!important}
#hud #power-stack .px-meter .meter-icon{grid-column:1;grid-row:1/3;width:25px!important;height:25px!important;margin:0!important;image-rendering:auto}
#hud #power-stack .px-meter>span:not(.meter-icon){display:block!important;grid-column:2;grid-row:1;font:700 7px/1 Silkscreen,monospace!important;letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#eee2c8}
#hud #power-stack .px-meter>b{grid-column:2;grid-row:2;margin:0!important;font:600 18px/1 Rajdhani,sans-serif!important;color:var(--accent)!important}
#hud #power-stack .px-meter .meter-bar{grid-column:1/-1;grid-row:3;width:100%!important;height:4px!important;margin:0!important}
#hud #power-stack .px-meter[data-urgent=true]{animation:hud-expiry .65s steps(2,end) infinite}
#hud .hud-notice-slot{position:relative;min-width:0;min-height:0;pointer-events:none;display:none}
#hud .hud-notice-slot[data-active=true]{display:block}
#hud #announcement.px-banner{position:relative!important;inset:auto!important;left:auto!important;top:auto!important;transform:none!important;width:100%;max-width:none!important;min-height:36px!important;margin:0;padding:7px 12px!important;display:flex;align-items:center;justify-content:center;gap:8px;font:700 16px/1.12 Rajdhani,sans-serif!important;color:#eee2c8;background:linear-gradient(90deg,#232049f5,#161222f5);border:1px solid #9f8fb3;border-top:2px solid #4f6bff;border-radius:4px 4px 10px 10px;box-shadow:0 3px #d51b7b;white-space:normal!important;text-wrap:balance;text-shadow:none!important}
#hud #announcement.px-banner[data-priority="3"]{border-top-color:#ff6b9e;background:linear-gradient(90deg,#431b36f5,#241329f5)}
#hud #announcement.px-banner[data-icon]:before{width:22px;height:22px;flex:0 0 22px}
#hud #announcement.px-banner[data-icon=""]:before{display:none}
#threat.px-panel{left:max(12px,env(safe-area-inset-left));right:auto;bottom:calc(env(safe-area-inset-bottom) + 23px);top:auto!important;transform:none!important;width:min(225px,calc(100% - 86px));min-height:46px;padding:7px 10px;border:1px solid #b96b87;border-left:4px solid #ff377f;border-radius:4px 11px 4px 4px;background:linear-gradient(110deg,#39152aee,#171021ed);box-shadow:inset 0 1px #dca9bf44,0 3px #700c3b;text-align:left}
#threat.px-panel span{font-size:9px;letter-spacing:.6px}#threat.px-panel span:before{content:'!';display:inline-block;color:#ffe18b;margin-right:6px}
#threat.px-panel div{margin:5px 0 3px;height:4px;background:#5b263d}
#threat.px-panel small{font-size:9px;letter-spacing:.7px}
body:not([data-mode=running]) #hud *,body:not([data-mode=running]) #hud *:before{animation-play-state:paused!important}
body:is([data-mode=welcome],[data-mode=intro],[data-mode=over]) #hud{visibility:hidden}
@keyframes hud-meter-sweep{from{transform:translateX(-30px)}to{transform:translateX(150px)}}
@keyframes hud-expiry{50%{border-color:#ffe8ac;box-shadow:inset 0 0 0 1px #ffe8ac88}}
@media(max-width:350px){#hud{gap:5px!important}#hud .topbar{gap:6px;grid-template-columns:minmax(0,1.42fr) minmax(0,1fr)}#hud .score-stat{padding:7px 7px 6px}#hud .coin-stat{padding:7px 6px 6px}#hud #score{font-size:30px}#hud #tokens{font-size:25px}#hud .coin-total{gap:4px}#hud .coin-total img{width:24px;height:24px}#hud .px-label{font-size:7px;letter-spacing:.3px}#hud #hud-milestone-pop{font-size:6px}#hud #letter-tracker{padding-inline:4px}#hud #letter-tracker .px-label{margin-right:4px;font-size:6px}#hud #letter-tracker .collection-word b{width:11px;height:16px;font-size:11px}#hud #power-stack{gap:4px}#hud #power-stack .px-meter{grid-template-columns:21px minmax(0,1fr);column-gap:4px;padding:5px!important}#hud #power-stack .px-meter .meter-icon{width:21px!important;height:21px!important}#hud #power-stack .px-meter>span:not(.meter-icon){font-size:6px!important}#hud #announcement.px-banner{font-size:14px!important;min-height:34px!important}}
@media(max-height:460px) and (orientation:landscape){#hud{display:grid!important;grid-template-columns:minmax(270px,360px) minmax(200px,300px);justify-content:space-between;max-width:none;column-gap:16px!important;row-gap:6px!important}#hud .topbar{grid-column:1;grid-row:1/3}#hud .world-badge{grid-column:2;grid-row:1;margin:0!important}#hud #letter-tracker{grid-column:2;grid-row:2}#hud #power-stack{grid-column:1;grid-row:3}#hud .hud-notice-slot{grid-column:2;grid-row:3}#hud #announcement.px-banner{height:100%;font-size:14px!important}#hud #power-stack .px-meter{max-width:none}}
@media(prefers-reduced-motion:reduce){#hud *,#hud *:before{animation:none!important;transition:none!important}}
/* The world ribbon precedes the letter strip regardless of legacy DOM order. */
#hud .topbar{order:1}#hud .world-badge{order:2}#hud #letter-tracker{order:3}#hud #power-stack{order:4}#hud .hud-notice-slot{order:5}
#hud #announcement.px-banner[data-icon]:not([data-icon=""]):before{display:block}
#hud .notice-text{display:block;min-width:0}
/* Letter sockets divide the available width, including narrow landscape columns. */
#hud #letter-tracker .collection-word{flex:5 1 0;min-width:0}
#hud #letter-tracker .collection-word+.collection-word{flex:10 1 0}
#hud #letter-tracker .collection-word b{flex:1 1 0;min-width:0;width:auto;max-width:16px}
#threat.px-panel>span{display:block;line-height:1.2}
#threat.px-panel>small{display:block;line-height:1.2;margin:0}

/* Temporary information stamps float over gameplay, never inside the HUD. */
#viewport>.hud-notice-slot{position:absolute;top:29%;left:50%;translate:-50% 0;width:calc(100% - 36px);max-width:410px;min-height:0;z-index:18;pointer-events:none;display:none;isolation:isolate}
#viewport>.hud-notice-slot[data-active=true]{display:block}
#viewport>.hud-notice-slot #announcement.px-banner{position:relative!important;inset:auto!important;left:auto!important;top:auto!important;transform:none!important;width:100%;max-width:none!important;min-height:0!important;margin:0;padding:0!important;display:block;border:0;border-radius:0;background:none;box-shadow:none;filter:none;rotate:-3deg;color:#eee2c8;font:900 clamp(26px,7.7vw,36px)/1.05 'Barlow Condensed',BarlowCondensed,'Arial Narrow',sans-serif!important;letter-spacing:.5px;text-align:center;text-transform:uppercase;white-space:normal!important;text-wrap:balance;overflow-wrap:normal;text-shadow:-2px -2px 0 #170b20,2px -2px 0 #170b20,-2px 2px 0 #170b20,2px 2px 0 #170b20,0 4px 0 #9e125d,0 6px 5px #08050fcc!important;transition:opacity .12s ease-out}
#viewport>.hud-notice-slot #announcement.px-banner[data-priority="3"]{color:#ffe291;text-shadow:-2px -2px 0 #170b20,2px -2px 0 #170b20,-2px 2px 0 #170b20,2px 2px 0 #170b20,0 4px 0 #b91665,0 6px 5px #08050fcc!important}
#viewport>.hud-notice-slot #announcement.px-banner:before,#viewport>.hud-notice-slot #announcement.px-banner:after{display:none!important;content:none!important}
.hud-notice-slot .notice-text{display:block}
body:is([data-mode=welcome],[data-mode=intro],[data-mode=over],[data-mode=paused]) #viewport>.hud-notice-slot{visibility:hidden}
@media(max-height:460px) and (orientation:landscape){#viewport>.hud-notice-slot{max-width:380px}#viewport>.hud-notice-slot #announcement.px-banner{font-size:25px!important}}
@media(prefers-reduced-motion:reduce){#viewport>.hud-notice-slot #announcement{transition:none}}

/* Compact stamps wrap between complete words, never within a word. */
#viewport>.hud-notice-slot{width:min(calc(100% - 48px),250px);max-width:250px}
#viewport>.hud-notice-slot #announcement.px-banner,#viewport>.hud-notice-slot .notice-text{word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important;white-space:normal!important;text-wrap:balance}
#viewport>.hud-notice-slot #announcement.px-banner{line-height:1.12!important}
@media(max-height:460px) and (orientation:landscape){#viewport>.hud-notice-slot{width:240px;max-width:240px}}

/* Vertical power meters sit below the dashboard along the left edge. */
#hud #power-stack{position:absolute;top:calc(100% + 12px);left:0;right:auto;bottom:auto;width:48px;display:flex;flex-direction:column;align-items:stretch;gap:6px;margin:0;grid-column:auto;grid-row:auto}
#hud #power-stack .px-meter{display:grid;grid-template-columns:1fr;grid-template-rows:25px 18px minmax(22px,1fr);gap:3px;flex:none;width:48px!important;max-width:48px;min-height:0;height:clamp(88px,14vh,116px);padding:5px!important;text-align:center;border-radius:5px 9px 5px 5px!important}
#hud #power-stack .px-meter .meter-icon{grid-column:1;grid-row:1;justify-self:center;width:25px!important;height:25px!important}
#hud #power-stack .px-meter>span:not(.meter-icon){display:none!important}
#hud #power-stack .px-meter>b{grid-column:1;grid-row:2;justify-self:center;font-size:18px!important;line-height:18px!important}
#hud #power-stack .px-meter .meter-bar{grid-column:1;grid-row:3;justify-self:center;align-self:stretch;width:18px!important;height:100%!important;min-height:22px;margin:0!important;border:1px solid #847390!important;background:#090813!important}
#hud #power-stack .px-meter .meter-bar i{position:absolute;left:0;right:0;bottom:0;top:auto;width:100%!important;height:calc(var(--p,100) * 1%)!important;transition:height .15s linear}
#hud #power-stack .px-meter .meter-bar:after{background:repeating-linear-gradient(0deg,transparent 0 8px,#111019 8px 10px)}
#viewport>.hud-notice-slot{left:50%;width:min(calc(100% - 100px),240px);max-width:240px}
@media(max-height:460px) and (orientation:landscape){#hud #power-stack{width:auto;flex-direction:row}#hud #power-stack .px-meter{height:88px}#viewport>.hud-notice-slot{left:50%;width:240px}}
/* One continuous dashboard: two thin left rows, one spanning charge cell. */
#hud{--hud-panel-gap:8px;gap:var(--hud-panel-gap)!important;background:none;border:0;border-radius:0;padding:0;overflow:visible}
#hud .topbar{gap:var(--hud-panel-gap);align-items:stretch;margin:0;padding:0}
#hud .score-stat,#hud .coin-stat{box-shadow:inset 0 1px #eee2c855;border-bottom-width:3px;border-radius:4px}
#hud .score-stat{border-bottom-color:#d8167b}
#hud .hud-progress-row{order:2;display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);grid-template-rows:27px 25px;gap:var(--hud-panel-gap);min-width:0;margin:0}
#hud .hud-progress-row .world-badge{grid-column:1;grid-row:1;min-width:0;min-height:0;height:27px;margin:0!important;padding:3px 21px 3px 5px;gap:4px;border-radius:3px;box-shadow:none}
#hud .hud-progress-row .world-badge strong{font-size:10px;letter-spacing:.2px}
#hud .hud-progress-row .world-badge span{font-size:6px;padding-right:4px}
#hud .hud-progress-row .hud-portal-ring{right:6px;width:10px;height:10px}
#hud .hud-progress-row #letter-tracker{grid-column:1;grid-row:2;min-width:0;min-height:0;height:25px;flex-wrap:nowrap;gap:4px!important;margin:0!important;padding:3px!important;box-shadow:none}
#hud .hud-progress-row #letter-tracker .px-label{display:none}
#hud .hud-progress-row #letter-tracker .collection-word{flex:5 1 0;width:auto;min-width:0;gap:1px;margin:0}
#hud .hud-progress-row #letter-tracker .collection-word+.collection-word{flex:10 1 0;margin:0}
#hud .hud-progress-row #letter-tracker .collection-word b{flex:1 1 0;min-width:0;max-width:none;width:auto;height:17px;font-size:11px;letter-spacing:0}
#rocket-charge{grid-column:2;grid-row:1 / 3;position:relative;pointer-events:none;min-width:0;height:auto;align-self:stretch;padding:5px 7px;border:1px solid #ad7547;border-bottom:3px solid #684229;border-radius:4px;background:linear-gradient(120deg,#33223d,#161421);color:#eee2c8;display:flex;flex-direction:column;justify-content:center;gap:4px;isolation:isolate;overflow:hidden}
#rocket-charge:disabled{opacity:1;cursor:default}
.rocket-label{position:relative;z-index:2;font:700 7px/1 Silkscreen,monospace;letter-spacing:.6px;text-shadow:0 1px 3px #160914}
#rocket-charge strong{position:relative;z-index:2;font:700 12px/1 Rajdhani,sans-serif;text-shadow:0 1px 3px #160914}
.charge-fire{position:absolute;inset:0;z-index:0;pointer-events:none;opacity:clamp(0,calc(var(--heat,0) * 4),1);background:radial-gradient(ellipse at 50% 110%,#ffad2288,transparent 70%)}
.charge-fire i{position:absolute;left:calc(var(--n) * 15% - 5%);bottom:-7px;width:23%;height:calc(8px + var(--heat,0) * 42px);transform-origin:50% 100%;background:linear-gradient(0deg,#fff3a3 5%,#ffda40 30%,#ff791a 60%,#ff293e 90%);clip-path:polygon(0 100%,5% 65%,25% 45%,30% 0,55% 28%,63% 58%,83% 36%,100% 77%,100% 100%);animation:charge-flame var(--flame-speed,.65s) ease-in-out infinite alternate;animation-delay:calc(var(--n) * -.13s)}
.charge-fire i:nth-child(even){bottom:-11px;filter:brightness(1.2);animation-direction:alternate-reverse}
#rocket-charge:after{content:'';pointer-events:none;position:absolute;inset:0;border:1px solid #ffbb4d;opacity:var(--heat,0);box-shadow:inset 0 0 12px #ff7d28;animation:charge-heat 1.1s ease-in-out infinite alternate}
#rocket-charge[data-heat="1"]{--flame-speed:.55s;animation:charge-rattle 1.8s infinite}
#rocket-charge[data-heat="2"]{--flame-speed:.45s;animation:charge-rattle .7s infinite;border-color:#ff9f36}
#rocket-charge[data-heat="3"]{--flame-speed:.3s;animation:charge-rattle .22s infinite;border-color:#ffbc55}
#rocket-charge[data-ready=true]{--flame-speed:.3s;border-color:#ffe2a0;background:#64172b;animation:charge-rattle .18s infinite}
#rocket-charge[data-ready=true] strong{font:900 25px/.9 'Barlow Condensed',sans-serif;color:#fff1c6;text-shadow:0 2px 0 #3a1021,1px 0 #3a1021,-1px 0 #3a1021}

#rocket-charge[data-flying=true] .charge-fire{opacity:.7}
@keyframes charge-rattle{0%,80%,100%{transform:translateX(0)}84%{transform:translateX(.7px)}90%{transform:translateX(-.7px)}95%{transform:translateX(.5px)}}
@keyframes charge-flame{from{transform:scale(.92,.75) skewX(-5deg)}to{transform:scale(1.06,1.13) skewX(5deg)}}
@keyframes charge-heat{to{opacity:calc(var(--heat,0) * .45)}}
@media(max-width:350px){#hud .hud-progress-row .world-badge span{font-size:5px}#hud .hud-progress-row .world-badge strong{font-size:9px}#hud .hud-progress-row #letter-tracker .collection-word b{font-size:10px}.rocket-label{font-size:6px}}
@media(max-height:460px) and (orientation:landscape){#hud{display:flex!important;max-width:520px;gap:var(--hud-panel-gap)!important}#hud .hud-progress-row{grid-column:auto;grid-row:auto}}
@media(prefers-reduced-motion:reduce){#rocket-charge,#rocket-charge:after,.charge-fire i{animation:none!important}}

/* Overdrive energy cells are deliberately distinct from the score progress line. */
.rocket-cells{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;gap:3px;height:13px;padding:0 3px}
.rocket-cells i{position:relative;overflow:hidden;flex:1;height:100%;min-width:0;transform:skewX(-18deg);border:1px solid #ad6a47;background:#211321;box-shadow:inset 0 1px #ffffff12;transition:background .15s,box-shadow .15s}
.rocket-cells i::after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,#f44824,#ffbe39 60%,#fff3ac);transform:scaleX(var(--cell-fill,0));transform-origin:left;box-shadow:inset 0 -2px #ba3026}
.rocket-cells i[data-lit=true]{border-color:#fff1a1;box-shadow:0 0 5px #ff7d38}
#rocket-charge[data-ready=true] strong{font:700 12px/1 Rajdhani,sans-serif;letter-spacing:2px}
#overdrive-launch{--flame-speed:.3s;position:absolute;z-index:12;left:50%;top:62%;transform:translate(-50%,-50%);width:clamp(112px,30vw,146px);height:72px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;isolation:isolate;overflow:hidden;border:2px solid #fff0ac;border-bottom:5px solid #b6471e;border-radius:7px;background:linear-gradient(#602035,#a63220);color:#fff1cb;box-shadow:0 4px 0 #2b0e21,0 0 20px #ff872c99;touch-action:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:pointer;--heat:1;animation:launch-ready .8s ease-in-out infinite alternate}
#overdrive-launch[hidden],body:not([data-mode=running]) #overdrive-launch{display:none!important}
#overdrive-launch>span:not(.charge-fire){position:relative;z-index:2;font:700 8px/1 Silkscreen,monospace;letter-spacing:1px;text-shadow:0 2px #421125}
#overdrive-launch>strong{position:relative;z-index:2;font:900 33px/.9 'Barlow Condensed',sans-serif;letter-spacing:2px;text-shadow:0 2px 0 #421125,1px 0 #421125,-1px 0 #421125}
#overdrive-launch:active{translate:0 3px;box-shadow:0 1px 0 #2b0e21,0 0 20px #ff872c99}
#overdrive-launch .charge-fire i{height:65px}
@keyframes launch-ready{to{box-shadow:0 4px 0 #2b0e21,0 0 29px #ff9b39cc}}
@media(max-height:460px) and (orientation:landscape){#overdrive-launch{top:66%;height:60px;width:122px}}
@media(prefers-reduced-motion:reduce){#overdrive-launch{animation:none}}

/* Fill the existing coin panel without changing the dashboard dimensions. */
#hud .coin-stat{--coin-icon-size:clamp(32px,10vw,40px)}
#hud .coin-total{position:absolute;inset:23px 9px 6px;min-height:0;display:flex;align-items:center;gap:6px}
#hud .coin-total img{width:var(--coin-icon-size);height:var(--coin-icon-size);object-fit:contain}
#hud #tokens{font-size:clamp(34px,11vw,46px);line-height:.9;white-space:nowrap;letter-spacing:0}
#hud #tokens[data-digits="4"]{font-size:clamp(30px,9.6vw,38px)}
#hud #tokens[data-digits="5"]{font-size:clamp(24px,7.6vw,30px)}
#hud #tokens[data-digits="6"]{font-size:clamp(20px,6.3vw,25px)}
#hud #tokens[data-digits="7"]{font-size:clamp(17px,5.4vw,22px)}
@media(max-width:350px){#hud .coin-total{inset-inline:6px;gap:5px}}

/* Lower-centre prompt area, above the pause control and browser edge. */
#lower-game-prompts{position:absolute;z-index:12;left:50%;bottom:max(13%,calc(env(safe-area-inset-bottom) + 78px));transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:8px;width:min(340px,calc(100% - 48px));pointer-events:none}
#lower-game-prompts #threat.px-panel{position:relative;inset:auto!important;transform:none!important;flex:0 1 225px;min-width:0;width:225px;min-height:60px;margin:0;padding:8px 10px;display:flex;flex-direction:column;justify-content:center;opacity:.84;pointer-events:none}
#lower-game-prompts #threat.px-panel>span{font-size:9px;line-height:1.25}
#lower-game-prompts #threat.px-panel>small{font-size:9px;line-height:1.25;white-space:normal}
#lower-game-prompts #overdrive-launch{--flame-speed:.3s;position:relative;inset:auto;transform:none;flex:0 0 112px;width:112px;height:64px;margin:0;opacity:.86;pointer-events:auto}
#lower-game-prompts #overdrive-launch:active{opacity:1}
#lower-game-prompts #threat[hidden],body:not([data-mode=running]) #lower-game-prompts{display:none!important}
@media(max-height:460px) and (orientation:landscape){#lower-game-prompts{bottom:max(8%,calc(env(safe-area-inset-bottom) + 24px))}#lower-game-prompts #overdrive-launch{height:58px}#lower-game-prompts #threat.px-panel{min-height:54px}}

/* Edge flames stay within the surrounding gutters; the inner fire stays clipped. */
#rocket-charge{overflow:visible}
#rocket-charge>.charge-fire{overflow:hidden;border-radius:inherit}
.charge-outer-fire{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:var(--overheat,0)}
.charge-outer-fire i{position:absolute;display:block;width:16px;height:calc(5px + var(--overheat,0) * 9px);background:linear-gradient(0deg,#fff5a4,#ffca35 35%,#ff7420 68%,#ff3153);clip-path:polygon(0 100%,9% 65%,28% 43%,38% 0,59% 40%,63% 67%,80% 40%,100% 100%);filter:drop-shadow(0 0 2px #ff9027);transform-origin:50% 100%;animation:outer-heat-flicker .3s ease-in-out infinite alternate;animation-delay:var(--delay)}
.charge-outer-fire .edge-top{left:var(--at);bottom:100%;height:calc(2px + var(--overheat,0) * 3px);translate:-50% 0}
.charge-outer-fire .edge-bottom{left:var(--at);top:100%;rotate:180deg;transform-origin:50% 50%;translate:-50% 0}
.charge-outer-fire .edge-left{right:100%;top:var(--at);width:5px;height:17px;clip-path:polygon(100% 0,60% 18%,70% 34%,0 45%,65% 68%,48% 83%,100% 100%);translate:0 -50%}
.charge-outer-fire .edge-right{left:100%;top:var(--at);width:5px;height:17px;clip-path:polygon(0 0,40% 18%,30% 34%,100% 45%,35% 68%,52% 83%,0 100%);translate:0 -50%}
@keyframes outer-heat-flicker{from{scale:.85 .72;opacity:.65}to{scale:1 1;opacity:1}}
body:not([data-mode=running]) .charge-outer-fire i{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.charge-outer-fire i{animation:none}}

/* Keep each title readable within the existing 60% letter panel. */
#hud .hud-progress-row #letter-tracker .collection-word{flex:var(--word-length,1) 1 0;gap:1px;margin:0}
#hud .hud-progress-row #letter-tracker[data-long=true]{column-gap:2px}
#hud .hud-progress-row #letter-tracker[data-long=true] .collection-word b{font-size:9px}

/* Three equal-height instruments; shared gutters, compact numeric displays. */
#hud .topbar{grid-template-columns:minmax(0,1.35fr) minmax(0,1.08fr) minmax(0,.88fr);gap:var(--hud-panel-gap)}
#hud .score-stat,#hud .coin-stat,#hud .earth-stat{padding:7px 7px 6px;min-width:0;min-height:72px;box-sizing:border-box}
#hud .topbar .px-label{font-size:7px;letter-spacing:.3px;white-space:nowrap}
#hud .score-kicker{gap:3px}
#hud #hud-milestone-pop{display:none}
#hud #score{font-size:clamp(26px,7.2vw,37px);letter-spacing:0}
#hud .meter-row{gap:3px;padding-right:0;margin-top:6px;flex-wrap:wrap}
#hud .meter-track{min-width:22px}
#hud .meter-caption,#hud .meter-caption b{font-size:7px}
#hud .coin-total{position:static;min-height:36px;gap:3px}
#hud .coin-total img{width:clamp(20px,5.5vw,28px);height:clamp(20px,5.5vw,28px)}
#hud #tokens{font-size:clamp(28px,7.7vw,38px)}
#hud #tokens[data-digits="4"]{font-size:clamp(24px,6.6vw,32px)}
#hud #tokens[data-digits="5"]{font-size:clamp(20px,5.5vw,27px)}
#hud #tokens[data-digits="6"]{font-size:clamp(17px,4.7vw,23px)}
#hud #tokens[data-digits="7"]{font-size:clamp(15px,4.1vw,20px)}
#hud .earth-stat{position:relative;overflow:hidden;border:2px solid #8a9fbd;border-bottom:3px solid #4bb5ce;border-radius:4px;background:linear-gradient(125deg,#183c4df5,#151627f5 75%);box-shadow:inset 0 1px #eee2c855;display:flex;flex-direction:column;align-items:center}
#hud .earth-kicker{align-self:flex-start;color:#9de7ef}
#hud #earth-number{font:700 clamp(28px,7.7vw,38px)/1 Rajdhani,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:1px;color:#eee2c8;text-shadow:0 2px #080b18;min-width:3ch;text-align:center}
.earth-signal{display:block;width:24px;height:3px;margin-top:auto;background:repeating-linear-gradient(90deg,#5cc9dc 0 5px,transparent 5px 8px);opacity:.65}
#earth-panel[data-shuffling=true] #earth-number{color:#a8f3ff}
#earth-panel[data-shuffling=true] .earth-signal{animation:earth-signal .12s steps(2) infinite}
@keyframes earth-signal{to{opacity:.2}}
@media(prefers-reduced-motion:reduce){#earth-panel .earth-signal{animation:none!important}}

/* Letters above health, with Overdrive spanning both rows on the right. */
#hud .hud-progress-row .world-badge{display:none!important}
#hud .hud-progress-row #letter-tracker{grid-row:1;height:27px}
#hud #health-panel{grid-column:1;grid-row:2;display:flex;align-items:center;gap:6px;min-width:0;height:25px;padding:3px 5px;border:1px solid #668e86;border-bottom:2px solid #345b58;border-radius:3px;background:linear-gradient(110deg,#192e31,#121722);box-sizing:border-box;box-shadow:none;overflow:hidden}
#health-panel .health-label{font:700 6px/1 Silkscreen,monospace;letter-spacing:.4px;color:#b9e4d9;flex:none}
#health-panel .health-track{position:relative;flex:1;height:9px;min-width:0;overflow:hidden;border:1px solid #55756e;background:#0c111b}
#health-fill{display:block;height:100%;width:100%;background:linear-gradient(#a5f0b3,#41bb91);transition:width .3s ease-out,background .2s}
#health-panel .health-track:after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent calc(25% - 1px),#0c111b 25%,transparent calc(25% + 1px),transparent calc(50% - 1px),#0c111b 50%,transparent calc(50% + 1px),transparent calc(75% - 1px),#0c111b 75%,transparent calc(75% + 1px))}
#health-value{font:700 10px/1 Rajdhani,sans-serif;color:#d7f0dd;min-width:25px;text-align:right}
#hud #health-panel[data-critical=true]{border-color:#ff4e78;background:linear-gradient(110deg,#491626,#231320)}
#health-panel[data-critical=true] #health-fill{background:linear-gradient(#ff7187,#ed2454);animation:health-critical .75s ease-in-out infinite alternate}
#health-panel[data-critical=true] .health-label,#health-panel[data-critical=true] #health-value{color:#ffb1c1}
@keyframes health-critical{to{filter:brightness(1.5)}}
@media(prefers-reduced-motion:reduce){#health-fill{transition:none;animation:none!important}}

#health-panel[data-recovering=true] #health-fill{filter:brightness(1.2)}

/* A health palette, not a green progress meter; warning owns its own row. */
#hud #health-panel{border-color:#bd6689;border-bottom-color:#7a284e;background:linear-gradient(110deg,#361729,#191322)}
#health-panel .health-label,#health-value{color:#ffc4dc}
#health-panel .health-track{border-color:#85405f;background:#170d18}
#health-fill{background:linear-gradient(#ff81bb,#ec247b);box-shadow:inset 0 1px #ffe3ed88}
#health-panel[data-critical=true] #health-fill{background:linear-gradient(#ff6f76,#ed173d)}
#health-critical{grid-column:1;grid-row:3;align-self:start;justify-self:stretch;text-align:center;margin:0;min-width:0;font:900 clamp(24px,7vw,32px)/1 'Barlow Condensed',sans-serif;letter-spacing:1px;color:#ff506c;-webkit-text-stroke:.35px currentColor;text-shadow:0 2px #180910,1px 0 #180910,-1px 0 #180910;pointer-events:none;animation:critical-word .8s ease-in-out infinite alternate}
#health-critical[hidden]{display:none!important}
@keyframes critical-word{to{color:#ff9aaa;text-shadow:0 2px #180910,0 0 8px #ff234c66}}
/* EARTH and its shuffled digits have equal prominence as one full label. */
#hud .earth-stat{justify-content:center;padding-inline:3px;gap:8px}
#hud .earth-readout{display:flex;align-items:baseline;justify-content:center;gap:3px;white-space:nowrap;font:900 clamp(17px,4.8vw,25px)/1 'Barlow Condensed',sans-serif;letter-spacing:0;color:#eee2c8;text-shadow:0 2px #080b18}
#hud #earth-number{font:inherit;letter-spacing:0;min-width:0;color:inherit;text-shadow:inherit;font-variant-numeric:tabular-nums}
#hud .earth-signal{margin-top:0}
#earth-panel[data-shuffling=true] .earth-readout{color:#a8f3ff}
@media(prefers-reduced-motion:reduce){#health-critical{animation:none}}

/* Fixed tile metrics across every title; words no longer stretch their letters. */
#hud .hud-progress-row #letter-tracker{column-gap:6px!important;justify-content:center}
#hud .hud-progress-row #letter-tracker .collection-word,
#hud .hud-progress-row #letter-tracker .collection-word+.collection-word{display:flex;flex:0 0 auto;width:auto;min-width:0;gap:1px;margin:0}
#hud .hud-progress-row #letter-tracker .collection-word b,
#hud .hud-progress-row #letter-tracker[data-long] .collection-word b{flex:0 0 var(--letter-tile-width,6px);width:var(--letter-tile-width,6px);min-width:var(--letter-tile-width,6px);max-width:var(--letter-tile-width,6px);height:17px;box-sizing:border-box;font-size:var(--letter-tile-font,8px);padding:0;letter-spacing:0}

/* Preserve the original row footprint; equal tiles consume all available width. */
#hud .hud-progress-row #letter-tracker{column-gap:4px!important;justify-content:flex-start}
#hud .earth-stat{gap:2px}
#hud .earth-readout{flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:clamp(20px,5.8vw,26px);line-height:1}
#hud #earth-number{font-size:clamp(28px,7.7vw,36px);line-height:.95}
#hud .earth-signal{display:none}

body[data-mode=finale] #hud,body[data-mode=finale] #pause,body[data-mode=finale] #power-stack,body[data-mode=finale] #lower-game-prompts,body[data-mode=finale] .hud-notice-slot{visibility:hidden!important;pointer-events:none!important}
#final-hit-impact{position:absolute;inset:0;z-index:18;pointer-events:none;background:radial-gradient(ellipse,#ffe6df66,#7f123d88);animation:final-screen-hit .27s ease-out both}
#final-hit-impact[hidden]{display:none!important}#final-hit-impact svg{width:100%;height:100%;filter:drop-shadow(0 0 2px #ff77aa)}
@keyframes final-screen-hit{0%{background:#fff0d9;opacity:1}30%{background:#e9256577;opacity:1}100%{background:#160811dd;opacity:1}}

#final-hit-impact{animation-duration:.32s}#final-hit-impact svg{filter:drop-shadow(0 1px 1px #000) drop-shadow(0 0 3px #ff77aa)}

/* Damage stays red briefly, then retracts towards its left edge. */
#health-fill{transition:none}
#health-damage{position:absolute;top:0;bottom:0;left:100%;width:0;background:linear-gradient(#ffadb3,#ff244c);box-shadow:0 0 6px #ff244c;transition:width .08s linear;z-index:1}
#health-panel .health-track:after{z-index:2}
#health-critical{font:700 clamp(13px,3.6vw,19px)/1.35 'Press Start 2P',monospace;text-align:left;justify-self:stretch;letter-spacing:0;padding-top:5px;-webkit-text-stroke:.2px currentColor}
#health-critical[data-powers=true]{padding-left:58px}
#threat-fill{transition:width .06s linear}

body[data-mode=finale] #health-panel{visibility:visible!important}

/* A single red fill retracts left. No second layer or pink refill. */
#health-panel #health-fill,#health-panel[data-critical=true] #health-fill{background:#e52323;box-shadow:none;filter:none;animation:none;transition:none}
#threat #threat-fill{background:#e52323!important;box-shadow:none;animation:none;transition:width .06s linear}

/* Keep the warning at the same grid gap as the other HUD rows. */
#health-critical{padding-top:0;line-height:1}
#viewport>.hud-notice-slot .notice-line{display:block;white-space:nowrap!important;word-break:keep-all!important;overflow-wrap:normal!important}
#viewport>.hud-notice-slot .notice-line+.notice-line{margin-top:3px}
.letter-pickup-toast{position:absolute;left:50%;transform:translateX(-50%);z-index:15;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.letter-pickup-tile{display:grid;place-items:center;width:58px;height:66px;box-sizing:border-box;font:700 48px/1 Rajdhani,sans-serif;background:#ffdd67;border:3px solid #fff0a9;color:#261924;border-radius:4px;box-shadow:inset 0 -6px #b7842f,0 3px 0 #261924;transform-origin:center}
.letter-pickup-toast>span{font:900 26px/1 'Barlow Condensed',sans-serif;color:#eee2c8;text-shadow:-2px -2px #170b20,2px 2px #170b20,0 4px #9e125d}
body:is([data-mode=welcome],[data-mode=paused],[data-mode=over]) .letter-pickup-toast{visibility:hidden}

/* v276: three lives, with the original red draining overlay. */
#health-panel .health-track:after{background:linear-gradient(90deg,transparent calc(33.333% - 1px),#170d18 33.333%,transparent calc(33.333% + 1px),transparent calc(66.667% - 1px),#170d18 66.667%,transparent calc(66.667% + 1px))}
/* Power instructions use the existing stamp; side meters retain their compact size. */
#viewport>.hud-notice-slot #announcement.px-banner[data-kind="power"]{color:#ff9a35;text-shadow:-2px -2px 0 #170b20,2px -2px 0 #170b20,-2px 2px 0 #170b20,2px 2px 0 #170b20,0 4px 0 #a73b13,0 6px 5px #08050fcc!important}
.reward-coin-flight{position:fixed;z-index:40;width:24px;height:24px;pointer-events:none;object-fit:contain}
