/* =====================================================================
   PAINT DROP — Zambian Edition · Boot / Loading / Menu UI
   Layout is authored on a fixed 1600x900 (16:9) design canvas that is
   letter-boxed & scaled to any PC / Android viewport (see boot.js).
   ===================================================================== */
:root {
  --purple: #8b2cff;
  --purple-deep: #4a0d9e;
  --green: #9dff1e;
  --orange: #ff8a00;
  --ink: #12041f;
  --ui-scale: 1;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #2a0f4d, #07020f 70%);
  color: #fff; font-family: 'Lilita One', 'Trebuchet MS', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent; user-select: none; touch-action: none;
}
#game-root { position: fixed; inset: 0; display: grid; place-items: center; }

/* Fixed 16:9 stage, scaled by JS (transform) for exact aspect handling */
.stage {
  position: absolute; left: 50%; top: 50%;
  width: 1600px; height: 900px;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(var(--ui-scale));
  overflow: hidden; background: #6fb9f0; contain: strict;
}
#scene-canvas, #splash-overlay, #vignette { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#splash-overlay { pointer-events: none; z-index: 3; }
#vignette {
  pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, rgba(10,0,25,.55) 100%),
    linear-gradient(to bottom, transparent 70%, rgba(10,0,25,.45) 100%);
}

/* ------------------------------------------------------------------ */
/* LOADING SCREEN                                                      */
/* ------------------------------------------------------------------ */
.loading-screen { position: absolute; inset: 0; z-index: 5; pointer-events: none; transition: opacity .9s ease; }
.loading-screen.out { opacity: 0; }

