:root {
  --font-mono: 'Courier New', monospace;
  --font-ui: 'Segoe UI', Arial, sans-serif;
  --font-body: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans', 'Meiryo', Arial, sans-serif;
  --clr-cyan: #0ff;
  --clr-green: #0f0;
  --clr-yellow: #ff0;
  --clr-red: #f55;
  --clr-pink: #f0a;
  --clr-text: #bbb;
  --clr-text-dim: #888;
  --clr-bg-dark: rgba(0,0,0,.7);
  --clr-bg-screen: rgba(5,5,15,.94);
  --radius: 6px;
  --transition-fast: all .25s ease-out;
}

/* === RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: var(--font-body); user-select: none }
/* CJK overrides */
html[lang="zh"], html[lang="ja"] { letter-spacing: 0 !important; }
html[lang="zh"] .screen button, html[lang="ja"] .screen button { letter-spacing: 1px; }

/* === LANGUAGE SELECTOR === */
.lang-selector { display: flex; gap: 4px; justify-content: center; margin: 6px 0; flex-wrap: wrap; }
.lang-btn {
  padding: 5px 10px; font-size: 12px; font-weight: 700;
  background: transparent; color: #888; border: 1px solid rgba(255,255,0,.3);
  cursor: pointer; font-family: var(--font-mono); letter-spacing: 1px;
  transition: all .25s; border-radius: 4px; min-width: 32px; text-align: center;
}
.lang-btn:hover { color: #ff0; border-color: rgba(255,255,0,.6); }
.lang-btn.active {
  color: #ff0; border-color: #ff0;
  box-shadow: 0 0 8px rgba(255,255,0,.3), inset 0 0 8px rgba(255,255,0,.05);
  text-shadow: 0 0 6px rgba(255,255,0,.5);
}
canvas#gl { width: 100%; height: 100%; display: block }

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes titleGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); text-shadow: 0 0 40px currentColor, 0 0 80px currentColor, 0 0 120px rgba(255,0,0,.25); }
}
@keyframes subtitleSlide {
  from { opacity: 0; letter-spacing: 20px; }
  to { opacity: 1; letter-spacing: 6px; }
}

/* === UI OVERLAY === */
#ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none }
#crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 28px; height: 28px }
#crosshair::before, #crosshair::after { content: ''; position: absolute; background: #0f0; box-shadow: 0 0 8px #0f0, 0 0 2px #fff }
#crosshair::before { width: 2px; height: 28px; left: 13px; top: 0; clip-path: polygon(0 0,100% 0,100% 38%,0 38%,0 62%,100% 62%,100% 100%,0 100%) }
#crosshair::after { width: 28px; height: 2px; top: 13px; left: 0; clip-path: polygon(0 0,38% 0,38% 100%,0 100%,0 0,62% 0,62% 100%,100% 100%,100% 0,62% 0) }

