/* =============================================================
   Trust Vector Arcade - shared lobby styles
   ============================================================= */
body {
  background-color: #0B0E14;
  color: #00FF41;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  text-shadow: 0 0 5px #00FF41;
}

#arcade-cabinet {
  border: 4px solid #336633;
  padding: 50px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.1);
  background: rgba(0, 0, 0, 0.8);
}

h1 { letter-spacing: 5px; margin-bottom: 5px; }

button {
  background: transparent;
  color: #00FF41;
  border: 2px solid #00FF41;
  padding: 15px 30px;
  margin: 15px;
  cursor: pointer;
  font-size: 1.2rem;
  display: block;
  width: 250px;
  transition: 0.2s;
}

button:hover {
  background: #00FF41;
  color: #0B0E14;
  transform: scale(1.05);
}

footer {
  margin-top: 40px;
  font-size: 0.7rem;
  opacity: 0.6;
}

#prompt-zone {
  border: 2px dashed #336633;
  padding: 20px;
  margin: 20px 0;
  min-height: 80px;
  background: rgba(0, 255, 65, 0.05);
}

#action-buttons { display: flex; justify-content: center; gap: 10px; }

.btn-approve { border-color: #00FF41; color: #00FF41; }
.btn-approve:hover { background: #00FF41; color: #0B0E14; }

.btn-refine { border-color: #FFDC00; color: #FFDC00; }
.btn-refine:hover { background: #FFDC00; color: #0B0E14; }

.btn-discard { border-color: #FF4136; color: #FF4136; }
.btn-discard:hover { background: #FF4136; color: #0B0E14; }

#integrity-bar { font-size: 1.2rem; margin-bottom: 20px; color: #00FF41; }

/* CRT Scanline Effect (lobby only) */
body:not(#game-screen)::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

/* =============================================================
   DATA DEFENDER: DATA PRIVACY & AI SAFETY — Dashboard layout
   ============================================================= */
body#game-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  text-align: left;
  text-shadow: none;
  color: #d6f3ff;
  font-family: 'Courier New', Courier, monospace;
  background: #02020a;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

:root {
  --arcade-cyan: #5ed7ff;
  --arcade-pink: #ff73d1;
  --arcade-gold: #ffd67a;
}

body#game-screen .creator-credit {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 110;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(111, 233, 255, 0.35);
  background: rgba(4, 12, 30, 0.78);
  color: #9bc4d9;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-shadow: none;
}

body#game-screen .creator-name {
  color: #ffd86f;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 216, 111, 0.55);
}

/* CRT scanlines */
body#game-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: multiply;
}

body#game-screen.body-shake {
  animation: body-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes body-shake {
  0%   { transform: translate(0, 0) rotate(0); }
  15%  { transform: translate(-14px, 7px) rotate(-1.2deg); }
  30%  { transform: translate(16px, -9px) rotate(1.2deg); }
  45%  { transform: translate(-18px, 5px) rotate(-1.4deg); }
  60%  { transform: translate(15px, -8px) rotate(1deg); }
  75%  { transform: translate(-9px, 4px) rotate(-0.6deg); }
  90%  { transform: translate(5px, -2px) rotate(0.3deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

/* =============================================================
   HUD bar
   ============================================================= */
#hud {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 2px solid rgba(0, 220, 255, 0.35);
  background: linear-gradient(180deg, rgba(10, 5, 25, 0.85) 0%, rgba(10, 5, 25, 0) 100%);
  box-shadow: none;
}

.hud-stat {
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: #6fe9ff;
  text-shadow: 0 0 6px rgba(0, 220, 255, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hud-stat span {
  color: #fff;
  margin-left: 6px;
  letter-spacing: 2px;
}

.hud-shields {
  color: #6fe9ff;
}

#shield-segments { display: inline-flex; gap: 5px; }

.shield-pip {
  width: 24px;
  height: 10px;
  background: linear-gradient(180deg, #00ffd0 0%, #008cff 100%);
  border: 1px solid #6fffea;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 220, 255, 0.8), inset 0 0 6px rgba(255, 255, 255, 0.4);
  transition: all 0.4s ease;
}

.shield-pip.lost {
  background: linear-gradient(180deg, #2a1020 0%, #1a0810 100%);
  border-color: #5a2030;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
  filter: grayscale(1) brightness(0.5);
}

.shield-pip.hit-flash {
  animation: pip-hit-flash 0.6s ease-out forwards;
}

@keyframes pip-hit-flash {
  0%, 15% {
    background: #ff2244;
    border-color: #ff6680;
    box-shadow: 0 0 14px rgba(255, 40, 70, 0.95);
    filter: none;
  }
  100% {
    background: linear-gradient(180deg, #2a1020 0%, #1a0810 100%);
    border-color: #5a2030;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
    filter: grayscale(1) brightness(0.5);
  }
}

#hud-right { display: contents; }

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  width: auto;
  margin: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  letter-spacing: 3px;
  font-weight: bold;
  background: linear-gradient(180deg, rgba(20, 10, 40, 0.95) 0%, rgba(8, 4, 18, 0.95) 100%);
  color: #6fe9ff;
  border: 2px solid #00dcff;
  border-radius: 3px;
  text-decoration: none;
  text-shadow: 0 0 6px rgba(0, 220, 255, 0.8);
  box-shadow: 0 0 10px rgba(0, 220, 255, 0.35), inset 0 0 8px rgba(0, 220, 255, 0.1);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hud-btn:hover {
  background: linear-gradient(180deg, rgba(40, 20, 80, 0.95) 0%, rgba(20, 10, 40, 0.95) 100%);
  box-shadow: 0 0 16px rgba(0, 220, 255, 0.9), inset 0 0 10px rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.hud-btn:active { transform: translateY(1px); }
.hud-icon { font-size: 0.8rem; }

#menu-btn,
#pause-btn,
#music-btn {
  color: var(--arcade-pink);
  border-color: var(--arcade-pink);
  text-shadow: 0 0 6px rgba(255, 115, 209, 0.85);
  box-shadow: 0 0 10px rgba(255, 115, 209, 0.35), inset 0 0 8px rgba(255, 115, 209, 0.12);
}
#menu-btn:hover,
#pause-btn:hover,
#music-btn:hover { box-shadow: 0 0 16px rgba(255, 115, 209, 0.95), inset 0 0 10px rgba(255, 255, 255, 0.18); }

body#game-screen #pause-btn,
body#game-screen #music-btn {
  width: 64px;
  height: 64px;
  padding: 6px;
  gap: 4px;
  text-align: center;
  line-height: 1.05;
  white-space: normal;
}

body#game-screen #pause-btn {
  flex-direction: column;
}

body#game-screen #pause-btn .hud-icon {
  display: block;
}

/* =============================================================
   Dashboard: scanner (60%) + command deck (40%)
   ============================================================= */
#dashboard {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 60fr 40fr;
  height: 100%;
  overflow: hidden;
}

/* =============================================================
   TACTICAL SCANNER
   ============================================================= */
#scanner {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 100%, #1a0a3a 0%, #0a0625 45%, #02020a 100%);
  border-bottom: 3px solid #00dcff;
  box-shadow: 0 6px 20px rgba(0, 220, 255, 0.35);
}

/* Scanner corner brackets */
.scanner-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid #00dcff;
  z-index: 8;
  filter: drop-shadow(0 0 6px #00dcff);
  pointer-events: none;
}
.scanner-corner.tl { top: 10px;    left: 10px;    border-right: none; border-bottom: none; }
.scanner-corner.tr { top: 10px;    right: 10px;   border-left: none;  border-bottom: none; }
.scanner-corner.bl { bottom: 10px; left: 10px;    border-right: none; border-top: none; }
.scanner-corner.br { bottom: 10px; right: 10px;   border-left: none;  border-top: none; }

.scanner-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: #00ffd0;
  text-shadow: 0 0 6px rgba(0, 255, 200, 0.8);
  z-index: 8;
  pointer-events: none;
  animation: label-blink 2.4s ease-in-out infinite;
}

@keyframes label-blink {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 0.55; }
}

/* Sweeping radar line */
.scanner-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(0, 220, 255, 0) 0%,
    rgba(0, 220, 255, 0) 48%,
    rgba(0, 220, 255, 0.18) 50%,
    rgba(0, 220, 255, 0) 52%,
    rgba(0, 220, 255, 0) 100%);
  background-size: 100% 200%;
  animation: scanner-sweep 4s linear infinite;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes scanner-sweep {
  from { background-position: 0 -100%; }
  to   { background-position: 0 100%; }
}

/* =============================================================
   Background layer (parallax stars + debris) — inside scanner
   ============================================================= */
#background-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-star {
  position: absolute;
  top: -10%;
  width: var(--size, 2px);
  height: var(--size, 2px);
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px #ffffff, 0 0 14px rgba(255, 255, 255, 0.7);
  animation: bg-drift var(--dur, 10s) linear infinite,
             bg-twinkle 2.4s ease-in-out infinite;
  animation-delay: var(--delay, 0s), 0s;
  opacity: 0.95;
}

/* Warp-speed streaks */
.bg-streak {
  position: absolute;
  top: -10%;
  width: 2px;
  height: 36px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(180, 230, 255, 0.6) 50%,
    rgba(255, 255, 255, 1) 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(180, 230, 255, 0.85);
  animation: bg-drift var(--dur, 2.5s) linear infinite,
             streak-flicker 0.7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0.85;
}

.bg-debris {
  position: absolute;
  top: -10%;
  background: #6a6e80;
  box-shadow: 0 0 4px rgba(160, 165, 180, 0.4);
  opacity: 0.55;
  animation: bg-drift var(--dur, 30s) linear infinite,
             bg-spin 14s linear infinite;
  animation-delay: var(--delay, 0s), 0s;
}

.bg-debris.debris-a {
  width: 14px; height: 8px;
  background: #6e7286;
  clip-path: polygon(20% 0, 80% 10%, 100% 50%, 75% 100%, 15% 90%, 0 40%);
}
.bg-debris.debris-b {
  width: 10px; height: 10px;
  background: #5a5e72;
  clip-path: polygon(50% 0, 100% 35%, 85% 100%, 15% 95%, 0 40%);
}
.bg-debris.debris-c {
  width: 18px; height: 7px;
  background: #7c8094;
  clip-path: polygon(10% 0, 90% 15%, 100% 60%, 80% 100%, 20% 85%, 0 50%);
}

@keyframes bg-drift  {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--drift-x, 0px), 120vh, 0); }
}
@keyframes bg-twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.35; } }
@keyframes bg-spin   { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes streak-flicker {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; }
}

