*{box-sizing:border-box} :root{font-family:'Trebuchet MS',system-ui,sans-serif;color:#27344b;background:#78c8f3}body{margin:0;background:radial-gradient(ellipse at 10% 10%,#e6f7ff 0,transparent 30%),linear-gradient(#76c8f4,#c4effd);min-height:100dvh}button,select{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible,select:focus-visible,a:focus-visible{outline:4px solid #552ca8;outline-offset:4px}button:disabled{opacity:.45;cursor:default}button{touch-action:manipulation}[hidden]{display:none!important}header{max-width:1300px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:14px 24px 8px;gap:16px}.brand{font-size:clamp(28px,4vw,47px);font-weight:1000;letter-spacing:-2.5px;text-decoration:none;color:white;-webkit-text-stroke:2px #101d45;paint-order:stroke fill;text-shadow:0 4px #172966,0 7px #32a5df;transform:rotate(-3deg);white-space:nowrap}.brand span{color:#ffd535;font-size:1.22em}.brand b{color:#ff4f97}.brand i{color:#ffcb29;font-style:normal;font-size:.7em;vertical-align:top;letter-spacing:0}.header-actions{display:flex;gap:8px}.header-actions button{border:2px solid white;border-radius:12px;background:#ffffffce;color:#26496a;font-weight:800;padding:9px 14px;box-shadow:0 3px #448ebb33;font-size:14px}main{max-width:1220px;margin:auto;padding:6px 20px 12px}.game-shell{position:relative;isolation:isolate;border:5px solid #fff;border-radius:28px;background:#7bcbea;box-shadow:0 12px 0 #28588124,0 20px 48px #135a8929;overflow:hidden}.hud{position:absolute;left:2%;right:2%;top:14px;display:grid;grid-template-columns:repeat(4,1fr);gap:8px;z-index:2;pointer-events:none}.player-card{display:flex;align-items:center;gap:5px;min-width:0;border:3px solid white;border-radius:17px;padding:4px 7px;background:var(--tint);box-shadow:0 4px 0 #0002}.player-card.out{filter:grayscale(1);opacity:.65}.head{width:48px;height:53px;flex-shrink:0;background-repeat:no-repeat;background-size:400% auto;background-position-y:18%;}.player-card strong{font-size:16px;display:block;white-space:nowrap}.player-card small{font-size:12px;font-weight:800}.stats{font-size:12px;white-space:nowrap;margin-top:3px}.timer{position:absolute;left:50%;top:96px;transform:translateX(-50%);color:white;background:#173e6ddd;border:3px solid #fff;border-radius:16px;text-align:center;padding:4px 18px;z-index:2;pointer-events:none;box-shadow:0 3px #0002}.timer span{font-size:24px;font-weight:1000;line-height:1.1}.timer small{display:block;font-size:11px;font-weight:900;letter-spacing:1px}.timer.danger{background:#c63f45}.stage{position:relative;aspect-ratio:1100/850}canvas{display:block;width:100%;height:100%;touch-action:none}.overlay{position:absolute;inset:0;z-index:4;display:flex;justify-content:center;align-items:center;background:#12486a48;backdrop-filter:blur(3px);padding:18px}.panel{width:min(820px,100%);border:4px solid white;border-radius:28px;background:linear-gradient(#fffcf3,#fff4db);padding:24px;text-align:center;box-shadow:0 10px 0 #223f6040,0 18px 60px #183c6355}.eyebrow{font-size:12px;font-weight:1000;letter-spacing:2px;color:#788ba2}h1{font-size:clamp(23px,3vw,34px);margin:8px 0 19px;color:#273553}h2{font-size:30px;margin:10px 0}.characters{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.character{position:relative;overflow:hidden;min-width:0;padding:0 4px 12px;border:3px solid #fff;border-radius:20px;background:linear-gradient(#fff8,var(--tint));color:#252743;box-shadow:0 4px #0001;transition:transform .16s,border-color .16s}.character:hover{transform:translateY(-4px)}.character.selected{border-color:#ffba20;box-shadow:0 0 0 3px #ffda65,0 7px #db942533;transform:translateY(-5px)}.character strong{font-size:17px;display:block}.character small{font-size:12px;display:block;color:#596077;margin-top:3px}.character .portrait{width:100%;aspect-ratio:1/1.1;background-repeat:no-repeat;background-size:400% 100%;}.character.selected:after{content:'✓';position:absolute;right:7px;top:7px;width:24px;height:24px;border-radius:50%;background:#ffcb32;font-weight:bold;color:#4c3900}.options{display:flex;justify-content:center;gap:25px;margin:22px 0 18px}label{font-size:14px;text-align:left;font-weight:800;display:grid;gap:6px}select{font-size:16px;padding:9px 35px 9px 12px;background:white;color:#2d3852;border:2px solid #d8deea;border-radius:10px}.primary{display:block;width:min(360px,100%);margin:auto;border:3px solid white;border-radius:17px;background:linear-gradient(#ffd952,#ffb731);color:#4e3316;font-size:22px;font-weight:1000;padding:12px 20px;box-shadow:0 5px #c68526}.primary:hover{filter:brightness(1.06)}.primary:active{transform:translateY(3px);box-shadow:0 2px #c68526}.hint{font-size:14px;margin:18px 0 0;color:#687589}.compact{max-width:420px}.compact p{color:#63738b;font-size:16px;line-height:1.5}.secondary{display:block;margin:18px auto 0;border:0;background:transparent;font-size:16px;font-weight:800;color:#395274;padding:10px}.winner-portrait{margin:auto;width:150px;height:170px;background-size:400% 100%;background-repeat:no-repeat}.countdown{position:absolute;inset:0;display:grid;place-items:center;z-index:3;color:#fff;font-size:100px;font-weight:1000;-webkit-text-stroke:5px #213d64;paint-order:stroke fill;text-shadow:0 8px #23355566;pointer-events:none}.controls{position:absolute;bottom:17px;left:23px;right:23px;display:flex;align-items:end;justify-content:space-between;z-index:3;pointer-events:none}.bomb-button{width:120px;height:120px;border:5px solid white;outline:3px solid #7d282e;border-radius:50%;background:radial-gradient(circle at 40% 30%,#ff9d9d,#e43043);color:white;box-shadow:0 6px #9b253b;pointer-events:auto;user-select:none;touch-action:none}.bomb-button span{font-size:46px;display:block;line-height:1}.bomb-button b{font-size:14px;letter-spacing:2px;display:block;margin-top:6px}.bomb-button:active{transform:translateY(4px);box-shadow:0 2px #9b253b}.power-legend{display:flex;gap:18px;background:#ffffffdb;padding:9px 14px;border-radius:12px;font-size:12px;font-weight:800;margin-bottom:1px;color:#36516d}footer{display:flex;justify-content:space-between;gap:20px;align-items:center;font-size:13px;font-weight:700;color:#3a647f;padding:17px 6px 0}kbd{font:inherit;background:#fff8;border-radius:4px;padding:3px 5px}.mobile-help{display:none}body.in-menu .controls{visibility:hidden}body.in-menu .hud,body.in-menu .timer{opacity:.25}body:not(.in-menu) .header-actions #menu{display:block}body.in-menu #pause{display:none}
@media(min-width:1000px){main{max-width:1120px}.game-shell{max-height:calc(100dvh - 125px);min-height:530px}.stage{max-height:calc(100dvh - 135px)}canvas{object-fit:contain}.controls{bottom:12px}.bomb-button{width:102px;height:102px}}
@media(max-width:650px){header{padding:12px 12px 9px}.header-actions button{padding:7px 9px}.header-actions button span{display:none}.brand{font-size:32px}main{padding:4px 6px}.game-shell{border-width:3px;border-radius:19px;overflow:visible}.stage{aspect-ratio:1100/970;overflow:hidden;border-radius:16px}canvas{height:100%;object-fit:cover}.hud{top:7px;left:2%;right:2%;gap:4px}.player-card{display:block;text-align:center;border-width:2px;border-radius:11px;padding:3px 2px}.head{display:none}.player-card strong{font-size:12px}.player-card small{font-size:10px}.stats{font-size:10px}.timer{top:74px;padding:3px 12px}.timer span{font-size:18px}.timer small{font-size:9px}.overlay{padding:10px}.panel{padding:19px 12px;border-radius:20px}.characters{gap:6px}.character{border-radius:13px;padding:0 1px 10px}.character strong{font-size:12px}.character small{font-size:10px}.character.selected:after{width:18px;height:18px;font-size:12px;right:3px;top:3px}.options{gap:14px;margin:18px 0}.primary{font-size:20px}.hint{font-size:12px;line-height:1.4}h1{font-size:24px}.eyebrow{font-size:10px;letter-spacing:1.4px}.controls{position:relative;left:auto;right:auto;bottom:auto;padding:6px 15px 15px;min-height:140px;border-radius:0 0 16px 16px;background:#a6dcee}.bomb-button{width:97px;height:97px}.bomb-button span{font-size:39px}.power-legend{display:none}footer{padding:14px 10px;font-size:11px}.desktop-help{display:none}.mobile-help{display:block}.compact{width:90%}.countdown{font-size:75px}body.in-menu .controls{display:none}.winner-portrait{width:110px;height:125px}h2{font-size:25px}}
@media(max-height:600px) and (min-width:650px){header{height:52px;padding:5px 18px}.brand{font-size:29px}main{max-width:760px;padding-top:0}.game-shell{min-height:0;height:calc(100dvh - 62px)}.stage{height:100%;aspect-ratio:auto}canvas{object-fit:contain}.hud{top:5px}.player-card{padding:2px 5px}.head{width:32px;height:37px}.player-card strong{font-size:12px}.player-card small,.stats{font-size:10px}.timer{top:68px}.timer span{font-size:17px}.timer small{font-size:9px}.controls{bottom:10px;left:9px;right:9px}.bomb-button{width:85px;height:85px}.bomb-button span{font-size:31px}.power-legend{display:none}footer{display:none}.panel{max-width:650px;padding:12px 20px}.eyebrow{font-size:10px}h1{font-size:20px;margin:4px 0 9px}.characters{max-width:520px;margin:auto}.portrait{max-height:150px}.options{margin:9px 0;gap:20px;align-items:center}label{display:flex;align-items:center;font-size:12px}select{padding:5px;font-size:14px}.primary{padding:7px;font-size:18px}.hint{margin-top:9px;font-size:12px}.winner-portrait{height:90px;width:80px}.compact h2{font-size:24px}.compact p{margin:8px}}
@media(prefers-reduced-motion:reduce){.character{transition:none}}
@media(max-width:650px){body.in-menu .stage{aspect-ratio:auto;height:460px}.selection{max-height:100%;overflow-y:auto}body.in-menu .hud,body.in-menu .timer{visibility:hidden}}

.mode-switch{display:flex;justify-content:center;gap:7px;margin:15px 0}.mode-switch button{border:2px solid #d7dfeb;background:#fff;border-radius:10px;padding:8px 13px;font-weight:800;color:#63748d;font-size:14px}.mode-switch .active{border-color:#efb737;background:#fff0bc;color:#4e3714}input{font:inherit;padding:9px 12px;border:2px solid #d8deea;border-radius:10px;color:#2d3852;max-width:100%}input:focus-visible{outline:3px solid #9a70ea}.name-field{max-width:340px;margin:12px auto}.join-row{display:flex;gap:8px;max-width:360px;margin:20px auto 0}.join-row input{min-width:0;flex:1;text-transform:uppercase;letter-spacing:3px;font-weight:900}.join-row button,.invite-button{background:#fff;border:2px solid #7ab8e7;border-radius:11px;padding:9px 12px;color:#355575;font-weight:800;font-size:14px}.error{color:#b73545;font-size:14px;min-height:18px;margin:10px 0 0}.audio-panel{position:absolute;right:20px;top:66px;z-index:20;padding:20px;background:#fffcf3;border:3px solid white;border-radius:18px;box-shadow:0 8px 40px #173e6b66;width:260px}.audio-panel label{margin:0 0 15px;font-size:14px;display:block}.audio-panel input[type=checkbox]{width:18px;height:18px;vertical-align:middle;margin-right:6px}.audio-panel input[type=range]{display:block;width:100%;padding:0;margin-top:10px;accent-color:#edb72c}.audio-panel .secondary{margin-top:0;padding:0}.lobby-panel{max-width:560px;max-height:100%;overflow-y:auto}.lobby-panel h2{font-size:28px}.lobby-members{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:18px 0}.lobby-member{border:2px solid var(--tint);border-radius:13px;background:#fff;padding:10px;text-align:left;display:flex;align-items:center;gap:10px;min-width:0}.lobby-member .mini{width:42px;height:57px;flex-shrink:0;background-size:400% 100%;background-repeat:no-repeat}.lobby-member strong{font-size:15px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:150px}.lobby-member small{font-size:12px;display:block;color:#6a7791}.lobby-member .ready{color:#308050;font-weight:900}.lobby-actions{display:flex;gap:14px;align-items:center;margin:14px 0 0}.lobby-actions .primary{font-size:18px;flex:1}.lobby-actions .secondary{font-size:18px;border:2px solid #bed2e4;background:#fff;border-radius:12px;margin:0;padding:12px 22px}.lobby-actions .secondary.is-ready{background:#dcf0dd;border-color:#68b16c}.connection-banner{position:absolute;top:120px;left:12%;right:12%;z-index:8;border:2px solid #fff;background:#d94e3fe8;color:white;border-radius:13px;padding:12px;text-align:center;font-size:14px;font-weight:800;pointer-events:none}body.in-lobby .controls{visibility:hidden}
@media(max-width:650px){body.in-menu.online-setup .stage{height:640px}body.in-lobby .stage{height:620px;aspect-ratio:auto}body.in-lobby .controls{display:none}.audio-panel{top:62px;right:10px}.selection{padding-top:14px;padding-bottom:14px}h1{margin-bottom:10px}.mode-switch{margin:10px 0}.mode-switch button{font-size:12px;padding:7px 10px}.lobby-member{padding:6px;gap:5px}.lobby-member strong{font-size:13px;max-width:110px}.lobby-panel h2{font-size:24px}.lobby-panel .options{margin:12px 0}.lobby-actions .secondary{padding:12px;font-size:16px}.lobby-actions .primary{font-size:16px}.connection-banner{top:107px;left:5%;right:5%;font-size:12px}.lobby-members{gap:7px}}
@media(max-height:600px) and (min-width:650px){.online-setup .selection{width:640px;display:grid;grid-template-columns:1fr 1fr;gap:4px 16px}.online-setup .selection .eyebrow,.online-setup .selection h1{grid-column:1}.online-setup .characters{grid-column:1;grid-row:3/6;grid-template-columns:repeat(2,1fr);width:100%}.online-setup .characters .portrait{max-height:85px}.online-setup .mode-switch{grid-column:2;grid-row:1/3;align-self:center}.online-setup #onlineOptions{grid-column:2;grid-row:3/6}.online-setup .selection .hint{grid-column:1/3}.online-setup .name-field{margin:0}.online-setup .options{margin:8px 0}.online-setup .join-row{margin:12px auto 0}.lobby-panel{max-width:650px;padding:12px 18px}.lobby-panel h2{font-size:20px;margin:3px 0}.lobby-members{margin:8px 0;grid-template-columns:repeat(4,1fr);gap:5px}.lobby-member .mini{display:none}.lobby-member{padding:7px}.lobby-member strong{font-size:12px;max-width:100px}.lobby-panel .options{display:inline-flex;margin:5px 7px;gap:10px}.lobby-panel .hint{margin:6px}.lobby-panel .error{min-height:0;margin:5px}.lobby-actions{max-width:400px;margin:10px auto 0}.lobby-panel .secondary{margin-top:7px;padding:4px}}

.selection{max-height:100%;overflow-y:auto}

/* v0.4: preserve the island's native proportions at every viewport size. */
main{max-width:1500px}.game-shell{border-radius:24px;max-height:none;min-height:0}.stage{aspect-ratio:1672/957;max-height:none;height:auto}canvas{object-fit:contain}
.hud{top:12px;grid-template-columns:1fr 1fr 210px 1fr 1fr;gap:9px}.player-card:nth-child(3){grid-column:4}.player-card:nth-child(4){grid-column:5}
.player-card{background:linear-gradient(145deg,#ffffffdd,var(--tint));border-radius:20px;padding:6px 9px;box-shadow:0 4px 0 #2c456b33,inset 0 2px 0 #fff9}
.player-card strong{font-size:18px;color:#1e2850;text-shadow:0 1px #fff9}.head{width:54px;height:64px}.stats{font-size:13px}.player-card small{font-size:11px}
.arena-mark{position:absolute;left:50%;top:5px;transform:translateX(-50%) rotate(-3deg);font-size:37px;font-weight:1000;letter-spacing:-2px;color:#fff;-webkit-text-stroke:2px #132855;paint-order:stroke fill;text-shadow:0 3px #15275d,0 5px #36b8ef;z-index:2;pointer-events:none;white-space:nowrap}.arena-mark span{color:#ffd731;font-size:1.2em}.arena-mark b{color:#ff519f}.arena-mark i{color:#ffd546;font-size:.65em;font-style:normal}
.timer{top:62px;padding:3px 15px;border-radius:22px;background:linear-gradient(#22466bdc,#102950e8)}.timer span{font-size:26px}.timer small{font-size:9px}
.character strong{padding:4px 0 0}.controls{bottom:14px}.bomb-button span{width:61px;height:65px;margin:auto;background:url(assets/props.png) right center/400% 100% no-repeat;font-size:0}.power-legend{font-size:11px;padding:7px 10px}
@media(min-width:1000px){main{max-width:min(1500px,calc((100dvh - 155px)*1.747))}.stage{max-height:none}.game-shell{min-height:0}.controls{bottom:10px}}
@media(min-width:651px) and (max-width:1100px){.hud{grid-template-columns:1fr 1fr 170px 1fr 1fr;gap:5px;top:9px}.player-card{padding:4px;border-width:2px;gap:2px;border-radius:14px}.head{width:38px;height:46px}.player-card strong{font-size:13px}.stats{font-size:10px}.player-card small{font-size:9px}.arena-mark{font-size:30px}.timer{top:48px;padding:2px 12px}.timer span{font-size:20px}.timer small{font-size:8px}.bomb-button{width:88px;height:88px}.bomb-button span{width:44px;height:47px}.bomb-button b{font-size:10px;margin-top:2px}.power-legend{display:none}}
@media(max-width:650px){.stage{aspect-ratio:1672/957;height:auto;border-radius:0}canvas{object-fit:contain}.game-shell{overflow:hidden}.hud{position:relative;top:auto;left:auto;right:auto;grid-template-columns:repeat(4,1fr);gap:4px;padding:6px 5px 3px;background:#a9e4fb}.player-card:nth-child(3),.player-card:nth-child(4){grid-column:auto}.player-card{padding:3px 1px;border-radius:10px;box-shadow:0 2px #24456d33}.player-card strong{font-size:12px}.player-card small{font-size:9px}.stats{font-size:9px;margin-top:2px}.head{display:none}.arena-mark{display:none}.timer{top:67px;padding:2px 9px;border-width:2px;border-radius:15px}.timer span{font-size:15px}.timer small{display:none}.controls{position:relative;bottom:auto;padding-top:7px}.bomb-button span{width:53px;height:58px}.power-legend{display:none}body.in-menu .hud,body.in-menu .timer,body.in-lobby .hud,body.in-lobby .timer{display:none}body.in-menu .stage{height:460px;aspect-ratio:auto}body.in-menu.online-setup .stage{height:640px}body.in-lobby .stage{height:620px;aspect-ratio:auto}}
@media(max-height:600px) and (min-width:651px){.game-shell{height:auto}.stage{height:auto}header{padding-top:5px;padding-bottom:3px}.brand{font-size:28px}.header-actions button{padding:5px 10px}main{max-width:min(1200px,calc((100dvh - 80px)*1.747));padding-top:0;padding-bottom:0}footer{padding-top:7px;font-size:10px}.controls{bottom:6px;left:12px;right:12px}.bomb-button{width:78px;height:78px}.bomb-button span{width:39px;height:43px}.bomb-button b{font-size:9px;margin-top:0}.power-legend{display:none}.hud{top:6px;gap:4px;grid-template-columns:1fr 1fr 160px 1fr 1fr}.player-card{padding:2px 4px;border-width:2px;border-radius:12px}.head{width:32px;height:40px}.player-card strong{font-size:12px}.stats{font-size:9px}.player-card small{font-size:8px}.arena-mark{font-size:28px;top:2px}.timer{top:41px;padding:1px 10px}.timer span{font-size:17px}.timer small{font-size:7px}}

/* v0.5 touch controls and onboarding. */
header{max-width:1500px}.header-actions{gap:5px}.header-actions button{font-size:13px;padding:8px 10px}
canvas{cursor:crosshair;user-select:none;-webkit-user-select:none}.rotate-nudge{max-width:650px;margin:0 auto 7px;padding:8px 12px;background:#ffffffc9;border-radius:12px;color:#284965;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;font-weight:800}.rotate-nudge button{border:0;background:none;color:#284965;font-size:21px;padding:0 3px}
.tap-notice{position:absolute;z-index:9;bottom:14px;left:50%;transform:translateX(-50%);width:max-content;max-width:90%;padding:8px 12px;border:2px solid white;border-radius:14px;background:#163d60e8;color:#fff;text-align:center;font-size:12px;font-weight:800;pointer-events:none}
.guide-overlay{position:fixed;inset:0;z-index:50;padding:max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));background:#102e54b5;backdrop-filter:blur(5px);display:grid;place-items:center}
.guide-panel{width:min(480px,100%);max-height:100%;overflow-y:auto;border:3px solid white;border-radius:25px;padding:22px;background:linear-gradient(#fffef5,#fff1d3);box-shadow:0 10px 45px #061b4566;text-align:center}.guide-top{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:900;color:#71829a}.guide-panel h2{font-size:27px;margin:12px 0}.guide-panel h3{font-size:22px;margin:12px 0 8px}.guide-panel p{font-size:15px;line-height:1.5;color:#4c617c;margin:8px 0 12px}.guide-panel .guide-detail{font-size:13px}.guide-phone,.guide-taps{font-size:49px;display:flex;justify-content:center;align-items:center;gap:15px;color:#2373aa;margin:18px auto}.guide-phone span{font-size:34px;color:#efae2e}.guide-taps span{font-size:20px;font-weight:900}.guide-fullscreen{padding:9px 16px;border:2px solid #68abd7;border-radius:12px;background:white;color:#255b7d;font-weight:900}.guide-path{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,29px);gap:3px;justify-content:center;margin:16px auto}.guide-path i{border-radius:5px;background:#eed7ad;font-style:normal;line-height:29px;color:#387299;font-size:23px}.guide-path .you{background:#ffc849;color:#674b1b}.guide-path .route,.guide-path .goal{background:#b2e9fb}.guide-path .diagonal{background:#f3cbc4;color:#b54e4a}.guide-remember{display:flex;align-items:center;justify-content:center;gap:7px;font-size:13px;margin:18px 0 14px}.guide-remember input{width:18px;height:18px;padding:0;accent-color:#299dc5}.guide-actions{display:flex;align-items:center;gap:12px}.guide-actions .secondary{margin:0;font-size:14px;white-space:nowrap;padding:10px 0}.guide-actions .primary{flex:1;font-size:17px;padding:9px 14px}.guide-panel .guide-online{font-size:12px;color:#b54e36}
.touch-device .bomb-button{width:76px;height:76px;border-width:3px}.touch-device .bomb-button span{width:38px;height:42px}.touch-device .bomb-button b{font-size:10px;margin-top:2px}
@media(max-width:650px){header{padding:9px 9px 6px;gap:5px}.brand{font-size:25px;letter-spacing:-2px}.header-actions{gap:3px}.header-actions button{padding:5px;width:30px;height:31px;font-size:14px;border-radius:9px}.header-actions button span{display:none}.rotate-nudge{margin:0 8px 6px}.touch-device .controls{min-height:108px;padding:7px 14px 12px}.touch-device .hud{padding-top:4px}.guide-panel{padding:18px}.guide-panel h2{font-size:24px}}
/* Landscape play uses all available browser space, including tablets and short phones. */
.touch-landscape.playing{height:100dvh;overflow:hidden;overscroll-behavior:none}
.touch-landscape.playing main{position:fixed;inset:0;max-width:none;width:auto;margin:0;padding:0}
.touch-landscape.playing .game-shell{height:100%;width:100%;max-height:none;min-height:0;border:0;border-radius:0;box-shadow:none;display:grid;grid-template-columns:calc(104px + env(safe-area-inset-left)) minmax(0,1fr) calc(74px + env(safe-area-inset-right));grid-template-rows:calc(43px + env(safe-area-inset-top)) minmax(0,1fr);padding-bottom:env(safe-area-inset-bottom);background:linear-gradient(#97dbf7,#8bcde6);overflow:hidden}
.touch-landscape.playing .stage{grid-column:2;grid-row:2;aspect-ratio:auto;height:100%;width:100%;max-height:none;min-height:0;min-width:0;overflow:hidden;border-radius:0}
.touch-landscape.playing canvas{width:100%;height:100%;object-fit:contain}
.touch-landscape.playing .hud{grid-column:1/-1;grid-row:1;position:relative;top:0;left:0;right:0;gap:5px;padding:calc(3px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) 3px calc(8px + env(safe-area-inset-left));grid-template-columns:1fr 1fr 78px 1fr 1fr;align-items:center;background:#b4e8fa}
.touch-landscape.playing .player-card{display:flex;padding:1px 7px;gap:2px;border:2px solid white;border-radius:11px;box-shadow:0 2px #24578322;min-height:34px}.touch-landscape.playing .head{display:none}.touch-landscape.playing .player-card strong{display:inline;font-size:12px}.touch-landscape.playing .player-card small{font-size:9px;margin-left:5px;white-space:nowrap}.touch-landscape.playing .stats{font-size:10px;margin-top:1px}.touch-landscape.playing .player-card:nth-child(3){grid-column:4}.touch-landscape.playing .player-card:nth-child(4){grid-column:5}
.touch-landscape.playing .timer{top:calc(5px + env(safe-area-inset-top));padding:3px 8px;border:2px solid white;border-radius:13px;box-shadow:none}.touch-landscape.playing .timer span{font-size:19px}.touch-landscape.playing .timer small,.touch-landscape.playing .arena-mark{display:none}
.touch-landscape.playing header{height:auto;min-height:0;position:fixed;top:calc(50px + env(safe-area-inset-top));right:calc(13px + env(safe-area-inset-right));padding:0;margin:0;z-index:12;max-width:none}.touch-landscape.playing .brand{display:none}.touch-landscape.playing .header-actions{flex-direction:column;gap:4px}.touch-landscape.playing .header-actions button{width:46px;height:30px;padding:0;font-size:16px;line-height:1;border-radius:10px}.touch-landscape.playing .header-actions button span{display:none}
.touch-landscape.playing .controls{display:contents;min-height:0;padding:0}
.touch-landscape.playing .bomb-button{position:absolute;right:calc(8px + env(safe-area-inset-right));bottom:calc(13px + env(safe-area-inset-bottom));width:58px;height:58px;outline-width:2px;border-width:3px;box-shadow:0 3px #9b253b}.touch-landscape.playing .bomb-button span{width:29px;height:32px}.touch-landscape.playing .bomb-button b{font-size:8px;margin-top:0}.touch-landscape.playing .power-legend,.touch-landscape.playing footer,.touch-landscape.playing .rotate-nudge{display:none}
.touch-landscape.playing .tap-notice{bottom:8px;font-size:11px}.touch-landscape.playing .connection-banner{top:52px;font-size:12px}.touch-landscape.playing .audio-panel{position:fixed;top:50px;right:80px}
@media(orientation:landscape) and (max-height:500px){.guide-panel{width:min(620px,100%);padding:13px 22px}.guide-panel h2{font-size:20px;margin:5px 0}.guide-panel h3{font-size:20px;margin:7px 0}.guide-panel p{font-size:13px;margin:5px 0 8px}.guide-phone,.guide-taps{font-size:33px;margin:7px auto}.guide-path{grid-template-rows:repeat(3,18px);margin:5px auto}.guide-path i{line-height:18px;font-size:18px}.guide-remember{margin:9px 0}.guide-actions .primary{padding:7px 12px;font-size:15px}.guide-actions .secondary{font-size:13px;padding:6px 0}.guide-fullscreen{padding:5px 12px}}

/* Timer pickups remain readable without adding a row to the compact HUD. */
.fuse-stat.fast{color:#9a301b}.fuse-stat.slow{color:#174f98}.power-legend{flex-wrap:wrap;gap:8px}
.touch-landscape.playing .stats{font-size:9px;white-space:nowrap}
@media(max-width:700px){.touch-landscape.playing .player-card{padding:1px 3px}.touch-landscape.playing .stats{font-size:8px}}

/* v0.8: readable pickup symbols and the BoomBoomBags wordmark. */
.arena-mark{font-size:24px;letter-spacing:-1px;top:10px}
.brand span{font-size:1em}.arena-mark span{font-size:1em}
.stats span{display:inline-flex;align-items:center;gap:2px;margin-right:4px}.stats svg{width:13px;height:13px;vertical-align:middle}
.power-legend span{display:inline-flex;align-items:center;gap:4px}.power-legend svg{width:18px;height:18px}
.guide-pickups{display:grid;grid-template-columns:1fr 1fr;gap:9px;text-align:left;margin:14px 0 8px}
.guide-pickups>div{display:flex;gap:7px;align-items:center}.pickup-icon{display:grid;place-items:center;width:34px;height:34px;flex-shrink:0;border:2px solid white;border-radius:9px;color:white;box-shadow:0 2px 4px #142b4326}.pickup-icon svg{width:25px;height:25px}
.guide-pickups b{font-size:12px;color:#273553}.guide-pickups small{display:block;font-size:11px;line-height:1.3;color:#4c617c}
.guide-panel{display:flex;flex-direction:column;overflow:hidden}.guide-top,.guide-panel h2,.guide-remember,.guide-actions{flex-shrink:0}.guide-content{min-height:0;overflow-y:auto;overscroll-behavior:contain}.guide-bomb svg{width:42px;height:42px;display:block}
.touch-landscape.playing .game-shell{grid-template-columns:calc(96px + env(safe-area-inset-left)) minmax(0,1fr) calc(70px + env(safe-area-inset-right))}
.touch-landscape.playing .stats span{margin-right:3px;gap:1px}.touch-landscape.playing .stats svg{width:10px;height:10px}
.touch-landscape.playing .player-card small{display:inline-block;max-width:55px;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
.touch-device.playing:not(.touch-landscape) .stage{aspect-ratio:1320/716}
.touch-device.playing:not(.touch-landscape) .timer{position:relative;top:auto;left:auto;transform:none;width:fit-content;margin:3px auto;box-shadow:none}
@media(max-width:650px){.brand{font-size:20px;letter-spacing:-1.2px;-webkit-text-stroke:1.5px}.stats span{margin-right:2px;gap:1px}.stats svg{width:10px;height:10px}.guide-pickups{gap:8px}}
@media(max-width:360px){.brand{font-size:clamp(14px,4.4vw,16px);letter-spacing:-1px}.header-actions{gap:2px}.header-actions button{width:26px;height:29px}}
@media(max-width:700px){.touch-landscape.playing .stats svg{width:9px;height:9px}.touch-landscape.playing .stats span{margin-right:1px}}

/* v0.9: settings stay compact; all seven pickup effects remain available in Help. */
.pickup-options{display:flex;justify-content:center;margin:8px 0 15px}.pickup-options select{max-width:100%}.shield-stat{color:#066574}.route-danger{color:#b53930}
.touch-landscape.playing .stats .shield-stat{margin:0}.power-legend{gap:7px;font-size:10px}
@media(max-height:600px) and (min-width:651px){.online-setup .pickup-options{margin:4px 0}.pickup-options{margin:5px 0 8px}.pickup-options select{padding:5px;font-size:13px}}

.player-card>div:last-child{min-width:0;max-width:100%}.stats{display:flex;flex-wrap:wrap;align-items:center;gap:1px 2px}.stats span{flex-shrink:0}
@media(max-width:650px){.touch-device:not(.touch-landscape) .stats{justify-content:center}.touch-device:not(.touch-landscape) .player-card{height:100%}}
@media(orientation:landscape) and (max-height:500px){
 .touch-landscape.in-menu:not(.online-setup) .stage{height:calc(100dvh - 82px);aspect-ratio:auto}
 .touch-landscape.in-menu:not(.online-setup) .selection{display:grid;grid-template-columns:1.1fr 1fr;gap:5px 15px;padding:12px 15px;width:min(820px,100%)}
 .touch-landscape.in-menu:not(.online-setup) .selection .eyebrow{grid-column:1;font-size:9px;letter-spacing:1px}
 .touch-landscape.in-menu:not(.online-setup) .selection h1{grid-column:1;font-size:20px;margin:0 0 5px}
 .touch-landscape.in-menu:not(.online-setup) .characters{grid-column:1;grid-row:3;gap:5px;align-self:center}
 .touch-landscape.in-menu:not(.online-setup) .character{padding-bottom:5px;border-radius:12px}.touch-landscape.in-menu:not(.online-setup) .character strong{font-size:11px}
 .touch-landscape.in-menu:not(.online-setup) .mode-switch{grid-column:2;grid-row:1/3;margin:0;align-self:center;gap:4px}.touch-landscape.in-menu:not(.online-setup) .mode-switch button{font-size:11px;padding:6px}
 .touch-landscape.in-menu:not(.online-setup) #singleOptions{grid-column:2;grid-row:3;margin:0;gap:8px;align-self:center}
 .touch-landscape.in-menu:not(.online-setup) .selection label{font-size:11px;gap:3px}.touch-landscape.in-menu:not(.online-setup) .selection select{font-size:12px;padding:5px;min-width:0}
 .touch-landscape.in-menu:not(.online-setup) #singlePickupOptions{grid-column:2;grid-row:4;margin:0}
 .touch-landscape.in-menu:not(.online-setup) #start{grid-column:2;grid-row:5;font-size:17px;padding:7px}
 .touch-landscape.in-menu:not(.online-setup) .selection .hint{grid-column:1;grid-row:4/6;margin:0;font-size:11px;align-self:center}
}
@media(orientation:landscape) and (max-height:500px){
 .touch-landscape.in-menu:not(.online-setup) .selection{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}
 .touch-landscape.in-menu:not(.online-setup) .selection>*{min-width:0;max-width:100%}
 .touch-landscape.in-menu:not(.online-setup) .selection label{display:grid;min-width:0;max-width:100%;flex:1;text-align:left}
 .touch-landscape.in-menu:not(.online-setup) .selection select{width:100%;max-width:100%}
 .touch-landscape.in-menu:not(.online-setup) #singlePickupOptions label{max-width:100%;width:100%}
 .touch-landscape.in-menu:not(.online-setup) .mode-switch button{min-width:0;flex:1}
 .touch-landscape.in-menu:not(.online-setup) #start{width:100%}
}

@media(orientation:landscape) and (max-height:500px){
 .touch-landscape.in-menu:not(.online-setup) .character .portrait{max-height:60px}
 .touch-landscape.in-menu:not(.online-setup) .character strong{font-size:10px;white-space:nowrap}
 .touch-landscape.in-menu:not(.online-setup) .character.selected:after{width:14px;height:14px;font-size:10px;right:3px;top:3px}
}
@media(orientation:landscape) and (max-height:500px){.touch-landscape.in-menu:not(.online-setup) .character{padding-left:0;padding-right:0}}

/* v0.11: round scores and stage selection retain the compact mobile layout. */
.match-options{display:grid;grid-template-columns:minmax(90px,.7fr) minmax(0,1.6fr);gap:12px;margin:10px 0 15px;text-align:left}
.match-options label{display:grid;gap:5px;min-width:0;font-size:13px;font-weight:800;color:#3f6486}
.match-options select{width:100%;min-width:0;max-width:100%;font-size:13px}
.wins{display:inline-block;font-size:11px;color:#765206;background:#ffedaf;border-radius:6px;padding:1px 4px;margin-left:4px;white-space:nowrap}
.stage-banner{position:absolute;top:6px;left:50%;transform:translateX(-50%);z-index:2;display:flex;gap:10px;align-items:center;border:2px solid #ffffffbb;border-radius:10px;background:#24465ce0;color:white;padding:4px 12px;font-size:13px;font-weight:900;pointer-events:none;white-space:nowrap}
.stage-banner small{font-size:11px;color:#fff2ba}
.match-scores{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:12px 0;text-align:left}
.score-row{display:flex;align-items:center;gap:7px;padding:7px 10px;border-radius:12px;background:#edf6fb;border:2px solid #d1e6f0;color:#365c7c;font-weight:900;font-size:13px}
.score-row.leader{background:#fff0bc;border-color:#eac359}.score-row>span:nth-child(2){flex:1;min-width:0}.score-row small{display:block;font-size:10px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:95px}.score-row>b{font-size:24px;text-align:center}.score-row>b small{font-size:9px}.score-head{flex-shrink:0;width:30px;height:32px;background-size:400% auto;background-position-y:10%}
.next-round-note{font-size:12px;line-height:1.4;color:#52718a}#result .compact{width:min(530px,100%)}#resultTitle{font-size:26px}
.touch-landscape.playing .wins{font-size:10px;padding:0 3px;margin-left:3px}.touch-landscape.playing .stage-banner{top:3px;padding:3px 10px;font-size:11px}.touch-landscape.playing .stage-banner small{font-size:10px}
@media(max-width:360px){.match-options{grid-template-columns:1fr}.score-row{padding:5px;gap:4px;font-size:11px}.score-head{width:23px;height:26px}.wins{font-size:9px;padding:0 2px}.stage-banner{font-size:11px;gap:5px;padding:3px 6px}}
@media(orientation:landscape) and (max-height:500px){
 .touch-landscape.in-menu:not(.online-setup) #singleMatchOptions{grid-column:2;grid-row:5;margin:0;gap:7px}
 .touch-landscape.in-menu:not(.online-setup) #start{grid-row:6}
 .touch-landscape.in-menu:not(.online-setup) .selection .hint{grid-row:4/7}
 .touch-landscape.in-menu:not(.online-setup) .selection{padding:9px 14px;gap:4px 14px}
 #result .compact{padding:12px 22px}#result .winner-portrait{width:65px;height:70px;margin:0 auto}#resultTitle{font-size:22px;margin:3px 0}#resultStats{font-size:11px;margin:4px 0}
 .match-scores{gap:4px;margin:7px 0}.score-row{padding:3px 8px}.score-head{height:27px;width:27px}.score-row>b{font-size:20px}.next-round-note{margin:4px 0}#result .primary{padding:7px 16px;font-size:17px}#result .secondary{padding:7px;margin:3px 0}
}
body.playing .arena-mark{display:none}
body:not(.touch-device) .stage-banner{flex-direction:column;gap:2px;top:9px;width:190px;padding:4px;font-size:12px}
@media(orientation:landscape) and (max-height:500px){
 .touch-landscape.in-menu main{max-width:none;width:100%;padding:0 12px}
 .touch-landscape.in-menu:not(.online-setup) .characters{grid-row:3/6;align-self:center}
 .touch-landscape.in-menu:not(.online-setup) .selection .hint{grid-row:6;grid-column:1;font-size:10px}
 .touch-landscape.in-menu:not(.online-setup) .selection h1{white-space:nowrap;font-size:20px}
}
/* Results use the viewport so short portrait canvases cannot clip the scores/actions. */
#result{position:fixed;inset:0;z-index:30;overflow-y:auto;overscroll-behavior:contain;padding:12px}
#result .panel{position:relative;max-height:calc(100dvh - 24px);overflow-y:auto;flex-shrink:0}
.result-help{position:absolute;right:10px;top:8px;border:0;border-radius:8px;background:#e5eef3;color:#386284;font-size:11px;font-weight:800;padding:4px 7px}
#result .eyebrow{padding:0 50px}
@media(max-width:650px) and (orientation:portrait){#result .winner-portrait{width:80px;height:90px}#resultTitle{font-size:23px}#resultStats{font-size:12px}#result .next-round-note{font-size:12px}.score-row{font-size:12px}}

/* v0.11.3: one captured pointer can turn continuously without lifting. */
.thumbstick{position:relative;width:112px;height:112px;flex:0 0 auto;border:3px solid #d5f7ff;border-radius:50%;background:radial-gradient(circle,#184763c4 0 48%,#5298b5c9 49% 67%,#d2f2fb91 68%);box-shadow:0 4px 0 #16374e42,inset 0 2px 4px #e2ffffaa;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;cursor:grab}
.stick-knob{position:absolute;left:50%;top:50%;width:46%;height:46%;border:3px solid #f6fdff;border-radius:50%;background:radial-gradient(circle at 33% 24%,#f0fcff,#9bccdf 58%,#649db9);box-shadow:0 4px 8px #102e5377,inset 0 -3px 4px #41728b66;transform:translate(calc(-50% + var(--stick-x,0px)),calc(-50% + var(--stick-y,0px)));pointer-events:none}
.stick-knob:after{content:'';position:absolute;inset:30%;border:2px solid #457c9b77;border-radius:50%}
.stick-arrow{position:absolute;font-size:12px;color:#cbe9f6;line-height:1;pointer-events:none;text-shadow:0 1px #19364f}
.stick-up{top:5px;left:50%;transform:translateX(-50%)}.stick-down{bottom:5px;left:50%;transform:translateX(-50%)}.stick-left{left:5px;top:50%;transform:translateY(-50%)}.stick-right{right:5px;top:50%;transform:translateY(-50%)}
.thumbstick.engaged{border-color:#fff5a7;cursor:grabbing}.thumbstick.engaged .stick-knob{border-color:#fff5a7;background:radial-gradient(circle at 33% 24%,#fffdd8,#f5d568 65%,#d5a63c)}
.thumbstick[data-direction="0"] .stick-up,.thumbstick[data-direction="1"] .stick-right,.thumbstick[data-direction="2"] .stick-down,.thumbstick[data-direction="3"] .stick-left{color:#fff499}
.touch-device .thumbstick{width:100px;height:100px;border-width:2px}
.touch-landscape.playing .thumbstick{position:absolute;left:calc(3px + env(safe-area-inset-left));bottom:calc(15px + env(safe-area-inset-bottom));width:96px;height:96px}
@media(min-width:1000px){body:not(.touch-device) .thumbstick{width:108px;height:108px}}
@media(max-height:380px) and (orientation:landscape){.touch-landscape.playing .thumbstick{width:88px;height:88px;bottom:calc(12px + env(safe-area-inset-bottom))}}

/* v0.12: controls are device preferences; map coordinates never change. */
body .controls .thumbstick{width:var(--control-size,96px);height:var(--control-size,96px);opacity:var(--control-opacity,.85)}
body.stick-hidden .controls .thumbstick{display:none}
body.controls-right:not(.touch-landscape) .controls{flex-direction:row-reverse}
body:not(.touch-landscape) .controls .thumbstick{margin:0 min(var(--control-inset,3px),12px) var(--control-lift,15px)}
body.touch-landscape.playing .controls .thumbstick{left:calc(var(--control-inset,3px) + env(safe-area-inset-left));bottom:calc(var(--control-lift,15px) + env(safe-area-inset-bottom));width:var(--control-size,96px);height:var(--control-size,96px)}
body.touch-landscape.playing.controls-right .controls .thumbstick{left:auto;right:calc(var(--control-inset,3px) + env(safe-area-inset-right))}
body.touch-landscape.playing.controls-right .bomb-button{right:auto;left:calc(8px + env(safe-area-inset-left))}
body.touch-landscape.playing.controls-right header{right:auto;left:calc(13px + env(safe-area-inset-left))}
body.stick-hidden:not(.touch-landscape) .controls{justify-content:flex-end}
.settings-panel{width:min(620px,100%);text-align:left;max-height:100%;padding:20px}
.settings-panel h2{margin:9px 0 15px}.settings-content{display:grid;grid-template-columns:minmax(0,1fr) 170px;gap:25px;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 3px 8px}
.settings-fields{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 10px;align-items:center;color:#3d5875;font-weight:800;font-size:13px}
.settings-fields label{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:8px}.settings-fields input[type=range]{grid-column:1/-1;width:100%;padding:0;margin:0 0 6px;accent-color:#247b9d;min-height:20px;cursor:pointer}.settings-fields output{font-variant-numeric:tabular-nums;color:#227299}.settings-fields select{max-width:65%;font-size:12px;padding:7px}.settings-fields .settings-toggle{justify-content:flex-start}.settings-toggle input{width:19px;height:19px;accent-color:#247b9d;flex-shrink:0}.settings-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:16px;background:#d6edf3;padding:14px 8px;gap:12px}.settings-preview .thumbstick{pointer-events:none;flex-shrink:0}.settings-preview p{font-size:12px;text-align:center;line-height:1.45;margin:0;color:#426580}.settings-panel .guide-actions{margin-top:10px}.settings-panel .guide-online{margin:5px 0 0}.settings-panel .guide-actions .secondary{font-weight:800;color:#3d6885}
.pickup-feedback{position:absolute;z-index:9;bottom:9px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:9px;max-width:calc(100% - 12px);width:max-content;padding:8px 12px;background:#f9fcfff5;color:#254560;border:2px solid var(--pickup-color,#823ce6);border-radius:14px;box-shadow:0 3px 15px #1833563b;pointer-events:none;text-align:left}
.pickup-feedback-icon{display:grid;place-items:center;flex-shrink:0;width:34px;height:34px;border-radius:9px;background:var(--pickup-color);color:white}.pickup-feedback-icon svg{width:26px;height:26px}.pickup-feedback strong{display:block;font-size:14px;line-height:1.2;color:var(--pickup-color)}.pickup-feedback small{display:block;font-size:11px;line-height:1.4;margin-top:3px}.pickup-feedback.bad{background:#fff0f3}.pickup-feedback:not([hidden])~.tap-notice{bottom:76px}
.stat-changed{border-radius:4px;background:#ffedb1;box-shadow:0 0 0 2px #ffd754;animation:stat-pulse .45s ease-out 2}
@keyframes stat-pulse{50%{background:#fffcef;box-shadow:0 0 0 2px #fff09a}}
@media(max-width:420px){.settings-panel{padding:15px}.settings-content{grid-template-columns:minmax(0,1fr);gap:12px}.settings-preview{display:none}.settings-panel h2{font-size:23px}.pickup-feedback{padding:6px 8px;gap:6px}.pickup-feedback strong{font-size:12px}.pickup-feedback small{font-size:10px}.pickup-feedback-icon{width:29px;height:29px}}
@media(orientation:landscape) and (max-height:500px){.settings-panel{padding:12px 18px}.settings-panel h2{font-size:21px;margin:5px 0 9px}.settings-content{gap:18px}.settings-fields{gap:4px 8px;font-size:12px}.settings-fields input[type=range]{min-height:17px;margin:0 0 2px}.settings-fields select{padding:5px}.settings-preview p{font-size:11px}.settings-panel .guide-actions{margin-top:6px}.settings-panel .guide-actions .primary{padding:7px 12px}.pickup-feedback{padding:5px 9px;bottom:6px}.pickup-feedback strong{font-size:12px}.pickup-feedback small{font-size:10px}.pickup-feedback-icon{width:29px;height:29px}.pickup-feedback:not([hidden])~.tap-notice{bottom:66px}}
@media(prefers-reduced-motion:reduce){.stat-changed{animation:none}}
@media(max-width:420px){body:not(.touch-landscape) header{flex-wrap:wrap;justify-content:center;gap:6px;padding-top:8px}body:not(.touch-landscape) .brand{font-size:20px;letter-spacing:-1.2px}body:not(.touch-landscape) .header-actions{flex-basis:100%;justify-content:center;gap:6px}body:not(.touch-landscape) .header-actions button{width:32px;height:31px}}
.settings-fields .control-range{grid-column:1/-1;display:grid;gap:5px;min-width:0}
.settings-preview .thumbstick{position:relative;left:auto;right:auto;bottom:auto;top:auto;margin:0}
@media(orientation:landscape) and (max-height:500px){.settings-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 14px}.settings-fields .control-range{grid-column:auto;gap:3px}.settings-fields .control-range label{font-size:11px;gap:3px}.settings-fields .control-range output{font-size:11px}.settings-fields .control-range input[type=range]{margin:0;min-height:18px}}
#controlsPreview{position:relative;inset:auto;margin:0}

/* v0.13: room coordination and readable match history. Arena geometry is unchanged. */
.elimination-feed{position:absolute;z-index:9;bottom:90px;left:50%;transform:translateX(-50%);width:max-content;max-width:72%;display:grid;gap:4px;pointer-events:none;text-align:center;font-size:12px;font-weight:800;color:white}
.elimination-feed>div{padding:6px 10px;background:#183b60ed;border:1px solid #d9edff;border-radius:10px;overflow-wrap:anywhere}
.result-details{text-align:left;background:#f5f9fc;border:1px solid #cbddeb;border-radius:12px;margin:8px 0;padding:8px}
.result-details summary{cursor:pointer;font-size:13px;font-weight:800;color:#375a7b;min-height:24px}
#result .stats-explainer{font-size:11px;line-height:1.4;margin:6px 0}
#matchStats{width:100%;table-layout:fixed;border-collapse:collapse;font-size:11px}
#matchStats th,#matchStats td{padding:7px 2px;text-align:center;border-bottom:1px solid #d4e1eb}
#matchStats th:first-child{width:30%;text-align:left;overflow-wrap:anywhere}#matchStats th small{display:block;font-size:9px;font-weight:400;overflow-wrap:anywhere}#matchStats abbr{text-decoration:none}
#result .match-awards p{font-size:11px;margin:6px 0;color:#75551b}.round-events{padding-left:18px;margin:5px 0;font-size:11px;line-height:1.7;overflow-wrap:anywhere}
.lobby-panel{max-width:820px}.lobby-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}.lobby-settings{min-width:0}.lobby-settings .options{gap:8px;margin:10px 0;display:flex}.lobby-settings label{min-width:0;flex:1;display:grid}.lobby-settings select{width:100%;min-width:0;font-size:13px;padding:8px}.lobby-settings .match-options{grid-template-columns:1fr 1fr}
.room-chat{text-align:left;border:2px solid #c7ddeb;background:#f5fbff;border-radius:14px;padding:10px;min-width:0}.room-chat h3{font-size:15px;margin:0 0 8px}.chat-log{height:200px;overflow:auto;overscroll-behavior:contain}.chat-message{background:white;border:1px solid #dce8f0;border-radius:10px;padding:8px;margin:0 0 6px;font-size:12px;overflow-wrap:anywhere}.chat-message.own{background:#fff1c8;border-color:#ead694}.chat-message strong{font-size:11px}.chat-message time{float:right;font-size:9px;color:#67809b;margin-left:6px}.chat-message p{margin:4px 0 0;line-height:1.4;white-space:pre-wrap}.chat-empty{font-size:12px;line-height:1.6;color:#687e91;margin:10px 5px}.room-chat form{display:flex;gap:6px;margin-top:8px}.room-chat input{flex:1;min-width:0;width:100%;font-size:16px;padding:8px}.room-chat button{border:2px solid #e5bd53;background:#ffe49a;color:#503c20;border-radius:9px;font-weight:800;padding:8px}.chat-meta{display:flex;gap:8px;align-items:start;justify-content:space-between;min-height:20px;margin-top:5px}.chat-counter{font-size:10px;color:#617a91;white-space:nowrap}.chat-error{font-size:11px;color:#af3342;line-height:1.4}
@media(max-width:560px) and (orientation:portrait){.lobby-body{grid-template-columns:1fr;gap:10px}.chat-log{height:150px}.lobby-panel .options{margin:7px 0}.lobby-panel{max-height:100%}.elimination-feed{font-size:10px;bottom:83px;max-width:92%}#matchStats{font-size:10px}#matchStats th,#matchStats td{padding:6px 1px}}
@media(orientation:landscape) and (max-height:500px){.lobby-body{gap:10px}.chat-log{height:125px}.room-chat{padding:7px}.room-chat h3{margin-bottom:4px}.lobby-settings .options{margin:4px 0;display:flex}.lobby-settings label{font-size:11px}.lobby-settings select{padding:5px}.lobby-settings .pickup-options,.lobby-settings .match-options{margin:4px 0}.elimination-feed{font-size:10px;bottom:78px;max-width:65%}.elimination-feed>div{padding:4px 7px}}

@media(orientation:landscape) and (max-height:500px){body.in-lobby main{max-width:none;width:100%;padding:0 12px}body.in-lobby .stage{height:calc(100dvh - 70px);aspect-ratio:auto}body.in-lobby .hud,body.in-lobby .timer,body.in-lobby .arena-mark{display:none}body.in-lobby .lobby-panel{padding:10px 14px}body.in-lobby .lobby-members{grid-template-columns:repeat(4,1fr)}}
.lobby-actions{background:#fff4dc;border-radius:12px;padding:5px}
.stage:has(.tap-notice:not([hidden])) .elimination-feed{bottom:126px}

@media(max-width:360px){#matchStats thead{font-size:9px}#matchStats td{border-left:1px solid #e3ecf3}}

/* v0.13.1: compact touch notifications leave more of the arena visible. */
.pickup-compact-title{display:none!important}
body.touch-device .pickup-feedback{padding:4px 8px;gap:6px;max-width:calc(100% - 16px);border-width:1px;border-radius:10px;background:rgb(249 252 255 / 65%);box-shadow:none;bottom:6px}
body.touch-device .pickup-feedback.bad{background:rgb(255 240 243 / 65%)}
body.touch-device .pickup-feedback-icon{width:22px;height:22px;border-radius:6px}
body.touch-device .pickup-feedback-icon svg{width:17px;height:17px}
body.touch-device .pickup-feedback-copy{min-width:0}
body.touch-device .pickup-feedback .pickup-full-title,body.touch-device .pickup-feedback .pickup-full-detail{display:none}
body.touch-device .pickup-feedback .pickup-compact-title{display:block!important;font-size:12px;line-height:1.3;white-space:nowrap;color:#173e5c}
body.touch-device .pickup-feedback.bad .pickup-compact-title{color:#871d40}
body.touch-device .pickup-feedback:not([hidden])~.tap-notice{bottom:48px}

/* v0.14: latency stays outside the arena on touch landscape screens. */
.network-status{flex-shrink:0;display:inline-flex;align-items:center;gap:4px;padding:5px 7px;border:1px solid #fff;border-radius:9px;background:#f9fcffe6;color:#315672;font-size:11px;font-weight:800;white-space:nowrap;pointer-events:none}
.network-status:before{content:'';width:6px;height:6px;border-radius:50%;background:#889aa6}.network-status[data-quality=good]:before{background:#20804b}.network-status[data-quality=fair]:before{background:#b07b00}.network-status[data-quality=high]:before{background:#c73744}.network-status[data-quality=offline]:before{background:#c73744}
body .connection-banner{position:fixed;left:50%;right:auto;top:58px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);z-index:45;display:flex;align-items:center;justify-content:center;gap:10px;background:#173e62f0;padding:8px 12px;border-width:1px;font-size:12px;line-height:1.4;pointer-events:auto}
.connection-banner button{flex-shrink:0;border:1px solid white;border-radius:7px;padding:6px 8px;background:#fff3cb;color:#513b17;font-size:11px;font-weight:800}
body.touch-landscape.playing .network-status{position:fixed;top:calc(50px + env(safe-area-inset-top));left:calc(8px + env(safe-area-inset-left));width:62px;max-width:62px;flex-direction:column;gap:0;padding:3px 4px;font-size:10px;line-height:1.25;z-index:12}
body.touch-landscape.playing.controls-right .network-status{left:auto;right:calc(8px + env(safe-area-inset-right))}
body.touch-landscape.playing .connection-banner{top:auto;bottom:8px;font-size:11px;max-width:70%;padding:7px 9px}
@media(max-width:420px){body:not(.touch-landscape) .network-status{font-size:10px;padding:4px 6px}body .connection-banner{top:82px;gap:6px;font-size:11px}}

body.touch-landscape.playing .network-status:before{position:absolute;left:5px;top:5px;width:5px;height:5px}body.touch-landscape.playing #networkLabel{font-size:8px}body.touch-landscape.playing #networkValue{font-size:10px}

@media(max-width:900px){body:has(.network-status:not([hidden])):not(.touch-landscape.playing) header{height:auto;flex-wrap:wrap;justify-content:center;gap:6px}body:has(.network-status:not([hidden])):not(.touch-landscape.playing) .header-actions{flex-basis:100%;justify-content:center}}
@media(orientation:landscape) and (max-height:500px) and (max-width:900px){body.in-lobby:has(.network-status:not([hidden])) .stage{height:calc(100dvh - 100px)}}

/* v0.15: opt-in assist and an undo action in the mobile control rail. */
.assist-options{margin:6px 0 10px;text-align:left;color:#3f6486}.assist-options label{display:flex;align-items:center;gap:7px;font-size:12px;cursor:pointer}.assist-options input{width:18px;height:18px;margin:0;accent-color:#317ba8}.assist-options small{display:block;font-size:10px;margin:3px 0 0 25px;color:#61788c}
.mobile-bonus{display:inline-block!important;font-size:9px!important;white-space:nowrap;color:#125d7a!important;font-weight:900;background:#e8fbff;border-radius:4px;padding:1px 3px}
.bomb-queue{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);width:100px;display:grid;gap:4px;text-align:center;font-size:11px;font-weight:800;color:#294d6a;pointer-events:auto}.bomb-queue span{background:#ffffffe0;border-radius:6px;padding:3px}.bomb-queue button{border:2px solid #fff;border-radius:10px;padding:8px 5px;background:#ffe29b;color:#513a12;font-size:12px;font-weight:900;min-height:40px;touch-action:manipulation}
body.touch-landscape.playing .bomb-queue{position:fixed;left:calc(8px + env(safe-area-inset-left));top:calc(96px + env(safe-area-inset-top));bottom:auto;transform:none;width:62px;z-index:12;font-size:8px}
body.touch-landscape.playing.controls-right .bomb-queue{left:auto;right:calc(8px + env(safe-area-inset-right))}
body.touch-landscape.playing .mobile-bonus{font-size:8px!important;padding:0 2px}
@media(orientation:landscape) and (max-height:500px){.touch-landscape.in-menu:not(.online-setup) #singleAssistOptions{grid-column:2;grid-row:6;margin:0}.touch-landscape.in-menu:not(.online-setup) #start{grid-row:7}.touch-landscape.in-menu:not(.online-setup) .assist-options small{display:none}.touch-landscape.in-menu:not(.online-setup) .selection .hint{grid-row:6/8}.lobby-settings .assist-options{margin:5px 0}.lobby-settings .assist-options small{font-size:9px}}

body.touch-landscape.playing .bomb-queue button{font-size:10px;padding:8px 2px}
body.touch-device.playing:not(.touch-landscape) .bomb-queue{position:static;transform:none;width:62px;flex-shrink:0;font-size:9px}
body.touch-device.playing:not(.touch-landscape) .bomb-queue button{font-size:10px;padding:8px 2px}

/* v0.16: modes and rosters fit inside scrollable menus, outside the live arena. */
.battle-options{display:flex;justify-content:center;margin:8px 0}.battle-options label{width:100%;max-width:360px}.battle-options select{width:100%;min-width:0}
.roster-settings{text-align:left;margin:8px 0;border:1px solid #cbdde7;border-radius:10px;background:#f7fbff;padding:7px 10px;font-size:12px;min-width:0}.roster-settings summary{cursor:pointer;font-weight:800;color:#385e7e;line-height:1.5;overflow-wrap:anywhere}.roster-row{display:flex;gap:10px;margin-top:7px}.roster-row label{flex:1;min-width:0;display:grid;font-size:12px}.roster-row select{min-width:0;width:100%;padding:6px;font-size:13px}.team-rule,.practice-hint{font-size:12px;line-height:1.5;color:#456682;margin:7px 0}.practice-hint{padding:10px;border:1px solid #cadfe8;border-radius:12px;background:#effbff;text-align:left}
.team-chip{display:inline-block;font-size:9px;line-height:1.2;background:var(--team);color:white;border:1px solid white;border-radius:4px;padding:1px 3px;margin-left:4px;font-weight:900}.team-score{display:flex;justify-content:space-between;gap:12px;margin:6px 0;border:2px solid var(--team);border-radius:10px;padding:8px;background:#f5faff;color:var(--team);font-size:14px}.team-score.leader{background:#fff1c9}.lobby-team-label{font-size:10px;gap:2px;margin:3px 0;display:grid}.lobby-team-label select{width:100%;max-width:150px;padding:3px;font-size:11px}.lobby-member>div:last-child{min-width:0;flex:1}
.selection{max-height:100%;overflow-y:auto;overscroll-behavior:contain}.mode-switch{flex-wrap:wrap}.mode-switch button{flex:1;min-width:90px;font-size:12px}.selection .battle-options select{font-size:13px;padding:6px}.selection .options{margin:10px 0}.selection .roster-settings select{font-size:12px}.selection .match-options{margin:8px 0}.selection .pickup-options{margin:8px 0}
body.touch-landscape.playing .team-chip{font-size:7px;padding:0 2px;margin-left:3px}.player-card .team-chip{max-width:40px}.lobby-panel .battle-options{margin:4px 0}.lobby-panel .roster-settings{padding:5px 7px}
@media(orientation:landscape) and (max-height:500px){
 .touch-landscape.in-menu:not(.online-setup) .selection{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 13px;align-content:start;overflow-y:auto;padding:10px 13px}
 .touch-landscape.in-menu:not(.online-setup) .selection .eyebrow{grid-column:1;grid-row:1}
 .touch-landscape.in-menu:not(.online-setup) .selection h1{grid-column:1;grid-row:2;margin:0;font-size:19px}
 .touch-landscape.in-menu:not(.online-setup) .characters{grid-column:1;grid-row:3/7;align-self:start;max-width:100%;width:100%;gap:5px;margin-top:6px}
 .touch-landscape.in-menu:not(.online-setup) .character .portrait{max-height:105px}
 .touch-landscape.in-menu:not(.online-setup) .mode-switch{grid-column:2;grid-row:1/3;gap:3px;flex-wrap:nowrap}
 .touch-landscape.in-menu:not(.online-setup) .mode-switch button{min-width:0;font-size:10px;padding:5px 3px}
 .touch-landscape.in-menu:not(.online-setup) #singleBattleOptions{grid-column:2;grid-row:3;margin:0}
 .touch-landscape.in-menu:not(.online-setup) #singleOptions{grid-column:2;grid-row:4;margin:0}
 .touch-landscape.in-menu:not(.online-setup) #singleRoster{grid-column:2;grid-row:5;margin:0;padding:3px 6px;font-size:10px}
 .touch-landscape.in-menu:not(.online-setup) #singlePickupOptions{grid-column:2;grid-row:6;margin:0}
 .touch-landscape.in-menu:not(.online-setup) #singleMatchOptions{grid-column:2;grid-row:7;margin:0}
 .touch-landscape.in-menu:not(.online-setup) #singleAssistOptions{grid-column:2;grid-row:8;margin:0}
 .touch-landscape.in-menu:not(.online-setup) #start{grid-column:1;grid-row:8;margin:0;width:100%;align-self:center;font-size:16px;padding:6px}
 .touch-landscape.in-menu:not(.online-setup) .selection .hint{grid-column:1;grid-row:7;margin:0;align-self:center;font-size:10px}
 .touch-landscape.in-menu:not(.online-setup) #practiceHint{grid-column:2;grid-row:3/7;margin:0;font-size:11px;padding:8px}
 .touch-landscape.in-menu:not(.online-setup) .selection select{padding:4px;font-size:11px}
 .touch-landscape.in-menu:not(.online-setup) .roster-row{gap:5px}.touch-landscape.in-menu:not(.online-setup) .roster-row label{font-size:10px}
}
@media(max-width:360px){.mode-switch button{font-size:10px;min-width:0;padding:7px 4px}.team-chip{font-size:7px!important}}
@media(orientation:landscape) and (max-height:500px){
 .touch-landscape.in-menu:not(.online-setup) .selection{gap:3px 12px}
 .touch-landscape.in-menu:not(.online-setup) .selection label{font-size:10px;line-height:1.1;gap:3px}
 .touch-landscape.in-menu:not(.online-setup) .selection select{font-size:11px;line-height:1.1;padding:3px;min-height:23px}
 .touch-landscape.in-menu:not(.online-setup) #singleBattleOptions>label,.touch-landscape.in-menu:not(.online-setup) #singlePickupOptions>label{display:flex;align-items:center;justify-content:space-between;width:100%;gap:5px}
 .touch-landscape.in-menu:not(.online-setup) #singleBattleOptions select,.touch-landscape.in-menu:not(.online-setup) #singlePickupOptions select{max-width:67%}
 .touch-landscape.in-menu:not(.online-setup) #singleOptions label{display:flex;align-items:center;gap:4px;min-width:0}
 .touch-landscape.in-menu:not(.online-setup) #singleOptions{justify-content:space-between;gap:5px}
 .touch-landscape.in-menu:not(.online-setup) #singleRoster summary{line-height:1.25}
 .touch-landscape.in-menu:not(.online-setup) #singleAssistOptions label{line-height:1.1;font-size:10px;display:flex}
 .touch-landscape.in-menu:not(.online-setup) #singleAssistOptions small{display:none}
 .touch-landscape.in-menu:not(.online-setup) .selection .hint{font-size:9px}
 .touch-landscape.in-menu:not(.online-setup) .character .portrait{max-height:95px}
}
body.practice-setup #singleMatchOptions{grid-template-columns:1fr}
/* Keep team labels on the compact HUD's first line. */
body.touch-landscape.playing .player-card strong{font-size:11px}
body.touch-landscape.playing .player-card small{font-size:8px;margin-left:2px}
body.touch-landscape.playing .wins{font-size:8px;padding:0 2px;margin-left:2px}
body.touch-landscape.playing .team-chip{font-size:6px;padding:0 2px;margin-left:2px}
@media(max-width:700px){body.touch-landscape.playing .player-card strong{font-size:10px}}