/* === HUD BARS & TEXT === */
#hpBar {
  position: absolute; top: 20px; left: 20px; width: 260px; height: 24px;
  background: rgba(0,0,0,.8); border: 2px solid rgba(255,50,50,.7); border-radius: 6px;
  box-shadow: 0 0 12px rgba(255,0,0,.25), inset 0 1px 3px rgba(0,0,0,.5), inset 0 0 8px rgba(255,0,0,.1);
  overflow: hidden;
}
#hpFill {
  width: 100%; height: 100%;
  background: linear-gradient(90deg,#a00,#e33 40%,#f55 80%,#f77);
  border-radius: 4px; transition: width .3s ease-out;
  box-shadow: 0 0 12px rgba(255,50,50,.5), inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 0 rgba(0,0,0,.3);
  position: relative;
}
#hpFill::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.15), transparent);
  border-radius: 4px 4px 0 0;
}
#hpTxt { position: absolute; top: 21px; left: 290px; color: #fff; font-size: 16px; font-weight: bold; text-shadow: 0 0 8px #f00, 0 1px 3px rgba(0,0,0,.8) }
#coinsTxt {
  position: absolute; top: 50px; left: 20px; color: #ffd700; font-size: 15px; font-weight: bold;
  text-shadow: 0 0 8px rgba(255,215,0,.5), 0 1px 3px rgba(0,0,0,.8);
  font-family: var(--font-mono);
}
#ammoTxt {
  position: absolute; bottom: 40px; right: 40px; color: #fff; font-size: 24px;
  text-shadow: 0 0 10px #0ff, 0 0 20px rgba(0,255,255,.2), 0 2px 4px rgba(0,0,0,.8);
  font-weight: bold; font-family: var(--font-mono);
  background: rgba(0,0,0,.35); padding: 6px 14px; border-radius: 6px;
  border: 1px solid rgba(0,255,255,.15); backdrop-filter: blur(2px);
}
#objTxt {
  position: absolute; top: 55px; left: 20px; color: #ffe066; font-size: 14px;
  text-shadow: 0 0 6px rgba(170,170,0,.5), 0 1px 3px rgba(0,0,0,.8); line-height: 1.8;
  background: rgba(0,0,0,.3); padding: 8px 14px; border-radius: 6px;
  border-left: 3px solid rgba(255,224,102,.4); max-width: 340px;
}
#timerTxt {
  position: absolute; top: 2%; left: 50%; transform: translateX(-50%); color: #f33;
  font-size: 52px; font-weight: bold; display: none; font-family: var(--font-mono);
  text-shadow: 0 0 20px #f00, 0 0 40px rgba(255,0,0,.3), 0 0 80px rgba(255,0,0,.15); letter-spacing: 4px;
  background: rgba(0,0,0,.4); padding: 4px 24px; border-radius: 8px;
  border: 1px solid rgba(255,50,50,.3); z-index: 21;
}
#damageOverlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(ellipse, transparent 40%, rgba(0,180,255,.45)); opacity: 0; transition: opacity .4s; pointer-events: none }
#hitMarker { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #ff0; font-size: 32px; font-weight: bold; opacity: 0; pointer-events: none; text-shadow: 0 0 10px #fa0, 0 0 20px rgba(255,200,0,.3) }
#infoTxt {
  position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%); color: #ffe066;
  font-size: 17px; display: none; text-align: center; padding: 8px 20px;
  text-shadow: 0 0 10px rgba(255,230,0,.5), 0 1px 4px rgba(0,0,0,.8);
  background: rgba(0,0,0,.45); border-radius: 6px; backdrop-filter: blur(3px);
}
#staminaBar {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 200px; height: 7px;
  background: rgba(0,0,0,.7); display: none; border: 1px solid rgba(0,200,255,.4); border-radius: 3px;
  box-shadow: 0 0 6px rgba(0,180,255,.15); overflow: hidden;
}
#staminaFill {
  width: 100%; height: 100%; background: linear-gradient(90deg,#0af,#0ff); border-radius: 2px;
  transition: width .15s ease-out; box-shadow: 0 0 4px rgba(0,220,255,.3); position: relative;
}
#staminaFill::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.2), transparent);
}
#reloadBar {
  position: absolute; bottom: 72px; right: 40px; width: 130px; height: 7px;
  background: rgba(0,0,0,.7); border: 1px solid #0ff; display: none; border-radius: 3px;
  box-shadow: 0 0 6px rgba(0,255,255,.15); overflow: hidden;
}
#reloadFill {
  width: 0%; height: 100%; background: linear-gradient(90deg,#08c,#0ff); border-radius: 2px;
  transition: width .05s linear; box-shadow: 0 0 4px rgba(0,255,255,.3); position: relative;
}
#reloadFill::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.2), transparent);
}
#criticalHitTxt {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%,-50%); color: #ff0;
  font-size: 30px; font-weight: bold; opacity: 0; pointer-events: none; z-index: 60; letter-spacing: 4px;
  text-shadow: 0 0 12px #ff0, 0 0 30px rgba(255,255,0,.5), 0 0 50px rgba(255,200,0,.2);
}

