/* style.css — DOM UI for 方塊戰線：油井島. Everything scales with --u (1px at a 396px-high page, up to 1.6px on desktop). */
#ui { --u: clamp(1px, calc(100vh / 396), 1.6px); --navy: #13233a; --cream: #f3ead7; --blue: #5cc8ff; --red: #ff7a59; --orange: #ff8a1f; --teal: #3ee6d0;
  font-family: var(--font, "Trebuchet MS", sans-serif); color: var(--cream); font-weight: 800; -webkit-tap-highlight-color: transparent; }
#ui *, #ui *::before, #ui *::after { box-sizing: border-box; -webkit-user-select: none; user-select: none; }
#ui img { -webkit-user-drag: none; pointer-events: none; }
#ui .hid { display: none !important; }
#ui .tx { font-weight: 900; paint-order: stroke fill; -webkit-text-stroke: calc(4 * var(--u)) var(--navy); text-shadow: 0 calc(2 * var(--u)) 0 var(--navy); letter-spacing: .02em; }
#ui .blue { color: var(--blue); } #ui .red { color: var(--red); }

/* ---- 9-slice panels / buttons ---- */
#ui .panel { border: calc(18 * var(--u)) solid transparent; border-image: url(assets/ui-panel.webp) 64 fill / calc(18 * var(--u)) stretch; background-clip: padding-box; }
#ui .panel.sm { border-width: calc(12 * var(--u)); border-image-width: calc(12 * var(--u)); }
#ui .btn { display: inline-flex; align-items: center; justify-content: center; gap: calc(6 * var(--u)); min-height: calc(46 * var(--u)); padding: 0 calc(6 * var(--u)); border: calc(14 * var(--u)) solid transparent; border-image: url(assets/ui-button.webp) 40 fill / calc(14 * var(--u)) stretch;
  background: none; color: #fff; font: inherit; font-weight: 900; font-size: calc(18 * var(--u)); pointer-events: auto; cursor: pointer; touch-action: manipulation; transition: transform .1s, filter .15s; outline: none; }