body#game-screen.paused .bg-star,
body#game-screen.paused .bg-streak,
body#game-screen.paused .bg-debris,
body#game-screen.paused .scanner-sweep,
body#game-screen.paused .data-meteor,
body#game-screen.paused .data-meteor *,
body#game-screen.paused .shield-circle,
body#game-screen.paused .target-aura,
body#game-screen.paused .target-ring,
body#game-screen.paused .crosshair,
body#game-screen.paused .lockon-bracket,
body#game-screen.paused .scanner-label,
body#game-screen.paused .lockon-label,
body#game-screen.paused .data-meteor .meteor-trail::before {
  animation-play-state: paused !important;
}

/* =============================================================
   Lock-on reticle
   ============================================================= */
#lock-on-zone {
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

#lock-on-zone.active { opacity: 1; }

#lock-on-zone.screen-locked {
  position: fixed;
}

#lock-on-zone.frozen .lockon-bracket,
#lock-on-zone.frozen .lockon-label {
  animation: none !important;
}

.lockon-bracket {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid #ffd86f;
  filter: drop-shadow(0 0 6px #ffd86f);
  animation: lockon-bracket-pulse 1.4s ease-in-out infinite;
}
.lockon-bracket.tl { top: 0;    left: 0;    border-right: none; border-bottom: none; }
.lockon-bracket.tr { top: 0;    right: 0;   border-left: none;  border-bottom: none; }
.lockon-bracket.bl { bottom: 0; left: 0;    border-right: none; border-top: none; }
.lockon-bracket.br { bottom: 0; right: 0;   border-left: none;  border-top: none; }

.lockon-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 4px;
  color: #ffd86f;
  text-shadow: 0 0 6px rgba(255, 200, 80, 0.85);
  white-space: nowrap;
  animation: lockon-label-pulse 1.4s ease-in-out infinite;
}