/* === SCREENS (menu, death, win, settings) === */
.screen {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(5,5,15,.94); z-index: 200; pointer-events: auto;
}
/* Subtle scan line overlay for screens */
.screen::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,100,.012) 2px, rgba(0,255,100,.012) 4px);
  pointer-events: none; z-index: 0;
}
/* Ambient light gradients */
.screen::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0,255,100,.025) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0,100,255,.025) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}
.screen > * { position: relative; z-index: 1; }
.screen h1 {
  font-size: 44px; margin-bottom: 8px; letter-spacing: 5px;
  font-weight: 800; text-transform: uppercase;
  animation: fadeInScale .5s ease-out;
}
.screen h2 {
  font-size: 16px; color: #8a8a9a; margin-bottom: 28px; letter-spacing: 6px;
  text-transform: uppercase; font-weight: 300;
  animation: subtitleSlide .8s ease-out;
}
.screen p {
  font-size: 15px; max-width: 440px; text-align: center; margin-bottom: 25px;
  line-height: 1.6; color: #bbb; animation: fadeInUp .4s ease-out;
}
.screen button {
  padding: 14px 48px; font-size: 16px; background: transparent; border: 2px solid;
  cursor: pointer; text-transform: uppercase; letter-spacing: 3px;
  transition: all .25s ease-out;
  margin: 6px; min-width: 280px; border-radius: 6px;
  backdrop-filter: blur(4px); font-weight: 600;
  position: relative; overflow: hidden;
  animation: fadeInUp .5s ease-out both;
}
/* Stagger button entrance animations */
.screen button:nth-child(2) { animation-delay: .05s; }
.screen button:nth-child(3) { animation-delay: .1s; }
.screen button:nth-child(4) { animation-delay: .15s; }
.screen button:nth-child(5) { animation-delay: .2s; }
.screen button:nth-child(6) { animation-delay: .25s; }
.screen button:nth-child(7) { animation-delay: .3s; }
.screen button:nth-child(8) { animation-delay: .35s; }
/* Sweep highlight on hover */
.screen button::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  transition: left .4s ease;
}
.screen button:hover::before { left: 100%; }
.screen button:active { transform: scale(0.97); }

/* --- Menu Screen --- */
#menuScreen h1 {
  color: #f55; font-size: 42px;
  text-shadow: 0 0 30px rgba(255,50,50,.6), 0 0 60px rgba(255,0,0,.2);
  animation: fadeInScale .5s ease-out, titleGlow 3s ease-in-out infinite;
  margin-bottom: 4px;
}
#menuScreen h2 {
  color: #7a7a8a; border-bottom: 1px solid rgba(255,255,255,.06);
  padding-bottom: 16px; margin-bottom: 12px;
}

/* Override .screen button defaults for menu buttons */
#menuScreen .menu-btn,
#menuScreen .menu-btn-sm,
#menuScreen .menu-btn-pro,
#menuScreen .menu-btn-account {
  min-width: 0; margin: 0;
}
#menuScreen .menu-btn-sm,
#menuScreen .menu-btn-account { backdrop-filter: none; }

/* === MENU TWO-COLUMN LAYOUT === */
.menu-layout {
  display: flex; gap: 28px; width: 100%; max-width: 720px;
  padding: 0 20px; box-sizing: border-box; align-items: flex-start;
}
.menu-left {
  flex: 1; display: flex; flex-direction: column; align-items: stretch; min-width: 0;
}
.menu-right {
  width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px;
}
.menu-nick-input {
  width: 100%; padding: 10px 14px; background: rgba(0,0,0,.7);
  border: 2px solid rgba(0,255,255,.4); color: #0ff; font-size: 15px;
  text-align: center; border-radius: 6px; font-family: var(--font-mono);
  outline: none; letter-spacing: 1px; box-sizing: border-box; margin-bottom: 12px;
  transition: border-color .25s, box-shadow .25s;
}
.menu-nick-input:focus { border-color: #0ff; box-shadow: 0 0 12px rgba(0,255,255,.2); }
.menu-btn-group {
  margin-bottom: 10px;
}
.menu-btn-label {
  color: rgba(255,255,255,.2); font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 6px; padding-left: 2px;
  font-family: var(--font-mono);
}
.menu-btn {
  display: block; width: 100%; padding: 12px 16px; font-size: 14px;
  background: transparent; border: 2px solid; cursor: pointer;
  text-transform: uppercase; letter-spacing: 2px; transition: all .25s ease-out;
  margin-bottom: 6px; border-radius: 6px; font-weight: 600;
  position: relative; overflow: hidden; font-family: var(--font-mono);
  min-width: 0;
  animation: fadeInUp .5s ease-out both;
}
.menu-btn::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  transition: left .4s ease;
}
.menu-btn:hover::before { left: 100%; }
.menu-btn:hover { transform: translateY(-1px); }
.menu-btn:active { transform: scale(0.97); }