.logo-block {
  position: absolute; left: 50%; top: 6px; width: 760px; transform: translateX(-50%);
  filter: drop-shadow(0 14px 18px rgba(20, 0, 40, .55));
  animation: logoIn 1.1s cubic-bezier(.2, 1.6, .4, 1) both;
}
.game-logo { width: 100%; height: auto; overflow: visible; display: block; }
.logo-bounce { transform-origin: 500px 300px; animation: logoBounce 3.2s ease-in-out infinite; }
.logo-word text { font-family: 'Titan One', 'Lilita One', Impact, sans-serif; paint-order: stroke fill; }
.edition-text { font-family: 'Titan One', Impact, sans-serif; font-size: 50px; fill: #120412; letter-spacing: 2px; }
.edition-block { animation: editionIn 1.2s .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.logo-drip { transform-box: fill-box; transform-origin: 50% 0; }
.logo-splat { transform-box: fill-box; transform-origin: 50% 50%; }

@keyframes logoIn { from { opacity: 0; transform: translateX(-50%) scale(.4) rotate(-6deg); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes editionIn { from { opacity: 0; transform: translate(500px, 488px) scaleX(.1); } to { opacity: 1; transform: translate(500px, 488px) scaleX(1); } }
@keyframes logoBounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  45% { transform: translateY(-7px) scale(1.012, .992); }
  55% { transform: translateY(-7px) scale(.995, 1.01); }
  80% { transform: translateY(2px) scale(1.01, .985); }
}

/* Loading panel */
.loading-panel { position: absolute; left: 50%; bottom: 46px; width: 700px; transform: translateX(-50%); text-align: center; }
.loading-row { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 18px 8px; }
.loading-label {
  font-family: 'Titan One', sans-serif; font-size: 40px; letter-spacing: 1px; color: #fff;
  text-shadow: 0 3px 0 #1a0630, 0 0 14px rgba(0,0,0,.6), -2px -2px 0 #1a0630, 2px -2px 0 #1a0630, -2px 2px 0 #1a0630, 2px 2px 0 #1a0630;
}
.loading-label .dots i { font-style: normal; animation: dot 1.4s infinite; display: inline-block; }
.loading-label .dots i:nth-child(2) { animation-delay: .2s; }
.loading-label .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 1; } 30% { transform: translateY(-8px); opacity: .6; } }
.loading-stage { font-size: 20px; color: #e9ddff; opacity: .9; text-shadow: 0 2px 4px #000; transition: opacity .3s; }

.loading-bar { position: relative; height: 62px; display: flex; align-items: center; gap: 0; }
.bar-track {
  position: relative; flex: 1; height: 100%; border-radius: 40px; padding: 7px;
  background: linear-gradient(#0d0418, #241040);
  border: 5px solid #fff; outline: 4px solid #12041f;
  box-shadow: 0 8px 22px rgba(0,0,0,.55), inset 0 4px 10px rgba(0,0,0,.8);
  margin-right: 122px;
}
.bar-fill {
  position: relative; height: 100%; width: 0%; border-radius: 30px; overflow: hidden;
  background: linear-gradient(90deg, #5a0fd0 0%, #9b34ff 32%, #c2ff2e 74%, #e6ff3a 100%);
  background-size: 200% 100%; animation: barFlow 3s linear infinite;
  box-shadow: 0 0 18px rgba(170, 80, 255, .7), inset 0 -6px 8px rgba(40, 0, 80, .45);
  transition: width .25s ease-out;
}
.bar-gloss { position: absolute; left: 10px; right: 10px; top: 4px; height: 38%; border-radius: 20px; background: linear-gradient(rgba(255,255,255,.75), rgba(255,255,255,.08)); }
.bar-shine { position: absolute; top: 0; bottom: 0; width: 90px; left: -120px; background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); animation: shine 2.2s ease-in-out infinite; }
.bar-bubbles { position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,.55) 2px, transparent 3px); background-size: 34px 22px; animation: bubbles 1.6s linear infinite; opacity: .5; }
@keyframes barFlow { to { background-position: -200% 0; } }
@keyframes shine { 0% { left: -120px; } 60%, 100% { left: 110%; } }
@keyframes bubbles { to { background-position: 34px 0; } }
.bar-percent {
  position: absolute; right: 0; width: 112px; text-align: right;
  font-family: 'Titan One', sans-serif; font-size: 44px; color: #fff;
  text-shadow: 0 3px 0 #1a0630, -2px -2px 0 #1a0630, 2px -2px 0 #1a0630, -2px 2px 0 #1a0630, 2px 2px 0 #1a0630;
}
.loading-tip {
  margin: 16px 0 0; min-height: 36px; font-size: 30px; font-style: italic; font-weight: 700;
  transform: skewX(-6deg); color: #fff; letter-spacing: .3px;
  text-shadow: 0 2px 0 #12041f, 0 0 10px rgba(0,0,0,.85), 0 0 2px #000;
  transition: opacity .55s ease, transform .55s ease;
}
.loading-tip.hide { opacity: 0; transform: skewX(-6deg) translateY(8px); }
.tip-swoosh { width: 320px; height: 14px; margin-top: 2px; opacity: .85; }
.press-continue { margin: 8px 0 0; font-size: 22px; color: #e8ff5a; text-shadow: 0 2px 0 #000; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* Zambian identity */
.identity-badge {
  position: absolute; left: 30px; bottom: 30px; display: flex; align-items: center; gap: 18px;
  padding: 10px 18px 10px 12px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(10, 2, 20, .55), rgba(10, 2, 20, .1));
}
.zm-emblem { display: flex; flex-direction: column; align-items: center; }
.zm-emblem svg { width: 74px; height: 56px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.zm-eagle { transform-origin: 60px 40px; animation: eagle 4s ease-in-out infinite; }
@keyframes eagle { 50% { transform: translateY(-2px) scaleX(1.04); } }
.zm-text { text-align: center; line-height: 1; }
.zm-text strong { display: block; font-family: 'Titan One', sans-serif; font-size: 22px; letter-spacing: 3px; }
.zm-text span { font-size: 10px; letter-spacing: 1.2px; opacity: .9; }
.zm-divider { width: 2px; height: 64px; background: rgba(255,255,255,.6); }
.play-big { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 16px; letter-spacing: 1px; }
.play-big i { font-size: 34px; }

.tagline {
  position: absolute; right: 34px; bottom: 34px; margin: 0; font-size: 18px; letter-spacing: 2px;
  color: #fff; opacity: .9; text-shadow: 0 2px 4px #000; font-style: italic;
}

/* ------------------------------------------------------------------ */
/* MAIN MENU                                                           */
/* ------------------------------------------------------------------ */
.main-menu { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.main-menu.in .menu-panel { opacity: 1; transform: translateX(0); }
.menu-panel {
  position: absolute; right: 60px; top: 50%; margin-top: -170px; width: 400px; display: flex; flex-direction: column; gap: 14px;
  opacity: 0; transform: translateX(60px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, 1.4, .4, 1); pointer-events: auto;
}
.menu-map { margin: 0 0 4px; font-size: 22px; letter-spacing: 2px; text-shadow: 0 2px 4px #000; }
.menu-btn {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 22px; cursor: pointer;
  font-family: 'Titan One', sans-serif; font-size: 26px; color: #fff; text-align: left;
  background: linear-gradient(100deg, rgba(25, 6, 45, .88), rgba(60, 16, 110, .78));
  border: 4px solid #fff; border-radius: 18px 40px 18px 40px; box-shadow: 0 6px 0 #12041f, 0 10px 20px rgba(0,0,0,.4);
  transition: transform .15s, background .2s;
}
.menu-btn i { font-size: 28px; width: 34px; text-align: center; color: var(--green); }
.menu-btn small { display: block; font-family: 'Lilita One', sans-serif; font-size: 15px; opacity: .8; letter-spacing: .5px; }
.menu-btn:hover, .menu-btn:focus-visible { transform: translateX(-8px) scale(1.03); outline: none; background: linear-gradient(100deg, #6a16d8, #a13cff); }
.menu-btn.primary { background: linear-gradient(100deg, #7a1fff, #b54bff); }
.menu-btn.primary i { color: #e8ff5a; }
.menu-btn.small { font-size: 20px; padding: 10px 18px; justify-content: center; }
.menu-toast {
  position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); padding: 12px 26px; border-radius: 30px;
  background: rgba(15, 4, 30, .85); border: 3px solid var(--green); font-size: 22px; pointer-events: none;
}

/* Corner controls */
.corner-controls { position: absolute; top: 22px; right: 24px; z-index: 8; display: flex; gap: 12px; }
.icon-btn {
  width: 58px; height: 58px; border-radius: 50%; border: 4px solid #fff; cursor: pointer;
  background: rgba(20, 5, 40, .6); color: #fff; font-size: 24px; box-shadow: 0 4px 0 #12041f;
}
.icon-btn:hover { background: var(--purple); }
.quality-badge { position: absolute; top: 30px; left: 28px; z-index: 8; font-size: 14px; opacity: .55; letter-spacing: 1px; text-shadow: 0 1px 2px #000; }

/* Settings dialog */
.settings-dialog {
  width: 560px; border: 5px solid #fff; border-radius: 26px; padding: 26px 30px; color: #fff;
  background: linear-gradient(160deg, #1d0838, #3a0f6e); box-shadow: 0 20px 60px rgba(0,0,0,.6);
  font-family: 'Lilita One', sans-serif;
}
.settings-dialog::backdrop { background: rgba(5, 0, 15, .55); }
.settings-dialog h2 { margin: 0 0 16px; font-family: 'Titan One', sans-serif; font-size: 32px; }
.settings-dialog .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.settings-dialog input[type=range] { width: 220px; accent-color: var(--green); }
.settings-dialog input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--green); }
.settings-dialog select { font: inherit; font-size: 18px; padding: 4px 10px; border-radius: 10px; }
.settings-dialog .hint { font-size: 15px; opacity: .7; }

.noscript, .fatal { position: absolute; inset: 0; display: grid; place-items: center; z-index: 20; font-size: 28px; background: #12041f; text-align: center; padding: 40px; }

/* Reduced motion */
.reduce-motion .logo-bounce, .reduce-motion .bar-shine, .reduce-motion .bar-bubbles, .reduce-motion .zm-eagle { animation: none !important; }

/* ------------------------------------------------------------------ */
/* States & transitions                                                */
/* ------------------------------------------------------------------ */
#scene-canvas { opacity: 0; transition: opacity 1.2s ease; }
#scene-canvas.live { opacity: 1; }
.loading-panel { transition: opacity .5s ease, transform .5s ease; }
.loading-panel.gone { opacity: 0; transform: translateX(-50%) translateY(40px); pointer-events: none; }
.loading-screen.menu-mode .logo-block { left: 34px; top: 20px; width: 470px; transform: none; transition: all .8s cubic-bezier(.2,1.2,.4,1); animation: none; }
.loading-screen.menu-mode .tagline { bottom: auto; top: 300px; left: 60px; right: auto; font-size: 22px; }
#paint-wipe { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }
.stage.no-webgl { background: linear-gradient(160deg, #3b8fe0 0%, #8fd0ff 55%, #f2c27a 100%); }
body.portrait .loading-panel { width: 820px; }
@media (hover: none) { .menu-btn:hover { transform: none; } }

/* =====================================================================
   IN-MATCH HUD + TOUCH CONTROLS + RESULTS
   ===================================================================== */
.hud { position: absolute; inset: 0; z-index: 12; pointer-events: none; font-family: 'Lilita One', sans-serif; --hp: 1; }
.hud.on { display: block; }
.hud > * { pointer-events: none; }

/* ---- top bar ---- */
.hud-top { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; }
.turf-bar { position: relative; width: 330px; height: 34px; border-radius: 18px; background: rgba(8,2,18,.72); border: 3px solid rgba(255,255,255,.9); overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.turf-bar .turf-fill { position: absolute; inset: 0 auto 0 0; width: 0%; transition: width .35s ease-out; }
.turf-bar.a .turf-fill { right: auto; }
.turf-bar.b .turf-fill { left: auto; right: 0; }
.turf-bar.a { border-radius: 18px 6px 6px 18px; }
.turf-bar.b { border-radius: 6px 18px 18px 6px; }
.turf-pct { position: absolute; top: 50%; transform: translateY(-50%); font-size: 18px; text-shadow: 0 2px 3px #000; }
.turf-bar.a .turf-pct { left: 12px; }
.turf-bar.b .turf-pct { right: 12px; }
.turf-icon { position: absolute; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.turf-bar.a .turf-icon { right: 9px; }
.turf-bar.b .turf-icon { left: 9px; }
.hud-timer { min-width: 108px; text-align: center; font-family: 'Titan One', sans-serif; font-size: 40px; color: #fff; text-shadow: 0 3px 0 #12041f, 0 0 12px rgba(0,0,0,.8); }
.hud-timer.urgent { color: #ff5b7a; animation: pulse 1s infinite; }
.hud-score { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); display: flex; gap: 10px; font-size: 17px; opacity: .85; text-shadow: 0 2px 3px #000; }
.hud-score span:first-child { color: #d9c4ff; }
.hud-score span:last-child { color: #d1ff9d; }

/* ---- kill feed ---- */
.hud-feed { position: absolute; right: 22px; top: 84px; width: 340px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.feed-line { background: rgba(8,2,18,.72); border-left: 4px solid var(--green); padding: 5px 12px; border-radius: 6px; font-size: 17px; transition: opacity .8s; text-shadow: 0 1px 2px #000; }
.feed-line i { opacity: .8; margin: 0 4px; font-size: 13px; }
.feed-line.fade { opacity: 0; }

/* ---- crosshair ---- */
.hud-cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.hud-cross.off { display: none; }
.hud-cross .cl { position: absolute; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.55); border-radius: 2px; }
.hud-cross .cl.t, .hud-cross .cl.b { width: 3px; height: 10px; left: -1.5px; }
.hud-cross .cl.t { top: -19px; } .hud-cross .cl.b { top: 9px; }
.hud-cross .cl.l, .hud-cross .cl.r { height: 3px; width: 10px; top: -1.5px; }
.hud-cross .cl.l { left: -19px; } .hud-cross .cl.r { left: 9px; }
.hud-cross .cl.dot { width: 4px; height: 4px; left: -2px; top: -2px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0,0,0,.6); }
.hud-cross.ch-scope .cl.dot { width: 3px; height: 3px; }
.hud-cross.ch-scope .cl.t, .hud-cross.ch-scope .cl.b { height: 26px; }
.hud-cross.contrast-high .cl { background: #ffe94a; box-shadow: 0 0 0 3px #000; }
.hit-mark { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; opacity: 0;
  background:
    linear-gradient(45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%);
  filter: drop-shadow(0 0 3px #000); }
.hit-mark.show { animation: hitpop .32s ease-out; }
.hit-mark.crit { filter: drop-shadow(0 0 4px #ff3ea0) brightness(1.4); }
@keyframes hitpop { from { opacity: 1; transform: scale(.6) rotate(0); } to { opacity: 0; transform: scale(1.25) rotate(8deg); } }

/* ---- damage direction ---- */
.dmg-wrap { position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; margin: -120px 0 0 -120px; opacity: 0; transition: opacity .25s; transform: rotate(var(--dmg-rot, 0deg)); }
.dmg-arrow { position: absolute; left: 50%; top: 0; width: 0; height: 0; margin-left: -22px; border-left: 22px solid transparent; border-right: 22px solid transparent; border-bottom: 34px solid rgba(255,60,90,.85); }
.dmg-arrow:nth-child(2) { display: none; }

/* ---- bottom left ---- */
.hud-bl { position: absolute; left: 26px; bottom: 26px; display: flex; align-items: flex-end; gap: 14px; }
.ink-bar { position: relative; width: 44px; height: 150px; border-radius: 22px; background: rgba(8,2,18,.75); border: 3px solid #fff; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.ink-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transition: height .12s linear; }
.ink-bar.low { animation: pulse .6s infinite; }
.ink-label { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 15px; text-shadow: 0 2px 3px #000; }
.special-gauge { position: relative; width: 150px; height: 22px; border-radius: 12px; background: rgba(8,2,18,.75); border: 3px solid #fff; overflow: hidden; }
.special-fill { position: absolute; inset: 0 auto 0 0; width: 0%; transition: width .2s; }
.special-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; letter-spacing: .5px; text-shadow: 0 1px 2px #000; }
.special-gauge.ready { animation: ready 1s infinite; }
@keyframes ready { 50% { box-shadow: 0 0 18px #afff3a; } }
.weapon-box { position: absolute; left: 0; bottom: 168px; display: flex; align-items: center; gap: 8px; background: rgba(8,2,18,.7); padding: 7px 14px; border-radius: 12px; font-size: 17px; }
.weapon-box i { color: var(--green); font-size: 19px; }
.weapon-ammo { font-size: 13px; opacity: .75; }

/* ---- status ---- */
.hud-respawn { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; opacity: 0; transition: opacity .3s; }
.hud-respawn.on { opacity: 1; }
.hud-respawn strong { display: block; font-family: 'Titan One', sans-serif; font-size: 54px; color: #ff4d78; text-shadow: 0 4px 0 #12041f, 0 0 24px rgba(255,60,110,.6); }
.hud-respawn span { font-size: 22px; }
.hud-objective { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-family: 'Titan One', sans-serif; font-size: 30px; color: #e8ff5a; text-shadow: 0 3px 0 #12041f; opacity: .95; }
.hud-countdown { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(.6); opacity: 0; transition: opacity .2s, transform .3s; }
.hud-countdown.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hud-countdown strong { font-family: 'Titan One', sans-serif; font-size: 140px; color: #fff; text-shadow: 0 8px 0 #7a1fff, 0 0 40px rgba(160,60,255,.8); }
.hud.hurt::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 120px rgba(255,40,70,calc((1 - var(--hp)) * .55)); pointer-events: none; }

/* ---- system buttons ---- */
.hud-sys { position: absolute; right: 18px; top: 16px; display: flex; gap: 8px; pointer-events: auto; }
.hud-icon { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: rgba(12,3,26,.65); color: #fff; font-size: 17px; cursor: pointer; }
.hud-icon:hover { background: var(--purple); }
.hud-fps { position: absolute; left: 18px; top: 16px; font-size: 13px; letter-spacing: .5px; padding: 4px 10px; border-radius: 8px; background: rgba(8,2,18,.6); }
.hud-fps[data-status="green"] { color: #8dff5a; }
.hud-fps[data-status="yellow"] { color: #ffd84a; }
.hud-fps[data-status="red"] { color: #ff5b7a; }

/* ---- touch controls ---- */
.hud-touch { position: absolute; inset: 0; }
.hud-zone { position: absolute; pointer-events: auto; touch-action: none; }
.hud-zone.look-zone { pointer-events: auto; background: transparent; }
.hud-zone.look-zone .look-hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 12px; opacity: .35; letter-spacing: 1px; }
.hud-zone.stick-zone { display: grid; place-items: center; }
.stick-base { position: relative; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 4px solid rgba(255,255,255,.55); background: rgba(10,3,22,.35); }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.hud-zone[class*="btn-"] { display: grid; place-items: center; }
.hb-face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 4px solid rgba(255,255,255,.85); background: rgba(24,8,46,.6); font-size: 20px; color: #fff; }
.hud-zone.pressed .hb-face { background: rgba(160,70,255,.85); transform: scale(.94); }
.hud-zone.btn-fire .hb-face { border-color: #e8ff5a; background: rgba(120,30,220,.55); font-size: 26px; }
.hud-zone.btn-special .hb-face { border-color: #ffd84a; }
.hud-zone.btn-squid .hb-face { border-color: #6cf6ff; }
body:not(.touch-ui) .hud-touch { display: none; }

/* ---- results ---- */
.hud-results { position: absolute; inset: 0; display: none; place-items: center; background: rgba(6,1,14,.72); backdrop-filter: blur(3px); pointer-events: auto; z-index: 4; }
.hud-results.on { display: grid; }
.res-card { width: 860px; max-height: 84%; overflow: auto; background: linear-gradient(165deg, #1d0838, #3b0f70); border: 5px solid #fff; border-radius: 26px; padding: 26px 30px; box-shadow: 0 24px 70px rgba(0,0,0,.7); }
.res-title { margin: 0 0 12px; font-family: 'Titan One', sans-serif; font-size: 58px; text-align: center; }
.res-title.win { color: #b6ff3a; text-shadow: 0 4px 0 #12041f, 0 0 30px rgba(160,255,60,.5); }
.res-title.lose { color: #ff5b7a; text-shadow: 0 4px 0 #12041f; }
.res-title.draw { color: #ffe94a; }
.res-bars { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.res-team { display: flex; align-items: center; gap: 12px; font-size: 19px; }
.res-name { width: 78px; }
.res-bar { flex: 1; height: 26px; border-radius: 12px; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.5); overflow: hidden; }
.res-bar i { display: block; height: 100%; transition: width .8s cubic-bezier(.2,1.2,.4,1); }
.res-team b { width: 74px; text-align: right; font-family: 'Titan One', sans-serif; }
.res-sub { text-align: center; opacity: .7; font-size: 15px; }
.res-mvp { text-align: center; font-size: 21px; margin: 12px 0; }
.res-mvp i { color: #ffd84a; margin-right: 6px; }
.res-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.res-table th { text-align: left; opacity: .6; font-weight: 400; padding: 4px 8px; font-size: 13px; letter-spacing: 1px; }
.res-table td { padding: 5px 8px; border-top: 1px solid rgba(255,255,255,.12); }
.res-table tr.ta td:first-child { border-left: 4px solid #a06bff; }
.res-table tr.tb td:first-child { border-left: 4px solid #7dff1a; }
.res-table em { font-size: 11px; background: #e8ff5a; color: #1a0630; padding: 1px 5px; border-radius: 4px; font-style: normal; }
.res-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }

/* ---- pause ---- */
.hud-pause { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6,1,14,.75); backdrop-filter: blur(2px); pointer-events: auto; z-index: 5; }
.pause-card { width: 420px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(165deg, #1d0838, #3b0f70); border: 5px solid #fff; border-radius: 24px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.pause-card h2 { margin: 0; font-family: 'Titan One', sans-serif; font-size: 40px; text-align: center; }
.pause-mode { margin: 0 0 8px; text-align: center; font-size: 13px; letter-spacing: 1.5px; opacity: .7; }
.pause-note { margin: 6px 0 0; font-size: 12px; opacity: .55; text-align: center; }

/* ---- HUD editor ---- */
.hud.editing .hud-zone { outline: 2px dashed rgba(232,255,90,.75); outline-offset: 2px; pointer-events: auto; }
.hud.editing .hud-zone .hb-face, .hud.editing .stick-base { pointer-events: none; }
.hud.editing .hud-zone.overlap { outline-color: #ff3ea0; background: rgba(255,40,80,.18); }
.hud-zone .he-handle { display: none; }
.hud.editing .hud-zone .he-handle { display: block; position: absolute; right: -6px; bottom: -6px; width: 16px; height: 16px; border-radius: 4px; background: #e8ff5a; border: 2px solid #12041f; cursor: nwse-resize; }
.hud-editor { position: absolute; right: 16px; top: 70px; width: 330px; z-index: 14; background: rgba(15,4,32,.95); border: 3px solid #fff; border-radius: 18px; padding: 14px; pointer-events: auto; font-family: 'Lilita One', sans-serif; }
.hud-editor header { font-family: 'Titan One', sans-serif; font-size: 20px; margin-bottom: 6px; }
.hud-editor header small { display: block; font-family: 'Lilita One', sans-serif; font-size: 12px; opacity: .6; }
.he-row { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; flex-wrap: wrap; }
.he-row span { flex: 1; }
.he-row input[type=range] { width: 100%; accent-color: var(--green); }
.he-row button { font: inherit; font-size: 12px; padding: 4px 8px; border-radius: 8px; border: 2px solid rgba(255,255,255,.5); background: rgba(90,20,160,.6); color: #fff; cursor: pointer; }
.he-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 12px; margin: 6px 0; max-height: 200px; overflow: auto; }
.he-item { display: flex; align-items: center; gap: 5px; text-transform: capitalize; }
.he-item input { accent-color: var(--green); }
.hud-editor footer { display: flex; gap: 8px; margin-top: 8px; }
.hud-editor footer .menu-btn { flex: 1; justify-content: center; }

/* ---------------------------------------------------------------------------
   SETTINGS OVERLAY (v3) — 8 categories, presets, sensitivity practice test
   --------------------------------------------------------------------------- */
.settings-full{position:absolute;inset:0;z-index:60;display:grid;grid-template-rows:auto auto 1fr auto;
  background:linear-gradient(160deg,rgba(16,10,32,.97),rgba(9,6,20,.985));
  color:#f2ecff;font-family:'Lilita One',system-ui,sans-serif;opacity:0;transition:opacity .18s ease}
.settings-full.in{opacity:1}
.sf-head{display:flex;align-items:center;gap:16px;padding:14px 22px;border-bottom:1px solid rgba(255,255,255,.09)}
.sf-head h2{margin:0;font-size:22px;letter-spacing:.06em;display:flex;align-items:center;gap:10px}
.sf-head h2 i{color:#ffd23f}
.sf-preset{margin-left:auto;font-size:12px;letter-spacing:.12em;color:#b9aede}
.sf-preset b{color:#7dffb0}
.sf-tabs{display:flex;gap:2px;padding:0 14px;overflow-x:auto;border-bottom:1px solid rgba(255,255,255,.08);scrollbar-width:none}
.sf-tabs::-webkit-scrollbar{display:none}
.sf-tab{flex:0 0 auto;display:flex;align-items:center;gap:7px;padding:11px 14px;background:none;border:0;
  border-bottom:3px solid transparent;color:#9d93bd;font:inherit;font-size:12px;letter-spacing:.1em;cursor:pointer;transition:.15s}
.sf-tab:hover{color:#fff;background:rgba(255,255,255,.04)}
.sf-tab.active{color:#ffd23f;border-bottom-color:#ffd23f}
.sf-body{overflow-y:auto;padding:18px 22px 26px;overscroll-behavior:contain}
.sf-content{max-width:1080px;margin:0 auto}
.sf-foot{display:flex;align-items:center;gap:12px;padding:12px 22px;border-top:1px solid rgba(255,255,255,.09);background:rgba(0,0,0,.28)}
.sf-hint{margin-right:auto;font-size:11px;color:#8d84ab;letter-spacing:.04em;font-family:system-ui,sans-serif}
.sf-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:6px 26px}
.sf-row{display:flex;align-items:center;gap:14px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.05);min-height:38px}
.sf-row.check{cursor:pointer}
.sf-label{flex:1 1 auto;font-size:13px;letter-spacing:.02em;line-height:1.25}
.sf-label small{display:block;margin-top:3px;font-size:10.5px;color:#8d84ab;letter-spacing:0;font-family:system-ui,sans-serif;line-height:1.35}
.sf-row select{flex:0 0 156px;background:#1d1433;color:#efe9ff;border:1px solid rgba(255,255,255,.16);
  border-radius:7px;padding:6px 8px;font:inherit;font-size:12px;cursor:pointer}
.sf-row input[type=checkbox]{flex:0 0 auto;width:22px;height:22px;accent-color:#ffd23f;cursor:pointer}
.sf-range{flex:0 0 190px;display:flex;align-items:center;gap:9px}
.sf-range input[type=range]{flex:1;height:4px;-webkit-appearance:none;appearance:none;background:rgba(255,255,255,.18);border-radius:3px;outline:none;cursor:pointer}
.sf-range input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:15px;height:15px;border-radius:50%;
  background:#ffd23f;border:2px solid #2b1d4a;box-shadow:0 0 6px rgba(255,210,63,.6);cursor:pointer}
.sf-range input[type=range]::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:#ffd23f;border:2px solid #2b1d4a;cursor:pointer}
.sf-val{flex:0 0 52px;text-align:right;font-size:12px;color:#ffd23f;font-variant-numeric:tabular-nums}
.sf-sep{grid-column:1/-1;margin:14px 0 4px;font-size:11px;letter-spacing:.18em;color:#8f7fd0;
  border-bottom:1px solid rgba(143,127,208,.28);padding-bottom:5px}
.sf-presets{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin-bottom:14px}
.preset-btn{display:flex;flex-direction:column;gap:5px;padding:12px 14px;text-align:left;cursor:pointer;
  background:rgba(255,255,255,.045);border:2px solid rgba(255,255,255,.11);border-radius:11px;color:#e9e2ff;
  font:inherit;transition:.15s}
.preset-btn:hover{background:rgba(255,255,255,.09);transform:translateY(-1px)}
.preset-btn strong{font-size:15px;letter-spacing:.12em}
.preset-btn small{font-size:10px;color:#9d93bd;letter-spacing:.02em;font-family:system-ui,sans-serif}
.preset-btn.active{border-color:#ffd23f;background:rgba(255,210,63,.12);box-shadow:0 0 18px rgba(255,210,63,.18)}
.preset-btn.active strong{color:#ffd23f}
.sf-tools{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.sf-note{margin:16px 0 0;padding:10px 13px;border-left:3px solid rgba(255,210,63,.6);border-radius:0 8px 8px 0;
  background:rgba(255,210,63,.07);font-size:11.5px;color:#c8bfe4;font-family:system-ui,sans-serif;line-height:1.5}
.sf-note b{color:#ffd23f}
.sf-sens-head{margin-bottom:6px}
.sens-meter{display:inline-flex;align-items:center;gap:10px;padding:7px 14px;border-radius:9px;
  background:rgba(125,255,176,.09);border:1px solid rgba(125,255,176,.3);font-size:12px;color:#bfe9d0}
.sens-meter b{color:#7dffb0;font-size:15px;font-variant-numeric:tabular-nums}
.sf-practice{margin-top:18px;border:1px solid rgba(255,255,255,.12);border-radius:13px;overflow:hidden;background:rgba(0,0,0,.3)}
.sf-practice header{display:flex;align-items:center;gap:9px;padding:10px 14px;font-size:12px;letter-spacing:.12em;
  background:rgba(255,255,255,.05);border-bottom:1px solid rgba(255,255,255,.09)}
.sf-practice header i{color:#ffd23f}
.sf-practice header small{font-size:10px;letter-spacing:0;color:#9d93bd;font-family:system-ui,sans-serif;font-weight:400;margin-left:auto}
.pt-area{position:relative;height:230px;margin:12px;border-radius:10px;cursor:crosshair;
  background:radial-gradient(circle at 50% 45%,#241a44,#150e28 70%);border:1px solid rgba(255,255,255,.08)}
.pt-target{position:absolute;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;
  background:radial-gradient(circle,#fff 0 22%,#ff5d8f 24% 46%,rgba(255,93,143,.18) 48% 100%);transition:left .12s ease,top .12s ease}
.pt-reticle{position:absolute;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;
  border:2px solid #7dffb0;box-shadow:0 0 12px rgba(125,255,176,.8);pointer-events:none;transition:left .05s linear,top .05s linear}
.pt-stats{display:flex;gap:22px;padding:0 14px 13px;font-size:11px;color:#9d93bd;font-family:system-ui,sans-serif}
.pt-stats b{color:#ffd23f;font-size:13px;margin-left:5px}
.sf-sens-actions{display:flex;gap:10px;margin-top:16px;flex-wrap:wrap}
.sf-layout{margin-bottom:8px}
.sf-layout-btns{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.sf-layout-btns button{padding:8px 16px;border-radius:8px;cursor:pointer;font:inherit;font-size:11.5px;letter-spacing:.1em;
  background:rgba(255,255,255,.05);border:2px solid rgba(255,255,255,.13);color:#ddd5f5;transition:.15s}
.sf-layout-btns button:hover{background:rgba(255,255,255,.1)}
.sf-layout-btns button.active{border-color:#7dffb0;color:#7dffb0;background:rgba(125,255,176,.12)}
.key-btn{flex:0 0 128px;padding:6px 10px;border-radius:7px;cursor:pointer;font:inherit;font-size:11px;letter-spacing:.08em;
  background:#1d1433;border:1px solid rgba(255,255,255,.16);color:#efe9ff;transition:.15s}
.key-btn:hover{border-color:#ffd23f;color:#ffd23f}
.key-btn.listening{border-color:#7dffb0;color:#7dffb0;animation:pulseK .9s infinite}
@keyframes pulseK{0%,100%{box-shadow:0 0 0 0 rgba(125,255,176,.5)}50%{box-shadow:0 0 0 6px rgba(125,255,176,0)}}
@media (max-width:640px){
  .sf-grid{grid-template-columns:1fr}
  .sf-tab span{display:none}
  .sf-tab{padding:11px 13px;font-size:15px}
  .sf-hint{display:none}
  .pt-area{height:180px}
}

/* match loading curtain */
.match-curtain{position:absolute;inset:0;z-index:55;display:grid;place-items:center;opacity:0;transition:opacity .25s ease;
  background:radial-gradient(circle at 50% 40%,rgba(35,16,64,.96),rgba(8,4,18,.99))}
.match-curtain.in{opacity:1}
.mc-inner{display:flex;flex-direction:column;align-items:center;gap:10px;color:#fff;font-family:'Lilita One',system-ui,sans-serif}
.mc-inner i{font-size:44px;color:#ffd23f;animation:mcSpin 1.4s linear infinite}
.mc-inner b{font-size:26px;letter-spacing:.16em}
.mc-inner span{font-size:12px;letter-spacing:.14em;color:#9d93bd}
@keyframes mcSpin{0%{transform:translateY(0) scale(1)}50%{transform:translateY(-9px) scale(1.06)}100%{transform:translateY(0) scale(1)}}