@keyframes lockon-bracket-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.04); }
}

@keyframes lockon-label-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}
.lockon-bracket.tl { transform-origin: top left; }
.lockon-bracket.tr { transform-origin: top right; }
.lockon-bracket.bl { transform-origin: bottom left; }
.lockon-bracket.br { transform-origin: bottom right; }
.lockon-label { transform-origin: center bottom; }

/* =============================================================
   Meteors + laser inside scanner
   ============================================================= */
#meteor-layer { position: absolute; inset: 0; z-index: 7; }

#laser-layer {
  position: absolute; inset: 0; z-index: 8;
  pointer-events: none; width: 100%; height: 100%;
}

.laser-beam {
  stroke: #ff3df0; stroke-width: 2.5; stroke-linecap: round;
  filter: drop-shadow(0 0 6px #ff3df0) drop-shadow(0 0 14px #ff3df0);
  /* 90s-arcade flicker — fast opacity stutter while the beam is live. */
  animation: laser-flicker 70ms steps(2, jump-none) infinite;
}
.laser-glow {
  stroke: #ffffff; stroke-width: 6; stroke-linecap: round;
  opacity: 0.55; filter: blur(3px);
  animation: laser-flicker-glow 90ms steps(2, jump-none) infinite;
}
/* When the fade class is added we want a clean dissolve, not a flicker. */
.laser-fade { animation: none !important; transition: opacity 0.25s ease; opacity: 0; }

@keyframes laser-flicker {
  0%   { opacity: 1; }
  35%  { opacity: 0.55; }
  60%  { opacity: 1; }
  80%  { opacity: 0.7; }
  100% { opacity: 1; }
}
@keyframes laser-flicker-glow {
  0%   { opacity: 0.55; }
  50%  { opacity: 0.25; }
  100% { opacity: 0.65; }
}

/* Data Packet (Target) — visual only, no embedded text */
.data-meteor {
  position: absolute;
  width: 112px;
  height: 112px;
  margin-left: -56px;
  margin-top: -56px;
  pointer-events: auto;
  cursor: crosshair;
  animation: comet-pulse 1.6s ease-in-out infinite;
  transform: scale(var(--comet-scale, 1));
}

/* Trail wrapper rotates to face the comet's entry direction (set inline by
   spawnMeteor). Origin at bottom-center so it pivots around the meteor. */
.meteor-trail {
  position: absolute;
  bottom: 48%;
  left: 50%;
  width: 36px;
  height: 150px;
  margin-left: -18px;     /* center horizontally without using transform */
  transform-origin: 50% 100%;
  transform: rotate(0deg); /* JS overrides per-meteor */
  pointer-events: none;
  z-index: 0;
}
.meteor-trail::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(170, 240, 255, 0) 0%,
    rgba(130, 225, 255, 0.38) 40%,
    rgba(76, 196, 255, 0.92) 100%);
  border-radius: 50% 50% 50% 50% / 80% 80% 20% 20%;
  filter: blur(4px);
  opacity: 0.85;
  animation: trail-flicker 0.4s ease-in-out infinite alternate;
}
.data-meteor.locked .meteor-trail { opacity: 1; transition: opacity 0.2s ease; }

@keyframes trail-flicker {
  from { opacity: 0.55; transform: scaleY(1); }
  to   { opacity: 1;    transform: scaleY(1.15); }
}

.target-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(196, 246, 255, 0.78) 0%,
    rgba(125, 220, 255, 0.36) 34%,
    rgba(30, 86, 130, 0.2) 62%,
    rgba(30, 86, 130, 0) 74%);
  filter: blur(1px);
  animation: aura-pulse 1.4s ease-in-out infinite;
  z-index: 1;
}

@keyframes aura-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
  50%      { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.target-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border-radius: 58% 42% 62% 38% / 46% 60% 40% 54%;
  background: radial-gradient(circle at 35% 35%,
    #ffffff 0%,
    #c9f4ff 23%,
    #62d5ff 54%,
    #1d78bc 84%,
    #0a2c4d 100%);
  box-shadow:
    0 0 16px rgba(151, 232, 255, 0.95),
    0 0 34px rgba(70, 170, 255, 0.62),
    inset 0 0 18px rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.target-icon::before {
  content: '';
  position: absolute;
  top: 16%;
  left: 22%;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(215,245,255,0.15) 100%);
  filter: blur(0.6px);
}

.target-icon::after {
  content: '';
  position: absolute;
  bottom: 6%;
  right: 8%;
  width: 40%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(8,33,58,0.55) 0%, rgba(8,33,58,0) 100%);
}