#ui .btn:hover, #ui .btn.focus { filter: brightness(1.15); transform: scale(1.04); }
#ui .btn:active, #ui .btn.press { transform: scale(.92); filter: brightness(.95); }
#ui .btn.dis { filter: grayscale(1) brightness(.7); opacity: .85; }
#ui .btn.go { animation: pulse 1.1s ease-in-out infinite; }
#ui .btn.dis.go { animation: none; }
#ui .ibtn { width: calc(48 * var(--u)); height: calc(48 * var(--u)); min-height: 0; padding: 0; border-width: calc(10 * var(--u)); border-image-width: calc(10 * var(--u)); }
#ui .ibtn img { width: calc(28 * var(--u)); height: calc(28 * var(--u)); object-fit: contain; filter: drop-shadow(0 calc(2 * var(--u)) 0 var(--navy)); }
#ui .ibtn.wide { width: auto; min-width: calc(48 * var(--u)); padding: 0 calc(4 * var(--u)); }
#ui .ibtn.wide span { font-size: calc(17 * var(--u)); }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes popIn { 0% { transform: scale(.6); opacity: 0; } 65% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes drop { 0% { transform: translateY(-120%) scale(1.1); opacity: 0; } 60% { transform: translateY(6%) scale(1); opacity: 1; } 80% { transform: translateY(-3%); } 100% { transform: none; opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(calc(-6 * var(--u))) rotate(.6deg); } }
@keyframes glowp { 0%, 100% { filter: drop-shadow(0 0 calc(6 * var(--u)) rgba(62,230,208,.5)); } 50% { filter: drop-shadow(0 0 calc(18 * var(--u)) rgba(255,138,31,.9)); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes kfin { 0% { transform: translateX(60%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes ringp { 0%, 100% { box-shadow: 0 0 0 calc(3 * var(--u)) var(--teal), 0 0 calc(10 * var(--u)) var(--teal); } 50% { box-shadow: 0 0 0 calc(5 * var(--u)) var(--orange), 0 0 calc(18 * var(--u)) var(--orange); } }

/* ---- title ---- */
#title { position: fixed; inset: 0; pointer-events: auto; cursor: pointer; background: #1b3a55 url(assets/title-bg.webp) center / cover no-repeat; overflow: hidden; transition: opacity .3s; touch-action: manipulation; }
#title.out { opacity: 0; pointer-events: none; }
#title::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(8,18,32,.55)); pointer-events: none; }
#title .t-logo-w { position: absolute; left: 50%; top: 3vh; width: min(78vw, 60vh * 1.6); height: 33vh; transform: translateX(-50%); display: flex; justify-content: center; z-index: 2; }
#title .t-logo { max-width: 100%; max-height: 100%; object-fit: contain; animation: drop .8s cubic-bezier(.2,.9,.3,1.2) both, floaty 4s ease-in-out .9s infinite, glowp 3s ease-in-out 1s infinite; }
#title .t-prompt { position: absolute; left: 10%; right: 10%; bottom: 15%; text-align: center; font-size: calc(26 * var(--u)); z-index: 2; animation: pulse 1.3s ease-in-out infinite; color: #fff; }
#title .t-hint { position: absolute; left: 0; right: 0; bottom: 7%; text-align: center; font-size: calc(15 * var(--u)); z-index: 2; color: var(--cream); padding: 0 12px; }
#title .t-corner { position: absolute; right: calc(10 * var(--u)); top: calc(10 * var(--u)); display: flex; gap: calc(8 * var(--u)); z-index: 3; align-items: center; }
#title .t-corner.left { right: auto; left: calc(10 * var(--u) + 56px); }
#title .t-corner .btn.online span { font-size: calc(17 * var(--u)); padding: 0 calc(6 * var(--u)) 0 calc(2 * var(--u)); white-space: nowrap; }
#title .t-corner .btn img.cur { width: calc(26 * var(--u)); height: calc(26 * var(--u)); }

/* ---- in-game HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud .h-tl { position: absolute; left: 72px; top: 10px; display: flex; flex-direction: column; gap: calc(6 * var(--u)); }
#hud .hp-row { display: flex; align-items: center; gap: calc(6 * var(--u)); }
#hud .kit-badge { width: calc(36 * var(--u)); height: calc(36 * var(--u)); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4b6d90, #1d3350); border: calc(3 * var(--u)) solid var(--cream); box-shadow: 0 0 0 calc(2 * var(--u)) var(--navy); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
#hud .kit-badge img { width: 88%; height: 88%; object-fit: contain; }
#hud .hp-bar { position: relative; width: calc(128 * var(--u)); height: calc(24 * var(--u)); border-radius: calc(12 * var(--u)); background: rgba(19,35,58,.82); border: calc(3 * var(--u)) solid var(--navy); box-shadow: 0 0 0 calc(2 * var(--u)) rgba(243,234,215,.85); overflow: hidden; }
#ui.touch #hud .hp-bar { width: calc(100 * var(--u)); }
#hud .hp-fill { position: absolute; inset: 0; width: 100%; background: linear-gradient(#7dffb0, #1fc47a); transition: width .15s; }
#hud .hp-fill.low { background: linear-gradient(#ff9a7a, #e0361e); }
#hud .hp-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(17 * var(--u)); }
#hud .mm { position: relative; width: calc(112 * var(--u)); height: calc(112 * var(--u)); border-radius: calc(14 * var(--u)); border: calc(4 * var(--u)) solid var(--cream); box-shadow: 0 0 0 calc(3 * var(--u)) var(--navy), 0 calc(4 * var(--u)) 0 calc(3 * var(--u)) var(--navy); overflow: hidden; background: #2a6f93; }
#hud .mm canvas { width: 100%; height: 100%; display: block; }
#ui.touch #hud .mm { width: calc(104 * var(--u)); height: calc(104 * var(--u)); }
#hud .tk { position: absolute; left: 50%; top: calc(8 * var(--u)); transform: translateX(-50%); display: flex; align-items: center; gap: calc(5 * var(--u)); padding: calc(2 * var(--u)) calc(8 * var(--u)); border-radius: calc(20 * var(--u)); background: rgba(19,35,58,.72); border: calc(3 * var(--u)) solid rgba(243,234,215,.85); }
#hud .tk-num { font-size: calc(20 * var(--u)); min-width: calc(34 * var(--u)); text-align: center; line-height: 1.1; }
#hud .chips { display: flex; gap: calc(3 * var(--u)); }
#hud .chip { width: calc(30 * var(--u)); height: calc(30 * var(--u)); flex: none; border-radius: 50%; padding: calc(3 * var(--u)); background: conic-gradient(var(--rc, #fff) calc(var(--p, 0) * 1%), rgba(255,255,255,.18) 0); }
#hud .chip .in { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--cc, #8a98a8); font-size: calc(14 * var(--u)); border: calc(2 * var(--u)) solid var(--navy); color: #fff; -webkit-text-stroke-width: calc(3 * var(--u)); }
#hud .kf { position: absolute; right: 10px; top: 62px; display: flex; flex-direction: column; align-items: flex-end; gap: calc(3 * var(--u)); max-width: 42vw; }
#hud .kf-row { display: flex; align-items: center; gap: calc(6 * var(--u)); padding: calc(2 * var(--u)) calc(8 * var(--u)); border-radius: calc(12 * var(--u)); background: rgba(19,35,58,.7); font-size: calc(14 * var(--u)); animation: kfin .2s ease-out; white-space: nowrap; }
#hud .kf-row.me { box-shadow: 0 0 0 calc(2 * var(--u)) var(--orange); }
#hud .kf-row img { height: calc(16 * var(--u)); width: calc(34 * var(--u)); object-fit: contain; }
#hud .kf-row .tag { font-size: calc(12 * var(--u)); color: var(--orange); }
#hud .kf-row .nm { overflow: hidden; text-overflow: ellipsis; max-width: calc(110 * var(--u)); }
#ui.touch #hud .kf { right: auto; left: 50%; transform: translateX(-50%); top: calc(54 * var(--u)); align-items: center; }
#ui.touch #hud:has(.veh:not(.hid)) .kf { top: calc(104 * var(--u)); }

#hud .xh { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#hud .xh i { position: absolute; background: var(--cream); box-shadow: 0 0 0 calc(1.5 * var(--u)) var(--navy); border-radius: 2px; }
#hud .xh i.v { width: calc(3 * var(--u)); height: calc(9 * var(--u)); left: calc(-1.5 * var(--u)); }
#hud .xh i.h { height: calc(3 * var(--u)); width: calc(9 * var(--u)); top: calc(-1.5 * var(--u)); }
#hud .xh i.t { top: calc(-9 * var(--u) - var(--g, 8px)); } #hud .xh i.b { top: var(--g, 8px); }
#hud .xh i.l { left: calc(-9 * var(--u) - var(--g, 8px)); } #hud .xh i.r { left: var(--g, 8px); }
#hud .xh i.dot { width: calc(4 * var(--u)); height: calc(4 * var(--u)); left: calc(-2 * var(--u)); top: calc(-2 * var(--u)); border-radius: 50%; background: var(--orange); }
#hud .hm { position: absolute; left: 50%; top: 50%; width: calc(40 * var(--u)); height: calc(40 * var(--u)); margin: calc(-20 * var(--u)) 0 0 calc(-20 * var(--u)); opacity: 0; }
#hud .hm i { position: absolute; left: 50%; top: 50%; width: calc(4 * var(--u)); height: calc(12 * var(--u)); background: #fff; border-radius: 2px; box-shadow: 0 0 0 calc(1.5 * var(--u)) var(--navy); }
#hud .hm i:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg) translateY(calc(-14 * var(--u))); }
#hud .hm i:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg) translateY(calc(-14 * var(--u))); }
#hud .hm i:nth-child(3) { transform: translate(-50%, -50%) rotate(135deg) translateY(calc(-14 * var(--u))); }
#hud .hm i:nth-child(4) { transform: translate(-50%, -50%) rotate(-135deg) translateY(calc(-14 * var(--u))); }
#hud .hm.kill i { background: var(--red); }
#hud .pops { position: absolute; left: 50%; top: calc(50% - 64px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
#hud .pop { font-size: calc(20 * var(--u)); color: var(--orange); white-space: nowrap; }
#hud .scores { position: absolute; left: calc(50% + 46px); top: 52%; display: flex; flex-direction: column; gap: calc(2 * var(--u)); }
#hud .sc { font-size: calc(16 * var(--u)); color: #ffe27a; white-space: nowrap; }
#hud .scope { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 0, transparent 37vh, rgba(5,10,18,.97) 38vh); }
#hud .scope::before { content: ""; position: absolute; left: 50%; top: 12vh; width: 2px; height: 76vh; background: rgba(0,0,0,.55); }
#hud .scope::after { content: ""; position: absolute; top: 50%; left: calc(50% - 38vh); width: 76vh; height: 2px; background: rgba(0,0,0,.55); }
#hud .dmg { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#hud .dmg i { position: absolute; left: calc(-60 * var(--u)); top: calc(-110 * var(--u)); width: calc(120 * var(--u)); height: calc(26 * var(--u)); opacity: 0; transform-origin: 50% calc(110 * var(--u)); border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: radial-gradient(ellipse at 50% 100%, transparent 30%, rgba(255,60,40,.9) 32%, transparent 70%); }
#hud .lowhp { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 calc(110 * var(--u)) calc(30 * var(--u)) rgba(255,30,20,.75); }
#hud .down { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(120,128,138,.25) 20%, rgba(40,46,56,.88)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(10 * var(--u)); text-align: center; padding: 0 8vw; }
#hud .down .big { font-size: calc(28 * var(--u)); color: #fff; }
#hud .bar { width: calc(200 * var(--u)); height: calc(16 * var(--u)); border-radius: calc(8 * var(--u)); background: rgba(19,35,58,.85); border: calc(3 * var(--u)) solid var(--navy); box-shadow: 0 0 0 calc(2 * var(--u)) rgba(243,234,215,.85); overflow: hidden; position: relative; }
#hud .bar b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(#7dffb0, #1fc47a); }
#hud .bar.tug { background: var(--red); } #hud .bar.tug b { background: var(--blue); }
/* interact / exit hint: a small see-through pill hugging the bottom-left edge, never over the vehicle or the crosshair */
#hud .prompt { position: absolute; left: 18px; bottom: 18px; padding: calc(3 * var(--u)) calc(10 * var(--u)); border-radius: calc(12 * var(--u)); background: rgba(19,35,58,.5); border: calc(2 * var(--u)) solid rgba(62,230,208,.6); font-size: calc(14 * var(--u)); white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
#ui.touch #hud .prompt { bottom: auto; top: 46%; left: 14px; }
#hud .cap { position: absolute; left: 50%; top: calc(62 * var(--u)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: calc(4 * var(--u)); font-size: calc(16 * var(--u)); }
#ui.touch #hud .cap { top: calc(120 * var(--u)); }
#hud .wp { position: absolute; right: 18px; bottom: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: calc(4 * var(--u)); padding: calc(6 * var(--u)) calc(12 * var(--u)); border-radius: calc(16 * var(--u)); background: rgba(19,35,58,.72); border: calc(3 * var(--u)) solid rgba(243,234,215,.85); min-width: calc(150 * var(--u)); }
#ui.touch #hud .wp { right: calc(14px + 92 * var(--u) + 16px); bottom: auto; top: 66px; min-width: calc(104 * var(--u)); padding: calc(4 * var(--u)) calc(8 * var(--u)); }
#hud .wp .r1 { display: flex; align-items: center; gap: calc(8 * var(--u)); }
#hud .wp .wic { height: calc(26 * var(--u)); width: calc(56 * var(--u)); object-fit: contain; }
#ui.touch #hud .wp .wic { height: calc(22 * var(--u)); width: calc(44 * var(--u)); }
#hud .wp .wname { font-size: calc(14 * var(--u)); }
#hud .wp .ammo { display: flex; align-items: baseline; gap: calc(4 * var(--u)); }
#hud .wp .mag { font-size: calc(34 * var(--u)); line-height: 1; } #hud .wp .res { font-size: calc(18 * var(--u)); color: #c9d6e4; }
#ui.touch #hud .wp .mag { font-size: calc(26 * var(--u)); } #ui.touch #hud .wp .res { font-size: calc(16 * var(--u)); }
#hud .wp .dots { display: flex; gap: calc(5 * var(--u)); } #hud .wp .dots i { width: calc(10 * var(--u)); height: calc(10 * var(--u)); border-radius: 50%; background: rgba(243,234,215,.3); border: calc(2 * var(--u)) solid var(--navy); }
#hud .wp .dots i.on { background: var(--orange); box-shadow: 0 0 calc(6 * var(--u)) var(--orange); }
#hud .wp .rl { width: 100%; height: calc(8 * var(--u)); border-radius: 4px; background: rgba(0,0,0,.5); overflow: hidden; } #hud .wp .rl b { display: block; height: 100%; width: 0; background: var(--teal); }
#hud .wp .ad { display: flex; align-items: center; gap: calc(6 * var(--u)); font-size: calc(14 * var(--u)); }
#hud .wp .ad .ring { width: calc(30 * var(--u)); height: calc(30 * var(--u)); border-radius: 50%; padding: calc(3 * var(--u)); background: conic-gradient(var(--teal) calc(var(--p, 0) * 1%), rgba(255,255,255,.2) 0); }
#hud .wp .ad .ring img { width: 100%; height: 100%; object-fit: contain; background: var(--navy); border-radius: 50%; }
#hud .wp .ad .pips { display: flex; gap: calc(3 * var(--u)); } #hud .wp .ad .pips i { width: calc(12 * var(--u)); height: calc(12 * var(--u)); background: rgba(243,234,215,.25); border: calc(2 * var(--u)) solid var(--navy); transform: rotate(45deg); } #hud .wp .ad .pips i.on { background: var(--orange); box-shadow: 0 0 calc(6 * var(--u)) var(--orange); }
#hud .veh { position: absolute; left: 50%; top: calc(56 * var(--u)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: calc(3 * var(--u)); padding: calc(4 * var(--u)) calc(14 * var(--u)); border-radius: calc(14 * var(--u)); background: rgba(19,35,58,.72); border: calc(3 * var(--u)) solid rgba(243,234,215,.85); font-size: calc(15 * var(--u)); margin-top: calc(6 * var(--u)); }
#hud .veh .bar { width: calc(170 * var(--u)); height: calc(12 * var(--u)); }
#hud .veh .bar b { background: linear-gradient(#ffd27a, #ff8a1f); }
#hud .box { position: absolute; left: 0; top: 0; width: calc(60 * var(--u)); height: calc(60 * var(--u)); margin: calc(-30 * var(--u)) 0 0 calc(-30 * var(--u)); border: calc(3 * var(--u)) solid var(--red); border-radius: calc(6 * var(--u)); box-shadow: 0 0 calc(8 * var(--u)) var(--red), inset 0 0 calc(8 * var(--u)) rgba(255,90,60,.5); animation: blink .5s infinite; }
#hud .box.cand { border-color: #ffd27a; box-shadow: 0 0 calc(8 * var(--u)) #ffd27a; animation: none; }
#hud .box span { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: calc(13 * var(--u)); white-space: nowrap; color: #fff; }
#hud .bomb { position: absolute; left: 0; top: 0; width: calc(34 * var(--u)); height: calc(34 * var(--u)); margin: calc(-17 * var(--u)) 0 0 calc(-17 * var(--u)); border: calc(3 * var(--u)) solid var(--orange); border-radius: 50%; box-shadow: 0 0 0 calc(2 * var(--u)) var(--navy); }
#hud .bomb::before, #hud .bomb::after { content: ""; position: absolute; background: var(--orange); } #hud .bomb::before { left: 50%; top: -30%; bottom: -30%; width: calc(3 * var(--u)); margin-left: calc(-1.5 * var(--u)); } #hud .bomb::after { top: 50%; left: -30%; right: -30%; height: calc(3 * var(--u)); margin-top: calc(-1.5 * var(--u)); }
#hud .warn { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); font-size: calc(26 * var(--u)); color: var(--red); animation: blink .6s infinite; white-space: nowrap; text-align: center; }
#hud .fm { position: absolute; left: 0; top: 0; width: calc(32 * var(--u)); height: calc(32 * var(--u)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: calc(17 * var(--u)); background: var(--cc, #8a98a8); border: calc(3 * var(--u)) solid var(--cream); box-shadow: 0 0 0 calc(2 * var(--u)) var(--navy); color: #fff; will-change: transform; }
#hud .fm small { position: absolute; top: calc(100% + 6 * var(--u)); left: 50%; transform: translateX(-50%); font-size: calc(12 * var(--u)); white-space: nowrap; }
#hud .tb { position: absolute; right: 14px; top: 66px; display: grid; grid-template-columns: repeat(2, calc(46 * var(--u))); gap: 8px; pointer-events: none; }
#hud .tbtn { position: relative; width: calc(46 * var(--u)); height: calc(46 * var(--u)); border: calc(10 * var(--u)) solid transparent; border-image: url(assets/ui-button.webp) 40 fill / calc(10 * var(--u)) stretch; display: flex; align-items: center; justify-content: center; pointer-events: auto; touch-action: none; transition: transform .08s, filter .15s; }
#hud .tbtn img { width: calc(26 * var(--u)); height: calc(26 * var(--u)); object-fit: contain; filter: drop-shadow(0 calc(2 * var(--u)) 0 var(--navy)); }
#hud .tbtn.press { transform: scale(.88); } #hud .tbtn.act { filter: brightness(1.3) drop-shadow(0 0 calc(8 * var(--u)) var(--teal)); } #hud .tbtn.off { filter: grayscale(.8) brightness(.8); }
#hud .tbtn b { position: absolute; right: calc(-9 * var(--u)); top: calc(-9 * var(--u)); min-width: calc(20 * var(--u)); height: calc(20 * var(--u)); border-radius: 10px; background: var(--orange); border: calc(2 * var(--u)) solid var(--navy); font-size: calc(14 * var(--u)); display: flex; align-items: center; justify-content: center; }

/* ---- global banners ---- */
#ui .banner { position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%); font-size: calc(40 * var(--u)); white-space: nowrap; opacity: 0; pointer-events: none; z-index: 20; -webkit-text-stroke-width: calc(7 * var(--u)); text-align: center; max-width: 96vw; }
#ui .toasts { position: fixed; left: 50%; top: calc(128 * var(--u)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: calc(4 * var(--u)); z-index: 19; pointer-events: none; }
#ui .toast { padding: calc(4 * var(--u)) calc(16 * var(--u)); border-radius: calc(16 * var(--u)); background: rgba(19,35,58,.82); border: calc(3 * var(--u)) solid var(--teal); font-size: calc(17 * var(--u)); white-space: nowrap; }
#ui .sub { position: fixed; left: 50%; top: 20%; transform: translateX(-50%); max-width: 37%; text-align: center; padding: calc(5 * var(--u)) calc(14 * var(--u)); border-radius: calc(14 * var(--u)); background: rgba(19,35,58,.78); font-size: calc(16 * var(--u)); line-height: 1.3; z-index: 18; pointer-events: none; }

/* ---- deploy ---- */
#deploy { position: fixed; inset: 0; background: rgba(8,16,30,.66); pointer-events: auto; z-index: 10; display: flex; }
#deploy .dp-wrap { display: flex; gap: 12px; width: 100%; height: 100%; padding: 56px 12px 12px; align-items: flex-start; justify-content: center; }
#deploy .dp-map { position: relative; flex: none; width: min(45vw, calc(100vh - 68px)); height: min(45vw, calc(100vh - 68px)); border-radius: calc(16 * var(--u)); border: calc(5 * var(--u)) solid var(--cream); box-shadow: 0 0 0 calc(3 * var(--u)) var(--navy), 0 calc(6 * var(--u)) 0 calc(3 * var(--u)) var(--navy); background: #2a6f93; overflow: hidden; animation: popIn .3s ease-out; }
#deploy .dp-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#deploy .mk { position: absolute; width: calc(30 * var(--u)); height: calc(30 * var(--u)); margin: calc(-15 * var(--u)) 0 0 calc(-15 * var(--u)); border-radius: 50%; border: calc(3 * var(--u)) solid var(--cream); background: var(--cc, #3a7fb0); box-shadow: 0 0 0 calc(2 * var(--u)) var(--navy); display: flex; align-items: center; justify-content: center; font-size: calc(14 * var(--u)); color: #fff; pointer-events: auto; cursor: pointer; padding: 0; overflow: visible; transition: transform .12s; touch-action: manipulation; }
#deploy .mk img { width: 86%; height: 86%; object-fit: contain; border-radius: 50%; }
#deploy .mk.fl { width: calc(40 * var(--u)); height: calc(40 * var(--u)); margin: calc(-20 * var(--u)) 0 0 calc(-20 * var(--u)); font-size: calc(18 * var(--u)); z-index: 2; }
#deploy .mk.sq { width: calc(30 * var(--u)); height: calc(30 * var(--u)); margin: calc(-15 * var(--u)) 0 0 calc(-15 * var(--u)); font-size: calc(13 * var(--u)); }
#deploy .mk.sel { transform: scale(1.2); z-index: 5; animation: ringp 1s ease-in-out infinite; background: var(--teal); }
#deploy .mk.na { filter: grayscale(1) brightness(.6); pointer-events: none; }
#deploy .mk:active { transform: scale(.9); }
#deploy .dp-right { flex: 1 1 0; min-width: 0; max-width: calc(520 * var(--u)); height: calc(100vh - 68px); max-height: calc(330 * var(--u)); display: flex; flex-direction: column; gap: calc(6 * var(--u)); padding: calc(4 * var(--u)); overflow: hidden; animation: popIn .3s ease-out .05s both; }
#deploy .row { display: flex; gap: calc(5 * var(--u)); flex: none; }
#deploy .kc, #deploy .pc { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: calc(10 * var(--u)); border: calc(3 * var(--u)) solid rgba(243,234,215,.35); background: rgba(19,35,58,.6); padding: calc(2 * var(--u)) 1px; cursor: pointer; pointer-events: auto; color: var(--cream); font: inherit; font-weight: 900; transition: transform .1s, background .15s; touch-action: manipulation; position: relative; }
#deploy .kc { height: calc(50 * var(--u)); } #deploy .pc { height: calc(42 * var(--u)); }
#deploy .kc img, #deploy .pc img { height: calc(22 * var(--u)); width: 90%; object-fit: contain; }
#deploy .pc img { height: calc(18 * var(--u)); }
#deploy .kc span, #deploy .pc span { font-size: calc(12 * var(--u)); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#deploy .kc.sel, #deploy .pc.sel { background: linear-gradient(#3ee6d0, #1b9aa0); border-color: #fff; transform: scale(1.06); z-index: 2; box-shadow: 0 0 calc(10 * var(--u)) var(--teal); }
#deploy .pc.def::after { content: ""; position: absolute; right: calc(3 * var(--u)); top: calc(3 * var(--u)); width: calc(7 * var(--u)); height: calc(7 * var(--u)); border-radius: 50%; background: var(--orange); border: 1px solid var(--navy); }
#deploy .kc:active, #deploy .pc:active { transform: scale(.92); }
#deploy .perk { flex: none; font-size: calc(13 * var(--u)); line-height: 1.2; min-height: calc(30 * var(--u)); display: flex; align-items: center; justify-content: center; text-align: center; color: #ffe9b8; padding: 0 4px; }
#deploy .loadout { flex: none; display: flex; align-items: center; justify-content: space-around; gap: calc(4 * var(--u)); padding: calc(2 * var(--u)) calc(6 * var(--u)); border-radius: calc(10 * var(--u)); background: rgba(0,0,0,.28); min-height: calc(30 * var(--u)); }
#deploy .loadout .li { display: flex; align-items: center; gap: calc(3 * var(--u)); font-size: calc(12 * var(--u)); white-space: nowrap; } #deploy .loadout img { height: calc(20 * var(--u)); width: calc(40 * var(--u)); object-fit: contain; }
/* the spawn list is its own scrolling box between the loadout and the deploy button */
#deploy .spwrap { flex: 1 1 0; min-height: 0; max-height: calc(150 * var(--u)); position: relative; display: flex; }
#deploy .spbar { position: absolute; right: calc(4 * var(--u)); top: calc(5 * var(--u)); bottom: calc(5 * var(--u)); width: calc(13 * var(--u)); border-radius: calc(7 * var(--u)); background: rgba(19,35,58,.9); box-shadow: inset 0 0 0 calc(2 * var(--u)) rgba(243,234,215,.35); pointer-events: auto; touch-action: none; cursor: pointer; }
#deploy .spbar.off { display: none; }
#deploy .spthumb { position: absolute; left: calc(1 * var(--u)); right: calc(1 * var(--u)); top: 0; border-radius: calc(6 * var(--u)); background: linear-gradient(90deg, #3ee6d0, #1b9aa0); border: calc(2 * var(--u)) solid #f3ead7; cursor: grab; touch-action: none; }
#deploy .spthumb.drag, #deploy .spthumb:hover { filter: brightness(1.2); }
#deploy .sp.off { visibility: hidden; }
#deploy .splist { flex: 1 1 auto; min-height: 0; padding-right: calc(22 * var(--u)) !important; display: flex; flex-wrap: wrap; align-content: flex-start; gap: calc(5 * var(--u)); padding: calc(4 * var(--u)); border-radius: calc(12 * var(--u)); background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 calc(2 * var(--u)) rgba(243,234,215,.18); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; pointer-events: auto; touch-action: pan-y; cursor: grab; }
#deploy .splist::-webkit-scrollbar { display: none; }
@media (hover: hover) {
  #deploy .sp:not(.sel):hover, #deploy .kc:not(.sel):hover, #deploy .pc:not(.sel):hover { background: rgba(62,230,208,.22); border-color: rgba(243,234,215,.8); }
  #deploy .mk:not(.sel):hover { box-shadow: 0 0 0 calc(2 * var(--u)) var(--navy), 0 0 0 calc(5 * var(--u)) rgba(243,234,215,.7); }
}
#deploy .sp { flex: 1 1 calc(50% - 5px); min-width: 0; height: calc(44 * var(--u)); min-height: calc(44 * var(--u)); display: flex; align-items: center; gap: calc(6 * var(--u)); padding: 0 calc(8 * var(--u)); border-radius: calc(12 * var(--u)); border: calc(3 * var(--u)) solid rgba(243,234,215,.35); background: rgba(19,35,58,.6); color: var(--cream); font: inherit; font-weight: 900; font-size: calc(14 * var(--u)); text-align: left; cursor: pointer; pointer-events: auto; transition: transform .1s, background .12s; touch-action: pan-y; outline: none; }
#deploy .sp .ic { flex: none; width: calc(28 * var(--u)); height: calc(28 * var(--u)); border-radius: 50%; background: var(--cc, #3a7fb0); border: calc(2 * var(--u)) solid var(--cream); display: flex; align-items: center; justify-content: center; font-size: calc(14 * var(--u)); overflow: hidden; color: #fff; }
#deploy .sp .ic img { width: 90%; height: 90%; object-fit: contain; }
#deploy .sp span.lb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#deploy .sp.sel { background: linear-gradient(#3ee6d0, #1b9aa0); border-color: #fff; box-shadow: inset 0 0 0 calc(2 * var(--u)) #13233a, 0 0 calc(10 * var(--u)) var(--teal); color: #fff; text-shadow: 0 1px 0 #13233a, 0 0 3px #13233a; }
#deploy .sp.sel::after { content: "✔"; margin-left: auto; flex: none; font-size: calc(14 * var(--u)); color: #fff; }
#deploy .sp.na { opacity: .4; pointer-events: none; }
#deploy .kc, #deploy .pc, #deploy .mk { outline: none; }
#deploy .dpbtn { flex: none; min-height: calc(54 * var(--u)); font-size: calc(22 * var(--u)); }
/* short screens (phone held sideways): drop the loadout line so the spawn list gets two rows */
#deploy .loadout { display: none; }
#deploy .dp-right { max-height: calc(345 * var(--u)); }
#deploy .kc span, #deploy .pc span { line-height: 1.15; flex: none; }
#deploy .kc img, #deploy .pc img { flex: none; }
@media (max-height: 450px) { #deploy .kc { height: calc(42 * var(--u)); } #deploy .pc { height: calc(38 * var(--u)); } #deploy .kc img { height: calc(17 * var(--u)); } #deploy .pc img { height: calc(13 * var(--u)); } #deploy .kc span, #deploy .pc span { font-size: calc(11.5 * var(--u)); } #deploy .dpbtn { min-height: calc(46 * var(--u)); } #deploy .perk { min-height: calc(26 * var(--u)); font-size: calc(12 * var(--u)); } }

/* ---- airdrop menu ---- */
#airdrop { position: fixed; inset: 0; pointer-events: auto; background: rgba(8,16,30,.35); z-index: 12; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: calc(8 * var(--u)); }
#airdrop .ad-t { font-size: calc(24 * var(--u)); color: var(--orange); }
#airdrop .cards { display: flex; gap: calc(12 * var(--u)); }
#airdrop .card { position: relative; width: calc(146 * var(--u)); display: flex; flex-direction: column; align-items: center; gap: calc(3 * var(--u)); padding: calc(4 * var(--u)); cursor: pointer; pointer-events: auto; animation: popIn .25s ease-out both; transition: transform .1s, filter .15s; touch-action: manipulation; }
#airdrop .card:nth-child(2) { animation-delay: .05s; } #airdrop .card:nth-child(3) { animation-delay: .1s; }
#airdrop .card:hover { transform: scale(1.05); } #airdrop .card:active { transform: scale(.94); }
#airdrop .card img { width: calc(82 * var(--u)); height: calc(60 * var(--u)); object-fit: contain; }
#airdrop .card .nm { font-size: calc(16 * var(--u)); text-align: center; } #airdrop .card .ds { font-size: calc(12 * var(--u)); text-align: center; line-height: 1.2; min-height: calc(30 * var(--u)); color: #dbe6f2; }
#airdrop .card .pips { display: flex; gap: calc(5 * var(--u)); } #airdrop .card .pips i { width: calc(16 * var(--u)); height: calc(16 * var(--u)); transform: rotate(45deg); background: rgba(243,234,215,.25); border: calc(2 * var(--u)) solid var(--navy); } #airdrop .card .pips i.on { background: var(--orange); box-shadow: 0 0 calc(8 * var(--u)) var(--orange); }
#airdrop .card .key { position: absolute; left: calc(2 * var(--u)); top: calc(2 * var(--u)); width: calc(22 * var(--u)); height: calc(22 * var(--u)); border-radius: 6px; background: var(--navy); border: 2px solid var(--cream); font-size: calc(14 * var(--u)); display: flex; align-items: center; justify-content: center; }
#airdrop .card.na { filter: grayscale(1) brightness(.7); }
#airdrop .card .need { font-size: calc(12 * var(--u)); color: var(--red); min-height: calc(14 * var(--u)); }

/* ---- rewards ---- */
#rewards { position: fixed; inset: 0; background: rgba(8,16,30,.7); pointer-events: auto; z-index: 21; display: flex; align-items: center; justify-content: center; }
#rewards .rw-ban { position: absolute; left: 50%; top: 50%; font-size: calc(64 * var(--u)); transform: translate(-50%, -50%); white-space: nowrap; -webkit-text-stroke-width: calc(9 * var(--u)); }
#rewards .rw-panel { width: min(88vw, calc(430 * var(--u))); display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--u)); padding: calc(6 * var(--u)) calc(10 * var(--u)); animation: popIn .3s ease-out both; }
#rewards .rw-head { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(28 * var(--u)); } #rewards .rw-head img { height: calc(44 * var(--u)); }
#rewards .rw-score { display: flex; align-items: baseline; gap: calc(10 * var(--u)); font-size: calc(18 * var(--u)); } #rewards .rw-score b { font-size: calc(40 * var(--u)); color: #ffe27a; }
#rewards .chips { display: flex; gap: calc(8 * var(--u)); flex-wrap: wrap; justify-content: center; }
#rewards .rc { display: flex; align-items: center; gap: calc(5 * var(--u)); min-width: calc(84 * var(--u)); padding: calc(3 * var(--u)) calc(10 * var(--u)); border-radius: calc(14 * var(--u)); background: rgba(0,0,0,.35); font-size: calc(18 * var(--u)); } #rewards .rc svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); flex: none; }
#rewards .rc small { font-size: calc(12 * var(--u)); color: #c9d6e4; }
#rewards .rw-gold { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(30 * var(--u)); color: #ffd27a; } #rewards .rw-gold img { height: calc(36 * var(--u)); }
#rewards .rw-btns { display: flex; gap: calc(10 * var(--u)); flex-wrap: wrap; justify-content: center; }