.menu-btn-row {
  display: flex; gap: 6px; margin-top: 4px;
}
.menu-btn-sm {
  flex: 1; padding: 10px 8px; font-size: 12px;
  background: transparent; border: 1px solid; cursor: pointer;
  text-transform: uppercase; letter-spacing: 1px; transition: all .25s ease-out;
  border-radius: 6px; font-weight: 600; font-family: var(--font-mono);
  position: relative; overflow: hidden;
}
.menu-btn-sm:hover { transform: translateY(-1px); }

/* Right panel */
#menuScreen .statsBox {
  margin: 0; max-width: none; font-size: 13px; line-height: 1.8;
  padding: 14px 18px;
}
.menu-pro-block {
  padding: 12px 16px; border: 1px solid rgba(255,255,0,.2);
  background: linear-gradient(135deg,rgba(255,200,0,.05),rgba(255,100,0,.05));
  border-radius: 6px; text-align: center;
}
.menu-btn-pro {
  display: block; width: 100%; padding: 10px 12px; font-size: 13px;
  background: transparent; border: 2px solid; cursor: pointer;
  text-transform: uppercase; letter-spacing: 1px; transition: all .25s ease-out;
  margin-bottom: 5px; border-radius: 6px; font-weight: 600;
  font-family: var(--font-mono); position: relative; overflow: hidden;
  min-width: 0;
}
.menu-btn-pro:hover { transform: translateY(-1px); }

/* Bottom account bar */
.menu-bottom-bar {
  display: flex; gap: 10px; margin-top: 20px; justify-content: center;
  flex-wrap: wrap; padding: 0 20px;
}
.menu-btn-account {
  padding: 9px 20px; font-size: 11px; background: transparent;
  border: 1px solid; cursor: pointer; text-transform: uppercase;
  letter-spacing: 1px; transition: all .25s ease-out; border-radius: 6px;
  font-weight: 600; font-family: var(--font-mono);
  min-width: 140px;
}
.menu-btn-account:hover { transform: translateY(-1px); }

/* Responsive: stack on narrow screens */
@media (max-width: 680px) {
  .menu-layout { flex-direction: column; align-items: center; }
  .menu-right { width: 100%; max-width: 340px; }
}

/* --- Death Screen --- */
#deathScreen h1 { color: #f44; text-shadow: 0 0 30px rgba(255,0,0,.5), 0 0 60px rgba(255,0,0,.2); animation: fadeInScale .3s ease-out; }
#deathScreen p { color: #e99; font-size: 16px; line-height: 1.6 }
#deathScreen button { color: #f66; border-color: rgba(255,100,100,.5); background: rgba(255,50,50,.04) }
#deathScreen button:hover {
  background: rgba(255,100,100,.12); color: #f88;
  box-shadow: 0 0 25px rgba(255,100,100,.2), inset 0 0 30px rgba(255,50,50,.05);
  border-color: #f66; transform: translateY(-1px);
}

/* --- Win Screen --- */
#winScreen h1 { color: #0f0; text-shadow: 0 0 30px rgba(0,255,0,.5), 0 0 60px rgba(0,255,0,.2); animation: fadeInScale .3s ease-out; }
#winScreen p { color: #afa; font-size: 18px; line-height: 1.6 }
#winScreen button { color: #0f0; border-color: rgba(0,255,0,.5); background: rgba(0,255,0,.04) }
#winScreen button:hover {
  background: rgba(0,255,0,.12); color: #4f4;
  box-shadow: 0 0 25px rgba(0,255,0,.2), inset 0 0 30px rgba(0,255,0,.05);
  border-color: #0f0; transform: translateY(-1px);
}

/* --- Blitz Result Screen --- */
#blitzResultScreen h1 { color: #ff0; text-shadow: 0 0 30px rgba(255,255,0,.5), 0 0 60px rgba(255,255,0,.2); animation: fadeInScale .3s ease-out; }
#blitzResultScreen button { color: #ff0; border-color: rgba(255,255,0,.5); background: rgba(255,255,0,.04) }
#blitzResultScreen button:hover {
  background: rgba(255,255,0,.12); color: #ff0;
  box-shadow: 0 0 25px rgba(255,255,0,.2), inset 0 0 30px rgba(255,255,0,.05);
  border-color: #ff0; transform: translateY(-1px);
}