.target-ring {
  display: none;
}

.target-cross {
  display: none;
}

.target-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  background: #f5fdff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px #ffffff, 0 0 22px #85deff;
  animation: dot-blink 0.6s ease-in-out infinite;
}

@keyframes ring-spin  { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes ring-pulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.15); } }
@keyframes dot-blink  { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

@keyframes comet-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.18); }
}

/* Crosshair frame */
.crosshair {
  display: none;
}

.ch-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #ffd86f;
  filter: drop-shadow(0 0 6px #ffd86f);
}
.ch-tl { top: 0;    left: 0;    border-right: none; border-bottom: none; }
.ch-tr { top: 0;    right: 0;   border-left: none;  border-bottom: none; }
.ch-bl { bottom: 0; left: 0;    border-right: none; border-top: none; }
.ch-br { bottom: 0; right: 0;   border-left: none;  border-top: none; }

.ch-tick {
  position: absolute;
  background: #ffd86f;
  box-shadow: 0 0 6px #ffd86f;
}
.ch-top    { top: -4px;    left: 50%; width: 2px; height: 10px; transform: translateX(-50%); }
.ch-bottom { bottom: -4px; left: 50%; width: 2px; height: 10px; transform: translateX(-50%); }
.ch-left   { left: -4px;   top: 50%;  width: 10px; height: 2px; transform: translateY(-50%); }
.ch-right  { right: -4px;  top: 50%;  width: 10px; height: 2px; transform: translateY(-50%); }

@keyframes crosshair-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

.data-meteor.locked {
  animation: none !important;
  transform: scale(var(--comet-scale, 1));
}

.data-meteor.screen-locked {
  position: fixed !important;
  margin-left: 0 !important;
  margin-top: 0 !important;
  transform: translate(-50%, -50%) scale(var(--comet-scale, 1)) !important;
}

.data-meteor.locked * {
  animation-play-state: paused !important;
}

.data-meteor.locked .target-aura {
  background: radial-gradient(circle,
    rgba(255, 211, 120, 0.72) 0%,
    rgba(255, 151, 50, 0.35) 34%,
    rgba(191, 74, 16, 0.16) 64%,
    rgba(191, 74, 16, 0) 76%);
}

.data-meteor.locked .target-icon {
  box-shadow:
    0 0 18px rgba(255, 196, 112, 0.95),
    0 0 34px rgba(255, 132, 36, 0.65),
    inset 0 0 18px rgba(255, 235, 184, 0.24);
}

.data-meteor.scanning .target-icon {
  animation: scan-spin 0.8s linear infinite;
}

@keyframes scan-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.data-meteor.exploded { animation: explode 0.7s ease-out forwards; }
@keyframes explode {
  0%   { transform: scale(calc(var(--comet-scale, 1) * 1)); opacity: 1; }
  35%  { transform: scale(calc(var(--comet-scale, 1) * 1.85)); filter: brightness(2.8) hue-rotate(-22deg); }
  100% { transform: scale(calc(var(--comet-scale, 1) * 2.25)); opacity: 0; }
}

/* =============================================================
   Planetary base (inside scanner)
   ============================================================= */
#planetary-base {
  position: absolute;
  bottom: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 480px;
  z-index: 5;
  pointer-events: none;
}

.shield-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.shield-circle {
  filter: drop-shadow(0 0 8px currentColor);
  animation: shield-pulse 3s ease-in-out infinite;
}

@keyframes shield-pulse {
  0%, 100% { stroke-opacity: 0.95; }
  50%      { stroke-opacity: 0.55; }
}

.shield-glow { opacity: 0.6; }

.shield-seg.shattering .shield-circle {
  animation: shield-break 1s ease-out forwards;
}
.shield-seg.destroyed { display: none; }

