:root{--bg:#F5EDE0;--ink:#1D1533;--card:#FFFBF2;--mut:#6E6486;--hot:#FF5A3C;--vio:#4B2A80;--sh:#6A22E8;--line:#1D153322;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#0D0A1A;--ink:#F4ECFF;--card:#1B1531;--mut:#9F95BD;--sh:#B58CFF;--line:#F4ECFF22}}
:root[data-theme="dark"]{--bg:#0D0A1A;--ink:#F4ECFF;--card:#1B1531;--mut:#9F95BD;--sh:#B58CFF;--line:#F4ECFF22}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:400 16px/1.45 "Instrument Sans",system-ui,sans-serif}
.wrap{width:min(100%,1200px);max-width:none;margin:0 auto;padding:calc(clamp(12px,2vw,24px) + env(safe-area-inset-top,0px)) clamp(12px,2vw,24px) calc(40px + env(safe-area-inset-bottom,0px))}
h1,h2{font-family:"Bricolage Grotesque",system-ui,sans-serif;margin:0;letter-spacing:-.02em}
.top{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:12px}
h1{font-size:clamp(34px,7vw,56px);line-height:.95;font-weight:800}
.top p{margin:6px 0 0;color:var(--mut);max-width:38ch}
.hud{display:flex;gap:10px;align-items:center}
.hud div{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:6px 12px;min-width:74px}
.hud small{display:block;color:var(--mut);font-size:12px}.hud b{font:800 22px "Bricolage Grotesque",sans-serif}
#mult{color:var(--hot)}
.stage{position:relative;container-type:inline-size;aspect-ratio:16/9;border-radius:clamp(14px,1.8cqw,22px);overflow:hidden;box-shadow:0 20px 50px -20px #2b1b5a99;background:#2B1B5A}
canvas{display:block;width:100%;height:100%;touch-action:none}#c{visibility:hidden}
.ov{z-index:5;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#120c2acc;padding:12px}
.ov[hidden]{display:none}
.card{background:var(--card);border-radius:18px;padding:22px 26px;text-align:center;max-width:420px}
.card h2{font-size:34px}.card p{color:var(--mut);margin:8px 0 16px}.pause__actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
button{font:600 16px "Instrument Sans",sans-serif;cursor:pointer;border:0;border-radius:999px;padding:12px 22px;background:var(--hot);color:#fff}
button.ghost{background:transparent;color:var(--ink);border:1.5px solid var(--line)}
button:focus-visible,input:focus-visible{outline:3px solid var(--vio);outline-offset:2px}
.pass{display:grid;grid-template-columns:1fr clamp(64px,10cqw,110px);position:relative;overflow:hidden;border-radius:clamp(12px,1.4cqw,18px);width:min(64cqw,720px);max-width:100%;color:#4A3418;
  background-color:#f0e2b6;
  background-image:linear-gradient(45deg,#d9c48c 25%,transparent 25%),linear-gradient(-45deg,#d9c48c 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#d9c48c 75%),linear-gradient(-45deg,transparent 75%,#d9c48c 75%);
  background-size:44px 44px;background-position:0 0,0 22px,22px -22px,-22px 0}
.pass__main{padding:clamp(14px,2cqw,28px);position:relative;z-index:1}
.pass__brand{display:flex;align-items:center;gap:10px}.pass__logo{width:34px;height:auto}
.pass__main h2{font-size:clamp(18px,2.4cqw,32px);font-weight:800;letter-spacing:-.01em}
.pass__row{display:flex;gap:clamp(10px,2cqw,24px);margin:clamp(8px,1.3cqw,16px) 0}.pass__row small{display:block;color:#7A5A2E;font-size:clamp(9px,1.2cqw,14px)}.pass__row b{font:800 clamp(20px,3.2cqw,42px) "Bricolage Grotesque",sans-serif}
.pass input{width:100%;font:600 clamp(14px,1.8cqw,20px) "Instrument Sans",sans-serif;padding:clamp(7px,1cqw,12px) clamp(9px,1.3cqw,16px);border-radius:10px;border:1.5px solid #4A341855;background:#fffaf0cc;color:#4A3418;margin:4px 0 12px}
.pass__row b.rt,.pass__row .rt{font-size:clamp(16px,2.2cqw,28px)}.pass .dest{color:#1E8A5A;text-decoration:underline;cursor:pointer}
.pass__btns{display:flex;gap:8px;flex-wrap:wrap;position:relative;z-index:1}
.pass__btns button{background:linear-gradient(#5a3d22,#3b2614);color:#F2D98A;border:1.5px solid #F2D98A88;box-shadow:0 2px 0 #2a1a0d}
.pass__btns button.ghost{background:transparent;color:#4A3418;border:1.5px solid #4A341855;box-shadow:none}
.pass__money{position:absolute;width:60px;height:94px;opacity:.55;pointer-events:none;
  background-image:url(assets/money-sprite.png);background-size:400% 100%;background-position:0 0;
  filter:drop-shadow(0 2px 4px #0003)}
.pass__money--a{top:8px;right:14px;transform:rotate(8deg)}
.pass__money--b{bottom:54px;right:2px;width:46px;height:72px;transform:rotate(-14deg)}
.pass__stub{background:linear-gradient(#3b2614,#1f1409);color:#F2D98A;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:14px 8px;border-left:2px dashed #F2D98A55}
.pass__stub-logo{width:26px;height:auto}
.pass__pieces{writing-mode:vertical-rl;font-size:22px;letter-spacing:6px;color:#4CC08A;text-shadow:0 1px 2px #0006}
.pass__stub .bars{background:repeating-linear-gradient(90deg,#F2D98A 0 2px,transparent 2px 5px,#F2D98A 5px 6px,transparent 6px 10px)}
.bars{width:52px;height:80px;background:repeating-linear-gradient(90deg,#fff 0 2px,transparent 2px 5px,#fff 5px 6px,transparent 6px 10px)}
#msg{min-height:1.4em;color:var(--hot);font-weight:600;margin:0 0 8px}
.board{margin-top:22px}.board h2{font-size:26px;margin-bottom:8px}.board ol{counter-reset:board-rank}.board li{counter-increment:board-rank}.board li:before{content:counter(board-rank);flex:0 0 28px;color:var(--mut);font-weight:800}
ol{list-style:none;margin:0;padding:0;display:grid;gap:6px}
li{display:flex;justify-content:space-between;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px 14px}
li b{font-family:"Bricolage Grotesque",sans-serif}li.me{border-color:var(--hot)}
.help{color:var(--mut);font-size:14px;margin-top:10px}
@media (max-width:700px){.top{align-items:flex-start;flex-direction:column}.top p{font-size:14px}.hud{width:100%;justify-content:space-between}.hud div{flex:1;text-align:center;min-width:0;padding:5px 6px}.hud b{font-size:19px}.stage{border-radius:12px}.help{font-size:13px}}@media (max-width:560px){.pass{grid-template-columns:1fr;width:96cqw}.pass__stub{display:none}.pass__row{flex-wrap:wrap;gap:10px;margin:10px 0}.pass__row>div{min-width:calc(33.333% - 8px);flex:1}.pass__main{padding:14px}.pass__brand{gap:7px}.pass__logo{width:28px}.pass__main h2{font-size:18px}.pass__btns button{flex:1;min-width:0;padding:11px 10px}.card{width:min(100%,360px);padding:20px 16px}.card h2{font-size:28px}.pause__actions button{min-height:52px}}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
/* Arcade main menu inspired by the supplied menu demo. */
.mobile-tips{z-index:6}.mobile-tips .card{max-width:340px}.mobile-tips__hint{font-size:13px;margin-bottom:0!important}.countdown{z-index:5;background:transparent;color:#d8ffb8;font:800 clamp(70px,18vw,180px)/1 "Bricolage Grotesque",sans-serif;text-shadow:8px 8px 0 #000,-4px -4px 0 #4dff6a;animation:count-pop .45s ease-out}
@keyframes count-pop{from{transform:scale(1.5);opacity:0}to{transform:scale(1);opacity:1}}

.mobile-controls{display:none}
@media (max-width:700px),(pointer:coarse) and (hover:none){.mobile-controls{position:absolute;z-index:4;left:0;right:0;bottom:10px;display:flex;justify-content:space-between;align-items:flex-end;padding:0 14px;pointer-events:none}.mobile-controls button{pointer-events:auto;min-width:112px;min-height:64px;padding:10px 14px;border:3px solid #4dff6a;border-radius:10px;background:linear-gradient(#164c4d,#08142b);box-shadow:0 5px 0 #1d7a3a,inset 0 0 0 2px #0a2b2b;color:#d8ffb8;font:800 15px 'Press Start 2P',monospace;text-shadow:2px 2px #000;touch-action:manipulation}.mobile-controls button:active{transform:translateY(4px);box-shadow:0 1px 0 #1d7a3a,inset 0 0 0 2px #0a2b2b}.mobile-controls button:last-child{border-color:#ffca63;color:#fff0b5;background:linear-gradient(#5a3d22,#2b1b12);box-shadow:0 5px 0 #8a4d22,inset 0 0 0 2px #3d2415}.mobile-controls button:last-child:active{box-shadow:0 1px 0 #8a4d22,inset 0 0 0 2px #3d2415}}


.mobile-controls[hidden]{display:none!important}
.mini-board{display:none}
@media (pointer:coarse){
  body.playing{height:100vh;height:100dvh;overflow:hidden}
  body.playing .wrap{height:100vh;height:100dvh;min-height:0;width:100%;display:flex;flex-direction:column;gap:clamp(6px,1.5vh,12px);padding:env(safe-area-inset-top,0px) clamp(8px,2vw,18px) env(safe-area-inset-bottom,0px)}
  body.playing .top{position:static;display:flex;flex:0 0 auto;align-items:center;flex-direction:row;margin:0;pointer-events:none}
  body.playing .top>div:first-child{display:none}
  body.playing .hud{width:100%;display:flex;flex-direction:row;justify-content:space-between;gap:6px}
  body.playing .hud div{flex:1;min-width:0;padding:clamp(3px,.8vh,7px) 6px;text-align:center}
  body.playing .hud b{font-size:clamp(17px,5vw,25px)}
  body.playing .stage{order:2;align-self:center;width:min(100%,calc((100dvh - 185px)*16/9));height:auto;flex:0 1 auto;aspect-ratio:16/9;margin:0;border-radius:clamp(8px,2vw,16px);box-shadow:0 12px 30px -16px #0008}
  body.playing .mobile-controls{order:3;position:static;display:flex!important;flex:0 0 clamp(54px,9vh,78px);width:100%;padding:0;gap:10px;opacity:1;pointer-events:auto}
  body.playing .mobile-controls button{flex:1;min-width:0;min-height:0;height:100%;padding:8px;font-size:clamp(11px,3.2vw,15px);touch-action:manipulation;user-select:none;-webkit-user-select:none}
  body.playing .mini-board{order:4;display:flex;flex:1 1 auto;min-height:0;overflow:hidden;flex-direction:column;padding:clamp(5px,1vh,9px) 0 0}
  body.playing .mini-board__head{display:flex;align-items:center;justify-content:space-between;gap:8px}
  body.playing .mini-board h2{font-size:clamp(16px,4.5vw,22px);margin:0}
  body.playing .mini-board a{color:#d8ffb8;font-size:clamp(11px,3vw,14px);text-decoration:underline}
  body.playing .mini-board ol{display:grid;grid-template-columns:1fr 1fr;gap:4px 8px;margin-top:5px;overflow:hidden}
  body.playing .mini-board li{padding:4px 8px;font-size:clamp(11px,2.8vw,14px);min-width:0;white-space:nowrap;overflow:hidden}
  body.playing .mini-board li span{overflow:hidden;text-overflow:ellipsis}
  body.playing .mini-board li b{font-size:clamp(11px,2.8vw,14px)}
}
/* Original Gamdom pocket-console shell for active mobile runs. */
@media (pointer:coarse){
  body.playing .wrap{background:#171326}
  body.playing .mobile-console{order:1;display:flex;flex:1 1 auto;min-height:0;flex-direction:column;gap:clamp(6px,1.2vh,10px);width:min(100%,430px);margin:0 auto;padding:clamp(8px,2vw,14px);background:#c8892a;border:clamp(3px,.9vw,6px) solid #edbd52;border-radius:clamp(22px,6vw,36px);box-shadow:inset 0 0 0 clamp(3px,1vw,7px)#9b5b22,0 8px 28px #0008}
  body.playing .top{order:1;width:100%;padding:clamp(4px,1vh,8px) clamp(4px,1.5vw,10px);background:#26233a;border:clamp(2px,.6vw,4px) solid #11101d;border-radius:clamp(7px,2vw,12px);box-shadow:inset 0 0 0 2px #514967}
  body.playing .stage{order:2;width:100%;max-width:none;flex:0 1 auto;aspect-ratio:16/9;border:clamp(5px,1.4vw,9px) solid #11101d;border-radius:clamp(8px,2vw,14px);box-shadow:inset 0 0 0 2px #514967,0 3px 0 #704017}
  body.playing .mobile-controls{order:3;position:relative;display:block!important;flex:0 0 clamp(116px,19vh,164px);width:100%;padding:0;background:#b87522;border:2px solid #704017;border-radius:clamp(10px,3vw,18px);box-shadow:inset 0 0 0 2px #d99c38;opacity:1}
  body.playing .dpad{position:absolute;left:clamp(12px,5vw,28px);top:50%;width:clamp(66px,20vw,88px);height:clamp(66px,20vw,88px);transform:translateY(-58%)}
  body.playing .dpad i{position:absolute;display:block;background:#292536;border:2px solid #15131e;box-shadow:inset 0 0 0 2px #47415a}
  body.playing .dpad-up,body.playing .dpad-down{left:33%;width:34%;height:40%}
  body.playing .dpad-up{top:0;border-radius:8px 8px 2px 2px}.dpad-down{bottom:0;border-radius:2px 2px 8px 8px}
  body.playing .dpad-left,body.playing .dpad-right{top:33%;width:40%;height:34%}
  body.playing .dpad-left{left:0;border-radius:8px 2px 2px 8px}.dpad-right{right:0;border-radius:2px 8px 8px 2px}
  body.playing .dpad-center{left:33%;top:33%;width:34%;height:34%;background:#332d43!important}
  body.playing .handheld-actions{position:absolute;right:clamp(12px,5vw,28px);top:50%;display:flex;flex-direction:row-reverse;gap:clamp(8px,2.5vw,14px);transform:translateY(-58%);align-items:center}
  body.playing .round-button{width:clamp(54px,17vw,76px);height:clamp(54px,17vw,76px);padding:0;border:3px solid #1e1a2a;border-radius:50%;background:#383044;color:#f5d98a;box-shadow:inset 0 -5px 0 #1b1725,0 4px 0 #704017;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;touch-action:manipulation;user-select:none;-webkit-user-select:none}
  body.playing .round-button b{font:800 clamp(18px,5vw,25px) 'Bricolage Grotesque',sans-serif}.round-button span{font:600 clamp(7px,2vw,10px) 'Instrument Sans',sans-serif}
  body.playing .round-button--a{background:#5e3943;color:#ffd6a4}.round-button--b{background:#343044!important;color:#d8cfff!important}
  body.playing .round-button:active{transform:translateY(3px);filter:brightness(1.25);box-shadow:inset 0 -2px 0 #1b1725,0 1px 0 #704017}
  body.playing .handheld-bottom{position:absolute;bottom:clamp(5px,1vh,10px);left:50%;display:flex;gap:clamp(8px,2.5vw,14px);transform:translateX(-50%)}
  body.playing .handheld-bottom button{padding:clamp(3px,1vh,6px) clamp(10px,3vw,18px);border:2px solid #704017;border-radius:999px;background:#d7a13e;color:#542a18;font:800 clamp(8px,2vw,11px) 'Instrument Sans',sans-serif;touch-action:manipulation;user-select:none;-webkit-user-select:none}
  body.playing .handheld-bottom button:active{transform:translateY(2px);filter:brightness(1.15)}
  body.playing .mini-board{order:2;flex:0 0 clamp(104px,17vh,144px);width:min(100%,430px);margin:0 auto;padding:clamp(5px,1vh,9px) 2px 0;background:#211a38;border-radius:12px}
}
.mobile-console:before{content:none!important}
.console-brand{display:none}
.handheld-bottom button:before,.handheld-bottom button:after{content:none!important}
.handheld-bottom button span{display:block}
.ios-hint{position:fixed;z-index:50;left:50%;bottom:calc(12px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:min(92vw,390px);display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #d8cfff55;border-radius:12px;background:#211a38;color:#fff;font-size:13px;box-shadow:0 8px 24px #0008}
.ios-hint[hidden]{display:none}.ios-hint span{flex:1}.ios-hint button{padding:2px 8px;background:transparent;color:#fff;border:1px solid #ffffff66;font-size:18px;line-height:1}
@media (pointer:coarse){
  body.playing .console-brand{display:flex;flex-direction:column;align-items:center;flex:0 0 auto;color:#552b17;font:800 clamp(10px,2.7vw,15px)/1.05 'Bricolage Grotesque',sans-serif;letter-spacing:.08em;text-align:center}
  body.playing .console-brand small{font-size:clamp(8px,2.1vw,12px);letter-spacing:.12em;margin-top:2px}
}
/* Keep the crash card inside the handheld screen. */
@media (pointer:coarse){
  body.playing #over{position:absolute!important;inset:0;z-index:20;overflow:hidden;padding:clamp(5px,1.5vw,12px);background:#120c2af2}
  body.playing #over .pass{display:block;width:100%;max-width:100%;max-height:100%;overflow:auto;border-radius:clamp(8px,2vw,14px)}
  body.playing #over .pass__main{padding:clamp(9px,2vw,16px)}
  body.playing #over .pass__stub{display:none}
  body.playing #over .pass__brand h2{font-size:clamp(14px,4vw,22px)}
  body.playing #over .pass__row{gap:clamp(6px,2vw,12px);margin:clamp(5px,1vw,10px) 0}
  body.playing #over .pass__row b{font-size:clamp(16px,4vw,25px)}
  body.playing #over .pass__row b.rt,body.playing #over .pass__row .rt{font-size:clamp(12px,3vw,18px)}
  body.playing #over .pass input{margin:2px 0 6px;padding:6px 8px;font-size:14px}
  body.playing #over .pass__btns button{padding:8px 9px;font-size:12px}
  .handheld-bottom button:before,.handheld-bottom button:after{content:none!important;display:none!important}
}
@media (pointer:coarse){
  /* More vertical game area while preserving a responsive handheld screen. */
  body.playing .stage{aspect-ratio:3/2}
  body.playing .handheld-bottom button{font-size:0!important;text-shadow:none!important;-webkit-text-shadow:none}
  body.playing .handheld-bottom button:before{content:none!important;display:none!important}
  body.playing .handheld-bottom button:after{content:attr(data-label)!important;display:block;font:800 clamp(8px,2vw,11px)/1 'Instrument Sans',sans-serif;color:#542a18;text-shadow:none!important}
}
@media (pointer:coarse){
  body.playing .handheld-bottom button{font:800 clamp(8px,2vw,11px)/1 'Instrument Sans',sans-serif!important;font-size:clamp(8px,2vw,11px)!important;text-shadow:none!important}
  body.playing .handheld-bottom button:before,body.playing .handheld-bottom button:after{content:none!important;display:none!important}
}
/* Reference-inspired Gamdom handheld shell skin. Controls and playfield geometry remain unchanged. */
@media (pointer:coarse){
  body.playing .mobile-console{
    position:relative;
    background:linear-gradient(145deg,#ffffff 0%,#f5f6f4 58%,#e5e8e5 100%);
    border:clamp(3px,.9vw,6px) solid #d5d8d6;
    border-radius:clamp(26px,7vw,44px) clamp(26px,7vw,44px) clamp(42px,11vw,68px) clamp(42px,11vw,68px);
    box-shadow:inset 0 2px 0 #ffffff, inset 0 -10px 18px #bcc3bf66, 0 16px 32px #05030d66;
    overflow:hidden;
  }
  body.playing .mobile-console:before{
    content:''!important;
    position:absolute;
    z-index:4;
    top:clamp(10px,2.5vw,18px);
    left:clamp(12px,3vw,22px);
    width:clamp(7px,1.8vw,11px);
    height:clamp(7px,1.8vw,11px);
    border-radius:50%;
    background:#23d978;
    border:2px solid #11844d;
    box-shadow:0 0 0 2px #ffffffaa,0 0 10px #23d978;
  }
  body.playing .mobile-console:after{
    content:'';
    position:absolute;
    z-index:3;
    right:clamp(16px,4vw,28px);
    bottom:clamp(11px,2.5vw,20px);
    width:clamp(44px,13vw,68px);
    height:clamp(22px,6vw,34px);
    border-radius:50%;
    opacity:.62;
    background:repeating-linear-gradient(90deg,#87918d 0 2px,transparent 2px 6px);
    filter:drop-shadow(0 1px 0 #fff);
  }
  body.playing .console-brand{
    position:relative;
    z-index:5;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    min-height:clamp(30px,8vw,48px);
    padding:clamp(4px,1vw,8px) clamp(14px,4vw,26px);
    color:#5f7089;
    background:linear-gradient(#ffffff,#edf0ee);
    border:1px solid #d5d9d7;
    border-radius:999px;
    box-shadow:inset 0 1px 2px #fff,0 2px 5px #7d878244;
    letter-spacing:.08em;
    text-align:center;
  }
  body.playing .console-brand span{
    font:800 clamp(11px,3.2vw,18px)/1 'Bricolage Grotesque',sans-serif;
  }
  body.playing .console-brand small{
    margin-top:clamp(2px,.5vw,4px);
    color:#718096;
    font:700 clamp(7px,1.9vw,11px)/1 'Instrument Sans',sans-serif;
    letter-spacing:.16em;
  }
  body.playing .top{
    position:relative;
    z-index:5;
    background:#0d8158;
    border-color:#075f43;
    box-shadow:inset 0 2px 0 #55c99a, inset 0 -3px 0 #075b41, 0 3px 0 #b7c0bc;
  }
  body.playing .hud div{
    background:linear-gradient(#148f63,#08734e);
    border-color:#52c598;
    color:#f1fff8;
    box-shadow:inset 0 1px 0 #85e0b8, inset 0 -2px 0 #075b41;
  }
  body.playing .hud small{color:#d3f7e5}
  body.playing .hud b{color:#ffffff}
  body.playing .stage{
    position:relative;
    z-index:2;
    border:clamp(6px,1.7vw,10px) solid #153c34;
    border-radius:clamp(10px,2.8vw,18px);
    background:#0b1d29;
    box-shadow:inset 0 0 0 2px #4e7569, inset 0 5px 12px #000b, 0 3px 0 #c7ceca;
  }
  body.playing .stage:after{
    content:'';
    position:absolute;
    inset:clamp(6px,1.7vw,10px);
    pointer-events:none;
    border:1px solid #ffffff2e;
    border-radius:clamp(5px,1.5vw,10px);
    box-shadow:inset 0 0 12px #0008;
  }
  body.playing .mobile-controls{
    position:relative;
    z-index:2;
    background:linear-gradient(145deg,#f9faf8,#e9ecea);
    border-color:#cdd2cf;
    box-shadow:inset 0 2px 0 #fff, inset 0 -5px 12px #b7bfbb66, 0 3px 0 #c0c6c3;
  }
}/* Keep the mobile HUD aligned and place the affiliate mark in the shell footer. */
@media (pointer:coarse){
  body.playing .top{align-self:stretch;width:100%;flex:0 0 auto;box-sizing:border-box}
  body.playing .hud{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;width:100%;gap:clamp(6px,1.5vw,10px)}
  body.playing .hud>div{width:100%;min-width:0;min-height:clamp(52px,12vw,76px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;box-sizing:border-box}
  body.playing .console-affiliate{order:4;align-self:center;display:flex;align-items:center;justify-content:center;gap:clamp(4px,1vw,8px);margin-top:auto;margin-bottom:clamp(8px,2vw,14px);padding:clamp(4px,1vw,8px) clamp(12px,3vw,20px);color:#5f7089;text-decoration:none;background:linear-gradient(#fff,#edf0ee);border:1px solid #d5d9d7;border-radius:999px;box-shadow:inset 0 1px 2px #fff,0 2px 5px #7d878244;font:800 clamp(10px,2.8vw,15px)/1 'Bricolage Grotesque',sans-serif;letter-spacing:.08em;z-index:5;touch-action:manipulation}
  body.playing .console-affiliate img{width:clamp(18px,5vw,28px);height:auto}
  body.playing .console-affiliate:active{transform:translateY(1px);filter:brightness(.96)}
}/* The affiliate badge is mobile-shell-only; prevent its intrinsic image from appearing below desktop play. */
.console-affiliate{display:none}
/* Gamdom green branded page backdrop. Content remains above this subtle logo pattern. */
body,
body.playing{background-color:#100b1f}
body{position:relative}
body::before{
  content:'';
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  opacity:.13;
  background-image:url('../assets/logo-mark.png');
  background-repeat:repeat;
  background-size:clamp(44px,6vw,78px);
  background-position:clamp(12px,3vw,48px) clamp(14px,4vw,60px);
}
body>.wrap{position:relative;z-index:1}

/* ===== Desktop handheld shell =====================================================================
   Same pocket-console look as the mobile skin (cream body, green HUD panel, dark screen bezel, dark
   D-pad, round A/B, gold SELECT/START, Gamdom pill) laid out landscape: D-pad | screen | A/B.
   Applies to mouse/keyboard devices (anything that is not pointer:coarse) on windows >= 760px wide, menu AND gameplay. */
@media (min-width:760px) and (not (pointer:coarse)){
  body>.wrap{width:min(100%,1560px)}
  .board,.help,.mini-board{max-width:1200px;margin-left:auto;margin-right:auto}
  .mobile-console{
    --stage-w:clamp(480px,min(1040px,calc((100dvh - 330px)*16/9),calc(100vw - 470px)),1040px);
    position:relative;display:grid;
    grid-template-columns:minmax(130px,1fr) var(--stage-w) minmax(130px,1fr);
    grid-template-areas:". brand ." ". hud ." "left screen right" ". sel ." ". aff .";
    align-items:center;justify-items:center;
    column-gap:clamp(10px,1.6vw,26px);row-gap:clamp(8px,1.4vh,14px);
    width:fit-content;max-width:100%;margin:0 auto 18px;
    padding:clamp(16px,2.6vh,28px) clamp(18px,2.4vw,36px) clamp(12px,2vh,20px);
    background:linear-gradient(145deg,#fff 0%,#f5f6f4 58%,#e5e8e5 100%);
    border:6px solid #d5d8d6;border-radius:56px 56px 96px 96px;
    box-shadow:inset 0 2px 0 #fff,inset 0 -10px 18px #bcc3bf66,0 16px 32px #05030d66;overflow:hidden;
  }
  .mobile-console:before{content:''!important;position:absolute;z-index:4;top:20px;left:34px;width:11px;height:11px;border-radius:50%;
    background:#23d978;border:2px solid #11844d;box-shadow:0 0 0 2px #ffffffaa,0 0 10px #23d978}
  .mobile-console:after{content:'';position:absolute;z-index:3;right:46px;bottom:22px;width:68px;height:34px;border-radius:50%;opacity:.62;
    background:repeating-linear-gradient(90deg,#87918d 0 2px,transparent 2px 6px);filter:drop-shadow(0 1px 0 #fff)}
  .console-brand{grid-area:brand;position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
    min-height:44px;padding:6px 28px;color:#5f7089;background:linear-gradient(#fff,#edf0ee);border:1px solid #d5d9d7;border-radius:999px;
    box-shadow:inset 0 1px 2px #fff,0 2px 5px #7d878244;letter-spacing:.08em;text-align:center}
  .console-brand span{font:800 18px/1 'Bricolage Grotesque',sans-serif}
  .console-brand small{margin-top:4px;color:#718096;font:700 10px/1 'Instrument Sans',sans-serif;letter-spacing:.16em}
  .top{grid-area:hud;position:relative;z-index:1;width:100%;margin:0;padding:8px 10px;background:#0d8158;border:4px solid #075f43;border-radius:12px;
    box-shadow:inset 0 2px 0 #55c99a,inset 0 -3px 0 #075b41,0 3px 0 #b7c0bc}
  .top>div:first-child{display:none}
  .hud{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:10px}
  .hud>div{min-width:0;min-height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
    background:linear-gradient(#148f63,#08734e);border:1px solid #52c598;color:#f1fff8;box-shadow:inset 0 1px 0 #85e0b8,inset 0 -2px 0 #075b41}
  .hud small{color:#d3f7e5}.hud b{color:#fff;font-size:24px}
  .stage{grid-area:screen;position:relative;z-index:2;width:100%;aspect-ratio:16/9;border:10px solid #153c34;border-radius:18px;background:#0b1d29;
    box-shadow:inset 0 0 0 2px #4e7569,inset 0 5px 12px #000b,0 3px 0 #c7ceca}
  .stage:after{content:'';position:absolute;inset:0;pointer-events:none;border:1px solid #ffffff2e;border-radius:8px;box-shadow:inset 0 0 12px #0008;z-index:30}
  /* controls stay visible on desktop (menu, play and crash); their children become grid items of the console */
  .mobile-controls,.mobile-controls[hidden]{display:contents!important}
  .dpad{grid-area:left;position:relative;z-index:2;width:clamp(100px,9vw,136px);aspect-ratio:1;justify-self:center;margin-top:20px}
  .dpad i{position:absolute;display:block;background:#292536;border:2px solid #15131e;box-shadow:inset 0 0 0 2px #47415a;cursor:pointer;transition:filter .08s}
  .dpad i:hover{filter:brightness(1.35)}
  .dpad-up,.dpad-down{left:33%;width:34%;height:40%}.dpad-up{top:0;border-radius:8px 8px 2px 2px}.dpad-down{bottom:0;border-radius:2px 2px 8px 8px}
  .dpad-left,.dpad-right{top:33%;width:40%;height:34%}.dpad-left{left:0;border-radius:8px 2px 2px 8px}.dpad-right{right:0;border-radius:2px 8px 8px 2px}
  .dpad-center{left:33%;top:33%;width:34%;height:34%;background:#332d43!important;cursor:default!important}
  .dpad-left,.dpad-right,.dpad-center{cursor:default!important}.dpad-left:hover,.dpad-right:hover,.dpad-center:hover{filter:none}
  .dpad i:active,.dpad i.pressed{filter:brightness(1.5);transform:translateY(2px)}
  .handheld-actions{grid-area:right;position:relative;z-index:2;display:flex;flex-direction:row-reverse;align-items:center;gap:clamp(10px,1.4vw,20px);justify-self:center;margin-top:20px}
  .round-button{width:clamp(66px,5.8vw,86px);height:clamp(66px,5.8vw,86px);min-width:0;min-height:0;padding:0;border:3px solid #1e1a2a;border-radius:50%;background:#383044;color:#f5d98a;
    box-shadow:inset 0 -5px 0 #1b1725,0 4px 0 #8f98a0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;user-select:none;transition:filter .08s}
  .round-button b{font:800 26px 'Bricolage Grotesque',sans-serif;color:inherit}.round-button span{font:600 10px 'Instrument Sans',sans-serif;color:inherit;display:block}
  .round-button--a{background:#5e3943;color:#ffd6a4;margin-bottom:34px}.round-button--b{background:#343044;color:#d8cfff;margin-top:34px}
  .round-button:hover{filter:brightness(1.2)}
  .round-button:active,.round-button.pressed{transform:translateY(3px);filter:brightness(1.25);box-shadow:inset 0 -2px 0 #1b1725,0 1px 0 #8f98a0}
  .handheld-bottom{grid-area:sel;position:relative;z-index:2;display:flex;gap:18px;justify-content:center}
  .handheld-bottom button{padding:6px 22px;border:2px solid #704017;border-radius:999px;background:#d7a13e;color:#542a18;font:800 12px/1 'Instrument Sans',sans-serif;letter-spacing:.06em;
    box-shadow:0 3px 0 #8a4d22;user-select:none;transition:filter .08s}
  .handheld-bottom button:hover{filter:brightness(1.1)}
  .handheld-bottom button:active,.handheld-bottom button.pressed{transform:translateY(2px);box-shadow:0 1px 0 #8a4d22;filter:brightness(1.15)}
  .console-affiliate{grid-area:aff;position:relative;z-index:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px 20px;color:#5f7089;text-decoration:none;
    background:linear-gradient(#fff,#edf0ee);border:1px solid #d5d9d7;border-radius:999px;box-shadow:inset 0 1px 2px #fff,0 2px 5px #7d878244;font:800 14px/1 'Bricolage Grotesque',sans-serif;letter-spacing:.08em}
  .console-affiliate img{width:26px;height:auto}.console-affiliate:hover{filter:brightness(.97)}
  /* crash card must fit the (now smaller) handheld screen */
  #over{overflow:hidden;padding:clamp(5px,1.2cqw,12px)}
  #over .pass{display:block;max-height:100%;overflow:auto;width:min(86cqw,640px)}
  #over .pass__stub{display:none}#over .pass__main{padding:clamp(10px,1.6cqw,18px)}
  #over .pass__row{margin:clamp(5px,.9cqw,10px) 0}#over .pass input{margin:2px 0 6px}
  .help{text-align:center;color:#a79fc4}
}

/* Desktop leaderboard redesign: a dedicated arcade scoreboard panel. */
@media (min-width:760px) and (not (pointer:coarse)){
  .board{
    width:min(100%,980px);
    margin:34px auto 0;
    padding:24px 26px 28px;
    position:relative;
    overflow:hidden;
    background:linear-gradient(145deg,#102b35 0%,#0b1d29 58%,#101326 100%);
    border:3px solid #1f6f5a;
    border-radius:22px;
    box-shadow:0 12px 30px #05030d66,inset 0 0 0 2px #ffffff0b,inset 0 18px 35px #23d9780b;
  }
  .board:before{content:'TOP RUNNERS';display:block;margin-bottom:4px;color:#55d39a;font:800 11px/1 "Instrument Sans",sans-serif;letter-spacing:.2em}
  .board:after{content:'';position:absolute;top:0;left:26px;right:26px;height:3px;background:linear-gradient(90deg,transparent,#55d39a,#d7a13e,transparent);opacity:.8}
  .board h2{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px;color:#f2fff8;font-size:clamp(28px,3vw,38px);letter-spacing:-.04em}
  .board h2:after{content:'SEASON BOARD';color:#8aa6a4;font:700 11px/1 "Instrument Sans",sans-serif;letter-spacing:.14em}
  .board ol{gap:9px;counter-reset:board-rank}
  .board li{counter-increment:board-rank;min-height:52px;align-items:center;padding:11px 16px;color:#e8fff4;background:linear-gradient(100deg,#163b42,#102831);border:1px solid #2f7866;border-radius:12px;box-shadow:inset 0 1px 0 #ffffff0a;transition:transform .15s,border-color .15s,background .15s}
  .board li:before{content:counter(board-rank,decimal-leading-zero);flex:0 0 42px;color:#7da39e;font:800 16px/1 "Bricolage Grotesque",sans-serif;letter-spacing:.04em}
  .board li span{flex:1;min-width:0;color:#f4fff9;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .board li b{min-width:104px;text-align:right;color:#7dff9f;font-size:22px;letter-spacing:.02em}
  .board li:hover{transform:translateX(4px);border-color:#55d39a;background:linear-gradient(100deg,#1b4e4e,#14333a)}
  .board li:nth-child(1){border-color:#d7a13e;background:linear-gradient(100deg,#3b3220,#173c3d);box-shadow:inset 3px 0 0 #d7a13e,0 0 18px #d7a13e1c}
  .board li:nth-child(1):before{color:#ffd36a}
  .board li:nth-child(2){border-color:#91b7b1;box-shadow:inset 3px 0 0 #91b7b1}
  .board li:nth-child(2):before{color:#c4e2dc}
  .board li:nth-child(3){border-color:#a87852;box-shadow:inset 3px 0 0 #a87852}
  .board li:nth-child(3):before{color:#dba57b}
  .board li.me{outline:2px solid #7dff9f;outline-offset:2px}
}
/* Neon handheld skin inspired by the selected reference design. */
@media (min-width:760px) and (not (pointer:coarse)){
  .mobile-console{
    background:
      linear-gradient(90deg,#10161d1f 0 2px,transparent 2px 6px),
      linear-gradient(145deg,#303841 0%,#151b24 46%,#090e16 100%);
    background-size:7px 100%,100% 100%;
    border-color:#49eaff;
    border-radius:64px 64px 96px 96px;
    box-shadow:inset 0 2px 0 #ffffff66,inset 0 -12px 24px #02050c99,0 0 0 3px #124c83,0 0 24px #20cfffcc,0 18px 38px #02030dcc;
  }
  .mobile-console:before{background:#58ff9c;border-color:#baffdc;box-shadow:0 0 0 2px #ffffffaa,0 0 16px #58ff9c,0 0 30px #20cfff}
  .mobile-console:after{opacity:.8;background:repeating-linear-gradient(90deg,#6c7b87 0 2px,transparent 2px 6px);filter:drop-shadow(0 0 3px #49eaff)}
  .console-brand{color:#d8f8ff;background:linear-gradient(#34404c,#171e28);border-color:#627789;box-shadow:inset 0 1px 2px #ffffff55,0 0 10px #20cfff99,0 2px 5px #0008}
  .console-brand small{color:#86b5c4}
  .top{background:#087d59;border-color:#1edb91;box-shadow:inset 0 2px 0 #8affc8,inset 0 -3px 0 #07543e,0 0 14px #20cfff66,0 3px 0 #0a2538}
  .hud>div{background:linear-gradient(#11966a,#075b48);border-color:#54ffc0;box-shadow:inset 0 1px 0 #b1ffdd,inset 0 -2px 0 #043f38,0 0 8px #23d97855}
  .stage{border-color:#42e9ff;background:#071b2d;box-shadow:inset 0 0 0 3px #0c4774,0 0 0 2px #176d9e,0 0 22px #20cfffcc,0 8px 16px #000b}
  .dpad i{background:linear-gradient(145deg,#273b50,#101b2a);border-color:#70efff;box-shadow:inset 0 0 0 2px #1d7091,0 0 12px #20cfff99;color:#d8fbff}
  .dpad i:hover{filter:brightness(1.35);box-shadow:inset 0 0 0 2px #9effff,0 0 22px #20cfff}
  .dpad-center{background:#17283a!important}
  .round-button{background:radial-gradient(circle at 35% 25%,#56758a,#17283a 62%);border-color:#69efff;color:#e5fcff;box-shadow:inset 0 -5px 0 #08131f,0 0 0 2px #155779,0 0 17px #20cfffcc}
  .round-button--a{background:radial-gradient(circle at 35% 25%,#71815b,#263b34 64%);border-color:#71ff9f;color:#d9ffe3}
  .round-button--b{background:radial-gradient(circle at 35% 25%,#56758a,#17283a 64%);color:#d8fbff}
  .round-button:hover{filter:brightness(1.25)}
  .handheld-bottom button{background:linear-gradient(#3d7180,#152d3d);border-color:#67eaff;color:#d8fbff;box-shadow:0 0 12px #20cfff99}
  .console-affiliate{color:#d8f8ff;background:linear-gradient(#34404c,#171e28);border-color:#627789;box-shadow:inset 0 1px 2px #ffffff55,0 0 12px #20cfff99}
}
@media (pointer:coarse){
  body.playing .mobile-console{background:linear-gradient(90deg,#10161d1f 0 2px,transparent 2px 6px),linear-gradient(145deg,#303841,#111822 54%,#090e16);background-size:7px 100%,100% 100%;border-color:#49eaff;box-shadow:inset 0 2px 0 #ffffff55,inset 0 -8px 18px #02050c99,0 0 0 2px #124c83,0 0 20px #20cfffcc,0 8px 28px #000b}
  body.playing .top{background:#087d59;border-color:#1edb91;box-shadow:inset 0 2px 0 #8affc8,inset 0 -3px 0 #07543e,0 0 12px #20cfff66}
  body.playing .hud div{background:linear-gradient(#11966a,#075b48);border-color:#54ffc0;box-shadow:inset 0 1px 0 #b1ffdd,inset 0 -2px 0 #043f38,0 0 8px #23d97855}
  body.playing .stage{border-color:#42e9ff;box-shadow:inset 0 0 0 2px #0c4774,0 0 0 2px #176d9e,0 0 18px #20cfffcc,0 3px 0 #124c83}
  body.playing .dpad i{background:linear-gradient(145deg,#273b50,#101b2a);border-color:#70efff;box-shadow:inset 0 0 0 2px #1d7091,0 0 10px #20cfff99}
  body.playing .dpad-center{background:#17283a!important}
  body.playing .round-button{background:radial-gradient(circle at 35% 25%,#56758a,#17283a 62%);border-color:#69efff;color:#e5fcff;box-shadow:inset 0 -5px 0 #08131f,0 0 0 2px #155779,0 0 14px #20cfffcc}
  body.playing .round-button--a{background:radial-gradient(circle at 35% 25%,#71815b,#263b34 64%);border-color:#71ff9f;color:#d9ffe3}
  body.playing .round-button--b{background:radial-gradient(circle at 35% 25%,#56758a,#17283a 64%);color:#d8fbff}
  body.playing .handheld-bottom button{background:linear-gradient(#3d7180,#152d3d);border-color:#67eaff;color:#d8fbff;box-shadow:0 0 10px #20cfff99}
}
/* Final mobile control pass: match the neon shell and square up the D-pad. */
@media (min-width:760px) and (not (pointer:coarse)), (pointer:coarse){
  .dpad{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:0;aspect-ratio:1}
  .dpad i{position:static!important;width:auto!important;height:auto!important;margin:0;border-radius:0!important;transform:none!important}
  .dpad-up{grid-column:2;grid-row:1;border-radius:10px 10px 2px 2px!important}
  .dpad-left{grid-column:1;grid-row:2;border-radius:10px 2px 2px 10px!important}
  .dpad-center{grid-column:2;grid-row:2;border-radius:2px!important}
  .dpad-right{grid-column:3;grid-row:2;border-radius:2px 10px 10px 2px!important}
  .dpad-down{grid-column:2;grid-row:3;border-radius:2px 2px 10px 10px!important}
  .dpad i:after{content:'';display:block;width:0;height:0;margin:auto;position:relative;top:calc(50% - 7px);border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:9px solid #d8fbff;filter:drop-shadow(0 0 3px #20cfff)}
  .dpad-left:after{transform:rotate(-90deg)}
  .dpad-right:after{transform:rotate(90deg)}
  .dpad-down:after{transform:rotate(180deg)}
  .dpad-center:after{display:none!important}
}
@media (pointer:coarse){
  body.playing .mobile-controls{background:linear-gradient(145deg,#303841 0%,#151b24 46%,#090e16 100%);border-color:#49eaff;box-shadow:inset 0 2px 0 #ffffff55,inset 0 -8px 18px #02050c99,0 0 0 2px #124c83,0 0 20px #20cfffcc,0 8px 22px #000b}
  body.playing .console-brand{color:#d8f8ff;background:linear-gradient(#34404c,#171e28);border-color:#627789;box-shadow:inset 0 1px 2px #ffffff55,0 0 10px #20cfff99,0 2px 5px #0008}
  body.playing .console-brand small{color:#86b5c4}
  body.playing .console-affiliate{color:#d8f8ff;background:linear-gradient(#34404c,#171e28);border-color:#627789;box-shadow:inset 0 1px 2px #ffffff55,0 0 12px #20cfff99}
  body.playing .handheld-bottom button:after{color:#d8fbff!important}
  body.playing .dpad{position:absolute;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:0}
}

/* Mobile menu state: keep the same compact handheld, with the board below it. */
@media (pointer:coarse){
  body:not(.playing) .mobile-console{display:flex;flex-direction:column;gap:clamp(6px,1.2vh,10px);width:min(100%,430px);margin:0 auto;padding:clamp(8px,2vw,14px);background:linear-gradient(90deg,#10161d1f 0 2px,transparent 2px 6px),linear-gradient(145deg,#303841,#111822 54%,#090e16);background-size:7px 100%,100% 100%;border:clamp(3px,.9vw,6px) solid #49eaff;border-radius:clamp(26px,7vw,44px) clamp(26px,7vw,44px) clamp(42px,11vw,68px) clamp(42px,11vw,68px);box-shadow:inset 0 2px 0 #ffffff55,inset 0 -8px 18px #02050c99,0 0 0 2px #124c83,0 0 20px #20cfffcc,0 8px 28px #000b;overflow:hidden}
  body:not(.playing) .console-brand{display:flex;flex:0 0 auto;position:relative;z-index:5;align-items:center;justify-content:center;flex-direction:column;min-height:clamp(30px,8vw,48px);padding:clamp(4px,1vw,8px) clamp(14px,4vw,26px);color:#d8f8ff;background:linear-gradient(#34404c,#171e28);border:1px solid #627789;border-radius:999px;box-shadow:inset 0 1px 2px #ffffff55,0 0 10px #20cfff99,0 2px 5px #0008;letter-spacing:.08em;text-align:center}
  body:not(.playing) .console-brand span{font:800 clamp(11px,3.2vw,18px)/1 'Bricolage Grotesque',sans-serif}
  body:not(.playing) .console-brand small{margin-top:clamp(2px,.5vw,4px);color:#86b5c4;font:700 clamp(7px,1.9vw,11px)/1 'Instrument Sans',sans-serif;letter-spacing:.16em}
  body:not(.playing) .top{position:relative;z-index:5;display:block;flex:0 0 auto;width:100%;margin:0;padding:clamp(4px,1vh,8px) clamp(4px,1.5vw,10px);background:#087d59;border:clamp(2px,.6vw,4px) solid #1edb91;border-radius:clamp(7px,2vw,12px);box-shadow:inset 0 2px 0 #8affc8,inset 0 -3px 0 #07543e,0 0 12px #20cfff66}
  body:not(.playing) .top>div:first-child{display:none}
  body:not(.playing) .hud{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:clamp(6px,1.5vw,10px)}
  body:not(.playing) .hud>div{min-width:0;min-height:clamp(48px,12vw,70px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:linear-gradient(#11966a,#075b48);border:1px solid #54ffc0;box-shadow:inset 0 1px 0 #b1ffdd,inset 0 -2px 0 #043f38,0 0 8px #23d97855}
  body:not(.playing) .stage{position:relative;z-index:2;width:100%;max-width:none;aspect-ratio:3/2;border:clamp(6px,1.7vw,10px) solid #42e9ff;border-radius:clamp(10px,2.8vw,18px);background:#071b2d;box-shadow:inset 0 0 0 2px #0c4774,0 0 0 2px #176d9e,0 0 18px #20cfffcc,0 3px 0 #124c83;overflow:hidden}
  body:not(.playing) .mobile-controls{position:relative;display:block!important;width:min(100%,430px);height:clamp(116px,19vh,164px);margin:clamp(6px,1.2vh,10px) auto 0;padding:0;background:linear-gradient(145deg,#303841,#111822 54%,#090e16);border:2px solid #49eaff;border-radius:clamp(10px,3vw,18px);box-shadow:inset 0 2px 0 #ffffff55,inset 0 -8px 18px #02050c99,0 0 0 2px #124c83,0 0 20px #20cfffcc;opacity:1}
  body:not(.playing) .dpad{position:absolute;display:grid}
  body:not(.playing) .handheld-actions{position:absolute}
  body:not(.playing) .handheld-bottom{position:absolute}
  body:not(.playing) .console-affiliate{display:flex;align-items:center;justify-content:center;gap:clamp(4px,1vw,8px);margin:clamp(8px,2vw,14px) auto 0;padding:clamp(4px,1vw,8px) clamp(12px,3vw,20px);color:#d8f8ff;background:linear-gradient(#34404c,#171e28);border:1px solid #627789;border-radius:999px;box-shadow:inset 0 1px 2px #ffffff55,0 0 12px #20cfff99;font:800 clamp(10px,2.8vw,15px)/1 'Bricolage Grotesque',sans-serif;letter-spacing:.08em}
  body:not(.playing) .console-affiliate img{width:clamp(18px,5vw,28px);height:auto}
}
/* Match menu-state controls to the normal mobile handheld geometry. */
@media (pointer:coarse){
  body:not(.playing) .dpad{left:clamp(12px,5vw,28px);top:50%;width:clamp(66px,20vw,88px);height:clamp(66px,20vw,88px);transform:translateY(-58%)}
  body:not(.playing) .handheld-actions{right:clamp(12px,5vw,28px);top:50%;display:flex;flex-direction:row-reverse;gap:clamp(8px,2.5vw,14px);transform:translateY(-58%);align-items:center}
  body:not(.playing) .round-button{width:clamp(54px,17vw,76px);height:clamp(54px,17vw,76px);padding:0;border:3px solid #69efff;border-radius:50%;background:radial-gradient(circle at 35% 25%,#56758a,#17283a 62%);color:#e5fcff;box-shadow:inset 0 -5px 0 #08131f,0 0 0 2px #155779,0 0 14px #20cfffcc;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;touch-action:manipulation;user-select:none}
  body:not(.playing) .round-button b{font:800 clamp(18px,5vw,25px) 'Bricolage Grotesque',sans-serif}
  body:not(.playing) .round-button span{font:600 clamp(7px,2vw,10px) 'Instrument Sans',sans-serif;display:block}
  body:not(.playing) .round-button--a{background:radial-gradient(circle at 35% 25%,#71815b,#263b34 64%);border-color:#71ff9f;color:#d9ffe3}
  body:not(.playing) .handheld-bottom{bottom:clamp(5px,1vh,10px);left:50%;display:flex;gap:clamp(8px,2.5vw,14px);transform:translateX(-50%)}
  body:not(.playing) .handheld-bottom button{padding:clamp(3px,1vh,6px) clamp(10px,3vw,18px);border:2px solid #67eaff;border-radius:999px;background:linear-gradient(#3d7180,#152d3d);color:#d8fbff;font:800 clamp(8px,2vw,11px) 'Instrument Sans',sans-serif;box-shadow:0 0 10px #20cfff99;white-space:nowrap}
}
/* Final mobile menu control sizing: prevent generic touch-button rules from stretching controls. */
@media (pointer:coarse){
  body:not(.playing) .mobile-controls{position:relative;display:block!important;overflow:hidden}
  body:not(.playing) .mobile-controls button{min-width:0!important;min-height:0!important;flex:none!important;box-sizing:border-box}
  body:not(.playing) .dpad{z-index:2;width:clamp(66px,20vw,88px)!important;height:clamp(66px,20vw,88px)!important}
  body:not(.playing) .handheld-actions{z-index:2;right:clamp(12px,5vw,28px);top:50%;width:auto;display:flex;flex-direction:row-reverse;align-items:center}
  body:not(.playing) .round-button{flex:0 0 auto!important;width:clamp(54px,17vw,76px)!important;height:clamp(54px,17vw,76px)!important;min-width:0!important;min-height:0!important;padding:0!important}
  body:not(.playing) .handheld-bottom{z-index:3;bottom:clamp(5px,1vh,10px);left:50%;width:max-content;display:flex;align-items:center;gap:clamp(8px,2.5vw,14px)}
  body:not(.playing) .handheld-bottom button{flex:0 0 auto!important;width:clamp(72px,22vw,104px)!important;height:clamp(30px,9vw,42px)!important;min-width:0!important;min-height:0!important;padding:0!important;font-size:clamp(8px,2vw,11px)!important;line-height:1!important}
}
/* Responsive edge-case safeguards. */
@media (pointer:coarse) and (max-width:380px){
  body.playing .wrap{padding-left:6px;padding-right:6px;gap:6px}
  body.playing .mobile-console{width:100%;padding:7px;border-radius:24px 24px 38px 38px}
  body.playing .console-brand{min-height:32px;padding:4px 12px}
  body.playing .console-brand span{font-size:clamp(10px,3vw,15px)}
  body.playing .console-brand small{font-size:8px}
  body.playing .top{padding:4px 5px}
  body.playing .hud{gap:4px}
  body.playing .hud>div{min-height:46px;padding:3px}
  body.playing .hud small{font-size:10px}
  body.playing .hud b{font-size:clamp(17px,5.5vw,22px)}
  body.playing .stage{aspect-ratio:16/9}
  body.playing .mobile-controls{flex-basis:118px}
  body.playing .mini-board{flex-basis:112px}
  body.playing .mini-board ol{gap:3px 5px}
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:600px){
  body.playing{overflow:auto}
  body.playing .wrap{height:auto;min-height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) clamp(154px,24vw,220px);grid-template-rows:auto auto auto auto;grid-template-areas:"console controls" "console affiliate" "board board" "help help";align-items:center;column-gap:clamp(8px,2vw,18px);row-gap:8px;padding:8px max(8px,env(safe-area-inset-left)) 12px max(8px,env(safe-area-inset-right))}
  body.playing .mobile-console{grid-area:console;width:100%;margin:0;align-self:center;padding:8px;border-radius:28px 28px 48px 48px}
  body.playing .top{padding:5px 6px}
  body.playing .console-brand{min-height:32px;padding:4px 12px}
  body.playing .console-brand span{font-size:clamp(11px,2.2vw,16px)}
  body.playing .console-brand small{font-size:8px}
  body.playing .stage{aspect-ratio:16/9;border-width:6px}
  body.playing .mobile-controls{grid-area:controls;width:100%;height:clamp(108px,42vh,170px);flex:none;margin:0;align-self:end}
  body.playing .dpad{left:10px;width:clamp(58px,12vw,82px)!important;height:clamp(58px,12vw,82px)!important}
  body.playing .handheld-actions{right:10px;gap:6px}
  body.playing .round-button{width:clamp(48px,11vw,68px)!important;height:clamp(48px,11vw,68px)!important}
  body.playing .handheld-bottom{bottom:6px;gap:6px}
  body.playing .handheld-bottom button{width:clamp(58px,10vw,82px)!important;height:28px!important;padding:0!important}
  body.playing .console-affiliate{grid-area:affiliate;margin:0;align-self:start;justify-self:center}
  body.playing .mini-board{grid-area:board;width:100%;max-width:none;margin:0}
  body.playing .help{grid-area:help;margin:0;text-align:center}
}
/* Branded first-load screen while game art is being prepared. */
.asset-loader{position:fixed;inset:0;z-index:100;display:grid;place-items:center;background:radial-gradient(circle at 50% 42%,#172c4b 0,#0b1427 42%,#100b1f 100%);color:#f5f8ff;opacity:1;visibility:visible;transition:opacity .28s ease,visibility 0s linear 0s}
.asset-loader__card{display:grid;justify-items:center;gap:9px;min-width:min(260px,78vw);padding:24px 30px;border:2px solid #48e8ff;border-radius:22px;background:linear-gradient(145deg,rgba(20,44,67,.96),rgba(12,20,39,.98));box-shadow:0 0 16px #25dfff,0 0 44px rgba(43,130,255,.42),inset 0 0 20px rgba(54,235,255,.12);text-align:center}
.asset-loader__logo{width:42px;height:42px;object-fit:contain;filter:drop-shadow(0 0 8px #42ecff);animation:loaderPulse 1.15s ease-in-out infinite}
.asset-loader__card b{font:800 17px/1.1 system-ui,sans-serif;letter-spacing:.12em;color:#eaffff;text-shadow:0 0 8px #51eaff}
.asset-loader__card small{font:600 11px/1.2 system-ui,sans-serif;letter-spacing:.08em;color:#9db9d6}
.asset-loader.is-ready{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .28s ease,visibility 0s linear .28s}
@keyframes loaderPulse{50%{transform:scale(1.08);filter:drop-shadow(0 0 15px #42ecff)}}
@media(prefers-reduced-motion:reduce){.asset-loader__logo{animation:none}.asset-loader{transition:none}.asset-loader.is-ready{transition:none}}

/* Final portrait screen sizing: give the gameplay display more vertical presence inside the handheld. */
@media (pointer:coarse) and (orientation:portrait){
  body.playing .mobile-console{gap:clamp(7px,1.5vh,12px)}
  body.playing .stage{aspect-ratio:3/2;margin-top:clamp(4px,1.2vh,10px)}
}


/* Reduced-motion accessibility: keep the game readable without decorative animation. */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
  .asset-loader__logo{animation:none!important}
}


/* Translucent HUD panel: let the neon handheld shell show through the green score area. */
.mobile-console > .top{background:linear-gradient(135deg,rgba(17,150,106,.38),rgba(7,91,72,.2))!important;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.mobile-console > .top .hud>div{background:linear-gradient(135deg,rgba(17,150,106,.48),rgba(7,91,72,.28))!important}

/* Developer debug controls. Compact, collapsible, and available on desktop/mobile. */
.debug-tools{position:fixed;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));z-index:110;font:600 12px/1.25 'Instrument Sans',sans-serif;color:#dffcff}
.debug-tools__toggle{border:1px solid #65efff;border-radius:999px;padding:7px 13px;background:linear-gradient(135deg,#123b59,#101b35);color:#dffcff;font:800 11px 'Bricolage Grotesque',sans-serif;letter-spacing:.12em;box-shadow:0 0 12px #20dfff99;cursor:pointer}
.debug-tools__toggle[aria-expanded=true]{border-color:#71ff9f;color:#baffce}
.debug-tools__body{width:min(250px,calc(100vw - 20px));margin-top:7px;padding:11px;border:1px solid #38dfff;border-radius:14px;background:rgba(7,18,35,.96);box-shadow:0 0 18px #20dfff66,0 12px 30px #0009;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.debug-tools__body label{display:grid;gap:4px;margin-bottom:8px;color:#9ed9e8}
.debug-tools__body select{width:100%;padding:6px 7px;border:1px solid #3daec4;border-radius:7px;background:#101d35;color:#efffff;font:600 12px 'Instrument Sans',sans-serif}
.debug-tools__check{display:flex!important;grid-template-columns:none!important;align-items:center;gap:7px!important;color:#dffcff!important}
.debug-tools__check input{accent-color:#4cff9f}
.debug-tools__actions{display:flex;gap:6px;margin-top:10px}
.debug-tools__actions button{flex:1;padding:7px 5px;border:1px solid #71ff9f;border-radius:8px;background:#123b3e;color:#dfffe6;font:800 10px 'Instrument Sans',sans-serif;cursor:pointer}
.debug-tools__actions .ghost{border-color:#54dfff;background:#12243a;color:#dffcff}
@media(pointer:coarse){
  .debug-tools{top:max(7px,env(safe-area-inset-top));right:7px}
  .debug-tools__body{width:min(230px,calc(100vw - 14px));padding:9px}
}