/* By Bu狼牙 — 菲比糯糯大枪战 · UI system.
   One stylesheet: tokens → base → components → screens → battle → modal → responsive.
   Cream paper, ink outlines, 菲比 sun yellow, 糯糯 sky blue; tomato only marks the main action. */

/* ---------- Tokens ---------- */
:root{
 --ink:#1d2733;--ink-2:#3b4757;--ink-3:#687284;--ink-4:#a3a9b2;
 --paper:#fffaf0;--paper-2:#fbf1dc;--paper-3:#f2e4c4;--cream:#fdf3de;--line:#e6d7b8;
 --sun:#ffc83d;--sun-2:#f2a516;--sun-3:#fff1c4;
 --sky:#5ec5f2;--sky-2:#2793cc;--sky-3:#ddf3fd;
 --tomato:#f0573a;--tomato-2:#c63f26;--tomato-3:#ffe3da;
 --grape:#8b7cf6;--grape-2:#5d4fd0;--grape-3:#ebe8ff;
 --leaf:#2fa36d;--leaf-3:#dcf3e6;
 --focus:#2b7fff;
 --p1:#f0573a;--p2:#2793cc;--p3:#8b7cf6;--p4:#2fa36d;
 --r-xs:8px;--r-sm:12px;--r-md:16px;--r-lg:22px;--r-xl:28px;
 --lift:0 4px 0 var(--ink);--lift-sm:0 3px 0 var(--ink);--lift-lg:0 7px 0 var(--ink);
 --float:0 22px 48px -18px rgba(29,39,51,.45);
 --font-ui:"PingFang SC","HarmonyOS Sans SC","MiSans","Microsoft YaHei UI","Microsoft YaHei","Noto Sans CJK SC","Source Han Sans SC",system-ui,sans-serif;
 --font-num:"Bahnschrift","DIN Alternate","DIN Condensed","Barlow Semi Condensed","Roboto Condensed","Segoe UI",system-ui,sans-serif;
 --font-latin:"Arial Black","Segoe UI Black","Helvetica Neue",Arial,sans-serif;
 --ease:cubic-bezier(.2,.8,.2,1);--spring:cubic-bezier(.34,1.56,.64,1);
 --header-h:64px;
 /* Icons are masks, so they inherit currentColor and never add text to accessible names. */
 --i-back:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E");
 --i-next:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
 --i-go:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E");
 --i-sound:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5L6 9H3v6h3l5 4z' fill='%23000'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E");
 --i-mute:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5L6 9H3v6h3l5 4z' fill='%23000'/%3E%3Cpath d='M16 9.5l5 5M21 9.5l-5 5'/%3E%3C/svg%3E");
 --i-expand:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H4v4M16 3h4v4M8 21H4v-4M16 21h4v-4'/%3E%3C/svg%3E");
 --i-pause:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='4' width='5' height='16' rx='1.6'/%3E%3Crect x='14' y='4' width='5' height='16' rx='1.6'/%3E%3C/svg%3E");
 --i-keys:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2.5'/%3E%3Cpath d='M6.5 10h.01M10 10h.01M13.5 10h.01M17 10h.01M7.5 14h9'/%3E%3C/svg%3E");
 --i-help:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M9.3 9.3a2.8 2.8 0 0 1 5.4 1c0 1.9-2.7 2.3-2.7 4'/%3E%3Cpath d='M12 17.6h.01' stroke-width='3'/%3E%3C/svg%3E");
 --i-lock:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10.5' rx='2.5' fill='%23000'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
 --i-check:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
 --i-copy:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11.5' height='11.5' rx='2.5'/%3E%3Cpath d='M5.5 15H5a1.5 1.5 0 0 1-1.5-1.5V5A1.5 1.5 0 0 1 5 3.5h8.5A1.5 1.5 0 0 1 15 5v.5'/%3E%3C/svg%3E");
 --i-rotate:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='9' width='18' height='11' rx='2.5'/%3E%3Cpath d='M6 5.5A8 8 0 0 1 17.5 4l1 1.5M19 2v3.5h-3.5'/%3E%3C/svg%3E");
 --i-left:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 4.5L6.5 12l9 7.5z' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
 --i-right:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 4.5l9 7.5-9 7.5z' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
 --i-jump:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l6-6 6 6M6 19l6-6 6 6'/%3E%3C/svg%3E");
 --i-drop:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4.5h16' stroke-dasharray='3 3'/%3E%3Cpath d='M12 8v11M7 14l5 5 5-5'/%3E%3C/svg%3E");
 --i-fire:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Cpath d='M12 2v5M12 17v5M2 12h5M17 12h5'/%3E%3Ccircle cx='12' cy='12' r='1.6' fill='%23000'/%3E%3C/svg%3E");
 --i-swap:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h14l-4-4M20 16H6l4 4'/%3E%3C/svg%3E");
 --i-reload:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.4-5.7L20 8.5M20 3.5v5h-5'/%3E%3C/svg%3E");
 --i-dice:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4.5' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3Ccircle cx='8.3' cy='8.3' r='1.8'/%3E%3Ccircle cx='15.7' cy='8.3' r='1.8'/%3E%3Ccircle cx='12' cy='12' r='1.8'/%3E%3Ccircle cx='8.3' cy='15.7' r='1.8'/%3E%3Ccircle cx='15.7' cy='15.7' r='1.8'/%3E%3C/svg%3E");
 --i-star:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5l2.6 7.9 7.9 2.6-7.9 2.6-2.6 7.9-2.6-7.9L1.5 12l7.9-2.6z'/%3E%3C/svg%3E");
 --i-cloud:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 19.5a5 5 0 0 1-.6-10A6.5 6.5 0 0 1 18.8 8a4.8 4.8 0 0 1-.8 11.5z'/%3E%3C/svg%3E");
 --i-heart:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8.5-5.2-8.5-11.3A4.7 4.7 0 0 1 12 6.6a4.7 4.7 0 0 1 8.5 3.1C20.5 15.8 12 21 12 21z'/%3E%3C/svg%3E");
 --i-crate:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M3.5 7.5L12 3l8.5 4.5v9L12 21l-8.5-4.5z'/%3E%3Cpath d='M3.5 7.5L12 12l8.5-4.5M12 12v9'/%3E%3C/svg%3E");
 --i-tip:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.6 10.8c.7.6 1.1 1.3 1.1 2.2h5c0-.9.4-1.6 1.1-2.2A6 6 0 0 0 12 3z'/%3E%3C/svg%3E");
 --i-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
 --i-flag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4M5 4h11l-2 4 2 4H5' fill='%23000'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-bottom:110px}
body{margin:0;min-height:100dvh;font-family:var(--font-ui);font-synthesis:none;color:var(--ink);line-height:1.5;-webkit-font-smoothing:antialiased;
 background-color:var(--cream);
 background-image:radial-gradient(circle at 1px 1px,rgba(29,39,51,.075) 1px,transparent 1.5px),radial-gradient(1000px 640px at -8% -12%,rgba(255,200,61,.34),transparent 66%),radial-gradient(1000px 680px at 108% -8%,rgba(94,197,242,.30),transparent 66%);
 background-size:18px 18px,auto,auto;background-attachment:scroll}
body.playing{background-color:#f5ead0;background-image:radial-gradient(circle at 1px 1px,rgba(29,39,51,.06) 1px,transparent 1.5px);background-size:18px 18px;overflow:hidden}
button,select,input{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:not-allowed}
:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
canvas{display:block}
.hidden{display:none!important}
::selection{background:var(--sun-3)}
h1,h2,h3,p{margin:0}
kbd{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;padding:0 7px;border:2px solid var(--ink);border-bottom-width:4px;border-radius:7px;background:#fff;color:var(--ink);font:700 13px/1 var(--font-num);white-space:nowrap;vertical-align:middle}
.eyebrow{display:inline-flex;align-items:center;gap:6px;width:max-content;max-width:100%;padding:5px 11px;border-radius:999px;background:var(--ink);color:var(--paper);font:700 11px/1.1 var(--font-num);letter-spacing:1.6px;text-transform:uppercase}

/* ---------- Buttons ---------- */
.primary,.textbutton,.iconbutton,.back-button{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:3px solid var(--ink);color:var(--ink);font-weight:800;white-space:nowrap;text-decoration:none;transition:transform .14s var(--ease),box-shadow .14s var(--ease),background-color .16s,color .16s}
.primary{min-height:54px;padding:0 26px;border-radius:var(--r-md);background:var(--tomato);color:#fff;font-size:18px;font-weight:900;letter-spacing:.6px;text-shadow:0 2px 0 rgba(120,30,10,.28);box-shadow:var(--lift)}
.primary:hover:not(:disabled){background:#ff6748;transform:translateY(-2px);box-shadow:0 6px 0 var(--ink)}
.primary:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 var(--ink)}
.primary:disabled{background:#e4d8c1;color:#8b8170;text-shadow:none;border-color:#a99d88;box-shadow:0 4px 0 #a99d88}
.textbutton{min-height:48px;padding:0 18px;border-width:2.5px;border-radius:var(--r-sm);background:var(--paper);font-size:15px;box-shadow:var(--lift-sm)}
.textbutton:hover:not(:disabled){background:#fff;transform:translateY(-1px);box-shadow:0 4px 0 var(--ink)}
.textbutton:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
.iconbutton{min-height:42px;padding:0 15px;border-width:2.5px;border-radius:999px;background:var(--paper);font-size:14px;box-shadow:var(--lift-sm)}
.iconbutton:hover{background:#fff;transform:translateY(-1px);box-shadow:0 4px 0 var(--ink)}
.iconbutton:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
.iconbutton svg{width:18px;height:18px;flex:0 0 auto}
.back-button{min-height:44px;padding:0 18px 0 13px;border-width:2.5px;border-radius:999px;background:var(--paper);font-size:15px;box-shadow:var(--lift-sm)}
.back-button::before{content:'';width:18px;height:18px;background:currentColor;-webkit-mask:var(--i-back) center/contain no-repeat;mask:var(--i-back) center/contain no-repeat}
.back-button:hover{background:#fff;transform:translateX(-2px)}
.back-button:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}

/* ---------- Header ---------- */
header{position:relative;z-index:6;height:var(--header-h);max-width:1440px;margin:0 auto;padding:0 28px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.brand{display:inline-flex;align-items:center;gap:11px;color:var(--ink);text-decoration:none;border-radius:14px}
.brandmark{position:relative;flex:0 0 auto;width:38px;height:38px;border:2.5px solid var(--ink);border-radius:12px;background:linear-gradient(135deg,var(--sun) 0 50%,var(--sky) 50% 100%);box-shadow:var(--lift-sm);transform:rotate(-6deg)}
.brandmark::after{content:'';position:absolute;inset:7px;background:#fff;-webkit-mask:var(--i-star) center/contain no-repeat;mask:var(--i-star) center/contain no-repeat;filter:drop-shadow(0 0 0 var(--ink))}
.brand-name{font-size:19px;font-weight:900;letter-spacing:1px;white-space:nowrap}
.brand-name i{font-style:normal;color:var(--tomato);margin:0 3px}
.brand small{padding:4px 8px;border:1.5px solid var(--ink-3);border-radius:999px;color:var(--ink-3);font:700 10px/1 var(--font-num);letter-spacing:2.2px;white-space:nowrap}
.topright{display:flex;align-items:center;gap:10px}
.edition{padding:6px 11px;border:1.5px dashed rgba(29,39,51,.28);border-radius:999px;background:rgba(255,250,240,.7);color:var(--ink-3);font:600 12px/1 var(--font-num);letter-spacing:.2px;white-space:nowrap}
#sound[aria-pressed=false]{background:var(--paper-3);color:var(--ink-3)}
#sound .ico-on,#sound[aria-pressed=false] .ico-off{display:block}
#sound .ico-off,#sound[aria-pressed=false] .ico-on{display:none}

/* ---------- Shared bits ---------- */
/* Screens fade in when shown; opacity only, so layout and hit targets never move. */
#modeHome,#menu,#campaignSelect,#onlineLobby{animation:screen-in .28s ease-out}
@keyframes screen-in{from{opacity:0}}
.menu label{display:flex;align-items:baseline;gap:10px;margin:0 0 9px;color:var(--ink);font-size:15px;font-weight:900;letter-spacing:.5px}
.menu label small{color:var(--ink-3);font-size:12px;font-weight:600;letter-spacing:0}

/* ---------- Home ---------- */
.mode-home{max-width:1440px;margin:0 auto;min-height:calc(100dvh - var(--header-h));padding:6px 28px 22px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:22px}
.home-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:0 4px}
.home-byline{display:inline-flex;align-items:center;gap:8px;margin-bottom:6px;color:var(--ink-2);font-size:15px;font-weight:800;letter-spacing:.5px}
.home-byline::before{content:'';width:22px;height:22px;background:var(--sun-2);-webkit-mask:var(--i-star) center/contain no-repeat;mask:var(--i-star) center/contain no-repeat}
.game-title{display:flex;align-items:flex-end;flex-wrap:nowrap;gap:0 .04em;margin:0;font-size:clamp(46px,6.6vw,106px);font-weight:900;line-height:1.08;letter-spacing:-.02em;white-space:nowrap;filter:drop-shadow(0 .07em 0 var(--ink))}
.game-title span,.game-title i{display:inline-block;font-style:normal;-webkit-text-stroke:.12em var(--ink);paint-order:stroke fill;transform-origin:50% 80%}
.title-feibi{color:var(--sun);transform:rotate(-4deg)}
.title-nuonuo{color:var(--sky);transform:rotate(3deg) translateY(-.04em)}
.title-battle{color:#fffdf6;transform:rotate(-1.5deg)}
.game-title i{color:var(--tomato);transform:rotate(9deg);margin-left:.02em}
.home-tagline{margin-bottom:10px;padding:14px 18px;border:2.5px solid var(--ink);border-radius:18px 18px 18px 4px;background:var(--paper);box-shadow:var(--lift-sm);font-size:17px;font-weight:800;line-height:1.55;text-align:left;transform:rotate(1.5deg)}
.mode-stages{position:relative;display:flex;min-height:380px;border:3px solid var(--ink);border-radius:var(--r-xl);background:var(--ink);box-shadow:var(--lift-lg);overflow:hidden;isolation:isolate}
.mode-entry{--accent:var(--sun);--cut:52px;position:relative;flex:1 1 0;min-width:0;margin:0 calc(var(--cut) * -1 + 6px) 0 0;padding:0;border:0;background:#2a3542;color:#fff;text-align:left;overflow:hidden;clip-path:polygon(var(--cut) 0,100% 0,calc(100% - var(--cut)) 100%,0 100%);transition:flex-grow .45s var(--ease)}
.mode-entry:first-child{clip-path:polygon(0 0,100% 0,calc(100% - var(--cut)) 100%,0 100%)}
.mode-entry:last-child{margin-right:0;clip-path:polygon(var(--cut) 0,100% 0,100% 100%,0 100%)}
.mode-online{--accent:var(--grape)}
.mode-practice{--accent:var(--sun)}
.mode-campaign{--accent:var(--tomato)}
.mode-illustration{position:absolute;inset:0}
.mode-illustration canvas{width:100%;height:100%;transition:transform .6s var(--ease),filter .3s}
.mode-entry::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(16,22,32,0) 45%,rgba(16,22,32,.72) 100%);pointer-events:none}
.mode-tag{position:absolute;z-index:2;top:18px;left:calc(var(--cut) + 14px);padding:6px 12px;border:2.5px solid var(--ink);border-radius:999px;background:var(--accent);color:var(--ink);font:800 12px/1 var(--font-num);letter-spacing:1.6px;box-shadow:var(--lift-sm)}
.mode-online .mode-tag{color:#fff}
.mode-entry:first-child .mode-tag{left:20px}
.mode-caption{position:absolute;z-index:2;left:0;right:0;bottom:0;display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:20px calc(var(--cut) + 18px) 24px 26px}
.mode-entry:last-child .mode-caption{padding-right:24px}
.mode-caption strong{display:block;color:#fff;font-size:clamp(28px,2.9vw,44px);font-weight:900;line-height:1.1;letter-spacing:1px;-webkit-text-stroke:7px var(--ink);paint-order:stroke fill;white-space:nowrap}
.mode-caption small{display:inline-block;margin-top:8px;padding:5px 11px;border-radius:999px;background:rgba(255,250,240,.94);color:var(--ink);font-size:14px;font-weight:800;box-shadow:0 2px 0 var(--ink)}
.mode-caption b{flex:0 0 auto;display:grid;place-items:center;width:54px;height:54px;border:3px solid var(--ink);border-radius:50%;background:var(--accent);color:var(--ink);font-size:0;box-shadow:var(--lift-sm);transition:transform .3s var(--spring)}
.mode-caption b::before{content:'';width:24px;height:24px;background:currentColor;-webkit-mask:var(--i-go) center/contain no-repeat;mask:var(--i-go) center/contain no-repeat}
.mode-online .mode-caption b{color:#fff}
.mode-entry:hover,.mode-entry:focus-visible{flex-grow:1.32}
.mode-entry:hover .mode-illustration canvas,.mode-entry:focus-visible .mode-illustration canvas{transform:scale(1.04);filter:saturate(1.12) brightness(1.04)}
.mode-entry:hover .mode-caption b,.mode-entry:focus-visible .mode-caption b{transform:rotate(45deg) scale(1.08)}
.mode-entry:focus-visible{outline:none}
.mode-entry:focus-visible::before{content:'';position:absolute;z-index:3;inset:5px;border:4px solid var(--focus);border-radius:4px;pointer-events:none}
.mode-entry:active .mode-caption b{transform:scale(.92)}
.home-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 4px}
.home-rules{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
.home-rules li{display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border:2px solid var(--ink);border-radius:999px;background:var(--paper);font-size:14px;font-weight:800}
.home-rules li::before{content:'';width:9px;height:9px;border-radius:50%;background:var(--sun-2);border:2px solid var(--ink)}
.home-rules li:nth-child(2)::before{background:var(--sky)}
.home-rules li:nth-child(3)::before{background:var(--tomato)}
.home-footer>div{display:flex;gap:10px}
.home-footer>div button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:2.5px solid var(--ink);border-radius:999px;background:var(--paper);font-size:15px;font-weight:800;box-shadow:var(--lift-sm);transition:transform .14s var(--ease),box-shadow .14s var(--ease)}
.home-footer>div button::before{content:'';width:18px;height:18px;background:currentColor;-webkit-mask:var(--icon) center/contain no-repeat;mask:var(--icon) center/contain no-repeat}
#homeSettings{--icon:var(--i-keys)}
#homeHelp{--icon:var(--i-help)}
/* The voiced release adds a credits link here; keep it in the same quiet chip style. */
.home-footer>div a{display:inline-flex;align-items:center;min-height:44px;padding:0 6px;color:var(--ink-2);font-size:14px;font-weight:800;text-decoration:underline;text-underline-offset:3px;border-radius:8px}
.home-footer>div a:hover{color:var(--ink)}
.home-footer>div button:hover{transform:translateY(-1px);box-shadow:0 4px 0 var(--ink);background:#fff}
.home-footer>div button:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}

/* ---------- Practice / loadout ---------- */
.menu{--hero:var(--sun);--hero-2:var(--sun-2);--hero-3:var(--sun-3);max-width:1440px;margin:0 auto;padding:4px 28px 0;display:grid;grid-template-columns:minmax(360px,.82fr) minmax(0,1.18fr);grid-template-rows:auto 1fr;gap:16px 26px;min-height:calc(100dvh - var(--header-h))}
.menu[data-hero-character=nuonuo],.menu[data-hero-character=funuonuo]{--hero:var(--sky);--hero-2:var(--sky-2);--hero-3:var(--sky-3)}
.menu .intro{grid-column:1/-1;display:flex;align-items:center;gap:16px;min-height:56px}
.menu .intro #practiceBack{order:-1}
.intro-title{display:flex;align-items:center;gap:12px;min-width:0}
.intro-title h1{font-size:30px;font-weight:900;letter-spacing:.5px;white-space:nowrap}
.intro-rules{display:flex;gap:8px;margin-left:auto}
.intro-rules span{padding:6px 12px;border:2px solid var(--ink);border-radius:999px;background:var(--paper);font-size:13px;font-weight:800;white-space:nowrap}
.menu .hero{grid-column:1;position:sticky;top:12px;align-self:start;display:flex;flex-direction:column;gap:14px;height:calc(100dvh - var(--header-h) - 92px);min-height:500px;max-height:760px}
.portrait-frame{position:relative;flex:1;min-height:0;border:3px solid var(--ink);border-radius:var(--r-xl);overflow:hidden;box-shadow:var(--lift-lg);
 background:radial-gradient(circle at 50% 62%,rgba(255,255,255,.75) 0 16%,transparent 52%),repeating-conic-gradient(from -4deg at 50% 64%,rgba(255,255,255,.34) 0 9deg,rgba(255,255,255,0) 9deg 18deg),linear-gradient(170deg,var(--hero-3) 0%,var(--hero) 100%);transition:background .4s}
.portrait-frame::after{content:'';position:absolute;inset:auto 0 0;height:22%;background:linear-gradient(180deg,transparent,rgba(29,39,51,.18));pointer-events:none}
.menu #portrait{position:absolute;inset:0;width:100%;height:100%;cursor:pointer}
.menu #portrait:focus-visible{outline:4px solid var(--focus);outline-offset:-8px;border-radius:var(--r-lg)}
.hero-stamp{position:absolute;z-index:2;top:18px;left:18px;padding:8px 12px;border:2.5px solid var(--ink);border-radius:12px;background:var(--paper);color:var(--ink);font:900 13px/1.05 var(--font-latin);letter-spacing:.5px;transform:rotate(-8deg);box-shadow:var(--lift-sm);pointer-events:none}
.menu .hero-caption{position:absolute;z-index:2;left:22px;right:22px;bottom:18px;display:flex;align-items:flex-end;justify-content:space-between;gap:10px;pointer-events:none}
#selectedCharacterName{color:#fff;font-size:clamp(40px,4.4vw,64px);font-weight:900;line-height:1;letter-spacing:2px;-webkit-text-stroke:8px var(--ink);paint-order:stroke fill;filter:drop-shadow(0 5px 0 var(--ink))}
.menu .hero-caption small{padding:6px 11px;border:2px solid var(--ink);border-radius:999px;background:var(--paper);font-size:13px;font-weight:800;box-shadow:0 2px 0 var(--ink)}
.character-picks{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.character-picks button{--c:var(--sun);position:relative;display:grid;grid-template-rows:auto auto;justify-items:center;gap:2px;min-width:0;padding:6px 4px 9px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--paper);box-shadow:var(--lift-sm);transition:transform .16s var(--ease),box-shadow .16s var(--ease),background-color .2s}
.character-picks button[data-character=nuonuo],.character-picks button[data-character=funuonuo]{--c:var(--sky)}
.character-picks canvas{width:100%;max-width:92px;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 50% 40%,#fff 0 30%,var(--paper-2) 72%)}
.character-picks span{font-size:16px;font-weight:900;line-height:1.2}
.character-picks small{font-size:11px;font-weight:700;color:var(--ink-3);line-height:1.2}
.character-picks button:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 5px 0 var(--ink)}
.character-picks button.selected{background:var(--c);box-shadow:0 4px 0 var(--ink),inset 0 0 0 3px rgba(255,255,255,.55)}
.character-picks button.selected canvas{background:radial-gradient(circle at 50% 40%,#fff 0 34%,rgba(255,255,255,.4) 74%)}
.character-picks button.selected small{color:var(--ink)}
.character-picks button.selected::after{content:'';position:absolute;top:-8px;right:-8px;width:26px;height:26px;border:2.5px solid var(--ink);border-radius:50%;background:var(--paper) var(--check-fill,none);box-shadow:0 2px 0 var(--ink)}
.character-picks button.selected::before{content:'';position:absolute;z-index:1;top:-2px;right:-2px;width:14px;height:14px;background:var(--leaf);-webkit-mask:var(--i-check) center/contain no-repeat;mask:var(--i-check) center/contain no-repeat}
.character-picks button:disabled{opacity:.55;box-shadow:none}
.character-picks button:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
.menu .setup{grid-column:2;display:flex;flex-direction:column;gap:18px;min-width:0;padding:22px 24px 0;border:3px solid var(--ink);border-radius:var(--r-xl);background:var(--paper);box-shadow:var(--lift-lg);align-self:start}
.setup-section{min-width:0}
.mode-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.menu .mode-row>label{margin:0}
.segmented{display:flex;flex:1;min-width:260px;padding:4px;border:2.5px solid var(--ink);border-radius:999px;background:var(--paper-2);gap:4px}
.segmented button{flex:1;min-height:40px;padding:0 14px;border:0;border-radius:999px;background:transparent;color:var(--ink-2);font-size:15px;font-weight:800;transition:background-color .2s,color .2s,box-shadow .2s}
.segmented button:hover:not(.selected){background:rgba(255,255,255,.8);color:var(--ink)}
.segmented button.selected{background:var(--ink);color:var(--paper);box-shadow:0 2px 0 rgba(0,0,0,.25)}
.mode-note{color:var(--ink-3);font-size:13px;font-weight:700}
.map-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.map-options button{position:relative;display:flex;flex-direction:column;min-width:0;padding:0;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--paper);overflow:hidden;box-shadow:var(--lift-sm);transition:transform .16s var(--ease),box-shadow .16s var(--ease)}
.map-options canvas,.map-random{width:100%;aspect-ratio:16/9;background:linear-gradient(160deg,#cfeaf5,#f7e5c4)}
.map-random{display:grid;place-items:center;background:repeating-linear-gradient(135deg,var(--sun-3) 0 12px,#fff6df 12px 24px);font-size:0}
.map-random::before{content:'';width:34%;aspect-ratio:1;background:var(--ink);-webkit-mask:var(--i-dice) center/contain no-repeat;mask:var(--i-dice) center/contain no-repeat;transform:rotate(-12deg)}
.map-options b{display:block;padding:6px 6px 7px;border-top:2.5px solid var(--ink);font-size:14px;font-weight:900;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.map-options button:hover{transform:translateY(-2px);box-shadow:0 5px 0 var(--ink)}
.map-options button.selected{box-shadow:0 0 0 3px var(--paper),0 0 0 6px var(--tomato),0 4px 0 6px var(--ink);transform:translateY(-1px)}
.map-options button.selected b{background:var(--sun)}
.map-options button:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
#mapDescription{margin:9px 2px 0;color:var(--ink-2);font-size:14px;font-weight:600;min-height:21px}
#mapDescription::before{content:'';display:inline-block;width:14px;height:14px;margin-right:7px;vertical-align:-2px;background:var(--tomato);-webkit-mask:var(--i-flag) center/contain no-repeat;mask:var(--i-flag) center/contain no-repeat}
.armory{display:flex;flex-direction:column;gap:12px;min-width:0}
.menu .armory>label{margin:0}
.weapon-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.weapon-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;min-width:0;padding:8px 10px 10px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:#fff linear-gradient(180deg,#fff 0,var(--paper) 100%);text-align:left;box-shadow:var(--lift-sm);transition:transform .16s var(--ease),box-shadow .16s var(--ease),background-color .2s}
.weapon-card svg,.weapon-card .weapon-illustration{display:block;width:100%;height:46px;object-fit:contain;margin-bottom:4px;transition:transform .3s var(--spring)}
.weapon-card b{font-size:16px;font-weight:900;line-height:1.2}
.weapon-card small{margin-top:2px;color:var(--ink-3);font-size:12px;font-weight:700;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.weapon-card:hover{transform:translateY(-2px);box-shadow:0 5px 0 var(--ink)}
.weapon-card:hover .weapon-illustration,.weapon-card:hover svg{transform:translateX(3px) rotate(-3deg)}
.weapon-card.selected{background:var(--sun);box-shadow:0 4px 0 var(--ink),inset 0 0 0 3px rgba(255,255,255,.5)}
.weapon-card.selected small{color:var(--ink-2)}
.weapon-card.selected::after{content:'';position:absolute;top:7px;right:7px;width:20px;height:20px;border:2px solid var(--ink);border-radius:50%;background:var(--paper)}
.weapon-card.selected::before{content:'';position:absolute;z-index:1;top:11px;right:11px;width:12px;height:12px;background:var(--leaf);-webkit-mask:var(--i-check) center/contain no-repeat;mask:var(--i-check) center/contain no-repeat}
.weapon-card:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
.weapon-preview{display:grid;grid-template-columns:minmax(150px,.9fr) minmax(0,1.6fr);align-items:center;gap:16px;padding:12px 16px;border:2.5px dashed rgba(29,39,51,.35);border-radius:var(--r-lg);background:repeating-linear-gradient(0deg,transparent 0 21px,rgba(29,39,51,.05) 21px 22px),repeating-linear-gradient(90deg,transparent 0 21px,rgba(29,39,51,.05) 21px 22px),#fffdf7}
.weapon-art{display:grid;place-items:center;height:86px}
.weapon-art svg,.weapon-art .weapon-illustration{width:100%;height:86px;object-fit:contain;filter:drop-shadow(0 4px 0 rgba(29,39,51,.18))}
.weapon-meta{min-width:0}
.weapon-meta-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.weapon-meta h2{font-size:24px;font-weight:900;line-height:1.1}
.weapon-meta p{color:var(--ink-2);font-size:14px;font-weight:800}
.weapon-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 14px;margin:8px 0 0;padding:0}
.weapon-stats div{min-width:0}
.weapon-stats dt{display:flex;justify-content:space-between;gap:6px;color:var(--ink-3);font-size:12px;font-weight:800}
.weapon-stats dt b{color:var(--ink);font:700 14px/1 var(--font-num)}
.weapon-stats dd{position:relative;height:8px;margin:5px 0 0;border:2px solid var(--ink);border-radius:999px;background:#fff;overflow:hidden}
.weapon-stats dd i{position:absolute;inset:0 auto 0 0;width:calc(var(--v) * 100%);background:linear-gradient(90deg,var(--sun-2),var(--tomato));border-radius:999px}
.weapon-preview .specs{margin-top:7px;color:var(--ink-3);font-size:12px;font-weight:700}
.loadout-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}
.side-group{min-width:0}
.menu .side-group>label{font-size:14px}
.side-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.side-options button{position:relative;display:flex;align-items:center;gap:10px;min-width:0;min-height:58px;padding:6px 12px 6px 8px;border:2.5px solid var(--ink);border-radius:var(--r-sm);background:#fff;text-align:left;box-shadow:var(--lift-sm);transition:transform .16s var(--ease),box-shadow .16s var(--ease),background-color .2s}
.side-options svg,.side-options .weapon-illustration{flex:0 0 auto;width:52px;height:34px;object-fit:contain}
.side-options span{display:flex;flex-direction:column;min-width:0}
.side-options b{font-size:15px;font-weight:900;line-height:1.2}
.side-options small{color:var(--ink-3);font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-options button:hover{transform:translateY(-1px);box-shadow:0 4px 0 var(--ink)}
.side-options button.selected{background:var(--sun-3);box-shadow:inset 0 0 0 2px var(--sun-2),0 3px 0 var(--ink)}
.side-options button.selected b::after{content:'';display:inline-block;width:12px;height:12px;margin-left:6px;background:var(--leaf);-webkit-mask:var(--i-check) center/contain no-repeat;mask:var(--i-check) center/contain no-repeat}
.side-options button:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)}
#sideDescription,#meleeDescription{margin-top:8px;color:var(--ink-2);font-size:13px;font-weight:600;line-height:1.55}
.opponent-loadout{padding:14px 16px 16px;border:2.5px solid var(--ink);border-radius:var(--r-lg);background:linear-gradient(180deg,var(--sky-3),#eef9fe)}
.opponent-loadout[data-opponent=local]{background:linear-gradient(180deg,var(--grape-3),#f5f3ff)}
.opponent-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.opponent-head h3{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:900}
.opponent-head h3::before{content:'VS';display:grid;place-items:center;width:30px;height:30px;border:2.5px solid var(--ink);border-radius:50%;background:var(--sky);font:900 11px/1 var(--font-latin);color:var(--ink)}
.opponent-loadout[data-opponent=local] .opponent-head h3::before{content:'P2';background:var(--grape);color:#fff}
.opponent-grid{display:grid;grid-template-columns:minmax(120px,.7fr) minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}
.enemy-select label{margin-bottom:9px}
.enemy-select select,.online-picks select{width:100%;min-height:48px;padding:0 40px 0 14px;border:2.5px solid var(--ink);border-radius:var(--r-sm);background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d2733' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center/18px no-repeat;font-size:15px;font-weight:800;-webkit-appearance:none;appearance:none;box-shadow:var(--lift-sm);cursor:pointer}
.enemy-select select:hover,.online-picks select:hover:not(:disabled){background-color:var(--paper)}
.opponent-loadout .side-options{grid-template-columns:1fr}
.opponent-loadout .side-options button{min-height:46px}
.opponent-loadout .side-options svg,.opponent-loadout .side-options .weapon-illustration{width:42px;height:26px}
.launch{position:sticky;bottom:0;z-index:4;display:flex;align-items:center;gap:10px;margin:2px -24px 0;padding:14px 24px 18px;border-top:2.5px solid var(--ink);border-radius:0 0 calc(var(--r-xl) - 3px) calc(var(--r-xl) - 3px);background:rgba(255,250,240,.96);backdrop-filter:blur(8px)}
.launch .textbutton{min-height:48px;padding:0 15px;font-size:14px}
.launch .textbutton::before{content:'';width:18px;height:18px;background:currentColor;-webkit-mask:var(--icon) center/contain no-repeat;mask:var(--icon) center/contain no-repeat}
#settings{--icon:var(--i-keys)}
#help{--icon:var(--i-help)}
#start{flex:1;justify-content:space-between;min-height:58px;font-size:20px}
#start span{display:grid;place-items:center;width:34px;height:34px;border:2.5px solid var(--ink);border-radius:50%;background:var(--paper);color:var(--ink);font-size:0;text-shadow:none;transition:transform .25s var(--spring)}
#start span::before{content:'';width:18px;height:18px;background:currentColor;-webkit-mask:var(--i-next) center/contain no-repeat;mask:var(--i-next) center/contain no-repeat}
#start:hover:not(:disabled) span{transform:translateX(4px)}

/* ---------- Campaign journey ---------- */

/* ---------- Online lobby ---------- */
.online-lobby{max-width:1280px;min-height:calc(100dvh - var(--header-h) - 40px);margin:4px auto 34px;padding:0 28px;display:flex;flex-direction:column;justify-content:center}
.online-shell{display:grid;grid-template-columns:minmax(0,1.04fr) minmax(0,.96fr);border:3px solid var(--ink);border-radius:var(--r-xl);background:var(--paper);box-shadow:var(--lift-lg);overflow:hidden}
.online-main{display:flex;flex-direction:column;gap:18px;min-width:0;padding:26px 30px 30px}
.online-heading{display:flex;flex-direction:column;align-items:flex-start;gap:14px}
.online-heading>div{display:flex;flex-direction:column;gap:8px}
.online-heading h2{font-size:clamp(32px,3.2vw,46px);font-weight:900;line-height:1.05;letter-spacing:1px}
#onlineClose{order:-1}
.online-intro{color:var(--ink-2);font-size:16px;font-weight:600;line-height:1.6}
.online-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0;padding:0;list-style:none;counter-reset:step}
.online-steps li{position:relative;display:flex;flex-direction:column;gap:2px;padding:12px 12px 12px 48px;border:2px solid var(--ink);border-radius:var(--r-md);background:#fff;font-size:14px;font-weight:900;line-height:1.3;counter-increment:step}
.online-steps li::before{content:counter(step);position:absolute;left:12px;top:12px;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--grape);color:#fff;font:700 15px/1 var(--font-num)}
.online-steps small{color:var(--ink-3);font-size:12px;font-weight:700}
.online-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px 12px;align-items:end}
#onlineCreate{grid-column:1/-1;min-height:60px;font-size:20px;background:var(--sun);color:var(--ink);text-shadow:none}
#onlineCreate:hover{background:#ffd45f}
.online-or{grid-column:1/-1;display:flex;align-items:center;gap:12px;color:var(--ink-3);font-size:13px;font-weight:800}
.online-or::before,.online-or::after{content:'';flex:1;height:2px;background:repeating-linear-gradient(90deg,var(--ink-4) 0 6px,transparent 6px 11px)}
.online-entry label{display:flex;flex-direction:column;gap:8px;margin:0;font-size:14px;font-weight:900}
#onlineCode{width:100%;height:60px;padding:0 16px;border:3px solid var(--ink);border-radius:var(--r-md);background:#fff;color:var(--ink);font:700 30px/1 var(--font-num);letter-spacing:.42em;text-transform:uppercase;box-shadow:inset 0 3px 0 rgba(29,39,51,.08)}
#onlineCode::placeholder{color:var(--ink-4);font:700 16px/1 var(--font-ui);letter-spacing:.1em}
#onlineCode:focus{outline:3px solid var(--focus);outline-offset:2px}
#onlineJoin{min-height:60px;background:var(--sky);color:var(--ink);text-shadow:none}
#onlineJoin:hover{background:#7fd2f6}
#onlineStatus{min-height:24px;color:var(--ink-2);font-size:15px;font-weight:800}
#onlineStatus:empty{display:none}
#onlineStatus::before{content:'';display:inline-block;width:10px;height:10px;margin-right:8px;border-radius:50%;background:var(--sun-2);vertical-align:1px;box-shadow:0 0 0 3px var(--sun-3)}
.online-art{width:100%;height:100%;min-height:520px;background:#a99cf1}
.online-stage{position:relative;border-left:3px solid var(--ink)}
.online-stage .online-art{position:absolute;inset:0;min-height:0}
.online-stage-caption{position:absolute;left:18px;right:18px;bottom:18px;display:flex;justify-content:space-between;gap:10px;pointer-events:none}
.online-stage-caption span{padding:6px 12px;border:2.5px solid var(--ink);border-radius:999px;background:var(--paper);font-size:13px;font-weight:900;box-shadow:var(--lift-sm)}
#onlineRoom{display:flex;flex-direction:column;gap:16px}
.room-code{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 16px;border:3px solid var(--ink);border-radius:var(--r-lg);background:var(--ink);color:var(--paper)}
.room-code-label{font-size:14px;font-weight:800;opacity:.85}
#roomCode{color:var(--sun);font:700 40px/1 var(--font-num);letter-spacing:.24em}
#onlineSeat{margin-left:auto;padding:5px 12px;border-radius:999px;background:var(--paper);color:var(--ink);font-size:14px;font-weight:900}
#onlineCopy{min-height:40px;padding:0 13px;border:2px solid var(--paper);border-radius:999px;background:transparent;color:var(--paper);font-size:14px;font-weight:800;display:inline-flex;align-items:center;gap:6px}
#onlineCopy::before{content:'';width:16px;height:16px;background:currentColor;-webkit-mask:var(--i-copy) center/contain no-repeat;mask:var(--i-copy) center/contain no-repeat}
#onlineCopy:hover{background:rgba(255,255,255,.12)}
#onlineCopy.copied{background:var(--leaf);border-color:var(--leaf)}
.online-players{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:stretch;gap:10px}
.online-vs{align-self:center;display:grid;place-items:center;width:46px;height:46px;border:3px solid var(--ink);border-radius:50%;background:var(--tomato);color:#fff;font:900 15px/1 var(--font-latin);box-shadow:var(--lift-sm);transform:rotate(-8deg)}
.online-player{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:4px 12px;min-height:96px;padding:12px;border:3px solid var(--ink);border-radius:var(--r-lg);background:#fff;box-shadow:var(--lift-sm)}
.online-player canvas{grid-row:1/3;width:64px;height:64px;border:2.5px solid var(--ink);border-radius:50%;background:radial-gradient(circle at 50% 40%,#fff,var(--sun-3))}
.online-player[data-family=nuonuo] canvas{background:radial-gradient(circle at 50% 40%,#fff,var(--sky-3))}
.online-player b{font-size:17px;font-weight:900;line-height:1.2;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.online-player small{color:var(--ink-3);font-size:13px;font-weight:700;line-height:1.3}
.online-player .state-pill{position:absolute;top:-12px;right:12px;padding:3px 10px;border:2px solid var(--ink);border-radius:999px;background:var(--paper);font-size:12px;font-weight:900;box-shadow:0 2px 0 var(--ink)}
.online-player[data-state=ready]{background:var(--leaf-3)}
.online-player[data-state=ready] .state-pill{background:var(--leaf);color:#fff}
.online-player[data-state=offline]{background:#f1e9da}
.online-player[data-state=offline] .state-pill{background:var(--tomato-3)}
.online-player[data-state=empty]{grid-template-columns:1fr;place-items:center;border-style:dashed;background:transparent;box-shadow:none;color:var(--ink-3)}
.online-player[data-state=empty] b{color:var(--ink-3);font-size:15px}
.online-player[data-state=empty] b::after{content:'';display:inline-block;width:1.2em;text-align:left;animation:dots 1.4s steps(4) infinite;vertical-align:bottom;overflow:hidden}
.online-player.me{outline:3px solid var(--sun);outline-offset:3px}
@keyframes dots{0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'...'}}
.online-picks{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.online-picks label{display:flex;flex-direction:column;gap:7px;margin:0;font-size:13px;font-weight:900;min-width:0}
.online-picks label:last-child{grid-column:1/-1}
.online-picks select:disabled{background-color:var(--paper-2);color:var(--ink-3);cursor:not-allowed;box-shadow:none}
.online-note{color:var(--ink-3);font-size:14px;font-weight:600}
.online-actions{display:flex;align-items:center;gap:12px}
#onlineReady{flex:1;min-height:60px;font-size:20px}
#onlineReady.is-ready{background:var(--paper);color:var(--ink);text-shadow:none}

/* ---------- Battle ---------- */
#arena{position:relative;max-width:1440px;margin:0 auto;padding:0 24px 14px;height:calc(100dvh - 56px);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr) auto;gap:10px}
body.playing{--header-h:56px}
body.playing header{height:56px}
#arena>*{grid-column:1/-1;min-width:0}
#rotateNotice{grid-row:1}
#campaignObjective{grid-row:2}
.battle-top{grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:16px;min-height:86px}
#campaignEnemies{grid-row:3;justify-self:end;align-self:center;max-width:calc(50% - 110px)}
.stage{grid-row:4;position:relative;width:100%;height:100%;max-height:calc((min(100vw,1440px) - 48px) * .5625);min-height:200px;margin:0 auto;border:3px solid var(--ink);border-radius:var(--r-lg);overflow:hidden;background:#cfe6ef;box-shadow:var(--lift)}
.stage canvas{position:absolute;inset:0;width:100%;height:100%}
.battle-bottom{grid-row:5;display:flex;align-items:center;gap:14px;min-height:66px}

/* Fighter cards */
.fighter{--pc:var(--p1);--fam:var(--sun);--fam-3:var(--sun-3);position:relative;justify-self:start;width:100%;max-width:470px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;min-width:0;min-height:80px;padding:8px 14px 8px 8px;border:3px solid var(--ink);border-radius:var(--r-lg);background:var(--paper);box-shadow:var(--lift-sm)}
.fighter:empty{visibility:hidden}
.fighter.right{--pc:var(--p2);justify-self:end;grid-template-columns:auto minmax(0,1fr) auto;direction:rtl;padding:8px 8px 8px 14px}
.fighter.right>*{direction:ltr}
.fighter[data-family=nuonuo]{--fam:var(--sky);--fam-3:var(--sky-3)}
.fighter-avatar{position:relative;width:62px;height:62px;border:3px solid var(--ink);border-radius:50%;background:radial-gradient(circle at 50% 38%,#fff 0 28%,var(--fam) 80%);overflow:hidden}
.fighter-avatar canvas{width:100%;height:100%}
.fighter-avatar::after{content:attr(data-tag);position:absolute;left:50%;bottom:-1px;transform:translateX(-50%);min-width:30px;padding:1px 5px;border:2px solid var(--ink);border-radius:999px;background:var(--pc);color:#fff;font:700 11px/1.15 var(--font-num);text-align:center;letter-spacing:.5px}
.fighter-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.fighter.right .fighter-info{align-items:flex-end;text-align:right}
.fighter .name{display:flex;align-items:baseline;gap:6px;font-size:17px;font-weight:900;line-height:1.2;white-space:nowrap}
.fighter .name small{padding:1px 7px;border-radius:999px;background:var(--pc);color:#fff;font:700 11px/1.4 var(--font-num);letter-spacing:.5px}
.lives{display:flex;align-items:center;gap:3px;height:18px}
.lives b{margin-right:5px;font:700 13px/1 var(--font-num);color:var(--ink-3)}
.lives span{width:17px;height:17px;background:var(--tomato);-webkit-mask:var(--i-heart) center/contain no-repeat;mask:var(--i-heart) center/contain no-repeat}
.lives span.lost{background:#d8ccb4}
.ammo-readout{display:flex;align-items:baseline;gap:5px;font-size:13px;font-weight:800;color:var(--ink-2);white-space:nowrap}
.ammo-readout b{font:700 20px/1 var(--font-num);color:var(--ink)}
.ammo-readout small{font:700 13px/1 var(--font-num);color:var(--ink-3)}
.shieldtext{color:var(--ink-3);font-size:12px;font-weight:700;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.effect-state{color:#a2541f;font-size:12px;font-weight:900;line-height:1.3}
.effect-state:empty{display:none}
.percent{--heat:var(--ink);position:relative;min-width:94px;font:700 54px/1 var(--font-num);color:var(--heat);text-align:right;letter-spacing:-1px;-webkit-text-stroke:0;text-shadow:0 3px 0 rgba(29,39,51,.14);transition:color .25s}
.fighter.right .percent{text-align:left}
.percent small{margin-left:2px;font-size:.42em;letter-spacing:0}
.percent[data-heat="1"]{--heat:#cf8a07}
.percent[data-heat="2"]{--heat:#ea6a1c}
.percent[data-heat="3"],.percent.high{--heat:#d93a24}
.fighter.hit{animation:fighter-hit .22s var(--ease)}
.fighter.hit .percent{animation:percent-hit .22s var(--ease)}
@keyframes fighter-hit{0%,100%{transform:none}30%{transform:translateX(-4px)}60%{transform:translateX(3px)}}
@keyframes percent-hit{0%{transform:scale(1)}40%{transform:scale(1.18)}100%{transform:scale(1)}}
.match-label{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:150px;padding:8px 18px 9px;border:3px solid var(--ink);border-radius:var(--r-lg);background:var(--ink);color:var(--paper);box-shadow:var(--lift-sm)}
.match-label span{color:var(--sun);font-size:13px;font-weight:900;letter-spacing:2px;white-space:nowrap}
.match-label b{font:700 34px/1 var(--font-num);letter-spacing:1px}
.match-label small{color:#c9d1db;font-size:12px;font-weight:700;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis}

/* Campaign HUD */
.campaign-objective{display:flex;align-items:center;gap:12px;min-height:46px;padding:7px 10px 7px 8px;border:3px solid var(--ink);border-radius:var(--r-md);background:var(--sun-3);box-shadow:var(--lift-sm);font-size:15px;font-weight:700;line-height:1.4}
.campaign-objective b{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;padding:5px 12px;border-radius:999px;background:var(--ink);color:var(--sun);font-size:14px;font-weight:900;white-space:nowrap}
.campaign-objective b::before{content:'';width:14px;height:14px;background:currentColor;-webkit-mask:var(--i-flag) center/contain no-repeat;mask:var(--i-flag) center/contain no-repeat}
.campaign-objective span{flex:1;min-width:0}
.campaign-objective small{flex:0 0 auto;min-width:56px;padding:3px 10px;border:2px solid var(--ink);border-radius:999px;background:#fff;font:700 15px/1.2 var(--font-num);text-align:center}
.campaign-playing #hud1{display:none}
.campaign-playing .fighter{max-width:420px}
.campaign-enemies{display:flex;gap:8px;min-width:0;max-width:100%}
.enemy-card{--pc:var(--p2);position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:center;gap:0 8px;min-width:0;width:200px;min-height:62px;padding:6px 10px 6px 6px;border:3px solid var(--ink);border-radius:var(--r-md);background:var(--paper);box-shadow:var(--lift-sm)}
.enemy-card[data-enemy="2"]{--pc:var(--p3)}
.enemy-card[data-enemy="3"]{--pc:var(--p4)}
.enemy-card canvas{grid-row:1/3;width:44px;height:44px;border:2.5px solid var(--ink);border-radius:50%;background:radial-gradient(circle at 50% 38%,#fff 0 28%,var(--pc) 90%)}
.enemy-card strong{min-width:0;font-size:14px;font-weight:900;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.enemy-card small{grid-column:2;min-width:0;color:var(--ink-3);font-size:11px;font-weight:700;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.enemy-card .enemy-percent{grid-column:3;grid-row:1/3;font:700 28px/1 var(--font-num)}
.enemy-card::after{content:attr(data-tag);position:absolute;left:8px;bottom:2px;min-width:26px;padding:0 4px;border:2px solid var(--ink);border-radius:999px;background:var(--pc);color:#fff;font:700 10px/1.25 var(--font-ui);text-align:center;display:none}
.enemy-card.out{opacity:.5;filter:grayscale(.8)}
.enemy-card.out .enemy-percent{text-decoration:line-through;text-decoration-thickness:3px}

/* Stage overlays */
.banner{position:absolute;z-index:3;left:0;right:0;top:16%;padding:0 12px;text-align:center;pointer-events:none;color:#fff;font-size:clamp(28px,4.6vw,64px);font-weight:900;letter-spacing:3px;line-height:1.1;-webkit-text-stroke:9px var(--ink);paint-order:stroke fill;filter:drop-shadow(0 6px 0 var(--ink))}
.banner:empty{display:none}
.banner.pop{animation:banner-pop .5s var(--spring)}
@keyframes banner-pop{0%{transform:scale(.6) rotate(-4deg);opacity:0}60%{transform:scale(1.08) rotate(1deg);opacity:1}100%{transform:none}}
.coach{position:absolute;z-index:3;top:12px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:8px;max-width:calc(100% - 24px);padding:7px 15px 7px 10px;border:2.5px solid var(--ink);border-radius:999px;background:rgba(255,250,240,.95);box-shadow:var(--lift-sm);color:var(--ink);font-size:15px;font-weight:800;line-height:1.3;white-space:nowrap;pointer-events:none}
.coach::before{content:'';flex:0 0 auto;width:20px;height:20px;background:var(--sun-2);-webkit-mask:var(--i-tip) center/contain no-repeat;mask:var(--i-tip) center/contain no-repeat}
.coach:empty{display:none}
.supply-status{position:absolute;z-index:3;top:12px;right:12px;display:flex;align-items:center;gap:7px;padding:6px 13px 6px 9px;border:2.5px solid var(--ink);border-radius:999px;background:rgba(255,250,240,.95);box-shadow:var(--lift-sm);font:700 14px/1.2 var(--font-num);font-family:var(--font-num),var(--font-ui);pointer-events:none;white-space:nowrap}
.supply-status::before{content:'';width:18px;height:18px;background:#a2541f;-webkit-mask:var(--i-crate) center/contain no-repeat;mask:var(--i-crate) center/contain no-repeat}
.supply-status:empty{display:none}

/* Loadout bar */
#loadout{display:flex;gap:10px;min-width:0}
.slot{position:relative;display:grid;grid-template-columns:58px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;column-gap:10px;min-width:150px;min-height:56px;padding:5px 14px 5px 8px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--paper);color:var(--ink);text-align:left;box-shadow:var(--lift-sm);transition:transform .14s var(--ease),background-color .2s,box-shadow .14s}
.slot-art{grid-row:1/3;display:flex;align-items:center;justify-content:center;width:58px;height:40px}
.slot-art svg,.slot-art .weapon-illustration{width:58px;height:36px;object-fit:contain}
.slot b{align-self:end;font-size:15px;font-weight:900;line-height:1.2;white-space:nowrap}
.slot small{align-self:start;color:var(--ink-3);font:700 13px/1.3 var(--font-num);font-family:var(--font-num),var(--font-ui);white-space:nowrap}
.slot.active{background:var(--sun);transform:translateY(-3px);box-shadow:0 6px 0 var(--ink)}
.slot.active small{color:var(--ink-2)}
.slot:disabled{opacity:.5;box-shadow:none}
.slot:hover:not(.active):not(:disabled){background:#fff}
.desktop-hint{display:flex;flex-direction:column;gap:5px;min-width:0;color:var(--ink-2);font-size:13px;font-weight:700;line-height:1.3}
.desktop-hint .hint-row{display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px}
.desktop-hint .hint-row>b{display:inline-grid;place-items:center;height:22px;padding:0 7px;border-radius:999px;background:var(--p1);color:#fff;font:700 12px/1 var(--font-num)}
.desktop-hint .hint-row+.hint-row>b{background:var(--p2)}
.desktop-hint kbd{min-width:22px;height:22px;padding:0 5px;border-width:1.5px;border-bottom-width:3px;border-radius:6px;font-size:12px}
.desktop-hint em{font-style:normal;color:var(--ink-3);margin-right:4px}
.battle-bottom>.iconbutton{margin-left:auto;min-height:48px;padding:0 18px;font-size:15px}
#pause .key-hint{margin-left:2px;padding:1px 6px;border:1.5px solid currentColor;border-radius:6px;font:700 11px/1.2 var(--font-num);opacity:.75}
.touch-device #pause .key-hint{display:none}
#pause::before{content:'';width:16px;height:16px;background:currentColor;-webkit-mask:var(--i-pause) center/contain no-repeat;mask:var(--i-pause) center/contain no-repeat}

/* Touch controls */
.touch-controls{display:none;position:absolute;z-index:4;inset:0;pointer-events:none}
.touch-device .touch-controls{display:block}
.touch-move,.touch-actions{position:absolute;bottom:12px;display:flex;align-items:flex-end;gap:10px}
.touch-move{left:12px}
.touch-actions{right:12px;display:grid;grid-template-columns:repeat(3,auto);grid-template-rows:auto auto;gap:8px;align-items:end;justify-items:center}
.touch-controls button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;width:58px;height:58px;padding:0;border:2.5px solid rgba(29,39,51,.9);border-radius:50%;background:rgba(255,250,240,.86);color:var(--ink);font-size:12px;font-weight:900;line-height:1.1;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;box-shadow:0 3px 0 rgba(29,39,51,.85);backdrop-filter:blur(3px);transition:transform .06s,background-color .1s}
.touch-controls button::before{content:'';width:22px;height:22px;background:currentColor;-webkit-mask:var(--icon) center/contain no-repeat;mask:var(--icon) center/contain no-repeat}
.touch-controls [data-control=left],.touch-controls [data-control=right]{width:64px;height:64px;font-size:0;border-radius:20px}
.touch-controls [data-control=left]::before,.touch-controls [data-control=right]::before{width:28px;height:28px}
.touch-controls [data-control=left]{--icon:var(--i-left)}
.touch-controls [data-control=right]{--icon:var(--i-right)}
.touch-controls [data-control=drop]{--icon:var(--i-drop);border-radius:20px}
.touch-controls [data-control=cycle]{--icon:var(--i-swap)}
.touch-controls [data-control=reload]{--icon:var(--i-reload)}
.touch-controls .jump{--icon:var(--i-jump);grid-column:3;grid-row:1;width:66px;height:66px;background:rgba(222,243,253,.92)}
.touch-controls .fire{--icon:var(--i-fire);grid-column:3;grid-row:2;width:80px;height:80px;background:var(--tomato);color:#fff;border-color:var(--ink);font-size:13px;box-shadow:0 4px 0 var(--ink)}
.touch-controls .fire::before{width:28px;height:28px}
.touch-controls [data-control=cycle]{grid-column:1;grid-row:2}
.touch-controls [data-control=reload]{grid-column:2;grid-row:2}
.touch-controls .small{width:54px;height:54px;font-size:11px}
.touch-controls button.pressed{transform:translateY(2px) scale(.94);background:var(--sun);color:var(--ink);box-shadow:0 1px 0 var(--ink)}
.touch-controls .fire.pressed{background:#ff8a6e;color:#fff}
.touch-controls button:disabled{opacity:.4}

/* Rotate guidance */
.rotate-notice{display:none}
.rotate-notice[hidden]{display:none!important}
.touch-device.mobile-portrait .rotate-notice{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:7px 7px 7px 10px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--sun-3);box-shadow:var(--lift-sm)}
.rotate-notice>div{position:relative;padding-left:36px;min-width:0}
.rotate-notice>div::before{content:'';position:absolute;left:0;top:50%;width:28px;height:28px;margin-top:-14px;background:var(--ink);-webkit-mask:var(--i-rotate) center/contain no-repeat;mask:var(--i-rotate) center/contain no-repeat}
.rotate-notice strong{display:block;font-size:14px;font-weight:900;line-height:1.3}
.rotate-notice span{display:block;color:var(--ink-2);font-size:12px;font-weight:600;line-height:1.35}
.rotate-notice button{min-height:44px;padding:0 12px;border:2.5px solid var(--ink);border-radius:999px;background:var(--paper);font-size:13px;font-weight:800;box-shadow:0 2px 0 var(--ink);white-space:nowrap}
#rotateFullscreen{background:var(--ink);color:var(--paper)}
#rotateContinue{display:grid;place-items:center;width:44px;padding:0;font-size:0}
#rotateContinue::before{content:'';width:16px;height:16px;background:currentColor;-webkit-mask:var(--i-close) center/contain no-repeat;mask:var(--i-close) center/contain no-repeat}

/* ---------- Modal ---------- */
.modal{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(18,24,33,.62);backdrop-filter:blur(5px);animation:fade-in .2s ease-out}
@keyframes fade-in{from{opacity:0}}
.modal-card{position:relative;display:flex;flex-direction:column;width:100%;max-width:720px;max-height:calc(100dvh - 48px);min-height:0;padding:26px 28px 22px;border:3px solid var(--ink);border-radius:var(--r-xl);background:var(--paper);box-shadow:0 10px 0 var(--ink),var(--float);overflow:hidden;animation:modal-in .32s var(--spring)}
@keyframes modal-in{from{opacity:0;transform:translateY(18px) scale(.97)}}
.modal-card>.eyebrow{flex:0 0 auto;margin-right:52px}
.modal-card>h2{flex:0 0 auto;margin:12px 52px 14px 0;font-size:32px;font-weight:900;line-height:1.2;letter-spacing:.5px}
.modal-close{position:absolute;z-index:2;top:16px;right:16px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:2.5px solid var(--ink);border-radius:50%;background:var(--paper);color:var(--ink);font-size:26px;font-weight:700;line-height:1;box-shadow:var(--lift-sm);transition:transform .14s var(--ease),background-color .15s}
.modal-close:hover{background:var(--tomato-3);transform:rotate(90deg)}
#modalBody{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;margin:0 -10px;padding:2px 10px 6px;scrollbar-width:thin;scrollbar-color:var(--ink-4) transparent}
#modalBody>p{margin:0 0 12px;color:var(--ink-2);font-size:15px;font-weight:600;line-height:1.7}
#modalButtons{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:10px;margin-top:16px;padding-top:16px;border-top:2.5px dashed rgba(29,39,51,.22)}
#modalButtons .primary{flex:1 1 100%}
#modalButtons .textbutton{flex:1 1 140px}
.help-tabs{display:flex;gap:4px;width:max-content;max-width:100%;margin:2px 0 14px;padding:4px;border:2.5px solid var(--ink);border-radius:999px;background:var(--paper-2)}
.help-tabs button{min-height:40px;padding:0 18px;border:0;border-radius:999px;background:transparent;color:var(--ink-2);font-size:15px;font-weight:800}
.help-tabs button[aria-pressed=true]{background:var(--ink);color:var(--paper)}
table.bindings{width:100%;border-collapse:separate;border-spacing:0;margin:0 0 14px;border:2.5px solid var(--ink);border-radius:var(--r-md);overflow:hidden;background:#fff;font-size:14px}
.bindings th{padding:9px 12px;background:var(--ink);color:var(--paper);font-size:13px;font-weight:800;text-align:left}
.bindings td{padding:7px 12px;border-top:1.5px solid var(--line);font-weight:700;vertical-align:middle}
.bindings tr:nth-child(even) td{background:#fffcf4}
.bindings td:first-child{color:var(--ink-2)}
.bindings kbd{font-size:13px}
.bind-key{min-width:92px;min-height:42px;padding:0 12px;border:2px solid var(--ink);border-bottom-width:4px;border-radius:9px;background:#fff;color:var(--ink);font:700 14px/1 var(--font-num);font-family:var(--font-num),var(--font-ui);transition:background-color .15s,transform .1s}
.bind-key:hover{background:var(--sun-3)}
.bind-key:active{transform:translateY(2px);border-bottom-width:2px}
.bind-key.capturing{background:var(--tomato);color:#fff;animation:capture-pulse 1s ease-in-out infinite}
@keyframes capture-pulse{50%{box-shadow:0 0 0 5px var(--tomato-3)}}
#bindingNotice{min-height:24px;margin:0;padding:8px 12px;border-radius:var(--r-sm);background:var(--sun-3);color:var(--ink-2);font-size:14px;font-weight:700}
.touch-guide{display:grid;gap:8px;margin-bottom:14px}
.touch-guide p{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;gap:12px;margin:0;padding:9px 12px;border:2px solid var(--line);border-radius:var(--r-sm);background:#fff;color:var(--ink-2);font-size:14px;font-weight:600;line-height:1.5}
.touch-guide b{display:inline-flex;justify-content:center;padding:4px 8px;border-radius:999px;background:var(--ink);color:var(--paper);font-size:13px;font-weight:800;white-space:nowrap}
#controlGuide>p{margin:0 0 12px;color:var(--ink-3);font-size:13px;font-weight:700}
.equipment-guide{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:4px 0 14px}
.equipment-guide p{margin:0;padding:12px 14px;border:2px solid var(--ink);border-radius:var(--r-md);background:#fff;color:var(--ink-2);font-size:13.5px;font-weight:600;line-height:1.6}
.equipment-guide b{display:block;margin-bottom:3px;color:var(--ink);font-size:15px;font-weight:900}
.guide-details{margin:4px 0 12px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--paper-2);overflow:hidden}
.guide-details summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:48px;padding:0 16px;font-size:15px;font-weight:900;cursor:pointer;list-style:none}
.guide-details summary::-webkit-details-marker{display:none}
.guide-details summary::after{content:'';width:16px;height:16px;background:currentColor;-webkit-mask:var(--i-next) center/contain no-repeat;mask:var(--i-next) center/contain no-repeat;transform:rotate(90deg);transition:transform .2s}
.guide-details[open] summary::after{transform:rotate(-90deg)}
.guide-details>div{padding:0 12px 4px}
.rules-callout{display:grid;gap:6px;margin:0 0 6px;padding:12px 14px 12px 50px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--sky-3);position:relative}
.rules-callout::before{content:'';position:absolute;left:14px;top:14px;width:24px;height:24px;background:var(--sky-2);-webkit-mask:var(--i-tip) center/contain no-repeat;mask:var(--i-tip) center/contain no-repeat}
.rules-callout p{margin:0;color:var(--ink-2);font-size:14px;font-weight:600;line-height:1.6}
.voice-options{margin:0 0 16px;padding:14px 16px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:#fff;display:flex;flex-wrap:wrap;align-items:center;gap:10px 22px}
.voice-options legend{padding:0 8px;margin-left:-4px;font-size:15px;font-weight:900}
.voice-options label{display:inline-flex;align-items:center;gap:10px;min-height:44px;margin:0;font-size:15px;font-weight:800;cursor:pointer}
.voice-options input[type=checkbox]{position:relative;width:52px;height:30px;margin:0;border:2.5px solid var(--ink);border-radius:999px;background:var(--paper-3);-webkit-appearance:none;appearance:none;cursor:pointer;transition:background-color .2s}
.voice-options input[type=checkbox]::after{content:'';position:absolute;top:2px;left:2px;width:21px;height:21px;border:2px solid var(--ink);border-radius:50%;background:#fff;transition:transform .22s var(--spring)}
.voice-options input[type=checkbox]:checked{background:var(--leaf)}
.voice-options input[type=checkbox]:checked::after{transform:translateX(21px)}
.voice-options input[type=range]{width:170px;accent-color:var(--tomato);cursor:pointer}
#voiceVolumeValue{min-width:48px;font:700 18px/1 var(--font-num)}
.voice-options p{flex-basis:100%;margin:0;color:var(--ink-3);font-size:13px;font-weight:600}
.control-mode{margin:0 0 16px;padding:14px 16px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:#fff}
.control-mode>b{display:block;margin-bottom:10px;font-size:15px;font-weight:900}
.control-mode>div{display:flex;gap:4px;padding:4px;border:2.5px solid var(--ink);border-radius:999px;background:var(--paper-2)}
.control-mode button{flex:1;min-height:42px;border:0;border-radius:999px;background:transparent;color:var(--ink-2);font-size:15px;font-weight:800}
.control-mode button[aria-pressed=true]{background:var(--ink);color:var(--paper)}
.control-mode p{margin:10px 0 0;color:var(--ink-3);font-size:13px;font-weight:600;line-height:1.6}
.bind-intro{margin:0 0 10px!important}
.result-hero{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:18px;margin-bottom:14px}
.result-portrait{width:120px;height:120px;border:3px solid var(--ink);border-radius:50%;background:radial-gradient(circle at 50% 38%,#fff 0 30%,var(--sun) 85%);box-shadow:var(--lift)}
.result-portrait[data-family=nuonuo]{background:radial-gradient(circle at 50% 38%,#fff 0 30%,var(--sky) 85%)}
.result-hero p{margin:0;color:var(--ink-2);font-size:16px;font-weight:700;line-height:1.6}
.result-hero .result-time{display:inline-block;margin-top:8px;padding:5px 13px;border-radius:14px;background:var(--ink);color:var(--paper);font-size:13px;font-weight:800;line-height:1.7}
.result-hero .result-time b{margin:0 3px;color:var(--sun);font:700 16px/1 var(--font-num)}
.match-feedback{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0 0 12px!important}
.match-feedback .sep,.match-feedback .lead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.match-feedback .stat{display:block;padding:10px 12px 9px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:#fff;color:var(--ink-3);font-size:13px;font-weight:800;line-height:1.2}
.match-feedback .stat i{font-style:normal}
.match-feedback .stat i:first-child{display:block;margin-bottom:5px}
.match-feedback .stat b{color:var(--ink);font:700 32px/1 var(--font-num);margin-right:2px}
.match-advice{display:flex;gap:10px;align-items:flex-start;margin:0!important;padding:12px 14px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--sun-3);color:var(--ink)!important;font-size:15px!important;font-weight:800!important}
.match-advice::before{content:'';flex:0 0 auto;width:22px;height:22px;margin-top:1px;background:var(--sun-2);-webkit-mask:var(--i-tip) center/contain no-repeat;mask:var(--i-tip) center/contain no-repeat}
.campaign-brief{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:18px;margin-bottom:14px}
.campaign-brief canvas{width:140px;height:168px;border:3px solid var(--ink);border-radius:var(--r-lg);background:radial-gradient(circle at 50% 30%,#fff 0 30%,var(--sun-3) 90%);box-shadow:var(--lift-sm)}
.campaign-brief>div{display:flex;flex-direction:column;gap:10px}
.campaign-brief p{position:relative;margin:0;padding:12px 16px;border:2.5px solid var(--ink);border-radius:18px 18px 18px 6px;background:#fff;color:var(--ink);font-size:16px;font-weight:700;line-height:1.65}
.campaign-brief p:nth-child(even){border-radius:18px 18px 6px 18px;background:var(--sky-3)}
.campaign-loadout{display:inline-flex;align-items:center;gap:8px;margin:0!important;padding:8px 14px;border-radius:999px;background:var(--ink);color:var(--paper)!important;font-size:14px!important;font-weight:800!important}
.campaign-loadout::before{content:'';width:16px;height:16px;background:var(--sun);-webkit-mask:var(--i-flag) center/contain no-repeat;mask:var(--i-flag) center/contain no-repeat}
#modalBody .pause-objective{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border:2.5px solid var(--ink);border-radius:var(--r-md);background:var(--sun-3);color:var(--ink);font-size:16px;font-weight:800;line-height:1.55}
.pause-objective b{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;background:var(--ink);color:var(--sun);font-size:13px;font-weight:900;line-height:1.5}
.pause-objective b::before{content:'';width:13px;height:13px;background:currentColor;-webkit-mask:var(--i-flag) center/contain no-repeat;mask:var(--i-flag) center/contain no-repeat}
.result-note{padding:10px 14px;border-radius:var(--r-sm);background:var(--tomato-3);color:var(--tomato-2)!important;font-weight:800!important}

/* ---------- Responsive: narrow desktop / tablet ---------- */
@media (max-width:1180px){
 .menu{grid-template-columns:minmax(300px,.8fr) minmax(0,1.2fr)}
 .weapon-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
 .weapon-card{padding:7px 8px 9px}
 .weapon-card b{font-size:15px}
 .opponent-grid{grid-template-columns:1fr 1fr}
 .opponent-grid .enemy-select{grid-column:1/-1}
 .fighter{gap:10px}
 .percent{min-width:80px;font-size:46px}
 .slot{min-width:128px}
 .online-steps{grid-template-columns:1fr}
}
@media (max-width:1000px){
 header{padding:0 18px}
 .brand small,.edition{display:none}
 .mode-home{padding:4px 18px 18px}
 .menu{padding:4px 18px 0;gap:14px 18px}
 .menu .hero{min-height:440px}
 .intro-rules{display:none}
 .weapon-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .map-options{grid-template-columns:repeat(3,minmax(0,1fr))}
 .weapon-preview{grid-template-columns:1fr}
 .weapon-art{height:70px}
 .weapon-art svg,.weapon-art .weapon-illustration{height:70px}
 .loadout-grid{grid-template-columns:1fr}

 .online-lobby{padding:0 18px}
 .online-shell{grid-template-columns:1fr}
 .online-stage{order:-1;min-height:240px;border-left:0;border-bottom:3px solid var(--ink)}
 #arena{padding:0 14px 12px}
 .desktop-hint{display:none}
 .battle-top{gap:10px}
 .fighter-avatar{width:52px;height:52px}
 .percent{font-size:40px;min-width:70px}
 .match-label{min-width:118px;padding:7px 12px}
 .match-label b{font-size:28px}
}

/* ---------- Short desktop windows ---------- */
@media (min-width:761px) and (max-height:760px){
 :root{--header-h:56px}
 header{height:56px}
 .mode-home{gap:14px;padding-bottom:14px}
 .game-title{font-size:clamp(42px,5.2vw,76px)}
 .home-tagline{font-size:15px;padding:10px 14px}
 .mode-stages{min-height:300px}
 .menu .hero{min-height:420px}
 .menu .setup{gap:14px;padding-top:18px}
 .battle-top{min-height:74px}

 .fighter{min-height:70px;padding-top:5px;padding-bottom:5px}
 .fighter-avatar{width:52px;height:52px}
 .percent{font-size:44px}
 .battle-bottom{min-height:58px}
 .slot{min-height:50px}
 #arena{gap:8px}
}

/* ---------- Phones: portrait and narrow ---------- */
@media (max-width:760px){
 :root{--header-h:56px}
 header{height:56px;padding:0 max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left))}
 .brand{gap:9px}
 .brandmark{width:32px;height:32px;border-radius:10px}
 .brand-name{font-size:17px}
 .topright{gap:7px}
 .iconbutton{min-height:40px;padding:0 12px;font-size:13px}
 .iconbutton svg{width:16px;height:16px}
 .mode-home{min-height:0;padding:2px 14px 20px;gap:16px}
 .home-heading{flex-direction:column;align-items:flex-start;gap:8px}
 .home-byline{font-size:13px}
 .game-title{font-size:clamp(32px,10.6vw,60px)}
 .home-tagline{display:none}
 .mode-stages{flex-direction:column;min-height:0;border-radius:var(--r-lg)}
 .mode-entry,.mode-entry:first-child,.mode-entry:last-child{--cut:0px;flex:none;height:clamp(150px,22dvh,190px);margin:0;clip-path:none}
 .mode-entry+.mode-entry{border-top:3px solid var(--ink)}
 .mode-entry:hover,.mode-entry:focus-visible{flex-grow:0}
 .mode-tag,.mode-entry:first-child .mode-tag{top:12px;left:14px;padding:5px 10px;font-size:11px}
 .mode-caption,.mode-entry:last-child .mode-caption{padding:12px 14px 14px 16px}
 .mode-caption strong{font-size:30px;-webkit-text-stroke-width:6px}
 .mode-caption small{margin-top:6px;font-size:13px}
 .mode-caption b{width:46px;height:46px}
 .home-footer{flex-direction:column;align-items:stretch;gap:12px}
 .home-rules{justify-content:center}
 .home-rules{gap:6px}
 .home-rules li{font-size:12px;padding:4px 9px;gap:5px;border-width:1.5px}
 .home-rules li::before{width:7px;height:7px;border-width:1.5px}
 .home-footer>div{justify-content:center}
 .home-footer>div button{flex:1;justify-content:center}
 .menu{display:flex;flex-direction:column;padding:2px 14px 0;gap:14px;min-height:0}
 .menu .intro{min-height:0;flex-wrap:wrap;gap:10px}
 .intro-title{flex-wrap:wrap;gap:8px}
 .intro-title h1{font-size:24px}
 .menu .hero{position:relative;top:0;height:auto;min-height:0;max-height:none}
 .portrait-frame{flex:none;height:min(52vw,250px);border-radius:var(--r-lg)}
 .hero-stamp{top:12px;left:12px;font-size:11px;padding:6px 9px}
 #selectedCharacterName{font-size:40px;-webkit-text-stroke-width:7px}
 .menu .hero-caption{left:14px;right:14px;bottom:12px}
 .menu .hero-caption small{font-size:12px}
 .character-picks{gap:8px}
 .character-picks span{font-size:14px}
 .character-picks small{display:none}
 .menu .setup{padding:16px 14px 0;gap:16px;border-radius:var(--r-lg)}
 .segmented{min-width:0;width:100%}
 .segmented button{font-size:14px;padding:0 8px}
 .mode-note{display:none}
 .map-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .map-options b{font-size:13px;padding:5px 4px 6px}
 .weapon-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .weapon-card svg,.weapon-card .weapon-illustration{height:40px}
 .weapon-card b{font-size:15px}
 .weapon-card small{font-size:11px}
 .weapon-preview{padding:10px 12px}
 .weapon-stats{gap:8px 10px}
 .side-options button{min-height:54px;padding:5px 8px 5px 6px;gap:6px}
 .side-options svg,.side-options .weapon-illustration{width:40px;height:28px}
 .side-options b{font-size:14px}
 .side-options small{font-size:11px}
 .opponent-loadout{padding:12px}
 .opponent-grid{grid-template-columns:1fr}
 .opponent-loadout .side-options{grid-template-columns:repeat(2,minmax(0,1fr))}
 .launch{margin:0 -14px;padding:12px 14px max(14px,env(safe-area-inset-bottom));border-radius:0 0 calc(var(--r-lg) - 3px) calc(var(--r-lg) - 3px);flex-wrap:wrap}
 .launch{flex-wrap:nowrap;gap:8px}
 .launch .textbutton{flex:0 0 48px;width:48px;min-height:52px;padding:0;font-size:0;gap:0}
 .launch .textbutton::before{width:22px;height:22px}
 #start{min-height:52px;padding:0 14px 0 18px;font-size:18px}

 .online-lobby{min-height:0;margin:2px auto 24px;padding:0 14px;display:block}
 .online-shell{border-radius:var(--r-lg)}
 .online-main{padding:18px 16px 20px;gap:14px}
 .online-heading{flex-wrap:wrap}
 .online-heading h2{font-size:30px}
 .online-stage{min-height:200px}
 .online-intro{font-size:14px}
 .online-steps{grid-template-columns:1fr;gap:6px}
 .online-steps li{padding:9px 10px 9px 44px}
 .online-steps li::before{top:9px}
 .online-entry{grid-template-columns:1fr}
 #onlineJoin{width:100%}
 #roomCode{font-size:32px}
 .online-players{grid-template-columns:1fr;gap:12px}
 .online-vs{justify-self:center;margin:-4px 0;width:40px;height:40px}
 .online-picks{grid-template-columns:repeat(2,minmax(0,1fr))}
 .online-actions{flex-direction:column;align-items:stretch}
 .modal{padding:12px}
 .modal-card{padding:20px 16px 16px;max-height:calc(100dvh - 24px);border-radius:var(--r-lg)}
 .modal-card>h2{font-size:25px;margin:10px 48px 12px 0}
 .modal-close{top:12px;right:12px;width:42px;height:42px}
 .equipment-guide{grid-template-columns:1fr}
 .touch-guide p{grid-template-columns:78px minmax(0,1fr);gap:8px;padding:8px 10px;font-size:13px}
 .bindings th,.bindings td{padding:7px 8px}
 .bind-key{min-width:70px;min-height:42px}
 .result-hero{grid-template-columns:84px minmax(0,1fr);gap:12px}
 .result-portrait{width:84px;height:84px}
 .match-feedback{grid-template-columns:repeat(3,minmax(0,1fr))}
 .match-feedback .stat{padding:8px}
 .match-feedback .stat b{font-size:24px}
 .campaign-brief{grid-template-columns:96px minmax(0,1fr);gap:12px}
 .campaign-brief canvas{width:96px;height:116px}
 .campaign-brief p{font-size:14px;padding:10px 12px}
 #modalButtons .textbutton{flex:1 1 120px;min-height:46px;font-size:14px}
}
@media (max-width:420px){
 .brand-name{font-size:16px}
 .iconbutton span{display:none}
 .iconbutton{width:44px;padding:0;justify-content:center}
}

/* ---------- Battle on touch devices ---------- */
.touch-device .desktop-hint{display:none}
.touch-device #arena{height:calc(var(--play-height,100dvh) - 56px);padding-bottom:max(6px,env(safe-area-inset-bottom))}
@media (orientation:portrait){
 .touch-device.playing header{height:calc(56px + env(safe-area-inset-top));padding-top:env(safe-area-inset-top)}
 .touch-device.playing #arena{height:calc(var(--play-height,100dvh) - 56px - env(safe-area-inset-top));max-width:none;padding:0 8px max(6px,env(safe-area-inset-bottom));gap:7px}
 .touch-device .battle-top{gap:6px;min-height:0}
 .touch-device .fighter{grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;gap:2px 8px;min-height:0;padding:6px 8px;border-width:2.5px;border-radius:var(--r-md)}
 .touch-device .fighter.right{padding:6px 8px}
 .touch-device .fighter-avatar{grid-row:1/3;width:40px;height:40px;border-width:2.5px}
 .touch-device .fighter-avatar::after{font-size:10px;min-width:24px;padding:0 3px;bottom:-3px}
 .touch-device .fighter .name{font-size:13px}
 .touch-device .fighter .name small{display:none}
 .touch-device .lives{height:14px}
 .touch-device .lives b{display:none}
 .touch-device .lives span{width:13px;height:13px}
 .touch-device .ammo-readout{font-size:11px}
 .touch-device .ammo-readout b{font-size:15px}
 .touch-device .ammo-readout small{font-size:11px}
 .touch-device .shieldtext,.touch-device .effect-state{display:none}
 .touch-device .fighter-info .ammo-readout{display:none}
 .touch-device .percent{grid-column:2;grid-row:2;min-width:0;font-size:26px;text-align:left}
 .touch-device .fighter.right .percent{text-align:right}
 .touch-device .fighter-info{grid-column:2;grid-row:1}
 .touch-device .match-label{min-width:0;padding:5px 9px;border-width:2.5px;border-radius:var(--r-sm)}
 .touch-device .match-label span,.touch-device .match-label small{display:none}
 .touch-device .match-label b{font-size:19px}
 .touch-device .stage{display:grid;grid-template-rows:minmax(0,1fr) 168px;max-height:none;min-height:0;border-width:2.5px;border-radius:var(--r-md)}
 .touch-device .stage canvas{position:relative;grid-row:1;min-height:0}
 .touch-device .touch-controls{position:relative;grid-row:2;inset:auto;height:168px;background:linear-gradient(180deg,#efe2c4,#f6ecd6);border-top:2.5px solid var(--ink)}
 .touch-device .touch-move{left:10px;bottom:14px;display:grid;grid-template-columns:repeat(2,auto);gap:8px}
 .touch-device .touch-controls [data-control=drop]{grid-column:1/-1;grid-row:1;justify-self:center;width:62px;height:50px}
 .touch-device .touch-controls [data-control=left],.touch-device .touch-controls [data-control=right]{width:64px;height:64px}
 .touch-device .touch-actions{right:10px;bottom:12px;gap:7px}
 .touch-device .touch-controls .jump{width:62px;height:62px}
 .touch-device .touch-controls .fire{width:76px;height:76px}
 .touch-device .touch-controls .small{width:52px;height:52px}
 .touch-device .battle-bottom{min-height:0;gap:6px}
 .touch-device #loadout{flex:1;gap:6px}
 .touch-device .slot{flex:1;min-width:0;grid-template-columns:1fr;min-height:50px;padding:4px 6px;text-align:center;border-radius:var(--r-sm)}
 .touch-device .slot-art{display:none}
 .touch-device .slot b{font-size:13px}
 .touch-device .slot small{font-size:11px;white-space:normal;line-height:1.2}
 .touch-device .slot.active{transform:translateY(-2px);box-shadow:0 4px 0 var(--ink)}
 .touch-device .battle-bottom>.iconbutton{min-height:50px;padding:0 10px;font-size:13px;border-radius:var(--r-sm)}
 .touch-device .coach{top:8px;max-width:calc(100% - 16px);font-size:12px;padding:5px 11px 5px 8px;white-space:normal;text-align:center}
 .touch-device .coach::before{width:16px;height:16px}
 .touch-device .supply-status{top:auto;bottom:8px;right:8px;font-size:12px;padding:4px 10px 4px 7px}
 .touch-device .banner{top:20%;font-size:30px;-webkit-text-stroke-width:7px}
 .touch-device .campaign-objective{min-height:0;padding:5px 8px 5px 6px;gap:8px;font-size:12px;border-width:2.5px}
 .touch-device .campaign-objective b{font-size:12px;padding:3px 9px}
 .touch-device .campaign-objective small{font-size:12px;min-width:44px;padding:2px 6px}
 .touch-device.campaign-playing .match-label{display:none}
 .touch-device.campaign-playing .battle-top{grid-template-columns:minmax(0,1fr)}
 .touch-device.campaign-playing #hud0{max-width:40%}
 .touch-device.campaign-playing #campaignEnemies{max-width:59%}
 /* Lessons without opponents keep the timer beside a full-width card. */
 .touch-device.campaign-playing #arena:has(#campaignEnemies.hidden) .battle-top{grid-template-columns:minmax(0,1fr) auto}
 .touch-device.campaign-playing #arena:has(#campaignEnemies.hidden) .match-label{display:flex}
 .touch-device.campaign-playing #arena:has(#campaignEnemies.hidden) #hud0{max-width:none}
 .touch-device .campaign-enemies{gap:5px;justify-content:flex-end}
 .touch-device .enemy-card{flex:0 1 auto;width:auto;min-width:0;min-height:0;grid-template-columns:auto auto;grid-template-rows:auto;padding:3px 6px 3px 3px;gap:0 3px;border-width:2.5px;border-radius:var(--r-sm)}
 .touch-device .enemy-card canvas{grid-row:1;width:32px;height:32px;border-width:2px}
 .touch-device .enemy-card strong,.touch-device .enemy-card small{display:none}
 .touch-device .enemy-card .enemy-percent{grid-column:2;grid-row:1;font-size:16px}
 .touch-device .enemy-card::after{display:block;left:3px;bottom:-4px;font-size:10px;min-width:24px}
}
/* Landscape phones: every horizontal pixel goes to the battlefield. */
@media (orientation:landscape){
 .touch-device.playing header{display:none}
 .touch-device.playing #arena{height:var(--play-height,100dvh);max-width:none;padding:max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));gap:6px}
 .touch-device .stage{max-height:none;border-width:2.5px;border-radius:var(--r-md)}
 .touch-device .touch-move{left:max(14px,env(safe-area-inset-left));bottom:12px}
 .touch-device .touch-actions{right:max(14px,env(safe-area-inset-right));bottom:10px}
 .touch-device .coach{top:auto;bottom:12px;max-width:calc(100% - 430px);white-space:normal;text-align:center}
 .touch-device .modal{padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
 .touch-device .modal-card{max-height:calc(var(--play-height,100dvh) - 20px)}
}
@media (orientation:landscape) and (max-height:550px){
 :root{--header-h:48px}
 header{height:48px;padding:0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left))}
 .brandmark{width:30px;height:30px;border-radius:9px}
 .brand-name{font-size:16px}
 .brand small,.edition{display:none}
 .iconbutton{min-height:40px;padding:0 12px;font-size:13px}
 .mode-home{min-height:calc(100dvh - 48px);padding:0 max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));gap:10px}
 .home-byline,.home-tagline{display:none}
 .game-title{font-size:clamp(30px,7.6dvh,44px)}
 .mode-stages{min-height:0;border-radius:var(--r-lg)}
 .mode-entry{--cut:34px}
 .mode-tag{top:10px;left:calc(var(--cut) + 8px);padding:4px 9px;font-size:10px}
 .mode-entry:first-child .mode-tag{left:12px}
 .mode-caption{padding:10px calc(var(--cut) + 8px) 12px 14px}
 .mode-entry:last-child .mode-caption{padding-right:14px}
 .mode-caption strong{font-size:24px;-webkit-text-stroke-width:5px}
 .mode-caption small{margin-top:5px;padding:3px 9px;font-size:12px;white-space:nowrap}
 .mode-caption b{width:38px;height:38px;border-width:2.5px}
 .mode-caption b::before{width:18px;height:18px}
 .home-footer{gap:10px}
 .home-rules li{padding:4px 10px;font-size:12px}
 .home-footer>div button{min-height:40px;padding:0 13px;font-size:13px}
 .menu{grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr);padding:0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));gap:10px 14px}
 .menu .intro{min-height:0}
 .intro-title .eyebrow{display:none}
 .intro-title h1{font-size:20px}
 .intro-rules,.mode-note{display:none}
 .menu .hero{top:8px;height:calc(100dvh - 48px - 72px);min-height:250px;gap:8px}
 .portrait-frame{border-radius:var(--r-lg)}
 .hero-stamp{display:none}
 #selectedCharacterName{font-size:30px;-webkit-text-stroke-width:6px}
 .menu .hero-caption{left:12px;right:12px;bottom:10px}
 .menu .hero-caption small{display:none}
 .character-picks{gap:6px}
 .character-picks button{padding:3px 2px 5px}
 .character-picks canvas{max-width:44px}
 .character-picks span{font-size:12px}
 .character-picks small{display:none}
 .menu .setup{padding:14px 14px 0;gap:14px;border-radius:var(--r-lg)}
 .map-options{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
 .map-options b{font-size:11px;padding:4px 3px 5px}
 .weapon-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
 .weapon-card{padding:5px 6px 7px}
 .weapon-card svg,.weapon-card .weapon-illustration{height:32px}
 .weapon-card b{font-size:13px}
 .weapon-card small{display:none}
 .weapon-preview{grid-template-columns:minmax(110px,.7fr) minmax(0,1.6fr);padding:8px 12px;gap:10px}
 .weapon-art,.weapon-art svg,.weapon-art .weapon-illustration{height:54px}
 .weapon-meta h2{font-size:18px}
 .loadout-grid{grid-template-columns:1fr 1fr;gap:10px}
 .side-options{grid-template-columns:1fr}
 .side-options button{min-height:48px}
 .opponent-grid{grid-template-columns:1fr 1fr}
 .opponent-loadout .side-options{grid-template-columns:1fr}
 .launch{margin:0 -14px;padding:10px 14px max(10px,env(safe-area-inset-bottom))}
 .launch .textbutton{min-height:44px;padding:0 12px;font-size:13px}
 #start{min-height:50px;font-size:17px}

 .online-lobby{min-height:0;margin:0 auto 18px;padding:0 max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));display:block}
 .online-shell{grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);border-radius:var(--r-lg)}
 .online-stage{order:0;border-left:3px solid var(--ink);border-bottom:0;min-height:0}
 .online-main{padding:14px 16px 16px;gap:10px}
 .online-heading h2{font-size:26px}
 .online-heading .eyebrow{display:none}
 .online-intro{font-size:13px}
 .online-steps{display:none}
 .online-entry{grid-template-columns:minmax(0,1fr) auto;gap:8px 10px}
 #onlineCreate{min-height:50px;font-size:17px}
 #onlineCode{height:50px;font-size:24px}
 #onlineJoin{min-height:50px}
 .room-code{padding:8px 12px}
 #roomCode{font-size:28px}
 .online-players{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
 .online-player{min-height:76px;padding:8px}
 .online-player canvas{width:48px;height:48px}
 .online-player b{font-size:14px}
 .online-player small{font-size:11px}
 .online-picks{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .online-picks select{min-height:44px;font-size:13px;padding-left:10px}
 .online-note{font-size:12px}
 #onlineReady{min-height:50px;font-size:17px}
 .modal-card{padding:14px 18px 14px;max-height:calc(100dvh - 20px);max-width:760px}
 .modal-card>h2{font-size:22px;margin:8px 52px 8px 0}
 .modal-close{top:10px;right:10px;width:40px;height:40px}
 #modalButtons{margin-top:10px;padding-top:10px;flex-wrap:nowrap}
 #modalButtons .primary{flex:1.4 1 0;min-height:46px;font-size:16px}
 #modalButtons .textbutton{flex:1 1 0;min-height:46px;padding:0 10px;font-size:13px}
 .result-portrait{width:74px;height:74px}
 .result-hero{grid-template-columns:74px minmax(0,1fr);margin-bottom:8px}
 .match-feedback .stat b{font-size:22px}
 .campaign-brief canvas{width:84px;height:100px}
 .campaign-brief p{font-size:14px;padding:8px 12px}
 /* Battle */
 .touch-device.playing #arena,body.playing #arena{gap:5px}
 .battle-top{gap:8px;min-height:0}
 .fighter{grid-template-columns:auto minmax(0,1fr) auto;gap:8px;min-height:0;padding:4px 10px 4px 4px;border-width:2.5px;border-radius:var(--r-md)}
 .fighter.right{padding:4px 4px 4px 10px}
 .fighter-avatar{width:40px;height:40px;border-width:2.5px}
 .fighter-avatar::after{display:none}
 .fighter .name{font-size:13px}
 .fighter .name small{font-size:10px;padding:0 5px}
 .lives{height:13px}
 .lives b{display:none}
 .lives span{width:12px;height:12px}
 .fighter-info{gap:1px}
 .ammo-readout{font-size:11px}
 .ammo-readout b{font-size:15px}
 .ammo-readout small{font-size:11px}
 .shieldtext{font-size:11px}
 .effect-state{font-size:11px}
 .fighter-info .shieldtext{display:none}
 .percent{min-width:58px;font-size:32px}
 .match-label{min-width:0;padding:4px 12px;border-width:2.5px;border-radius:var(--r-md)}
 .match-label span,.match-label small{display:none}
 .match-label b{font-size:22px}
 .stage{border-width:2.5px;border-radius:var(--r-md)}
 .battle-bottom{min-height:0;gap:8px}
 #loadout{gap:6px}
 .slot{grid-template-columns:34px minmax(0,1fr);min-width:118px;min-height:40px;padding:2px 10px 2px 5px;column-gap:6px;border-radius:var(--r-sm)}
 .slot-art{width:34px;height:28px}
 .slot-art svg,.slot-art .weapon-illustration{width:34px;height:24px}
 .slot b{font-size:12px}
 .slot small{font-size:11px}
 .slot.active{transform:translateY(-2px);box-shadow:0 4px 0 var(--ink)}
 .battle-bottom>.iconbutton{min-height:40px;padding:0 14px;font-size:13px}
 .touch-controls button{width:52px;height:52px;font-size:11px}
 .touch-controls button::before{width:19px;height:19px}
 .touch-controls [data-control=left],.touch-controls [data-control=right]{width:58px;height:58px}
 .touch-controls .small{width:48px;height:48px;font-size:10px}
 .touch-controls .jump{width:58px;height:58px}
 .touch-controls .fire{width:68px;height:68px;font-size:12px}
 .touch-actions{gap:6px}
 .touch-move{gap:8px}
 .coach{font-size:12px;padding:4px 11px 4px 8px}
 .coach::before{width:15px;height:15px}
 .supply-status{top:8px;right:8px;font-size:12px;padding:3px 10px 3px 7px}
 .banner{font-size:34px;-webkit-text-stroke-width:7px;top:12%}
 .campaign-objective{min-height:0;padding:3px 8px 3px 4px;gap:8px;font-size:12px;border-width:2.5px;border-radius:var(--r-sm)}
 .campaign-objective b{font-size:11px;padding:2px 8px}
 .campaign-objective small{font-size:11px;min-width:40px;padding:1px 5px}
 .campaign-playing .fighter{max-width:330px}
 #campaignEnemies{max-width:calc(50% - 70px)}
 .enemy-card{width:auto;flex:0 1 auto;min-height:0;grid-template-columns:auto auto;grid-template-rows:auto;padding:3px 9px 3px 4px;gap:0 5px;border-width:2.5px;border-radius:var(--r-sm)}
 .enemy-card canvas{grid-row:1;width:38px;height:38px;border-width:2px}
 .enemy-card strong,.enemy-card small{display:none}
 .enemy-card .enemy-percent{grid-column:2;grid-row:1;font-size:22px}
 .enemy-card::after{display:block;left:5px;bottom:-5px;font-size:10px;min-width:24px}
}
/* Tablets in landscape keep the desktop-sized HUD. */
@media (orientation:landscape) and (min-height:551px){
 .touch-device.playing #arena{gap:8px}
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion:reduce){
 *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
 .mode-entry:hover,.mode-entry:focus-visible{flex-grow:1}
}

/* Campaign layout restored from 207406d; isolated from the shared UI. */
#campaignSelect{--menu-ink:#202d3c;--menu-paper:#fff9e9;--feibi:#f8cf46;--nuonuo:#77c9ec;--tomato:#d44c31}
#campaignSelect.journey{max-width:1440px;padding:26px 36px 28px;margin:0 auto;color:var(--menu-ink);background:#fff9e9}
#campaignSelect .journey-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:20px}
#campaignSelect .journey-heading>div>span{font-size:14px;font-weight:800;border-left:5px solid var(--tomato);padding-left:10px}
#campaignSelect .journey-heading h1{font-size:clamp(25px,3vw,42px);line-height:1.25;margin:8px 0 0;letter-spacing:-1.5px;font-weight:1000}
#campaignSelect .journey-heading h1 span{color:#b53d26}
#campaignSelect .journey-body{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(330px,1fr);gap:28px;align-items:stretch}
#campaignSelect .journey-route{min-width:0;display:flex;flex-direction:column;position:relative;background:#e4f2f6;border-top:4px solid #76bdd5;overflow:hidden}
#campaignSelect .route-copy{display:flex;flex-direction:column;gap:6px;padding:22px 24px 0;position:relative;z-index:1}
#campaignSelect .route-copy b{font-size:18px}
#campaignSelect .route-copy span{font-size:12px}
#campaignSelect .route-landscape{height:330px;flex:1;min-height:300px;position:relative;background:linear-gradient(0deg,#dcecf0aa,#edf7f8aa),url('assets/maps/garden-background-1600x900.png') center/cover}
#campaignSelect .route-landscape>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
#campaignSelect .route-landscape>svg path{fill:none;stroke:#b76b3d;stroke-width:4;stroke-dasharray:8 7}
#campaignSelect .route-stop{position:absolute;left:var(--stop-x);top:var(--stop-y);transform:translate(-50%,-50%);width:115px;min-width:0;border:0;background:none;padding:0 2px;color:var(--menu-ink);text-align:center}
#campaignSelect .route-stop:active{transform:translate(-50%,-50%)}
#campaignSelect .route-stop canvas{display:block;width:100%;height:66px;border:2px solid #fff7de;border-bottom:6px solid #b6a57a;clip-path:polygon(5% 0,96% 0,100% 83%,88% 100%,12% 100%,0 83%)}
#campaignSelect .route-stop>b{position:absolute;top:-12px;left:5px;display:grid;place-items:center;width:28px;height:28px;background:#fff9e9;border:2px solid var(--menu-ink);font:bold 15px sans-serif;transform:rotate(-7deg)}
#campaignSelect .route-stop strong{display:block;font-size:11px;margin-top:4px;line-height:1.25}
#campaignSelect .route-stop small{font-size:10px;display:block;margin-top:3px;color:#52616c}
#campaignSelect .route-stop.locked canvas{filter:grayscale(.6);opacity:.75}
#campaignSelect .route-stop.locked small:before{content:'🔒 ';font-size:9px}
#campaignSelect .route-stop.selected canvas{border-color:#e5ad27;filter:saturate(1.15)}
#campaignSelect .route-stop.selected>b{background:var(--feibi)}
#campaignSelect .route-stop.selected strong{font-weight:1000}
#campaignSelect .route-stop.complete>b{background:#a8dff3}
#campaignSelect .route-progress{display:flex;align-items:center;gap:10px;padding:12px 20px;background:#e4f2f6}
#campaignSelect .route-progress b{font-size:19px}
#campaignSelect .route-progress span{font-size:11px}
#campaignSelect .level-preview{min-width:0;background:none;border-bottom:3px solid var(--menu-ink)}
#campaignSelect .level-scene{height:205px;position:relative;background:#c6dde5;overflow:hidden}
#campaignSelect .level-scene canvas{width:100%;height:100%;display:block}
#campaignSelect .level-position{position:absolute;top:12px;left:12px;font-weight:800;font-size:12px;background:var(--menu-paper);padding:7px 12px;transform:rotate(-3deg);box-shadow:2px 2px 0 var(--menu-ink)}
#campaignSelect .level-detail{padding:16px 0 18px}
#campaignSelect .level-detail h2{margin:0 0 8px;font-size:25px;font-weight:1000;letter-spacing:-.8px}
#campaignSelect .level-detail>p{font-size:13px;line-height:1.6;margin:0;min-height:42px;max-width:42em}
#campaignSelect .enemy-line{display:flex;align-items:center;gap:14px;min-height:83px;margin:5px 0}
#campaignSelect .enemy-line>span{font-size:11px;color:#58616b;writing-mode:vertical-rl;letter-spacing:2px}
#campaignSelect .enemy-preview{display:flex;align-items:center;min-width:0;gap:3px}
#campaignSelect .enemy-preview canvas{width:54px;height:71px}
#campaignSelect .enemy-preview small{font-size:10px;line-height:1.6}
#campaignSelect .chapter-launch{width:100%;padding:13px 18px;border:2px solid var(--menu-ink);box-shadow:3px 3px 0 var(--menu-ink);background:var(--feibi);color:var(--menu-ink);font-size:17px;font-weight:900;text-align:left;min-height:48px}
#campaignSelect .chapter-launch:disabled{background:#e7e6df;color:#63707a;box-shadow:none;cursor:not-allowed}
#campaignSelect .journey-bottom{display:grid;grid-template-columns:1.6fr 1fr;gap:32px;margin-top:25px}
#campaignSelect .lesson-heading{display:flex;gap:14px;align-items:baseline;margin-bottom:10px}
#campaignSelect .lesson-heading h2,#campaignSelect .journey-character h2{font-size:16px;margin:0;font-weight:900}
#campaignSelect .lesson-heading>span{font-size:11px;color:#63707a}
#campaignSelect .lesson-scenes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
#campaignSelect .lesson-entry{padding:0;background:none;border:0;border-bottom:2px solid #b5c6cc;text-align:left;color:var(--menu-ink);position:relative}
#campaignSelect .lesson-entry canvas{display:block;width:100%;height:76px}
#campaignSelect .lesson-entry>span{display:block;padding:8px 0 9px}
#campaignSelect .lesson-entry b{font-size:15px}
#campaignSelect .lesson-entry small{display:block;font-size:10px;margin-top:4px;line-height:1.5}
#campaignSelect .lesson-entry i{position:absolute;right:4px;top:5px;font-size:9px;font-style:normal;background:#fff9e9;padding:3px 5px}
#campaignSelect .journey-character>div{display:flex;gap:8px;justify-content:space-between;margin-top:8px}
#campaignSelect .journey-character button{min-width:0;flex:1;background:none;border:0;border-bottom:3px solid transparent;color:var(--menu-ink);padding:0 0 8px}
#campaignSelect .journey-character button[aria-pressed=true]{border-color:#d54b30;background:#fff0bc}
#campaignSelect .journey-character canvas{display:block;width:100%;height:94px}
#campaignSelect .journey-character span{font-size:12px;font-weight:800}
@media(max-width:1000px){
#campaignSelect .journey-body{grid-template-columns:1.2fr 1fr;gap:18px}
#campaignSelect.journey{padding:22px}
#campaignSelect .route-stop{width:86px}
#campaignSelect .route-stop canvas{height:53px}
#campaignSelect .route-stop strong{font-size:10px}
#campaignSelect .journey-bottom{grid-template-columns:1.5fr 1fr;gap:20px}
#campaignSelect .enemy-line{gap:8px}
#campaignSelect .enemy-preview canvas{width:44px}
#campaignSelect .enemy-preview small{font-size:9px}
}
@media(max-width:600px){
#campaignSelect.journey{padding:20px 14px 26px}
#campaignSelect .journey-heading{margin-bottom:16px;gap:8px}
#campaignSelect .journey-heading h1{font-size:27px;max-width:220px}
#campaignSelect .journey-heading h1 span{display:inline}
#campaignSelect .journey-heading>div>span{font-size:12px}
#campaignSelect .journey-body{display:flex;flex-direction:column;gap:22px}
#campaignSelect .level-preview{order:-1}
#campaignSelect .level-scene{height:190px}
#campaignSelect .level-detail{padding-top:12px}
#campaignSelect .level-detail h2{font-size:23px}
#campaignSelect .level-detail>p{font-size:13px;min-height:0}
#campaignSelect .enemy-line{margin:3px 0;min-height:72px}
#campaignSelect .enemy-preview canvas{height:65px;width:53px}
#campaignSelect .enemy-preview small{font-size:11px}
#campaignSelect .chapter-launch{padding:12px}
#campaignSelect .route-copy{padding:16px 16px 0}
#campaignSelect .route-copy b{font-size:15px}
#campaignSelect .route-landscape{min-height:285px;height:285px;flex:none}
#campaignSelect .route-stop{width:87px}
#campaignSelect .route-stop:nth-of-type(1){--stop-x:15%!important;--stop-y:33%!important}
#campaignSelect .route-stop:nth-of-type(2){--stop-x:50%!important;--stop-y:24%!important}
#campaignSelect .route-stop:nth-of-type(3){--stop-x:85%!important;--stop-y:38%!important}
#campaignSelect .route-stop:nth-of-type(4){--stop-x:85%!important;--stop-y:80%!important}
#campaignSelect .route-stop:nth-of-type(5){--stop-x:50%!important;--stop-y:71%!important}
#campaignSelect .route-stop:nth-of-type(6){--stop-x:15%!important;--stop-y:84%!important}
#campaignSelect .route-landscape>svg{display:none}
#campaignSelect .route-landscape:before{content:'';position:absolute;inset:23% 13% 15%;border:3px dashed #b76b3d;border-left:0;border-radius:0 70px 70px 0}
#campaignSelect .route-progress{padding:12px 15px}
#campaignSelect .journey-bottom{display:flex;flex-direction:column;gap:24px}
#campaignSelect .lesson-scenes{gap:10px}
#campaignSelect .lesson-entry canvas{height:70px}
#campaignSelect .lesson-entry small{font-size:9px}
#campaignSelect .lesson-entry b{font-size:14px}
#campaignSelect .journey-character canvas{height:100px}
}
@media(orientation:landscape) and (max-height:550px){
#campaignSelect.journey{padding:14px 20px}
#campaignSelect .journey-heading{margin-bottom:14px}
#campaignSelect .journey-heading h1{font-size:28px}
#campaignSelect .journey-body{grid-template-columns:1.25fr 1fr}
#campaignSelect .route-landscape{min-height:235px;height:235px}
#campaignSelect .route-stop{width:79px}
#campaignSelect .route-stop canvas{height:48px}
#campaignSelect .route-copy{padding:14px 14px 0}
#campaignSelect .route-copy b{font-size:14px}
#campaignSelect .route-copy span{font-size:10px}
#campaignSelect .level-scene{height:140px}
#campaignSelect .level-detail h2{font-size:20px}
#campaignSelect .level-detail>p{font-size:11px;min-height:0}
#campaignSelect .level-detail{padding-top:10px}
#campaignSelect .enemy-line{min-height:64px}
#campaignSelect .enemy-preview canvas{height:55px;width:43px}
#campaignSelect .chapter-launch{min-height:44px;padding:9px 12px;font-size:14px}
#campaignSelect .journey-bottom{margin-top:18px}
#campaignSelect .lesson-entry canvas{height:65px}
#campaignSelect .journey-character canvas{height:77px}
}
#campaignSelect .route-stop strong{font-size:12px}
#campaignSelect .route-stop small{font-size:11px}
#campaignSelect .enemy-preview canvas{width:72px;height:88px}
#campaignSelect .enemy-preview small{font-size:12px}
#campaignSelect .enemy-line>span{writing-mode:horizontal-tb;letter-spacing:0;max-width:30px;line-height:1.4}
#campaignSelect .lesson-entry canvas{height:91px}
@media(max-width:1000px){
#campaignSelect .route-stop strong{font-size:11px}
#campaignSelect .route-stop small{font-size:10px}
#campaignSelect .enemy-preview canvas{width:52px;height:72px}
#campaignSelect .enemy-preview small{font-size:10px}
}
@media(max-width:600px){
#campaignSelect .enemy-preview canvas{width:62px;height:77px}
#campaignSelect .enemy-preview small{font-size:11px}
#campaignSelect .lesson-entry canvas{height:78px}
}
@media(orientation:landscape) and (max-height:550px){
#campaignSelect .enemy-preview canvas{width:46px;height:62px}
#campaignSelect .enemy-preview small{font-size:10px}
#campaignSelect .lesson-entry canvas{height:75px}
#campaignSelect .route-stop strong{font-size:10px}
#campaignSelect .route-stop small{font-size:9px}
}
#campaignSelect .level-detail .journey-character{margin:8px 0 13px}
#campaignSelect .level-detail .journey-character h2{font-size:12px}
#campaignSelect .level-detail .journey-character>div{margin-top:3px;gap:6px}
#campaignSelect .level-detail .journey-character canvas{height:53px}
#campaignSelect .level-detail .journey-character button{padding-bottom:4px;min-height:44px}
#campaignSelect .journey-bottom{display:block}
#campaignSelect .lesson-scenes{max-width:950px}
@media(orientation:landscape) and (max-height:550px){
#campaignSelect.journey{padding-top:8px}
#campaignSelect .journey-heading{margin-bottom:8px}
#campaignSelect .journey-heading h1{font-size:23px;margin:3px 0 0}
#campaignSelect .journey-heading>div>span{font-size:11px}
#campaignSelect .level-scene{display:none}
#campaignSelect .level-detail{padding:0 0 8px}
#campaignSelect .level-detail h2{font-size:19px;margin-bottom:4px}
#campaignSelect .level-detail>p{font-size:10px;line-height:1.45}
#campaignSelect .enemy-line{margin:0;min-height:53px}
#campaignSelect .enemy-preview canvas{height:50px}
#campaignSelect .level-detail .journey-character{margin:3px 0 8px}
#campaignSelect .level-detail .journey-character h2{font-size:10px}
#campaignSelect .level-detail .journey-character canvas{height:30px}
#campaignSelect .level-detail .journey-character span{font-size:10px}
#campaignSelect .level-detail .journey-character button{min-height:47px}
#campaignSelect .route-landscape{min-height:220px;height:220px}
}
#campaignSelect .route-landscape{background:linear-gradient(#eef5f0dd,#eef5f0dd),url('assets/maps/garden-background-1600x900.png') center/cover}
#campaignSelect .route-stop.locked canvas{filter:saturate(.85);opacity:1}
#campaignSelect .route-stop strong{min-height:30px;max-width:100%;display:flex;align-items:center;justify-content:center;line-height:1.25}
#campaignSelect .route-stop small{margin-top:0}
#campaignSelect .route-stop{z-index:1}
#campaignSelect .route-landscape>svg path{stroke-width:2;stroke-dasharray:5 4}
#campaignSelect .route-stop strong,#campaignSelect .route-stop small{background:#eef5f0e8}
#campaignSelect .route-landscape>svg{pointer-events:none}
@media(max-width:600px){
#campaignSelect .route-stop{width:96px}
#campaignSelect .route-stop strong{font-size:11px;min-height:29px;padding:0 3px}
#campaignSelect .route-stop:nth-of-type(1){--stop-y:23%!important}
#campaignSelect .route-stop:nth-of-type(2){--stop-y:23%!important}
#campaignSelect .route-stop:nth-of-type(3){--stop-y:23%!important}
#campaignSelect .route-stop:nth-of-type(4){--stop-y:72%!important}
#campaignSelect .route-stop:nth-of-type(5){--stop-y:72%!important}
#campaignSelect .route-stop:nth-of-type(6){--stop-y:72%!important}
#campaignSelect .route-landscape>svg{display:block}
#campaignSelect .route-landscape:before{display:none}
}
@media(max-width:600px){
#campaignSelect .route-stop:nth-of-type(1),#campaignSelect .route-stop:nth-of-type(6){--stop-x:17%!important}
#campaignSelect .route-stop:nth-of-type(3),#campaignSelect .route-stop:nth-of-type(4){--stop-x:82%!important}
}
@media(orientation:landscape) and (max-height:550px){
#campaignSelect .level-preview{display:flex;flex-direction:column}
#campaignSelect .level-preview .level-detail{order:0}
#campaignSelect .level-preview .level-scene{display:block;order:1;flex:none;height:145px;margin-top:8px}
}
@media(max-width:600px) and (orientation:portrait){
#campaignSelect .journey-heading h1 span{display:block}
}

/* Quiet information; outlined and raised controls remain interactive. */
.home-rules li,.intro-rules span{border:0;border-radius:0;background:none;box-shadow:none;padding:5px 3px;color:var(--ink-2)}
.home-rules li+li,.intro-rules span+span{border-left:1px solid rgba(29,39,51,.25);padding-left:12px}
.home-rules li::before{border:0;width:5px;height:5px}
.mode-tag{border:0;border-radius:3px;box-shadow:none;padding:5px 9px}
.mode-caption small{border-radius:3px;box-shadow:none}
.hero-stamp{border:0;border-radius:0;box-shadow:none;background:none;padding:0;color:var(--ink-2)}
.menu .hero-caption small{border:0;border-radius:0;box-shadow:none;background:none;padding:0;color:var(--ink)}
.local-selection{border-bottom:1px solid rgba(29,39,51,.2);padding-bottom:16px}
.local-selection p{font-size:15px;font-weight:800;margin-bottom:10px}
.player-steps{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.player-steps button{display:flex;flex-direction:column;gap:5px;text-align:left;min-width:0;min-height:64px;padding:10px 12px;border:2px solid var(--ink);border-radius:12px;background:var(--paper);box-shadow:var(--lift-sm)}
.player-steps button[aria-current=step]{background:var(--sun)}
.player-steps button[data-edit-player="1"][aria-current=step]{background:var(--sky)}
.player-steps b{font-size:14px}.player-steps span{font-size:12px;line-height:1.5}
.player-steps button:disabled{opacity:.6;box-shadow:none;cursor:default}
.player-steps button:not(:disabled):hover{transform:translateY(-2px)}
@media(max-width:600px){.local-selection p{font-size:13px}.player-steps{gap:7px}.player-steps button{padding:8px}.player-steps b{font-size:12px}.player-steps span{font-size:11px}}

#campaignSelect .lesson-entry small,#campaignSelect .lesson-entry i,#campaignSelect .enemy-preview small{font-size:10px}

@media(max-width:600px){#menu .launch{gap:7px}#menu #start{min-width:0;font-size:16px;padding-left:10px;padding-right:10px;gap:6px}#menu #start span{flex-shrink:0}}
@media(orientation:landscape) and (max-height:550px){#menu .launch{gap:7px}#menu #start{min-width:0;font-size:15px;padding-left:10px;padding-right:10px;gap:6px}#menu #start span{flex-shrink:0}}

/* Asset preparation gates the match clock, with a recoverable failure state. */
#assetNotice{position:fixed;z-index:1000;left:50%;bottom:24px;transform:translateX(-50%);max-width:calc(100vw - 28px);padding:12px 18px;border:2px solid #1d2733;border-radius:12px;background:#fffaf0;color:#1d2733;font-weight:700;box-shadow:0 4px 0 #1d2733;white-space:normal}#assetNotice[hidden]{display:none}#assetNotice button{margin:6px;padding:6px 12px;}

/* Dual-region controls retain the existing menu art and input styling. */
.online-region-picker{margin:12px 0;padding:14px;border:1px solid #9aaba866;border-radius:12px;background:#f3f5ec;color:#233d42}
.online-region-picker .region-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.online-region-picker label{display:flex;gap:8px;align-items:center;font-size:13px}
.online-region-picker select{min-width:0;max-width:100%;flex:1}
.online-region-picker #regionResults{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0;font-size:12px}
.online-region-picker #regionResults>div{padding:8px;border-radius:6px;background:#fff}
.online-region-picker [data-status="disabled"],.online-region-picker [data-status="unavailable"]{color:#7b5140}
.online-region-picker .region-mixed{align-items:flex-start;line-height:1.5}
.online-region-picker .region-mixed input{width:17px;min-width:17px;height:17px;margin-top:2px}
.online-region-picker .region-explain{font-size:11px;line-height:1.55;margin:7px 0 0;color:#526267}
.online-region-picker button{font-size:12px;padding:6px 10px}
.online-entry #onlineCode{text-transform:none}
@media(max-width:500px){.online-region-picker #regionResults{grid-template-columns:1fr}.online-region-picker{padding:10px}.room-code strong{font-size:22px}}

.first-lesson{display:flex;align-items:center;gap:16px;background:#fff5d7;border:2px solid #53695c;border-radius:14px;padding:12px 18px;margin:10px 0}.first-lesson[hidden]{display:none}.first-lesson div{flex:1}.first-lesson b,.first-lesson span{display:block}.first-lesson span{font-size:13px;margin-top:4px}.first-lesson button{padding:10px;border-radius:9px}.first-lesson #firstTutorial{background:#ffe18b;font-weight:800}@media(max-width:650px){.first-lesson{flex-wrap:wrap;gap:8px}.first-lesson div{flex-basis:100%}}

.phoebe-hat-choice{display:flex;align-items:center;gap:10px;min-height:44px}.phoebe-hat-choice[hidden]{display:none}.phoebe-hat-choice input{width:20px;height:20px;accent-color:#6d63a8}

.asset-source-control{display:flex;align-items:center;gap:5px;font-size:12px;flex-wrap:wrap}.asset-source-control select{max-width:90px;padding:4px;border:1px solid currentColor;border-radius:6px;background:#fffaf0;color:inherit}.asset-source-control small{font-size:11px}