@keyframes shield-break {
  0%   { stroke: currentColor; filter: drop-shadow(0 0 8px currentColor); transform: scale(1); transform-origin: 200px 200px; opacity: 1; }
  10%  { stroke: #ff2d4f; filter: drop-shadow(0 0 28px #ff2d4f); transform: scale(1.1); transform-origin: 200px 200px; opacity: 1; }
  30%  { stroke: #ff2d4f; filter: drop-shadow(0 0 20px #ff2d4f); transform: scale(1.06); transform-origin: 200px 200px; opacity: 0.9; }
  50%  { stroke: #ff2d4f; filter: drop-shadow(0 0 14px #ff2d4f); transform: scale(1.08); transform-origin: 200px 200px; opacity: 0.6; }
  75%  { stroke: #ff2d4f; opacity: 0.3; transform: scale(1.12); transform-origin: 200px 200px; }
  100% { stroke: #ff2d4f; opacity: 0; transform: scale(1.15); transform-origin: 200px 200px; }
}

.dome-wrap {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 760px;     /* widened so the base spans more of the scanner */
  height: 300px;
}

/* Base structure — rendered from PNG asset, no procedural drawing.
   Element is kept (no border/background) so .dome.shield-shatter and
   .dome-wrap.pulse JS hooks can still flash a glow around it on impact.
   PNG itself depicts cannons aimed UPWARD at the sky, so no transform flip
   is needed — base sits naturally with the platform at the bottom. */
.dome {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 760px;
  height: 300px;
  background: url('/Assets/base_structure.png') no-repeat center bottom;
  background-size: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.dome.shield-shatter {
  animation: shield-shatter 1.1s ease-out forwards;
}

/* PNG-friendly shatter: red drop-shadow flash + a brief shake/jitter on the
   base, with strobing opacity so the shield reads as cracking apart. */
@keyframes shield-shatter {
  0% {
    filter: drop-shadow(0 0 0 rgba(255, 40, 70, 0));
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
  8% {
    filter: drop-shadow(0 0 22px #ff2244) drop-shadow(0 0 38px #ff2244);
    transform: translateX(-50%) translate(-6px, 4px) scale(1.04);
    opacity: 1;
  }
  18% {
    filter: drop-shadow(0 0 18px #ff2244) drop-shadow(0 0 34px #ff2244);
    transform: translateX(-50%) translate(7px, -3px) scale(1.05);
    opacity: 0.45;
  }
  28% {
    filter: drop-shadow(0 0 22px #ff2244);
    transform: translateX(-50%) translate(-5px, 3px) scale(1.03);
    opacity: 1;
  }
  42% {
    filter: drop-shadow(0 0 14px #ff5577);
    transform: translateX(-50%) translate(4px, -2px) scale(1.02);
    opacity: 0.55;
  }
  60% {
    filter: drop-shadow(0 0 10px #ff5577);
    transform: translateX(-50%) translate(-2px, 1px) scale(1.01);
    opacity: 1;
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 40, 70, 0));
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

/* Energy shield arc that briefly appears + fragments on hit. Sits over the
   base, anchored to .dome-wrap, sized just larger than the dome so it reads
   as a deflector dome shielding the turrets. */
.shield-arc {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 92%;
  height: 80%;
  border: 3px solid rgba(0, 255, 200, 0.0);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow:
    0 0 0 rgba(0, 255, 200, 0),
    inset 0 0 0 rgba(0, 255, 200, 0);
  pointer-events: none;
  opacity: 0;
}
.dome-wrap.shield-hit .shield-arc {
  animation: shield-arc-shatter 1.1s ease-out forwards;
}

@keyframes shield-arc-shatter {
  0%   { opacity: 0;    border-color: rgba(0, 255, 200, 0);
         box-shadow: 0 0 0 rgba(0, 255, 200, 0), inset 0 0 0 rgba(0, 255, 200, 0); }
  6%   { opacity: 0.95; border-color: #ff3355;
         box-shadow: 0 0 26px rgba(255, 50, 80, 0.85), inset 0 0 30px rgba(255, 50, 80, 0.55);
         clip-path: polygon(
           0% 100%, 0% 30%, 6% 8%, 14% 32%, 22% 6%, 32% 28%, 42% 4%, 50% 24%,
           58% 4%, 68% 28%, 78% 6%, 86% 32%, 94% 8%, 100% 30%, 100% 100%
         ); }
  22%  { opacity: 0.4;  border-color: #ff3355;
         box-shadow: 0 0 18px rgba(255, 50, 80, 0.65), inset 0 0 22px rgba(255, 50, 80, 0.35); }
  38%  { opacity: 0.85; border-color: #ff5577; }
  60%  { opacity: 0.3;  border-color: #ff5577; }
  100% { opacity: 0;    border-color: rgba(0, 255, 200, 0);
         box-shadow: 0 0 0 rgba(0, 255, 200, 0), inset 0 0 0 rgba(0, 255, 200, 0); }
}

.dome-wrap.pulse .dome { animation: dome-pulse 0.6s ease-out; }

@keyframes dome-pulse {
  0%   { filter: drop-shadow(0 0 4px rgba(0, 255, 100, 0.4)); transform: translateX(-50%) scale(1); }
  40%  { filter: drop-shadow(0 0 18px #00ffd0) drop-shadow(0 0 28px #00ffd0); transform: translateX(-50%) scale(1.04); }
  100% { filter: drop-shadow(0 0 4px rgba(0, 255, 100, 0.4)); transform: translateX(-50%) scale(1); }
}

/* .cannon is permanently hidden — the visible turret barrels live in the
   base PNG. The element is kept (with [hidden]) so legacy JS hooks like
   hideDefenderPlayer() still find a node without crashing. */
.cannon { display: none !important; }

/* =============================================================
   COMMAND DECK
   ============================================================= */
#command-deck {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 10px;
  padding: 14px 28px 18px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 220, 255, 0.04) 0px,
      rgba(0, 220, 255, 0.04) 2px,
      transparent 2px,
      transparent 6px
    ),
    linear-gradient(180deg, #0a1428 0%, #060914 100%);
  border-top: 3px solid #00dcff;
  box-shadow: inset 0 4px 18px rgba(0, 220, 255, 0.18);
}

.deck-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: #ffd86f;
  text-shadow: 0 0 6px rgba(255, 200, 80, 0.7);
}

.deck-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00ff66;
  box-shadow: 0 0 8px #00ff66;
  animation: light-blink 1.4s ease-in-out infinite;
}

#scenario-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(10, 30, 60, 0.85) 0%, rgba(5, 15, 35, 0.85) 100%);
  border: 2px solid #00dcff;
  border-radius: 4px;
  padding: 14px 22px;
  box-shadow:
    0 0 16px rgba(0, 220, 255, 0.3),
    inset 0 0 14px rgba(0, 220, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
}

#scenario-panel::before, #scenario-panel::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #ffd86f;
}
#scenario-panel::before { top: -6px; left: -6px;  border-right: none; border-bottom: none; }
#scenario-panel::after  { top: -6px; right: -6px; border-left: none;  border-bottom: none; }

#scenario-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#scenario-meta {
  font-size: 0.7rem;
  letter-spacing: 3px;
  color: #ffd86f;
  text-shadow: 0 0 4px rgba(255, 200, 80, 0.7);
}

#scenario-timer {
  min-width: 52px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 2px;
  color: #ffcf66;
  text-shadow: 0 0 6px rgba(255, 180, 60, 0.7);
}

#scenario-text {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.4;
  font-weight: bold;
  letter-spacing: 0.3px;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(180, 230, 255, 0.55);
}

#scenario-text.flash-update {
  animation: scenario-flash 0.5s ease-out;
}

@keyframes scenario-flash {
  0%   { color: #00ffd0; text-shadow: 0 0 16px #00ffd0; transform: translateX(-4px); }
  100% { color: #ffffff; text-shadow: 0 0 6px rgba(180, 230, 255, 0.55); transform: translateX(0); }
}

/* Cockpit buttons -------------------------------------------- */
body#game-screen #action-buttons {
  display: flex;
  justify-content: center;
  gap: 24px;
}

body#game-screen #action-buttons button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  min-width: 200px;
  margin: 0;
  padding: 14px 28px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.05rem;
  letter-spacing: 4px;
  font-weight: bold;
  color: var(--btn-color, #6fe9ff);
  background: linear-gradient(180deg, rgba(10, 30, 60, 0.95) 0%, rgba(5, 15, 35, 0.95) 100%);
  border: 2px solid var(--btn-color, #6fe9ff);
  border-radius: 6px;
  text-shadow: 0 0 8px var(--btn-color, #6fe9ff);
  box-shadow:
    0 0 12px rgba(0, 220, 255, 0.25),
    inset 0 0 12px rgba(0, 220, 255, 0.15);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body#game-screen #action-buttons button::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--btn-color, #6fe9ff);
  opacity: 0.35;
  border-radius: 4px;
  pointer-events: none;
}

body#game-screen #action-buttons button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(20, 60, 100, 0.95) 0%, rgba(10, 30, 60, 0.95) 100%);
  box-shadow:
    0 0 18px var(--btn-color, #6fe9ff),
    inset 0 0 18px rgba(255, 255, 255, 0.15);
}

body#game-screen #action-buttons button:active { transform: translateY(1px); }

body#game-screen .btn-glyph { font-size: 1.1rem; opacity: 0.9; }
body#game-screen .btn-safe      { --btn-color: #6fffb3; }
body#game-screen .btn-pii       { --btn-color: #ff6680; }
body#game-screen .btn-sensitive { --btn-color: #ffd86f; }

body#game-screen .btn-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  font-size: 0.75rem;
  font-weight: bold;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  color: #fff;
  flex-shrink: 0;
}

body#game-screen.paused #action-buttons button {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.5);
}

#feedback-zone {
  text-align: center;
  min-height: 22px;
}

#feedback-text {
  margin: 0;
  padding: 6px 14px;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  color: #e8f4ff;
  background: rgba(0, 8, 20, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 200, 255, 0.25);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(100, 200, 255, 0.12);
  border-radius: 3px;
  display: inline-block;
}

#feedback-text.success {
  color: #6fffb3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(70, 255, 160, 0.55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(70, 255, 160, 0.2);
}
#feedback-text.error {
  color: #ff8899;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 60, 100, 0.55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 60, 100, 0.2);
}
#feedback-text.info {
  color: #9ad8ff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

#feedback-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 18px 24px;
  background: rgba(0, 8, 20, 0.94);
  border: 1px solid rgba(0, 220, 255, 0.25);
  animation: panelFadeIn 0.3s ease-out;
}
#feedback-panel.hidden { display: none; }

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#feedback-verdict {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.3rem;
  letter-spacing: 3px;
  font-weight: bold;
  margin-bottom: 12px;
  text-align: center;
}
#feedback-verdict.correct {
  color: #6fffb3;
  text-shadow: 0 0 12px rgba(70, 255, 160, 0.6);
}
#feedback-verdict.wrong {
  color: #ff6680;
  text-shadow: 0 0 12px rgba(255, 60, 100, 0.6);
}