/* === MINIMAP === */
#minimap {
  position: absolute; bottom: 16px; left: 16px; width: 150px; height: 150px;
  border: 2px solid rgba(0,255,0,.35); background: rgba(0,0,0,.75); image-rendering: pixelated;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(0,255,0,.08), 0 4px 16px rgba(0,0,0,.6), inset 0 0 20px rgba(0,0,0,.3);
}

/* === GRAPHICS SETTINGS === */
.gfxRow { display: flex; align-items: center; gap: 12px; margin: 7px 0; width: 360px; justify-content: space-between }
.gfxRow label { color: #bbb; font-size: 13px; min-width: 110px; text-align: left }
.gfxRow input[type=range] { flex: 1; accent-color: #0f0; cursor: pointer; height: 6px; border-radius: 3px }
.gfxRow .gfxVal { color: #0f0; font-size: 13px; min-width: 50px; text-align: right; font-family: var(--font-mono); font-weight: bold }

/* === MAP EDITOR === */
#mapEditorScreen { overflow: auto }
#mapEditorScreen canvas { border: 2px solid rgba(0,255,0,.5); cursor: crosshair; image-rendering: pixelated; border-radius: 4px; box-shadow: 0 0 15px rgba(0,255,0,.1) }
.edTool {
  padding: 8px 14px; margin: 3px; background: rgba(0,40,0,.5);
  border: 1px solid rgba(0,255,0,.5); color: #0f0; cursor: pointer;
  font-size: 13px; display: inline-block; border-radius: 4px;
  transition: all .2s ease-out; font-weight: 500;
}
.edTool:hover { background: rgba(0,80,0,.5); transform: translateY(-1px); }
.edTool.active { background: rgba(0,100,0,.5); box-shadow: 0 0 10px rgba(0,255,0,.4); border-color: #0f0; }

/* === OVERLAYS === */
#vignetteOverlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.7) 100%); opacity: 0;
}

/* === MATH HUD (in-game question display) === */
#mathHud {
  position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
  font-size: 42px; color: #0ff; font-family: var(--font-mono);
  text-shadow: 0 0 15px #0ff, 0 0 30px #08f;
  text-align: center; pointer-events: none; z-index: 20; display: none;
}

/* === SETUP SCREENS (math & language mode config) === */
#mathSetupScreen, #langSetupScreen { overflow-y: auto }

.setupBtn {
  padding: 13px 36px; font-size: 15px; background: transparent;
  border: 2px solid rgba(0,255,255,.5); color: #0ff; cursor: pointer;
  text-transform: uppercase; letter-spacing: 2px;
  transition: all .25s ease-out;
  margin: 6px; min-width: 220px; border-radius: 6px;
  backdrop-filter: blur(4px); font-weight: 600;
  position: relative; overflow: hidden;
}
.setupBtn::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transition: left .4s ease;
}
.setupBtn:hover::before { left: 100%; }
.setupBtn:hover {
  background: rgba(0,255,255,.1); color: #0ff;
  box-shadow: 0 0 25px rgba(0,255,255,.15), inset 0 0 30px rgba(0,255,255,.04);
  border-color: #0ff; transform: translateY(-1px);
}
.setupBtn.active {
  background: rgba(0,255,255,.15);
  box-shadow: 0 0 15px rgba(0,255,255,.3), inset 0 0 20px rgba(0,255,255,.05);
  border-color: rgba(255,255,255,.7);
}
.setupBtn:active { transform: scale(0.97); }

/* Back-link button (← ВЫБОР ДЕЙСТВИЯ) */
.backLink {
  display: block; margin: 0 auto 4px; padding: 8px 20px;
  background: transparent; border: none; color: #888; cursor: pointer;
  font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  font-family: var(--font-ui); font-weight: 500;
  transition: color .2s; min-width: auto !important;
  border: 1px solid transparent !important; border-radius: 4px;
}
.backLink:hover { color: #ccc; background: rgba(255,255,255,.04); }
.backLink::before { display: none; }

/* === SETUP SLIDER (difficulty / range selectors) === */
.setupSlider { display: flex; align-items: center; gap: 12px; margin: 7px 0; width: 360px; justify-content: space-between }
.setupSlider label { color: #bbb; font-size: 13px; min-width: 110px; text-align: left }
.setupSlider input[type=range] { flex: 1; accent-color: #0ff; cursor: pointer; height: 6px }
.setupSlider .val { color: #0ff; font-size: 13px; min-width: 50px; text-align: right; font-family: var(--font-mono); font-weight: bold }

/* === STATS BOX (menu statistics display) === */
.statsBox {
  border: 1px solid rgba(0,255,255,.2); background: rgba(0,15,30,.5);
  padding: 16px 24px; margin: 14px auto; max-width: 420px; border-radius: 8px;
  color: #bbb; font-size: 14px; line-height: 1.9; text-align: left;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 20px rgba(0,100,150,.05), 0 2px 12px rgba(0,0,0,.3);
  animation: fadeInUp .4s ease-out .1s both;
}
.statsBox span { color: #0ff; font-weight: bold; font-family: var(--font-mono) }

/* === QUESTION TEXT (top-center during gameplay) === */
#questionTxt {
  position: absolute; top: 8%; left: 50%; transform: translateX(-50%); color: #0ff;
  font-size: 42px; font-weight: bold; display: none; pointer-events: none; z-index: 20;
  text-shadow: 0 0 20px #0ff, 0 0 40px rgba(0,255,255,.3);
  font-family: var(--font-mono); letter-spacing: 3px; text-align: center;
  background: rgba(0,10,20,.5); padding: 10px 28px; border-radius: 10px;
  border: 1px solid rgba(0,255,255,.2);
}

/* === ANSWER LABELS (floating above enemies, positioned via JS) === */
.answerLabel {
  position: absolute; color: #fff; font-weight: bold; pointer-events: none;
  white-space: nowrap; transform: translateX(-50%); z-index: 15;
  font-family: var(--font-mono);
  text-shadow: -2px -2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, 2px 2px 0 #000, 0 0 12px rgba(0,0,0,.8);
  background: rgba(0,0,0,.3); padding: 2px 8px; border-radius: 4px;
}

/* === SHOP BUTTONS === */
.shopBtn {
  display: block; width: 100%; padding: 11px 16px; margin: 5px 0; font-size: 14px;
  background: transparent; border: 2px solid rgba(255,255,0,.5); color: #ff0; cursor: pointer;
  text-transform: uppercase; letter-spacing: 2px;
  transition: all .25s ease-out;
  border-radius: 6px; font-family: var(--font-ui); font-weight: 600;
  position: relative; overflow: hidden;
}
.shopBtn::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,0,.06), transparent);
  transition: left .4s ease;
}
.shopBtn:hover:not(:disabled)::before { left: 100%; }
.shopBtn:hover:not(:disabled) {
  background: rgba(255,255,0,.08);
  box-shadow: 0 0 15px rgba(255,255,0,.15), inset 0 0 20px rgba(255,255,0,.03);
  border-color: #ff0; transform: translateY(-1px);
}
.shopBtn:disabled { cursor: default; opacity: 0.5; }
.shopBtn:active:not(:disabled) { transform: scale(0.97); }

/* === MAP SELECT BUTTONS === */
.mapBtn {
  padding: 14px 48px; font-size: 16px; background: transparent; border: 2px solid rgba(0,255,255,.5);
  color: #0ff; cursor: pointer; text-transform: uppercase; letter-spacing: 3px;
  transition: all .25s ease-out;
  margin: 6px; min-width: 280px; border-radius: 6px; font-weight: 600;
  position: relative; overflow: hidden;
}
.mapBtn::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,255,255,.06), transparent);
  transition: left .4s ease;
}
.mapBtn:hover:not(:disabled)::before { left: 100%; }
.mapBtn:hover:not(:disabled) {
  background: rgba(0,255,255,.08);
  box-shadow: 0 0 20px rgba(0,255,255,.15), inset 0 0 30px rgba(0,255,255,.03);
  border-color: #0ff; transform: translateY(-1px);
}
.mapBtn:disabled { cursor: default; opacity: 0.45; }
.mapBtn:active:not(:disabled) { transform: scale(0.97); }

