/* A hosted game already sits inside the portal's safe viewport. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
:root.embedded{--safe-top:0px;--safe-right:0px;--safe-bottom:0px;--safe-left:0px}
/* Bunker hardware: steel plates, brass switches, bolts and hazard tape. */
:root{--am:#efb643;--te:#efb643;--ink:#eadbc0;--muted:#b6ae9c;--panel:#2a2a29;--edge:#161514}
#modal{--modal-h:calc(100dvh - max(12px,var(--safe-top)) - max(12px,var(--safe-bottom)));padding:max(12px,var(--safe-top)) max(12px,var(--safe-right)) max(12px,var(--safe-bottom)) max(12px,var(--safe-left))}
#modal .earnings-card{position:relative;max-width:600px;padding:clamp(14px,3dvh,30px) clamp(16px,4vw,30px);max-height:var(--modal-h);overflow:hidden;display:grid;gap:clamp(6px,1.8dvh,16px);align-content:center}
#modal .earnings-card h3{font-size:clamp(20px,min(6vw,5.5dvh),44px);line-height:1.05;margin:0}
#modal .earnings-card p{font:600 clamp(13px,2.5dvh,20px)/1.25 'Barlow Condensed',Arial,sans-serif;color:#d5c9ac;max-width:430px;margin:0 auto}
#modal .earnings-card .amount{font:900 clamp(30px,min(12vw,10dvh),84px)/1.05 'Big Shoulders Display',Impact,sans-serif;letter-spacing:.02em;margin:0;text-shadow:0 3px #171814;overflow-wrap:anywhere}
#modal .earnings-card button{width:100%;min-height:clamp(44px,8dvh,60px);padding:8px;font:900 clamp(18px,4dvh,25px)/1.1 'Big Shoulders Display',Impact,sans-serif}
.earnings-icon{width:clamp(32px,7dvh,70px);height:clamp(32px,7dvh,70px);display:block;margin:0 auto}
@media(max-height:360px){.earnings-icon{display:none}#modal .earnings-card{gap:6px;padding:16px}#modal .earnings-card h3{font-size:22px}#modal .earnings-card p{font-size:13px}}
body{font-family:'Barlow Condensed',Arial,sans-serif}
button,select{font-family:'Barlow Condensed',Arial,sans-serif}button{border-radius:3px;border:1px solid #281c0c;border-top-color:#ffe4a0;background:linear-gradient(#ffdb7d 0%,#e8b94f 45%,#c78c2d 100%);box-shadow:inset 0 1px #fff9,inset 0 -3px #57391755,0 3px 0 #503716,0 4px 7px #0007;color:#261e12;letter-spacing:.035em;text-transform:uppercase;font-size:12px}button:hover:not(:disabled){background:linear-gradient(#ffe4a0,#eabd58,#dba03d)}button:active:not(:disabled),button.pressed{translate:0 2px;transform:none;box-shadow:inset 0 1px #fff6,inset 0 -1px #50371677,0 1px 0 #503716}
button.te{color:#261e12;background:linear-gradient(#ffdb7d,#e8b94f 45%,#c78c2d);box-shadow:inset 0 1px #fff8,inset 0 -3px #57391755,0 3px 0 #503716,0 4px 7px #0007}button.te:hover:not(:disabled){background:linear-gradient(#ffe4a0,#eabd58,#dba03d)}button:disabled,button.te:disabled{background:linear-gradient(#494740,#343530);border-color:#181915;border-top-color:#69685c;color:#aaa38f;box-shadow:inset 0 -2px #12151177;opacity:1}.quiet,.close{background:linear-gradient(#41413b,#292a27);color:#e6c681;box-shadow:inset 0 1px #fff1,0 2px #111; border:1px solid #141510;border-top-color:#686653}.quiet:hover:not(:disabled),.close:hover:not(:disabled){background:#555143}.danger{background:linear-gradient(#9b6344,#683d2b);color:#f5d6ad;box-shadow:0 2px #332115}button small{font-size:12px;color:inherit;opacity:1;font-variant-numeric:tabular-nums;letter-spacing:0;font-weight:800;text-transform:none}
.pill{border-radius:4px;border:2px solid #191715;border-top-color:#776647;background:linear-gradient(#3b382e,#212322);box-shadow:inset 0 0 0 1px #9c88632e,0 3px 8px #0008;padding-right:18px}/* Rivets at the plate's real top and bottom corners, whatever its height. */.pill:after{content:'';position:absolute;right:4px;top:5px;bottom:5px;width:3px;background:radial-gradient(circle,#8e866a 1.4px,transparent 1.6px) top/3px 3px no-repeat,radial-gradient(circle,#8e866a 1.4px,transparent 1.6px) bottom/3px 3px no-repeat}#money{color:#ffd780;font-family:'Big Shoulders Display',Impact,sans-serif;font-weight:900;letter-spacing:.03em;font-size:27px}#p2 b{color:#d0c19b}#p2 .sm{letter-spacing:.08em}#mb{border-radius:3px}#od{border-radius:3px}
.dlg{background:linear-gradient(112deg,#45433b 0,#30312e 28%,#282c2a 60%,#39392f);border:2px solid #111310;border-top-color:#8c7951;border-radius:3px;box-shadow:inset 0 0 0 1px #a2946544,inset 0 0 32px #0005,0 -6px 24px #0007}
.dlg:before{content:'';position:absolute;top:5px;left:5px;width:5px;height:5px;border:1px solid #161614;border-radius:50%;background:linear-gradient(130deg,#b7aa83,#3a3b33);box-shadow:calc(100vw - 26px) 0 #8b856a}
.dlg h3{font-family:'Big Shoulders Display',Impact,sans-serif;font-weight:900;letter-spacing:.07em;text-transform:uppercase;color:#ffd079;text-shadow:0 2px #151711}
.r{background:linear-gradient(#242621,#1a201dcc);border:1px solid #141814;border-top-color:#67684b66;border-radius:3px;box-shadow:inset 0 2px 6px #0005}.r>div{font-family:'Barlow Condensed',Arial,sans-serif;color:#e5d7b5;font-size:13px}.r small{color:#b9b29f;font-size:11px}.close{border-radius:3px;font-size:25px;width:40px;min-height:40px;top:16px}
#menu{border-radius:3px;padding-top:23px}#menu h3{font-size:24px}#menu .close{top:10px}#menu .r{margin-top:10px}select{background:#262a25;border-radius:3px;border:1px solid #837650;color:#e9d6a8;font-size:12px}#save-status{font-size:9px;color:#aca68f}
#toast{border-radius:3px;border:1px solid #c79f4d;background:linear-gradient(#3f3e32,#262923);font-size:12px;text-transform:uppercase;color:#ffe2a0;letter-spacing:.035em;box-shadow:0 3px 12px #0007}
.target-glow{outline:2px solid #ffe090!important;outline-offset:3px;animation:hardware-pulse .85s ease-in-out infinite!important;box-shadow:0 0 15px #ffcc6066!important}@keyframes hardware-pulse{50%{outline-color:#b78224;box-shadow:0 0 4px #ffcc6022}}
#tutorial{left:auto;right:auto;top:auto;width:max-content;max-width:230px;padding:8px 10px;border-radius:3px;background:linear-gradient(#f8d578,#ce9c3a);border:2px solid #302817;border-left:2px solid #302817;box-shadow:inset 0 1px #fff9,0 3px #302717,0 5px 12px #0008;z-index:6;text-align:center;pointer-events:none;color:#302313;transition:left .12s,top .12s}#tutorial:after{content:'';position:absolute;left:50%;bottom:-11px;width:15px;height:15px;transform:translateX(-50%) rotate(45deg);background:#cf9e3d;border-right:2px solid #302817;border-bottom:2px solid #302817}#tutorial .eyebrow{font-size:8px;letter-spacing:.12em;color:#59431f;font-weight:900}#tutorial h3{font-family:'Big Shoulders Display',Impact,sans-serif;font-weight:900;font-size:20px;letter-spacing:.05em;text-transform:uppercase;margin:3px 20px 1px}#tutorial p{font-size:11px;font-weight:800;color:#493417;line-height:1.3;margin-top:4px}#tutorial-actions{margin:0;position:absolute;right:2px;top:2px;gap:0}#tutorial-actions button{pointer-events:auto;min-height:24px;width:24px;min-width:24px;padding:1px;font-size:14px;box-shadow:none;background:transparent;border:0;color:#59431f}#tutorial-action{display:none}#tutorial-action.show{display:block}#tutorial .tutorial-dots{height:3px;background:#99752d;margin:6px 6px 0}#tutorial-progress{background:#372b15}#tutorial-target{border:2px dashed #ffe191;border-radius:3px;box-shadow:0 0 0 4px #0005,0 0 18px #ffd26066;z-index:5}#tutorial-target:after{content:'';clip-path:polygon(0 0,100% 0,50% 100%);width:22px;height:17px;background:#ffe094;position:absolute;top:-26px;left:50%;translate:-50% 0;font-size:24px;color:#ffe094;text-shadow:0 2px #211d12;animation:point .75s ease-in-out infinite}@keyframes point{50%{transform:translateY(-7px)}}
#loader{background:radial-gradient(at 50% 60%,#46402b,#171b17)}#loader h1{font-family:'Big Shoulders Display',Impact,sans-serif;font-weight:900}.loader-bar{border-radius:1px;background:#514a32}.loader-bar:after{background:repeating-linear-gradient(135deg,#f0be53 0,#f0be53 10px,#272b22 10px,#272b22 18px)}
@media(max-width:760px) and (min-height:521px){#tutorial{left:auto;right:auto;top:auto;width:max-content;max-width:220px;padding:7px 9px}#tutorial h3{font-size:18px;margin:3px 18px 1px}#tutorial p{font-size:10px}.pill{padding-right:12px}#money{font-size:25px}}
@media(max-height:520px){#tutorial{top:auto;width:max-content;max-width:180px;padding:6px 8px}#tutorial h3{font-size:17px}#tutorial p{font-size:10px}#tutorial-actions{margin:0}}
@media(prefers-reduced-motion:reduce){.target-glow,#tutorial-target:after{animation:none!important}}
.dlg{background-image:linear-gradient(112deg,#47433999,#252b28bb 62%,#39392f88),url('assets/ui-steel.png');background-size:auto,180px 180px}.r{background-image:linear-gradient(#20231dde,#161c19e8),url('assets/ui-steel.png');background-size:auto,220px 220px}.dlg h3{color:#f3c467}.pill{background-image:linear-gradient(#443d31dd,#1c2422ed),url('assets/ui-steel.png')}
.target-glow{outline:3px solid #ffe8a8!important;animation:hardware-pulse .8s ease-in-out infinite!important}
@keyframes hardware-pulse{0%,100%{outline-offset:1px;outline-color:#d59e32;box-shadow:0 0 4px #ffd15b66}50%{outline-offset:5px;outline-color:#fff3c7;box-shadow:0 0 0 5px #ffc94d55,0 0 25px #ffc94dcc}}
#tutorial-target{animation:world-pulse .8s ease-in-out infinite}@keyframes world-pulse{50%{border-color:#fff9dc;box-shadow:0 0 0 7px #ffc94d55,0 0 30px #ffc94daa}}
#tutorial.button-cue{width:22px;max-width:22px;height:30px;padding:0;border:0;background:none;box-shadow:none;transition:none}
#tutorial.button-cue>*{display:none}#tutorial.button-cue:after{content:'';clip-path:polygon(0 15%,100% 50%,0 85%,24% 50%);position:absolute;inset:0;background:#fff2b2;border:0;width:22px;height:30px;transform:none;font-size:26px;color:#fff2b2;text-shadow:0 2px #35220c,0 0 5px #ffc54d;animation:button-point .7s ease-in-out infinite}
@keyframes button-point{50%{transform:translateX(6px)}}
#modal .reboot-dlg{position:relative;text-align:left;padding:clamp(16px,3dvh,28px) 22px;max-height:var(--modal-h);overflow:hidden;display:grid;gap:clamp(6px,1.4dvh,12px)}
.hazard-edge{height:9px;position:absolute;top:0;left:0;right:0;background:repeating-linear-gradient(135deg,#e9b648 0 11px,#24251f 11px 23px)}
#modal .reboot-dlg h3{margin:0 45px 0 0;font-size:28px;line-height:1.05}#modal .reboot-dlg p{font-size:13px;color:#e1d3b3;margin:0;line-height:1.3}#modal .reboot-dlg .close{top:12px;right:10px;min-height:44px;width:44px}
.compact-copy{display:none}
.reboot-gears{padding:clamp(6px,2dvh,16px);border:1px solid #79714b;background:#171d18;text-align:center;margin:0}.reboot-gears b{display:block;color:#ffd274;font:clamp(28px,6dvh,46px)/1.1 'Big Shoulders Display',Impact,sans-serif}.reboot-gears span{font-size:11px;letter-spacing:.13em;text-transform:uppercase}
.reboot-meter{height:9px;border:1px solid #887744;background:#151b17}.reboot-meter i{display:block;height:100%;background:#deb34e}#modal .reboot-note{font-size:12px;color:#b7b298}#reboot-warning{color:#ffba87;font-size:13px;line-height:1.25;margin:0}#reboot-confirm{width:100%;margin:0;min-height:44px;padding:8px}
@media(max-height:520px){
 #modal .reboot-dlg{max-width:640px;grid-template-columns:minmax(0,1fr) minmax(0,2fr);padding:16px;gap:6px 12px}
 #modal .reboot-dlg h3,.reboot-help,.reboot-note,#reboot-warning,#reboot-confirm{grid-column:1/-1}
 #modal .reboot-dlg h3{font-size:24px}
 .reboot-gears{grid-column:1;grid-row:3/5;padding:6px}.reboot-earned{grid-column:2;align-self:end}.reboot-meter{grid-column:2}
}
@media(max-height:360px){
 #modal .reboot-dlg{padding:14px;gap:5px 10px}
 #modal .reboot-dlg h3{font-size:22px}
 .reboot-dlg .full-copy{display:none}.reboot-dlg .compact-copy{display:inline}
 .reboot-dlg.confirming .reboot-help,.reboot-dlg.confirming .reboot-gears,.reboot-dlg.confirming .reboot-earned,.reboot-dlg.confirming .reboot-meter{display:none}
}
/* Keep settings navigation available while the longer options use bunker rails. */
#menu{padding-top:12px;overflow-x:hidden}
.menu-head{position:sticky;top:0;z-index:3;min-height:44px;padding:6px 48px 8px 0;background:#30312b;border-bottom:1px solid #9e916040}
#menu .menu-head h3{margin:0;line-height:1.2;font-size:clamp(18px,6vw,24px);overflow-wrap:anywhere}#menu .menu-head .close{top:0;right:0;width:44px;min-height:44px}
#menu .r{flex-wrap:wrap;gap:8px;min-width:0}#menu .r>div{min-width:0}#menu select{max-width:100%}
@media(max-width:300px){
 #modal .earnings-card{padding:12px;gap:5px}#modal .earnings-card h3{font-size:20px}
 #modal .earnings-card p{font-size:13px;line-height:1.2}
 #modal .reboot-dlg{padding:12px;gap:5px;grid-template-columns:1fr}
 #modal .reboot-dlg h3{font-size:20px;overflow-wrap:anywhere;margin-right:42px}
 .reboot-dlg .full-copy{display:none}.reboot-dlg .compact-copy{display:inline}
 .reboot-gears{grid-column:1;grid-row:auto;display:flex;align-items:center;justify-content:center;gap:8px;padding:4px}
 .reboot-earned,.reboot-meter{grid-column:1}
 #modal .reboot-dlg p{font-size:12px;line-height:1.2}
 #reboot-warning{font-size:12px}
}
@media(max-height:300px){
 #modal .reboot-dlg{padding:14px;gap:5px}
 .reboot-help,.reboot-meter{display:none}
 .reboot-gears{grid-row:2;grid-column:1;padding:4px;display:flex;align-items:center;justify-content:center;gap:6px}
 .reboot-earned{grid-column:2;align-self:center}
 #modal .reboot-dlg p{font-size:12px;line-height:1.2}
}
@media(max-width:300px) and (max-height:300px){
 #modal .earnings-card{gap:4px;padding:10px}#modal .earnings-card p{font-size:12px}
 #modal .reboot-dlg{padding:12px;grid-template-columns:1fr}
 .reboot-earned{display:none}.reboot-gears{grid-column:1}
}
/* The visible rails are our controls, including dragging and keyboard input. */
.dlg,#story,.custom-scroll{scrollbar-width:none;overscroll-behavior:contain}.dlg::-webkit-scrollbar,#story::-webkit-scrollbar,.custom-scroll::-webkit-scrollbar{display:none;width:0;height:0}
#menu{z-index:8}
.custom-scroll.has-scroll{padding-right:max(32px,var(--safe-right))!important}
.scroll-rail{position:fixed;width:12px;padding:2px;border:1px solid #76704b;background:#151a16;box-shadow:inset 0 1px 4px #000b;border-radius:2px;touch-action:none}
#modal .earnings-card:has(.ad-status){overflow:auto}
#modal .dlg p.ad-status{color:#fff1cc;background:#191c18;border:1px solid #c9a65c;border-radius:3px;padding:8px 12px;font:700 clamp(15px,2.8dvh,18px)/1.3 'Barlow Condensed',Arial,sans-serif;max-width:100%;margin:0;text-align:center}
.scroll-thumb{position:absolute;left:2px;right:2px;min-height:24px;border:1px solid #302817;background:repeating-linear-gradient(0deg,#d7b25a 0 3px,#9b813f 3px 4px);border-radius:1px;cursor:grab;box-shadow:0 1px #0008}.scroll-thumb:active{cursor:grabbing}.scroll-rail:focus-visible{outline:2px solid #ffdf88}
@media(prefers-reduced-motion:reduce){#tutorial-target,#tutorial.button-cue:after{animation:none!important}}

.dlg{background-color:#30312b}.r{background-color:#1b211b}
button.danger:hover:not(:disabled){background:linear-gradient(#ab6a46,#743f2c);color:#fff0d4}
.dlg:before{box-shadow:none}

/* Handmade interface icons: no font or emoji dependency. */
.ui-icon{display:inline-block;width:22px;height:22px;vertical-align:middle;pointer-events:none;flex-shrink:0}.close .ui-icon{width:17px;height:17px}#tutorial-skip .ui-icon,#story-close .ui-icon{width:14px;height:14px}
@media (pointer:coarse) and (orientation:landscape) and (max-height:520px){#p1{left:max(4px,var(--safe-left))}}

/* ---------- HUD rack: cash and gears share one width, rhythm and plate finish ---------- */
:root{--rack-w:228px}
#p1,#p2{width:var(--rack-w);max-width:none}
#money{display:inline-block;transform-origin:left center}
#p1.gain #money{animation:cash-pop .5s cubic-bezier(.2,1.6,.4,1)}
@keyframes cash-pop{35%{transform:scale(1.1);color:#fff4c8;text-shadow:0 0 14px #ffcc66aa,0 2px #151711}}
#p1.gain:before{content:'';position:absolute;inset:0;border-radius:3px;pointer-events:none;background:radial-gradient(ellipse at 30% 50%,#ffd36a33,transparent 70%);animation:cash-flash .5s ease-out forwards}
@keyframes cash-flash{to{opacity:0}}
@media(max-width:760px) and (min-height:521px){:root{--rack-w:min(196px,calc(100vw - 172px))}}
/* ---------- Core Reboot: progress toward the next reboot fills the plate; it pulses when ready ---------- */
#od{overflow:hidden}
#od:before{content:'';position:absolute;left:0;bottom:0;height:4px;width:calc(100% * var(--reboot,0));background:linear-gradient(90deg,#7a4a12,#3a240a);box-shadow:0 -1px #ffffff22;transition:width .4s}
#od.ready{animation:reboot-ready 1.6s ease-in-out infinite}
@keyframes reboot-ready{50%{box-shadow:inset 0 1px #fff9,0 3px 0 #503716,0 0 0 3px #ffc94d55,0 0 22px #ffc94daa}}
/* A press on something priced in gears, without enough gears: a quick flash on Core Reboot, which is where gears come from. */
#od.hint{animation:reboot-hint .5s ease-in-out 3;z-index:9}
@keyframes reboot-hint{0%,100%{transform:scale(1)}50%{transform:scale(1.14);filter:brightness(1.3);box-shadow:inset 0 1px #fff9,0 0 0 3px #120e08,0 0 0 6px #ffd23f,0 0 0 8px #120e08,0 0 30px #ffd23fee}}
@media(prefers-reduced-motion:reduce){#od.hint{animation:none;outline:3px solid #ffd23f;outline-offset:2px}}
button.gear-short,button.gear-short:hover:not(:disabled),button.gear-short:active:not(:disabled),button.gear-short:focus:not(:disabled){background:linear-gradient(#494740,#343530)!important;border-color:#181915;border-top-color:#69685c;color:#aaa38f;box-shadow:inset 0 -2px #12151177;transform:none}
button.gear-short .purchase-price,button.gear-short .purchase-title{color:#d2c8af;text-shadow:0 1px #171a12}
.purchase-price{white-space:nowrap}
.purchase-price .rs-gear{width:.85em;height:.85em;margin-right:.14em;vertical-align:-.06em}
/* Padding is cancelled by the margin so the subtitle keeps its height; the pseudo-element gives a thumb-sized target. */
#pl.belt-tip{position:relative;display:inline-block;width:fit-content;cursor:pointer;color:#ffd274;background:#4a2412;border-left:3px solid #ff8a5a;padding:3px 9px;margin:-3px 0 -3px -3px;border-radius:2px}
#pl.belt-tip:after{content:'';position:absolute;inset:-9px -8px}
/* ---------- Toast: a short steel strip with hazard tape that drops in ---------- */
#toast{top:calc(16px + var(--safe-top));padding:9px 18px 9px 24px;font:800 15px/1.2 'Big Shoulders Display',Impact,sans-serif;letter-spacing:.06em;color:#ffe6a8;background:linear-gradient(#403d33,#22241f);border:1px solid #13140f;border-top-color:#8c7951;border-radius:3px;box-shadow:inset 0 1px #ffffff1c,0 8px 22px #000b;overflow:hidden;transform:translate(-50%,-12px);transition:opacity .18s,transform .3s cubic-bezier(.2,1.4,.4,1)}
#toast:before{content:'';position:absolute;left:0;top:0;bottom:0;width:7px;background:repeating-linear-gradient(135deg,#e9b648 0 5px,#24251f 5px 10px)}
#toast[style*="opacity: 1"]{transform:translate(-50%,0)}
@media(max-width:760px) and (min-height:521px){#toast{top:calc(226px + var(--safe-top))}}
/* ---------- Cards: a vignette veil, the card rises in, the ad action carries a play mark and a sheen ---------- */
#modal{background:radial-gradient(ellipse at center,#0a0806aa,#000000dd);animation:veil-in .22s ease-out}
#modal>.dlg{animation:card-in .36s cubic-bezier(.18,1.25,.4,1) both}
@keyframes veil-in{from{opacity:0}}
@keyframes card-in{from{opacity:0;transform:translateY(18px)}}
@keyframes card-fade{from{opacity:0}}
@media(max-height:420px){#modal>.dlg{animation-name:card-fade}}
#modal .ad-double{position:relative;overflow:hidden}
#modal .ad-double:before{content:'';display:inline-block;width:0;height:0;margin-right:.45em;vertical-align:.08em;border-left:.62em solid currentColor;border-top:.38em solid transparent;border-bottom:.38em solid transparent}
#modal .ad-double:after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(105deg,transparent 38%,#ffffff70 50%,transparent 62%);transform:translateX(-110%);animation:sheen 2.8s ease-in-out .5s infinite}
@keyframes sheen{55%,100%{transform:translateX(110%)}}
/* ---------- Upgrade deck wipes open from the bottom; the menu drops in ---------- */
#pn:not(.hide){animation:deck-in .26s cubic-bezier(.2,.9,.3,1)}
@keyframes deck-in{from{clip-path:inset(100% 0 0 0)}to{clip-path:inset(0 0 0 0)}}
#pn:not(.hide) #panel-body{animation:deck-content .34s ease-out}
@keyframes deck-content{from{opacity:0}}
#menu:not(.hide){animation:menu-in .22s cubic-bezier(.2,1.2,.4,1)}
@keyframes menu-in{from{opacity:0;transform:translateY(-8px)}}
@media(prefers-reduced-motion:reduce){#p1.gain #money,#od.ready,#modal,#modal>.dlg,#modal .ad-double:after,#pn,#panel-body,#menu{animation:none!important}}

/* ---------- Reveal banner (new floor, unlocks): a steel plate with hazard tape, low enough to leave the subject clear ---------- */
#banner{left:50%;right:auto;top:auto;bottom:calc(30% + var(--safe-bottom));transform:translateX(-50%);width:max-content;max-width:calc(100% - 28px);padding:14px 28px 12px;border:2px solid #111310;border-top-color:#8c7951;border-radius:3px;background:linear-gradient(112deg,#45433bf2,#282c2af2 60%,#39392ff2),url('assets/ui-steel.png');background-size:auto,180px 180px;box-shadow:inset 0 0 0 1px #a2946544,0 10px 30px #000c;overflow:hidden}
#banner:before{content:'';position:absolute;left:0;right:0;top:0;height:6px;background:repeating-linear-gradient(135deg,#e9b648 0 9px,#24251f 9px 18px)}
#banner b{font:900 clamp(24px,4.2vw,44px)/1.05 'Big Shoulders Display',Impact,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#ffd47a;text-shadow:0 2px #151711,0 0 18px #ffb84a55;margin-top:4px}
#banner span{display:block;margin-top:4px;font:700 clamp(13px,1.8vw,17px)/1.2 'Barlow Condensed',Arial,sans-serif;color:#9fe8e8;text-shadow:0 1px #000}
#banner.go{animation:banner-in 3.2s ease-out}@keyframes banner-in{0%{opacity:0;transform:translate(-50%,14px)}10%,82%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;transform:translate(-50%,-6px)}}
@media(prefers-reduced-motion:reduce){#banner.go{animation:banner-fade 3.2s}@keyframes banner-fade{0%,100%{opacity:0}10%,82%{opacity:1}}}

/* ---------- Gear cards: the gear plate opens a grid of multiplier cards ---------- */
#p2{pointer-events:auto;cursor:pointer;transition:filter .15s}#p2:hover{filter:brightness(1.12)}#p2:focus-visible{outline:2px solid #ffdf88;outline-offset:2px}
#p2 .rs-tag{margin-left:auto;font:800 9px 'Barlow Condensed',Arial,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#d0c19b;opacity:.8}
#p2.can{animation:rs-ready 1.8s ease-in-out infinite}@keyframes rs-ready{50%{box-shadow:inset 0 0 0 1px #9c88632e,0 3px 8px #0008,0 0 0 3px #ffc94d55,0 0 18px #ffc94d88}}
.rs-gear{width:1.1em;height:1.1em;vertical-align:-.18em;margin-right:.3em}
#modal .research-dlg{position:relative;max-width:min(860px,100%);width:100%;max-height:var(--modal-h);overflow:auto;text-align:left;padding:clamp(14px,3dvh,24px) clamp(12px,3vw,24px)}
.rs-top{display:flex;align-items:center;gap:12px;padding-right:66px}.rs-top h3{flex:1;margin:0!important;font-size:clamp(22px,4vw,30px)}.rs-top .close{top:10px;right:10px}
.rs-free{display:flex;align-items:center;gap:4px;padding:5px 10px;border:1px solid #79714b;background:#171d18;border-radius:3px}.rs-free b{font:900 20px 'Big Shoulders Display',Impact,sans-serif;color:#ffd274}.rs-free small{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#b9b29f}
.rs-intro{font-size:13px!important;color:#cdbf9f!important;margin:6px 0 10px!important;text-align:left}
.rs-body{display:grid;gap:12px}
.rs-section h4{margin:0 0 6px;font:900 15px 'Big Shoulders Display',Impact,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#9fe8e8;border-bottom:1px solid #4a5a50;padding-bottom:4px}
/* Upgrades wrap into as many 150px+ columns as the window holds (5 at most), so no card ever sits off-screen. */
.rs-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:9px;padding:4px 2px 6px}
/* The title bar and close button stay in view while the upgrades scroll. */
/* The title bar spans the whole window, carries the hazard stripe and stays in view while the upgrades scroll. */
#modal .research-dlg{padding-right:32px!important}.research-dlg>.hazard-edge{display:none}
#modal .research-dlg .rs-top{position:sticky;top:calc(-1 * clamp(14px,3dvh,24px));z-index:2;margin:calc(-1 * clamp(14px,3dvh,24px)) -32px 0 calc(-1 * clamp(12px,3vw,24px));padding:calc(clamp(14px,3dvh,24px) + 6px) 98px 8px clamp(12px,3vw,24px);background:repeating-linear-gradient(135deg,#e9b648 0 11px,#24251f 11px 23px) top left/100% 9px no-repeat,#30312b;box-shadow:0 6px 10px -8px #000c}
.rs-row>.rs-node{min-width:0}
.rs-node.owned{opacity:.72;border-top-color:#8fe0a8}.rs-owned{margin:auto 0 0!important;min-height:44px;display:grid;place-items:center;font:900 15px 'Big Shoulders Display',Impact,sans-serif!important;letter-spacing:.12em;text-transform:uppercase;color:#8fe0a8!important}.rs-node{--card:#deb34e;position:relative;display:flex;flex-direction:column;gap:4px;padding:10px 10px 9px;text-align:center;background:linear-gradient(#2a2b25,#1a201d);border:1px solid #141814;border-top:3px solid var(--card);border-radius:4px;box-shadow:inset 0 2px 6px #0005,0 3px 8px #0006}
.rs-node.can{border-color:#b08a3a;border-top-color:var(--card);box-shadow:inset 0 2px 6px #0005,0 0 0 1px #ffc94d55,0 0 14px #ffc94d33}.rs-node.locked{opacity:.5;filter:grayscale(.6)}
.rs-node.bought{animation:rs-bought .6s ease-out}@keyframes rs-bought{0%{transform:scale(1.04);box-shadow:0 0 0 2px #ffd36a,0 0 28px #ffc94dcc}}
.rs-name{font:800 15px/1.1 'Barlow Condensed',Arial,sans-serif;color:#ffd780}
.rs-val{font:900 32px/1 'Big Shoulders Display',Impact,sans-serif;color:var(--card);text-shadow:0 2px #0009;font-variant-numeric:tabular-nums}.rs-val small{margin-left:5px;font-size:16px;color:#b9b29f}
.rs-income .rs-val{color:#ffd274}.rs-capital .rs-val{color:#8fe0a8}.rs-offline .rs-val{color:#9fb8ff}.rs-robots .rs-val,.rs-lift .rs-val{color:#9fe8e8}
.rs-val small{display:block;margin:2px 0 0;font-size:13px;letter-spacing:.04em}
.rs-fx{margin:0!important;font-size:12px!important;line-height:1.25!important;color:#cdbf9f!important}
.rs-pips{display:flex;justify-content:center;gap:4px;margin:2px 0 4px}.rs-pips i{width:18px;height:5px;background:#151b17;border:1px solid #4a4532}.rs-pips i.on{background:var(--card);border-color:var(--card)}
.rs-lock{margin:auto 0 0!important;min-height:44px;display:grid;place-items:center;font-size:12px!important;color:#ffba87!important}
.rs-node button{margin-top:auto;width:100%;min-height:44px;padding:6px;font:900 17px 'Big Shoulders Display',Impact,sans-serif}
@media(max-height:520px){.rs-intro,.rs-fx{display:none}.rs-val{font-size:24px}.rs-body{gap:6px}}
@media(max-width:420px){.rs-val{font-size:26px}.rs-node{padding:8px 7px}}
.earn-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:8px}
.daily-days{display:flex;justify-content:center;gap:6px}.daily-days i{width:clamp(12px,3dvh,20px);aspect-ratio:1;border:1px solid #79714b;background:#171d18}.daily-days i.on{background:#deb34e;box-shadow:0 0 6px #deb34e88}
@media(max-height:300px){.daily-days{display:none}.earn-actions{grid-template-columns:1fr 1fr;gap:6px}#modal .earnings-card .earn-actions button{min-height:44px;padding:4px 6px;font-size:14px;line-height:1.05}}
/* ---------- Phones: the HUD hugs the screen edges and the cash plate is compact ---------- */
@media(max-width:760px),(max-height:520px){
 :root{--hud-gap:4px}
 #p1,#p2{left:calc(var(--hud-gap) + var(--safe-left))}
 #p1,#od,#mb{top:calc(var(--hud-gap) + var(--safe-top))}
 #mb{right:calc(var(--hud-gap) + var(--safe-right));width:44px;min-height:44px;padding:8px}
 #od{right:calc(var(--hud-gap) + 50px + var(--safe-right));min-height:44px;padding:8px 9px}
 #p1{padding:5px 12px 5px 8px;gap:6px}#p1 img{width:22px;height:22px}
 #money{font-size:20px}#inc{margin-top:1px;font-size:10px}
}
@media(max-width:760px) and (min-height:521px){
 :root{--rack-w:min(148px,calc(100vw - 166px))}
 #p2{top:calc(var(--hud-gap) + 56px + var(--safe-top));padding:4px 10px}#p2 b{font-size:16px}#p2 .rs-tag{display:none}
 #toast{top:calc(120px + var(--safe-top))}
}
@media(max-height:520px){:root{--rack-w:150px}}
/* ---------- FREE offer: a green ad tab beside the cash plate ---------- */
#offer{position:fixed;z-index:3;top:calc(14px + var(--safe-top));left:calc(22px + var(--rack-w) + var(--safe-left));height:56px;min-width:56px;padding:4px 10px;display:grid;justify-items:center;align-content:center;gap:3px;font:900 15px/1 'Big Shoulders Display',Impact,sans-serif;letter-spacing:.08em;color:#0f2a17;background:linear-gradient(#b4f5bc,#5cc777 50%,#2f8a48);border:1px solid #163a20;border-top-color:#e2ffe6;box-shadow:inset 0 1px #fff9,inset 0 -3px #0f3a1d55,0 3px 0 #1d4a2a,0 4px 7px #0007;animation:offer-pulse 1.8s ease-in-out infinite}
#offer:hover:not(:disabled){background:linear-gradient(#c8fbcf,#6fd789 50%,#36994f)}
.offer-play{width:0;height:0;border-left:12px solid currentColor;border-top:7px solid transparent;border-bottom:7px solid transparent}
@keyframes offer-pulse{50%{box-shadow:inset 0 1px #fff9,inset 0 -3px #0f3a1d55,0 3px 0 #1d4a2a,0 0 0 3px #7ef09a55,0 0 18px #7ef09a99}}
@media(prefers-reduced-motion:reduce){#offer{animation:none}}
@media(max-width:760px),(max-height:520px){#offer{top:calc(var(--hud-gap) + var(--safe-top));left:calc(var(--hud-gap)*2 + var(--rack-w) + var(--safe-left));height:49px;min-width:48px;padding:4px 7px;font-size:13px}}
@media(max-width:359px){#offer{left:auto;right:calc(var(--hud-gap) + var(--safe-right));top:calc(var(--hud-gap) + 50px + var(--safe-top));height:44px;min-width:44px}}
/* Tutorial bubble placed beside or below its target: the pointer moves to that edge. */
#tutorial[data-side="right"]:after{left:-9px;top:50%;bottom:auto;transform:translateY(-50%) rotate(135deg)}
#tutorial[data-side="left"]:after{left:auto;right:-9px;top:50%;bottom:auto;transform:translateY(-50%) rotate(-45deg)}
#tutorial[data-side="below"]:after{top:-9px;bottom:auto;transform:translateX(-50%) rotate(225deg)}
/* ---------- Short landscape screens: gears stay visible as a compact chip under the cash plate ---------- */
@media(max-height:520px){
 #p2{top:calc(var(--hud-gap) + 52px + var(--safe-top));width:auto;min-width:0;padding:3px 10px 3px 6px;gap:5px}
 #p2 img{width:18px;height:18px}#p2 b{font-size:15px}#p2 .sm,#p2 .rs-tag{display:none}
}
/* ---------- Core Reboot: the button shows the gears a reboot pays right now ---------- */
#od{display:inline-flex;align-items:center;justify-content:center;gap:6px}
#od .od-gain{padding:1px 5px;border-radius:3px;background:#2b1d0a;color:#ffd274;font:900 12px/1.2 'Big Shoulders Display',Impact,sans-serif;letter-spacing:.04em;white-space:nowrap}
@media(max-width:420px){#od{flex-direction:column;gap:1px;line-height:1.05}#od .od-gain{font-size:11px;padding:0 4px}}
.reboot-gears img{display:block;margin:0 auto 2px;width:clamp(20px,4.5dvh,32px);height:auto}
#modal .reboot-dlg p.reboot-next{font-size:12px;color:#9fe8e8}
#modal .reboot-dlg p.reboot-bonus{font-size:11px;color:#a49f8a;margin-top:-4px}@media(max-height:520px){.reboot-bonus{grid-column:2}}@media(max-height:440px){.reboot-dlg .reboot-bonus{display:none}}@media(max-width:300px){.reboot-bonus{grid-column:1}}
@media(max-height:520px){.reboot-next{grid-column:2}}
@media(max-height:440px){.reboot-dlg .full-copy{display:none}.reboot-dlg .compact-copy{display:inline}.reboot-dlg .reboot-next{display:none}}
@media(max-height:360px){.reboot-dlg .reboot-next,.reboot-gears img{display:none}}
@media(max-width:300px){.reboot-next{grid-column:1}.reboot-gears img{margin:0}}
/* Earned gears fly from the reboot card into the gear plate, which kicks as each one lands. */
.gear-fly{position:fixed;left:0;top:0;width:28px;height:28px;z-index:12;pointer-events:none;filter:drop-shadow(0 0 6px #7fd0d2aa) drop-shadow(0 2px 2px #000a);will-change:transform}
#p1.gear-hit,#p2.gear-hit{animation:gear-hit .28s ease-out}@keyframes gear-hit{40%{transform:scale(1.08);filter:brightness(1.35)}}
/* First reboot: the gear plate pulses and an arrow points at it until the cards are opened. */
#p2.guide-glow{animation:rs-ready 1s ease-in-out infinite;z-index:9}
#p2.guide-glow:before{content:'';position:absolute;left:calc(100% + 16px);top:50%;width:22px;height:30px;margin-top:-15px;background:#fff2b2;clip-path:polygon(100% 15%,0 50%,100% 85%,76% 50%);filter:drop-shadow(0 2px #35220c);animation:gear-point .7s ease-in-out infinite}
@keyframes gear-point{50%{transform:translateX(7px)}}
/* Gear cards level up many times: a level line and bar replace the three pips. */
.rs-level{display:grid;gap:3px;margin:2px 0 4px}.rs-level span{font:800 11px 'Barlow Condensed',Arial,sans-serif;letter-spacing:.1em;text-transform:uppercase;color:#b9b29f}
.rs-level b{display:block;height:5px;background:#151b17;border:1px solid #4a4532}.rs-level i{display:block;height:100%;background:var(--card)}
.rs-build .rs-val,.rs-head .rs-val{color:#8fe0a8}.rs-permit .rs-val{color:#ffba87}.rs-val{overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){#p2.guide-glow,#p2.guide-glow:before,#p2.gear-hit{animation:none!important}}
/* ---------- Gear upgrades on phones and short screens: one vertical list of compact rows, no sideways scrolling ---------- */
@media(max-width:640px),(max-height:520px){
 #modal:has(.research-dlg){padding:6px}
 #modal .research-dlg{max-height:calc(100dvh - 12px);padding:14px 14px 12px}
 #modal .research-dlg .rs-top{top:-14px;margin:-14px -32px 0 -14px;padding:19px 92px 6px 14px}
 .rs-top{gap:8px;padding-right:60px;flex-wrap:wrap}.rs-top h3{font-size:22px;line-height:1}.rs-free{padding:3px 8px}.rs-free b{font-size:17px}
 .rs-intro{display:none}.rs-body{gap:8px;margin-top:8px}.rs-section h4{font-size:13px;margin-bottom:4px}
 .rs-row{display:grid;grid-template-columns:1fr;gap:6px;overflow:visible;padding:0;scroll-snap-type:none}
 .rs-row>.rs-node{flex:none}
 .rs-node{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"name val btn" "fx val btn" "lvl val btn";align-items:center;gap:1px 8px;padding:6px 8px;text-align:left;border-top:1px solid #141814;border-left:4px solid var(--card)}
 .rs-node.can{border-left-color:var(--card)}
 .rs-name{grid-area:name;font-size:14px}
 .rs-fx{grid-area:fx;display:block!important;font-size:11px!important;line-height:1.15!important}
 .rs-level{grid-area:lvl;margin:2px 0 0;gap:2px}.rs-level span{font-size:10px}
 .rs-val{grid-area:val;font-size:21px;text-align:right;min-width:52px}.rs-val small{display:none}
 .rs-node button,.rs-owned{grid-area:btn;width:auto;min-width:78px;min-height:44px;margin:0!important;padding:4px 8px;font-size:15px}
 .rs-owned{font-size:12px!important;min-height:0}
}
@media(max-height:520px) and (min-width:641px){.rs-row{grid-template-columns:1fr 1fr}}
@media(max-width:300px){.rs-node{gap:1px 5px;padding:5px 6px}.rs-fx{display:none!important}.rs-val{font-size:16px;min-width:0}.rs-node button,.rs-owned{min-width:56px;padding:3px 5px;font-size:13px}.rs-name{font-size:12px}.rs-top h3{font-size:18px}}
/* ---------- Guide outlines: bright yellow framed by near-black edges, so they read on yellow and orange scenery ---------- */
:root{--guide:#ffd23f;--guide-hi:#fff6cf;--guide-ink:#120e08}
#tutorial-target{border:3px solid var(--guide)!important;border-radius:4px;outline:2px solid var(--guide-ink);box-shadow:inset 0 0 0 2px var(--guide-ink),0 0 0 6px #120e0855,0 0 22px #ffd23f88!important;animation:guide-box .8s ease-in-out infinite!important}
@keyframes guide-box{50%{border-color:var(--guide-hi);box-shadow:inset 0 0 0 2px var(--guide-ink),0 0 0 9px #120e0866,0 0 30px #ffd23fcc}}
.target-glow{outline:none!important;box-shadow:0 0 0 2px var(--guide-ink),0 0 0 5px var(--guide),0 0 0 7px var(--guide-ink),0 0 18px #ffd23f99!important;animation:guide-ring .8s ease-in-out infinite!important}
#p2.guide-glow{box-shadow:0 0 0 2px var(--guide-ink),0 0 0 5px var(--guide),0 0 0 7px var(--guide-ink),0 0 18px #ffd23f99;animation:guide-ring .8s ease-in-out infinite}
@keyframes guide-ring{50%{box-shadow:0 0 0 2px var(--guide-ink),0 0 0 6px var(--guide-hi),0 0 0 8px var(--guide-ink),0 0 26px #ffd23fdd}}
/* Arrows are outlined shapes (clip-path would cut off any outline). */
#tutorial-target:after{clip-path:none;width:26px;height:22px;top:-30px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 22'%3E%3Cpath d='M2.5 2.5h21L13 19.5z' fill='%23ffd23f' stroke='%23120e08' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;text-shadow:none}
#tutorial.button-cue:after{clip-path:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 30'%3E%3Cpath d='M2 4l18 11L2 26l5-11z' fill='%23ffd23f' stroke='%23120e08' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;text-shadow:none}
#p2.guide-glow:before{clip-path:none;filter:none;border-radius:0;box-shadow:none;right:auto;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 30'%3E%3Cpath d='M20 4L2 15l18 11-5-11z' fill='%23ffd23f' stroke='%23120e08' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
@media(prefers-reduced-motion:reduce){#tutorial-target,.target-glow,#p2.guide-glow{animation:none!important}}
/* Static phone highlights avoid repainting blurred shadows every display frame. */
@media(pointer:coarse){
 #offer,#tutorial-target,.target-glow,#p2.guide-glow{animation:none!important}
 #p1.gain:before{animation:none;background:none}
 #tutorial{transition:none}
}

/* A small common gutter leaves breathing room inside the portal's game viewport. */
@media(max-width:760px),(max-height:520px),(pointer:coarse){
 :root{--hud-gap:8px}
 #p1,#p2{left:calc(var(--hud-gap) + var(--safe-left))}
 #p1,#od,#mb{top:calc(var(--hud-gap) + var(--safe-top))}
 #mb{right:calc(var(--hud-gap) + var(--safe-right))}
 #od{right:calc(var(--hud-gap) + 48px + var(--safe-right));max-width:calc(100vw - var(--rack-w) - 72px - var(--safe-left) - var(--safe-right));min-width:0;white-space:normal;line-height:1.1}
}

/* The panel cue sits beside the button and points at it, instead of overlapping its edge. */
#tutorial.button-cue{rotate:90deg}

/* Later reboots: their own button under the world switch, filling as the next multiplier grows. */
#rb{position:fixed;z-index:6;top:calc(var(--hud-gap,10px) + var(--safe-top,0px));right:calc(var(--hud-gap,10px) + 160px + var(--safe-right,0px));padding:6px 9px;display:inline-flex;align-items:center;gap:6px;overflow:hidden}
#rb:before{content:'';position:absolute;left:0;bottom:0;height:4px;width:calc(100% * var(--reboot,0));background:linear-gradient(90deg,#ffb84a,#d9a441);transition:width .4s}
#rb.ready{animation:reboot-ready 1.6s ease-in-out infinite}
#rb .od-gain{padding:1px 5px;border-radius:3px;background:#2b1d0a;color:#ffd274;font:900 12px/1.2 'Big Shoulders Display',Impact,sans-serif}
.av-mult{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0 2px;font:900 40px/1 'Big Shoulders Display',Impact,sans-serif}
.av-mult span{color:#aab3b8}.av-mult b{color:#d9a441;font-size:28px}.av-mult strong{color:#ffd274;text-shadow:0 0 18px #ffb84a88}
.av-sub{text-align:center;margin:0 0 8px;color:#e9d6a8;font-weight:700}
/* Multiplier reveal after a reboot. */
#mult-reveal{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:radial-gradient(circle at 50% 45%,#2a1a08ee,#0a0704f2 70%);overflow:hidden;cursor:default}
#mult-reveal.ready{cursor:pointer}
#mult-reveal .mr-rays{position:absolute;left:50%;top:45%;width:180vmax;height:180vmax;margin:-90vmax 0 0 -90vmax;background:repeating-conic-gradient(from 0deg,#ffcf6a30 0deg 7deg,#0000 7deg 22.5deg);mask:radial-gradient(circle,#000 0,#0000 60%);-webkit-mask:radial-gradient(circle,#000 0,#0000 60%)}
#mult-reveal .mr-card{position:relative;text-align:center;padding:0 20px}
#mult-reveal .mr-top{margin:0;font:900 clamp(26px,6vw,46px)/1 'Big Shoulders Display',Impact,sans-serif;letter-spacing:.06em;color:#fff1cf;text-transform:uppercase;text-shadow:0 3px 0 #000}
#mult-reveal .mr-num{font:900 clamp(96px,24vw,190px)/1 'Big Shoulders Display',Impact,sans-serif;color:#ffd274;background:linear-gradient(#fff6dc,#ffd274 50%,#e08a1e);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 6px 0 #3a2208) drop-shadow(0 0 30px #ffb84a99)}
#mult-reveal .mr-sub{margin:4px 0 0;font:700 clamp(17px,3.6vw,24px) 'Barlow Condensed',sans-serif;color:#f3e2bd}
#mult-reveal .mr-from{margin:6px 0 0;font:900 20px 'Big Shoulders Display',Impact,sans-serif;color:#d9a441}
#mult-reveal .mr-go{margin:20px auto 0;min-width:220px;min-height:52px;font-size:20px;opacity:0}
#mult-reveal .mr-tap{margin:10px 0 0;font:700 16px 'Barlow Condensed',sans-serif;color:#f3e2bd;opacity:.45}
#mult-reveal .mr-burst{position:absolute;left:50%;top:44%;width:0;height:0;pointer-events:none}
#mult-reveal .mr-gear{position:absolute;left:-17px;top:-17px;width:34px;height:34px;opacity:0;pointer-events:none}
@keyframes mr-in{from{opacity:0}}@keyframes mr-out{to{opacity:0}}@keyframes mr-spin{to{transform:rotate(360deg)}}
@keyframes mr-pop{0%{transform:scale(1)}40%{transform:scale(1.32)}100%{transform:scale(1)}}
@keyframes mr-blink{0%,100%{opacity:.35}50%{opacity:1}}
@keyframes mr-burst{0%{transform:translate(0,0) scale(.3) rotate(0);opacity:0}15%{opacity:1}100%{transform:translate(var(--dx),var(--dy)) scale(1) rotate(540deg);opacity:0}}

/* Repeat reboots: one centred column at every size. */
#modal .reboot-dlg.reboot-again{grid-template-columns:1fr!important;text-align:center;max-width:560px}
#modal .reboot-dlg.reboot-again>*{grid-column:1/-1}
#modal .reboot-again .reboot-lead{margin:4px 12px 2px;font-size:clamp(17px,2.6vw,22px)}
#modal .reboot-again .reboot-small{margin:0 12px 8px}
#modal .reboot-again .av-mult{font-size:clamp(34px,7vw,52px)}
.reward-code-settings{border-top:1px solid #80704b;padding-top:14px;margin-top:12px}
.reward-code-settings>label{display:block;margin-bottom:8px;color:#e8dcc0}
.reward-code-entry{display:flex;gap:8px;align-items:stretch}
.reward-code-entry input{flex:1;min-width:0;min-height:44px;box-sizing:border-box;border:1px solid #81724f;border-radius:7px;padding:10px;background:#171a16;color:#fff0cf;font:700 18px 'Barlow Condensed',sans-serif;user-select:text;-webkit-user-select:text}
.reward-code-entry button{flex:none;min-height:44px}
#reward-code-status{margin:8px 0 0;line-height:1.4;overflow-wrap:anywhere}
#menu.editing-code{top:var(--code-menu-top,12px);max-height:var(--code-menu-height,calc(100dvh - 24px));box-sizing:border-box;animation:none;scroll-behavior:auto;scroll-padding-top:68px;scroll-padding-bottom:12px}
/* Discord keeps the bunker's steel frame, with a small community accent. */
#menu .community-entry{display:flex;align-items:center;gap:10px;width:100%;min-height:68px;margin:10px 0 14px;padding:10px;text-align:left;white-space:normal;background:linear-gradient(115deg,#45466a,#282d32);border:1px solid #9399d66b;border-left:3px solid #909aff;color:#f1f0ff;box-shadow:inset 0 1px #ffffff10}
.community-mark{display:grid;place-items:center;flex:none;width:34px;height:34px;color:#c0c7ff}.community-mark svg{width:30px;height:30px}
.community-copy{flex:1;min-width:0}.community-copy b{display:block;font:800 20px/1.1 'Barlow Condensed',sans-serif}.community-copy small{display:block;margin-top:4px;color:#d3d3e1;font:500 13px/1.2 'Barlow Condensed',sans-serif}
.community-label{flex:0 1 auto;max-width:42%;font:800 15px/1.15 'Barlow Condensed',sans-serif;text-align:right;color:#d2d6ff}
#modal .community-card{position:relative;display:grid;gap:12px;width:100%;max-width:440px;max-height:var(--modal-h);box-sizing:border-box;padding:28px 24px 14px;overflow:auto;animation-name:card-fade;border-top-color:#9ba6ff;background-image:radial-gradient(ellipse at 50% 0,#5b588b66,transparent 65%),linear-gradient(112deg,#393c3b,#222925)}
#modal .community-card .close{top:10px;right:10px;min-height:44px;width:44px;padding:10px}
.community-hero{display:grid;place-items:center;width:68px;height:68px;margin:4px auto 0;border:1px solid #c0c7ff66;border-radius:18px;background:linear-gradient(145deg,#747df1,#4b55b1);box-shadow:inset 0 1px #fff4,0 8px 24px #0004;color:#fff}.community-hero svg{width:42px;height:42px}
.community-eyebrow{font:700 12px/1.2 'Barlow Condensed',sans-serif;letter-spacing:.16em;color:#c0c7f5}
#modal .community-card h3{margin:0;font-size:32px;line-height:1.05;letter-spacing:.035em;color:#f6e8c5}
#modal .community-card p{margin:0;font:500 17px/1.3 'Barlow Condensed',sans-serif;color:#cbd0c4}
.community-reward{display:grid;gap:4px;padding:14px 10px;border:1px solid #caa6576b;border-radius:3px;background:linear-gradient(110deg,#65502a66,#35382866)}
.community-reward strong{font:900 30px/1.1 'Big Shoulders Display',Impact,sans-serif;color:#ffcf74;letter-spacing:.025em}.community-reward span{font:500 15px/1.25 'Barlow Condensed',sans-serif;color:#e4d4b0}
#modal .community-card .community-instructions{font-size:15px;color:#bcbfb5}
.community-actions{display:grid;gap:8px}.community-actions button,.community-join{min-height:46px;padding:10px 12px;font:800 18px/1.15 'Barlow Condensed',sans-serif}
.community-join{display:flex;align-items:center;justify-content:center;gap:10px;border:1px solid #b0b7ff;border-bottom-color:#39449e;border-radius:3px;background:linear-gradient(#737ff1,#535fc8);color:white;text-decoration:none;box-shadow:0 2px 0 #1e254f}
.community-join>svg{width:22px;height:22px;flex:none}.community-join>.ui-icon{width:16px;height:16px}.community-join:hover{filter:brightness(1.12)}.community-join:focus-visible{outline:3px solid #ffdb7d;outline-offset:3px}
.community-later{justify-self:center;min-height:44px;padding:7px 16px;background:none;border-color:transparent;box-shadow:none;color:#bfc1b6;font-size:15px}
@media(max-height:520px){#modal .community-card{gap:8px;padding:16px 20px 8px}.community-hero{width:40px;height:40px;margin:0 auto;border-radius:10px}.community-hero svg{width:27px;height:27px}#modal .community-card h3{font-size:26px}.community-reward{padding:8px}.community-reward strong{font-size:25px}.community-actions{grid-template-columns:1fr 1fr}#modal .community-card p{font-size:15px}.community-later{min-height:44px}}
@media(max-height:360px){.community-hero,.community-eyebrow{display:none}#modal .community-card h3{padding:0 34px;font-size:24px}.community-reward span{font-size:13px}}
@media(max-width:360px){#modal .community-card{padding-left:16px;padding-right:16px}.community-reward strong{font-size:26px}#menu .community-entry{gap:7px}.community-mark{width:28px}.community-copy b{font-size:18px}.community-label{font-size:14px}}
@media(max-width:420px) and (max-height:650px){#modal .community-card{gap:6px;padding:16px}.community-hero,.community-eyebrow{display:none}#modal .community-card h3{padding:0 32px;font-size:24px}#modal .community-card p{font-size:14px}.community-reward{padding:8px}.community-reward strong{font-size:25px}.community-reward span{font-size:13px}#modal .community-card .community-instructions{font-size:13px}.community-actions{gap:6px}.community-actions button,.community-join{min-height:44px;padding:8px}}
/* Keep every action visible; compact layouts use the close button for dismissal. */
#modal .community-card{overflow:hidden}
.community-copy b,.community-server{text-transform:none}
.community-copy small{display:flex;align-items:center;gap:5px}#community-settings-gift{display:inline-flex;color:#ffd274}#community-settings-gift svg{width:17px;height:17px}
.community-reward strong .community-reward-gift{display:inline-flex;vertical-align:-3px;margin-right:8px;color:#ffe09a}.community-reward-gift svg{width:26px;height:26px;filter:drop-shadow(0 0 6px #e9b64866)}
@media(max-height:650px){.community-hero{display:none}#modal .community-card{gap:8px;padding:20px}.community-reward strong{font-size:27px}}
@media(max-height:520px){.community-eyebrow,.community-later{display:none}#modal .community-card{gap:6px;padding:16px}#modal .community-card h3{padding:0 34px;font-size:26px}#modal .community-card p{font-size:14px}.community-reward{padding:8px}.community-reward strong{font-size:25px}.community-reward span{font-size:13px}#modal .community-card .community-instructions{font-size:13px}.community-actions{grid-template-columns:1fr 1fr;gap:8px}.community-actions button,.community-join{min-height:44px;padding:8px;font-size:17px}}
@media(max-height:360px){#community-description,.community-reward>span{display:none}#modal .community-card h3{font-size:24px}.community-reward strong{font-size:24px}.community-reward-gift svg{width:23px;height:23px}}
@media(max-width:360px) and (min-height:521px){.community-reward strong{font-size:23px}.community-reward-gift svg{width:22px;height:22px}#modal .community-card{gap:6px;padding:16px}}
#modal .community-card h3{display:grid;place-items:center;min-height:44px}
#modal .community-card .community-eyebrow{display:block;font-size:11px}
@media(max-width:600px) and (max-height:760px){.community-hero{display:none}}
/* Two-stage notices lead players from Settings to the Discord entry. */
.community-notice{display:grid;place-items:center;position:absolute;pointer-events:none;border-radius:50%;background:#ffd26b;border:2px solid #31200c;color:#2a1906;font:900 18px/1 'Barlow Condensed',sans-serif;box-shadow:0 2px 5px #0008;text-shadow:none;letter-spacing:0}
#community-settings-notice{width:23px;height:23px;right:-5px;top:-5px}
#menu .community-entry{position:relative}
#community-entry-notice{width:19px;height:19px;left:33px;top:5px;font-size:15px}
@media(max-width:360px){#community-entry-notice{left:28px}}
.community-reward strong .community-reward-value{font:inherit;color:inherit}