#feedback-rationale {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  line-height: 1.55;
  color: #d0e8ff;
  text-align: center;
  max-width: 640px;
  margin: 0 0 18px 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#feedback-continue-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 2px;
  color: #0a0e1a;
  background: #00dcff;
  border: none;
  padding: 10px 32px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: background 0.2s, transform 0.15s;
}
#feedback-continue-btn:hover {
  background: #5cf2ff;
  transform: scale(1.04);
}

/* Sector complete banner — Data Defender */
body#game-screen #sector-announce {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 90;
  font-family: 'Share Tech Mono', monospace;
  font-size: 2rem;
  letter-spacing: 10px;
  font-weight: bold;
  color: #ffd86f;
  text-shadow: 0 0 16px rgba(255, 200, 80, 0.9), 0 0 30px rgba(255, 200, 80, 0.5);
  background: rgba(0, 8, 20, 0.88);
  padding: 14px 36px;
  border: 2px solid #ffd86f;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 0 40px rgba(255, 200, 80, 0.3), 0 8px 32px rgba(0, 0, 0, 0.8);
  animation: sector-pop 2.6s ease-out forwards;
}
body#game-screen #sector-announce.hidden { display: none; }
@keyframes sector-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  75%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Sector line in center HUD */
#sector-line {
  font-size: 0.78rem;
  letter-spacing: 2px;
  color: #ffd86f;
  opacity: 0.85;
  margin-top: 4px;
}

#correct-line {
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: #6ff;
  opacity: 0.85;
  margin-top: 2px;
}

#correct-line #correct-value {
  color: #fff;
  margin-left: 4px;
}

/* Red impact flash ------------------------------------------ */
.red-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 40, 60, 0.55) 0%, rgba(255, 0, 30, 0) 70%);
  z-index: 50;
  pointer-events: none;
  animation: red-flash-fade 0.4s ease-out forwards;
}

@keyframes red-flash-fade {
  0%   { opacity: 0.95; }
  100% { opacity: 0; }
}