/* === FEEDBACK TEXT (correct/wrong flash) === */
#feedbackTxt {
  position: absolute; top: 35%; left: 50%; transform: translate(-50%,-50%);
  font-size: 52px; font-weight: 800; pointer-events: none; z-index: 100;
  opacity: 0; transition: opacity .4s ease-out; text-align: center;
  letter-spacing: 4px; font-family: var(--font-ui);
}

/* === AUTH TABS === */
#authTabs { justify-content: center; }
.auth-tab {
  padding: 10px 28px; font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  background: rgba(0,0,0,.6); color: #555;
  border: 2px solid rgba(100,100,100,.3); cursor: pointer;
  font-family: var(--font-mono);
  transition: all .25s;
}
.auth-tab:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.auth-tab:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.auth-tab:hover { color: #888; border-color: rgba(150,150,150,.4); }
.auth-tab-active {
  color: #0ff !important; border-color: rgba(0,255,255,.5) !important;
  background: rgba(0,255,255,.08);
  text-shadow: 0 0 8px rgba(0,255,255,.4);
}

/* === AUTH SCREEN INPUTS === */
#authScreen input[type=email],
#authScreen input[type=password],
#authScreen input[type=text] {
  width: 280px; padding: 12px 16px; margin: 5px;
  background: rgba(0,0,0,.85); border: 2px solid rgba(0,255,255,.3);
  color: #0ff; font-size: 15px; text-align: center;
  border-radius: 6px; font-family: var(--font-mono);
  outline: none; letter-spacing: 1px;
  transition: border-color .25s, box-shadow .25s;
}
#authScreen input[type=password] {
  -webkit-text-security: disc;
}
#authLoginForm, #authRegisterForm {
  display: flex; flex-direction: column; align-items: center;
}
.auth-field-wrap {
  position: relative; display: flex; flex-direction: column; align-items: center;
}
.auth-field-label {
  color: rgba(0,255,255,.4); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: -2px; margin-top: 4px;
  font-family: var(--font-mono);
}
#authScreen input:focus {
  border-color: #0ff;
  box-shadow: 0 0 12px rgba(0,255,255,.25);
}
#authScreen input::placeholder {
  color: rgba(0,255,255,.35); letter-spacing: 2px; text-transform: uppercase;
  font-size: 13px;
}
#authScreen input:-webkit-autofill,
#authScreen input:-webkit-autofill:hover,
#authScreen input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0ff;
  -webkit-box-shadow: 0 0 0 1000px rgba(0,10,20,.95) inset;
  border-color: rgba(0,255,255,.4);
  transition: background-color 9999s ease-in-out 0s;
}