/* =============================================================
   Overlays (pause, game over, win)
   ============================================================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 2, 12, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlay-fade 0.3s ease-out;
}

.overlay.hidden { display: none; }

@keyframes overlay-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.overlay-panel {
  background: linear-gradient(180deg, rgba(30, 10, 60, 0.95) 0%, rgba(10, 5, 30, 0.95) 100%);
  border: 3px solid #00dcff;
  border-radius: 6px;
  padding: 36px 50px;
  min-width: 380px;
  text-align: center;
  box-shadow:
    0 0 40px rgba(0, 220, 255, 0.6),
    inset 0 0 24px rgba(0, 220, 255, 0.15);
  position: relative;
}

/* ---------- Simplified arcade victory panel ---------- */
.overlay-panel.arcade-victory {
  padding: 44px 56px;
  min-width: 420px;
}
.overlay-title.arcade-mc {
  font-size: 3rem;
  letter-spacing: 10px;
  color: #fff;
  text-shadow:
    0 0 12px #00ffc8,
    0 0 28px #00dcff,
    0 0 56px rgba(0, 220, 255, 0.7),
    0 3px 0 #003040;
  margin: 0 0 28px;
}
.arcade-score-block,
.arcade-rank-block {
  margin: 18px 0;
}
.arcade-score-label,
.arcade-rank-label {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.7rem;
  letter-spacing: 5px;
  color: #00ffc8;
  opacity: 0.75;
  margin-bottom: 4px;
}
.arcade-score-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 3.4rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: #ffd86f;
  text-shadow:
    0 0 14px rgba(255, 200, 80, 0.95),
    0 0 36px rgba(255, 200, 80, 0.55);
}
.arcade-rank-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: #ff66ff;
  text-shadow:
    0 0 14px rgba(255, 102, 255, 0.95),
    0 0 36px rgba(255, 102, 255, 0.55);
  margin-top: 6px;
}
.arcade-victory .calibration-row { margin: 22px 0 8px; }

.overlay-panel::before, .overlay-panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid #ffd86f;
}
.overlay-panel::before { top: -10px; left: -10px; border-right: none; border-bottom: none; }
.overlay-panel::after  { bottom: -10px; right: -10px; border-left: none; border-top: none; }

.overlay-panel.danger { border-color: #ff3d6e; box-shadow: 0 0 40px rgba(255, 60, 110, 0.7), inset 0 0 24px rgba(255, 60, 110, 0.15); }
.overlay-panel.danger::before, .overlay-panel.danger::after { border-color: #ffd86f; }

.overlay-title {
  font-size: 2.6rem;
  letter-spacing: 12px;
  margin: 0 0 8px;
  color: #6fe9ff;
  text-shadow: 0 0 16px rgba(0, 220, 255, 0.8), 0 3px 0 #003040;
  animation: title-glow 1.6s ease-in-out infinite alternate;
}

.danger-title {
  color: #ff6680;
  text-shadow: 0 0 16px rgba(255, 60, 100, 0.85), 0 3px 0 #4a0010;
}

@keyframes title-glow {
  from { filter: brightness(1); }
  to   { filter: brightness(1.3); }
}

.overlay-sub {
  letter-spacing: 4px;
  color: #ffd86f;
  font-size: 0.85rem;
  margin: 0 0 24px;
  text-shadow: 0 0 6px rgba(255, 200, 80, 0.7);
}

.score-readout {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 220, 255, 0.4);
  padding: 16px 20px;
  margin: 0 0 24px;
  border-radius: 4px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: #9ad8ff;
  padding: 4px 0;
}

.score-row span:last-child { color: #fff; font-weight: bold; }

.score-row.total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 200, 80, 0.5);
  font-size: 1rem;
  color: #ffd86f;
  letter-spacing: 4px;
}
.score-row.total span:last-child { color: #ffd86f; text-shadow: 0 0 8px rgba(255, 200, 80, 0.8); font-size: 1.2rem; }

.score-divider {
  height: 1px;
  background: rgba(0, 255, 200, 0.25);
  margin: 14px 0 8px;
}
.score-section-head {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: #00ffc8;
  opacity: 0.75;
  margin: 0 0 6px;
  text-align: left;
}
.score-row.accent { color: #00ffc8; }
.score-row.accent span:last-child { color: #00ffc8; text-shadow: 0 0 8px rgba(0, 255, 200, 0.8); }

.overlay-btn {
  display: inline-block;
  padding: 14px 32px;
  margin: 6px 8px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  letter-spacing: 4px;
  font-weight: bold;
  color: #02020a;
  background: linear-gradient(180deg, #6fe9ff 0%, #00b4ff 100%);
  border: 2px solid #00dcff;
  border-radius: 4px;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 220, 255, 0.7);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.overlay-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 220, 255, 1);
}

.overlay-btn.secondary {
  background: transparent;
  color: #ffd86f;
  border-color: #ffd86f;
  text-shadow: 0 0 6px rgba(255, 200, 80, 0.7);
  box-shadow: 0 0 10px rgba(255, 200, 80, 0.35);
}
.overlay-btn.secondary:hover { box-shadow: 0 0 18px rgba(255, 200, 80, 0.85); }
#briefing-box {
  text-align: left;
  margin: 20px;
}

.objective-box, .instruction-box {
  border: 1px solid #336633;
  background: rgba(0, 255, 65, 0.05);
  padding: 15px;
  margin-bottom: 20px;
}

.objective-box h4, .instruction-box h4 {
  margin-top: 0;
  color: var(--arcade-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#briefing-box p {
  margin: 5px 0;
  line-height: 1.4;
}
/* Make text readable against neon backgrounds */
.briefing-box, .instruction-box {
    background: rgba(0, 0, 0, 0.85); /* Solid black-ish background */
  border: 2px solid var(--arcade-cyan);      /* Neon frame */
    color: #FFFFFF;                  /* Pure white text is easier to read than green */
    padding: 20px;
}

h4 { color: var(--arcade-cyan); }               /* Keep titles neon, but bodies white */

/* =============================================================
   Sector Failed overlay extras (Defender)
   ============================================================= */
.overlay-title.danger-title {
    color: #ff3d6e;
    text-shadow: 0 0 14px rgba(255, 60, 110, 0.95), 0 0 28px rgba(255, 60, 110, 0.6);
}
.overlay-detail {
    color: #ffd86f;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    text-align: center;
    margin: 4px 0 18px;
    opacity: 0.95;
}

/* =============================================================
   Calibration row + button (shared neon look)
   ============================================================= */
.calibration-row {
    margin: 18px 0 6px;
    padding: 14px;
    border: 1px dashed rgba(255, 0, 200, 0.5);
    border-radius: 4px;
    background: rgba(60, 0, 60, 0.18);
    text-align: center;
}
.calibration-sub {
    margin: 0 0 10px;
    color: #ff80ff;
    letter-spacing: 2px;
    font-size: 0.8rem;
    text-shadow: 0 0 6px rgba(255, 100, 255, 0.7);
}
.calibration-hint {
    margin: 8px 0 0;
    color: #b890c8;
    letter-spacing: 1px;
    font-size: 0.7rem;
    opacity: 0.8;
}
.calibration-btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 0.78rem;
    letter-spacing: 2px;
    color: #ff66ff;
    background: linear-gradient(180deg, rgba(50, 0, 50, 0.95) 0%, rgba(20, 0, 30, 0.95) 100%);
    border: 2px solid #ff66ff;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 8px rgba(255, 100, 255, 0.9);
    box-shadow: 0 0 16px rgba(255, 0, 200, 0.55);
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.calibration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(255, 0, 200, 0.95);
}

/* Mastery readout */
.mastery-row .score-row.token-row span:last-child {
    color: #80ffd8;
    font-size: 0.7rem;
    text-shadow: 0 0 6px rgba(0, 255, 200, 0.6);
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

/* L1 Reaction Tracker */
.l1-tracker {
    margin: 20px 0;
    text-align: center;
}
.l1-tracker p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #ffffff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}
.thumbs-btn {
    background: transparent;
    border: 2px solid var(--arcade-cyan);
    color: var(--arcade-cyan);
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}
.thumbs-btn:hover {
    background: var(--arcade-cyan);
    color: #0B0E14;
}
.thumbs-btn.is-selected,
.thumbs-btn.is-selected:hover {
  background: var(--arcade-pink);
  border-color: var(--arcade-pink);
  color: #0B0E14;
  box-shadow: 0 0 14px rgba(255, 115, 209, 0.55);
}


.overlay-panel.arcade-victory > :not(.victory-ring):not(.celebration-burst):not(.celebration-fireworks) {
  position: relative;
  z-index: 3;
}

.victory-ring,
.celebration-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.celebration-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.victory-ring::before,
.victory-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 43%;
  width: min(56vw, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  border: 2px solid rgba(94, 215, 255, 0.55);
  box-shadow: 0 0 26px rgba(94, 215, 255, 0.35), inset 0 0 24px rgba(255, 115, 209, 0.18);
  opacity: 0;
  animation: victory-pulse 2.8s ease-out 0.15s 2;
}

.victory-ring::after {
  border-color: rgba(255, 115, 209, 0.52);
  width: min(62vw, 420px);
  animation-delay: 0.6s;
}

.celebration-chip {
  position: absolute;
  top: -14%;
  width: 8px;
  height: 16px;
  border-radius: 2px;
  opacity: 0;
  filter: drop-shadow(0 0 9px currentColor);
  animation: confetti-fall linear forwards;
}

.celebration-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
}

.firework-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, currentColor 0%, rgba(255, 255, 255, 0.95) 40%, rgba(255, 255, 255, 0) 100%);
  transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) translateX(0px) scaleX(0.7);
  opacity: 0;
  filter: drop-shadow(0 0 10px currentColor);
  animation: firework-pop 0.95s cubic-bezier(.25,.8,.2,1) forwards;
}

.arcade-score-value.score-counting {
  animation: score-pulse 0.22s linear infinite;
}

.arcade-score-value.glitch-pop,
.arcade-rank-value.glitch-pop {
  animation: glitch-flicker 0.35s steps(2, end) 2;
}

.arcade-rank-value.rank-pop {
  animation: rank-pop 0.4s ease-out;
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(var(--x, 0), -8%, 0) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  100% {
    transform: translate3d(calc(var(--x, 0) + var(--drift, 0px)), 125%, 0) rotate(var(--spin, 360deg)) scale(1);
    opacity: 0;
  }
}

@keyframes victory-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.65);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 0;
  }
}

@keyframes firework-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) translateX(0px) scaleX(0.4);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) translateX(var(--distance, 95px)) scaleX(1);
  }
}

@keyframes score-pulse {
  0%, 100% { text-shadow: 0 0 14px rgba(255, 214, 122, 0.95), 0 0 36px rgba(255, 214, 122, 0.5); }
  50% { text-shadow: 0 0 18px rgba(94, 215, 255, 0.9), 0 0 38px rgba(255, 115, 209, 0.55); }
}

@keyframes rank-pop {
  0% { transform: scale(0.78); opacity: 0; }
  70% { transform: scale(1.07); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes glitch-flicker {
  0% { filter: hue-rotate(0deg) saturate(1); transform: translateX(0); }
  25% { filter: hue-rotate(20deg) saturate(1.6); transform: translateX(-2px); }
  50% { filter: hue-rotate(-18deg) saturate(1.7); transform: translateX(2px); }
  100% { filter: hue-rotate(0deg) saturate(1); transform: translateX(0); }
}