/* === SCROLLBAR STYLING === */
.screen::-webkit-scrollbar { width: 6px; }
.screen::-webkit-scrollbar-track { background: rgba(0,0,0,.3); }
.screen::-webkit-scrollbar-thumb { background: rgba(100,100,100,.4); border-radius: 3px; }
.screen::-webkit-scrollbar-thumb:hover { background: rgba(150,150,150,.5); }

/* === SLIDER INPUT CUSTOM (WebKit) === */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.08);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #0f0; border: 2px solid rgba(0,0,0,.4);
  margin-top: -6px; cursor: pointer;
  box-shadow: 0 0 6px rgba(0,255,0,.4);
  transition: box-shadow .2s;
}
input[type=range]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 12px rgba(0,255,0,.6);
}
/* Cyan accent variant for setup sliders */
.setupSlider input[type=range]::-webkit-slider-thumb {
  background: #0ff;
  box-shadow: 0 0 6px rgba(0,255,255,.4);
}
.setupSlider input[type=range]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 12px rgba(0,255,255,.6);
}
/* === Firefox range slider fallback === */
input[type=range]::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.08);
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #0f0; border: 2px solid rgba(0,0,0,.4);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,255,0,.4);
}
input[type=range]::-moz-range-thumb:hover {
  box-shadow: 0 0 12px rgba(0,255,0,.6);
}
.setupSlider input[type=range]::-moz-range-thumb {
  background: #0ff;
  box-shadow: 0 0 6px rgba(0,255,255,.4);
}
.setupSlider input[type=range]::-moz-range-thumb:hover {
  box-shadow: 0 0 12px rgba(0,255,255,.6);
}
