/* ===================================================
   AIM TRAINER — Peek-From-Cover Edition
   Valorant-style / Pragmata HUD
   Mobile-First CSS
   =================================================== */

/* ── LAYOUT ── */
.at-main {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 53px);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.at-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.at-hidden { display: none !important; }

/* Back button in navbar */
.at-back-btn {
  flex: unset !important;
  padding: 0.38rem 0.85rem !important;
  font-size: 0.68rem !important;
  border-radius: var(--radius-sm) !important;
  font-family: "Space Mono", monospace !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
}

/* ══════════════════════════════════════════════
   LOBBY SCREEN
   ══════════════════════════════════════════════ */
.at-lobby-content {
  text-align: center;
  padding: 2rem 1.25rem 3rem;
  max-width: 480px;
  width: 100%;
}

.at-logo-mark {
  font-size: 3.5rem;
  color: rgba(255, 70, 85, 0.9);
  text-shadow: 0 0 40px rgba(255, 70, 85, 0.5), 0 0 80px rgba(255, 70, 85, 0.2);
  margin-bottom: 0.5rem;
  animation: at-target-pulse 2.5s ease-in-out infinite;
  display: block;
  line-height: 1;
}

@keyframes at-target-pulse {
  0%, 100% { text-shadow: 0 0 30px rgba(255, 70, 85, 0.4), 0 0 60px rgba(255, 70, 85, 0.15); }
  50%       { text-shadow: 0 0 55px rgba(255, 70, 85, 0.85), 0 0 100px rgba(255, 70, 85, 0.3); }
}

/* Re-use cyan pulse for HUD elements */
@keyframes at-pulse {
  0%, 100% { text-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 0 0 60px rgba(0, 212, 255, 0.15); }
  50%       { text-shadow: 0 0 50px rgba(0, 212, 255, 0.9), 0 0 100px rgba(0, 212, 255, 0.35); }
}

.at-lobby-title {
  font-family: "Space Mono", monospace;
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  line-height: 1;
}

.at-lobby-title span {
  color: rgba(255, 70, 85, 0.9);
  text-shadow: 0 0 20px rgba(255, 70, 85, 0.5);
}

.at-lobby-sub {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 340px;
  margin-inline: auto;
}

/* ── LAST SESSION ── */
.at-last-session {
  background: rgba(255, 70, 85, 0.05);
  border: 1px solid rgba(255, 70, 85, 0.2);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  animation: fade-in 0.4s ease;
}

.at-last-label {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.at-last-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 70, 85, 0.9);
}

.at-last-unit {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  font-weight: 400;
}

.at-stat-sep { color: var(--border); font-size: 0.9rem; }

/* ── SETTINGS ── */
.at-settings {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.at-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.at-setting-label {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Segmented control */
.at-seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.at-seg-btn {
  flex: 1;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.at-seg-btn:last-child { border-right: none; }

.at-seg-btn:hover {
  background: rgba(255, 70, 85, 0.08);
  color: var(--text-bright);
}

.at-seg-btn.at-seg-active {
  background: rgba(255, 70, 85, 0.15);
  color: rgba(255, 70, 85, 0.95);
  box-shadow: inset 0 0 10px rgba(255, 70, 85, 0.1);
}

/* ── START BUTTON ── */
.at-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(255, 70, 85, 0.7);
  border-radius: var(--radius-md);
  color: rgba(255, 70, 85, 0.9);
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(255, 70, 85, 0.2);
}

.at-start-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 70, 85, 0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.at-start-btn:hover::before { opacity: 1; }

.at-start-btn:hover {
  background: rgba(255, 70, 85, 0.08);
  box-shadow: 0 0 24px rgba(255, 70, 85, 0.35), 0 0 8px rgba(255, 70, 85, 0.2) inset;
  transform: translateY(-1px);
}

.at-start-btn:active { transform: translateY(0); }
.at-start-icon { font-size: 0.9rem; }

/* ══════════════════════════════════════════════
   COUNTDOWN SCREEN
   ══════════════════════════════════════════════ */
.at-countdown-wrap { text-align: center; }

.at-countdown-num {
  font-family: "Space Mono", monospace;
  font-size: clamp(6rem, 25vw, 12rem);
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  text-shadow: 0 0 60px rgba(0, 212, 255, 0.7), 0 0 120px rgba(0, 212, 255, 0.3);
  animation: at-count-pop 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes at-count-pop {
  from { transform: scale(1.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.at-countdown-label {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 4px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* ══════════════════════════════════════════════
   GAME SCREEN — HUD BAR
   ══════════════════════════════════════════════ */
.at-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: rgba(6, 8, 16, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-dim);
  gap: 1rem;
}

.at-hud-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 42px;
}

.at-hud-val {
  font-family: "Space Mono", monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  transition: transform 0.1s ease;
}

.at-hud-val.at-bump {
  transform: scale(1.3);
  color: #fff;
}

.at-hud-label {
  font-family: "Space Mono", monospace;
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Timer ring */
.at-hud-timer {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-timer-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.at-timer-bg {
  fill: none;
  stroke: rgba(0, 212, 255, 0.1);
  stroke-width: 3;
}

.at-timer-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 150.8; /* 2π × 24 */
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.6));
  transition: stroke 0.5s ease;
}

.at-timer-fill.at-low {
  stroke: var(--red);
  filter: drop-shadow(0 0 6px rgba(255, 64, 96, 0.8));
}

.at-hud-time {
  font-family: "Space Mono", monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════
   GAME SCREEN — ARENA
   ══════════════════════════════════════════════ */
.at-arena {
  position: absolute;
  inset: 0;
  top: 53px; /* below HUD */
  cursor: crosshair;
  overflow: hidden;
  /* Floor */
  background:
    linear-gradient(to bottom,
      rgba(6, 8, 16, 0) 60%,
      rgba(0, 212, 255, 0.025) 100%
    );
}

/* ── WALLS ── */
.at-wall {
  position: absolute;
  z-index: 6; /* above peek slots and peekers */
  background: linear-gradient(
    180deg,
    var(--deep) 0%,
    var(--panel) 40%,
    var(--deep) 100%
  );
  border: 1px solid var(--border);
  border-radius: 3px;
  /* Floor shadow */
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.5),
    inset 1px 0 0 rgba(255, 255, 255, 0.04),
    inset -1px 0 0 rgba(0, 0, 0, 0.3);
}

/* Top cap — cyan glow line (like a HUD panel edge) */
.at-wall::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--cyan) 30%,
    var(--cyan) 70%,
    transparent 100%
  );
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
}

/* Bottom shadow line */
.at-wall::after {
  content: "";
  position: absolute;
  bottom: -3px; left: 10%; right: 10%;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  filter: blur(4px);
  border-radius: 50%;
}

/* ── PEEK SLOT (overflow:hidden container) ── */
/* The slot is placed flush against the wall's edge.
   The .at-peeker inside slides in/out via translateX.
   overflow:hidden clips the peeker when it's "behind" the wall. */
.at-peek-slot {
  position: absolute;
  overflow: hidden;
  z-index: 5; /* below wall (z:6), above arena bg */
  /* No background — purely a clip region */
}

/* ── PEEKER (the actual target circle) ── */
.at-peeker {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  cursor: crosshair;
  /* Valorant-style target: red rings + bullseye */
  background: radial-gradient(
    circle at 38% 35%,
    rgba(255, 120, 120, 0.25) 0%,
    rgba(255, 40, 55, 0.1) 60%,
    transparent 100%
  );
  border: 2px solid rgba(255, 70, 85, 0.9);
  box-shadow:
    0 0 14px rgba(255, 70, 85, 0.5),
    inset 0 0 10px rgba(255, 70, 85, 0.12);
  /* JS controls transition and transform */
}

/* Inner bullseye */
.at-peeker::before {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: rgba(255, 70, 85, 0.85);
  box-shadow: 0 0 8px rgba(255, 70, 85, 0.8);
}

/* Outer "ghost" ring (second ring) */
.at-peeker::after {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 70, 85, 0.45);
}

/* Peek-window shrink bar: thin border that shrinks clockwise
   to signal how long the target will stay */
.at-peek-timer-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 70, 85, 0.2);
  z-index: 1;
  animation: at-shrink-ring var(--peek-ms, 900ms) linear forwards;
  pointer-events: none;
}

@keyframes at-shrink-ring {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.6); }
}

/* ── HIT SPARK ── */
.at-hit-spark {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid var(--cyan);
  animation: at-hit-burst 0.4s ease forwards;
  pointer-events: none;
  z-index: 7;
}

@keyframes at-hit-burst {
  from { transform: scale(0.5); opacity: 1; border-color: var(--cyan); }
  50%  { border-color: #fff; }
  to   { transform: scale(2.2); opacity: 0; border-color: var(--cyan); }
}

/* ── HIT / MISS FLOAT INDICATORS ── */
.at-hit-indicator,
.at-miss-indicator {
  position: absolute;
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: at-float-up 0.6s ease forwards;
  z-index: 15;
  white-space: nowrap;
}

.at-hit-indicator  { color: var(--green); }
.at-miss-indicator { color: var(--red);   }

@keyframes at-float-up {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to   { opacity: 0; transform: translate(-50%, calc(-50% - 36px)); }
}

/* ── SCREEN FLASH ── */
.at-hit-flash,
.at-miss-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
}

.at-hit-flash.at-flash {
  background: radial-gradient(ellipse at center, rgba(0, 229, 160, 0.07) 0%, transparent 70%);
  animation: at-flash-anim 0.25s ease;
}

.at-miss-flash.at-flash {
  background: radial-gradient(ellipse at center, rgba(255, 64, 96, 0.07) 0%, transparent 70%);
  animation: at-flash-anim 0.25s ease;
}

@keyframes at-flash-anim {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── CROSSHAIR ── */
.at-crosshair {
  position: absolute;
  inset: 0;
  top: 53px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 18;
}

.at-cx-h, .at-cx-v {
  position: absolute;
  background: rgba(0, 212, 255, 0.75);
}

.at-cx-h {
  width: 18px;
  height: 1.5px;
}

.at-cx-v {
  width: 1.5px;
  height: 18px;
}

/* Create the gap in the crosshair via clip */
.at-cx-h:nth-child(1) { transform: translateX(-13px); }
.at-cx-h:nth-child(2) { transform: translateX(13px); }
.at-cx-v:nth-child(3) { transform: translateY(-13px); }
.at-cx-v:nth-child(4) { transform: translateY(13px); }

.at-cx-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.95);
}

/* ══════════════════════════════════════════════
   RESULTS SCREEN
   ══════════════════════════════════════════════ */
.at-results-content {
  text-align: center;
  padding: 2rem 1.25rem 3rem;
  max-width: 520px;
  width: 100%;
}

.at-result-icon {
  font-family: "Space Mono", monospace;
  font-size: 3rem;
  color: var(--cyan);
  text-shadow: 0 0 40px rgba(0, 212, 255, 0.7);
  margin-bottom: 0.75rem;
  animation: at-pulse 2.5s ease-in-out infinite;
  display: block;
  line-height: 1;
}

.at-results-title {
  font-family: "Space Mono", monospace;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.at-results-sub {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

.at-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.at-stat-card {
  background: var(--panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  position: relative;
  overflow: hidden;
}

.at-stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-top: 1.5px solid var(--cyan);
  border-left: 1.5px solid var(--cyan);
}

.at-stat-highlight {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.06);
  box-shadow: var(--glow-cyan-sm);
}

.at-stat-val {
  font-family: "Space Mono", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.at-stat-highlight .at-stat-val { font-size: 1.8rem; }

.at-stat-lbl {
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.at-acc-bar-wrap {
  position: relative;
  height: 28px;
  background: var(--abyss);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.at-acc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  border-radius: var(--radius-sm);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.at-acc-bar-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 2px;
}

.at-results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.at-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  background: var(--abyss);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  color: var(--text-mid);
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: var(--transition);
}

.at-back-link:hover {
  border-color: var(--text-mid);
  color: var(--text-bright);
  background: var(--surface);
}

/* ── RESPONSIVE ── */
@media (max-width: 400px) {
  .at-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .at-hud { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .at-hud-val { font-size: 1rem; }
  .at-hud-timer { width: 44px; height: 44px; }
  .at-hud-time { font-size: 0.85rem; }
}

@media (min-width: 600px) {
  .at-lobby-content,
  .at-results-content { padding: 3rem 2rem 4rem; }
}

/* ══════════════════════════════════════════════
   MODE SELECTOR CARDS
   ══════════════════════════════════════════════ */
.at-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.at-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.65rem;
  background: var(--abyss);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.at-mode-btn::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.25s ease;
}

.at-mode-btn:hover {
  background: var(--surface);
  border-color: var(--border);
}

.at-mode-icon {
  font-size: 1.6rem;
  font-family: "Space Mono", monospace;
  color: var(--text-dim);
  line-height: 1;
  transition: var(--transition);
}

.at-mode-name {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: var(--transition);
}

.at-mode-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.4;
  font-family: "Space Grotesk", sans-serif;
}

/* ── FREE RANGE active (cyan) ── */
#modeFree.at-mode-active {
  border-color: var(--cyan);
  background: var(--cyan-ghost);
  box-shadow: var(--glow-cyan-sm);
}

#modeFree.at-mode-active::after {
  background: var(--cyan);
}

#modeFree.at-mode-active .at-mode-icon,
#modeFree.at-mode-active .at-mode-name {
  color: var(--cyan);
}

/* ── PEEK MODE active (red) ── */
#modePeek.at-mode-active {
  border-color: rgba(255, 70, 85, 0.6);
  background: rgba(255, 70, 85, 0.06);
  box-shadow: 0 0 14px rgba(255, 70, 85, 0.18);
}

#modePeek.at-mode-active::after {
  background: rgba(255, 70, 85, 0.8);
}

#modePeek.at-mode-active .at-mode-icon,
#modePeek.at-mode-active .at-mode-name {
  color: rgba(255, 70, 85, 0.9);
}

/* ══════════════════════════════════════════════
   MODE BADGE (inside game HUD)
   ══════════════════════════════════════════════ */
.at-mode-badge {
  position: absolute;
  top: 58px; /* just below HUD */
  right: 1rem;
  font-family: "Space Mono", monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  z-index: 12;
  pointer-events: none;
}

.at-mode-badge.mode-free {
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.06);
}

.at-mode-badge.mode-peek {
  color: rgba(255, 70, 85, 0.9);
  border: 1px solid rgba(255, 70, 85, 0.3);
  background: rgba(255, 70, 85, 0.06);
}

/* ══════════════════════════════════════════════
   RESULTS MODE LABEL
   ══════════════════════════════════════════════ */
.at-results-mode {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

/* ══════════════════════════════════════════════
   FREE RANGE TARGET (pops up anywhere)
   ══════════════════════════════════════════════ */
.at-free-target {
  position: absolute;
  border-radius: 50%;
  cursor: crosshair;
  transform: scale(0);
  transform-origin: center center;
  animation: at-free-spawn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  background: radial-gradient(
    circle at 38% 35%,
    rgba(255, 120, 120, 0.3) 0%,
    rgba(255, 40, 55, 0.1) 60%,
    transparent 100%
  );
  border: 2px solid rgba(255, 70, 85, 0.9);
  box-shadow:
    0 0 14px rgba(255, 70, 85, 0.45),
    inset 0 0 10px rgba(255, 70, 85, 0.1);
}

/* Bullseye */
.at-free-target::before {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: rgba(255, 70, 85, 0.82);
  box-shadow: 0 0 8px rgba(255, 70, 85, 0.75);
}

/* Second ring */
.at-free-target::after {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 70, 85, 0.4);
}

@keyframes at-free-spawn {
  from { transform: scale(0); opacity: 0.5; }
  to   { transform: scale(1); opacity: 1;   }
}

.at-free-target.at-free-despawn {
  animation: at-free-despawn 0.15s ease forwards;
}

@keyframes at-free-despawn {
  to { transform: scale(0); opacity: 0; }
}

/* Shrink border shows remaining life */
.at-free-target .at-life-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 70, 85, 0.25);
  animation: at-life-shrink var(--life-ms, 1400ms) linear forwards;
  pointer-events: none;
}

@keyframes at-life-shrink {
  from { transform: scale(1);   opacity: 0.9; }
  to   { transform: scale(0.5); opacity: 0;   }
}

/* ── Mode selector: 3 columns on phones ≥ 360px ── */
@media (min-width: 360px) {
  .at-mode-selector {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ══════════════════════════════════════════════
   TRACKING MODE — button colour (amber/gold)
   ══════════════════════════════════════════════ */
#modeTrack.at-mode-active {
  border-color: rgba(255, 190, 50, 0.65);
  background: rgba(255, 190, 50, 0.07);
  box-shadow: 0 0 14px rgba(255, 190, 50, 0.18);
}

#modeTrack.at-mode-active::after {
  background: rgba(255, 190, 50, 0.85);
}

#modeTrack.at-mode-active .at-mode-icon,
#modeTrack.at-mode-active .at-mode-name {
  color: rgba(255, 190, 50, 0.95);
}

.at-mode-badge.mode-track {
  color: rgba(255, 190, 50, 0.95);
  border: 1px solid rgba(255, 190, 50, 0.3);
  background: rgba(255, 190, 50, 0.07);
}

/* ══════════════════════════════════════════════
   TRACKING MODE — moving target
   ══════════════════════════════════════════════ */

/* Outer wrapper — positioned via left/top in JS */
.at-tracking-target {
  position: absolute;
  border-radius: 50%;
  cursor: crosshair;
  will-change: transform, left, top, filter;
  /* Spawn pop */
  animation: at-track-spawn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform: scale(0);
}

@keyframes at-track-spawn {
  to { transform: scale(1); }
}

/* ── HP SVG ring (overlaid outside the circle) ── */
.at-hp-svg {
  position: absolute;
  /* Sits 6px outside the element */
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  transform: rotate(-90deg); /* arc starts from top */
  pointer-events: none;
  overflow: visible;
}

.at-hp-bg {
  fill: none;
  stroke: rgba(255, 190, 50, 0.12);
  stroke-width: 3.5;
}

.at-hp-fill {
  fill: none;
  stroke: rgba(255, 190, 50, 0.9);
  stroke-width: 3.5;
  stroke-linecap: round;
  /* dasharray / dashoffset set by JS */
  filter: drop-shadow(0 0 4px rgba(255, 190, 50, 0.6));
  transition: stroke 0.35s ease;
}

/* ── Target body ── */
.at-tracking-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 38% 35%,
    rgba(255, 210, 80, 0.25) 0%,
    rgba(255, 150, 30, 0.1) 55%,
    transparent 100%
  );
  border: 2px solid rgba(255, 190, 50, 0.85);
  box-shadow:
    0 0 16px rgba(255, 190, 50, 0.35),
    inset 0 0 10px rgba(255, 190, 50, 0.1);
}

/* Second ring */
.at-tracking-body::after {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 190, 50, 0.4);
}

/* Bullseye */
.at-tracking-bull {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: rgba(255, 190, 50, 0.85);
  box-shadow: 0 0 8px rgba(255, 190, 50, 0.7);
}

/* ── Lock-on ring (visible when mouse held inside target) ── */
.at-lock-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.08s ease, box-shadow 0.08s ease;
  pointer-events: none;
}

.at-tracking-target.at-locked .at-lock-ring {
  border-color: rgba(0, 212, 255, 0.8);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.5), inset 0 0 8px rgba(0, 212, 255, 0.1);
  animation: at-lock-pulse 0.55s ease-in-out infinite;
}

@keyframes at-lock-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.4); }
  50%       { box-shadow: 0 0 24px rgba(0, 212, 255, 0.75); }
}

/* HP colour transitions applied via JS (class variants) */
.at-tracking-target.at-hp-mid .at-tracking-body {
  border-color: rgba(255, 130, 40, 0.9);
  box-shadow: 0 0 16px rgba(255, 130, 40, 0.35), inset 0 0 8px rgba(255, 130, 40, 0.1);
}

.at-tracking-target.at-hp-low .at-tracking-body {
  border-color: rgba(255, 65, 65, 0.9);
  box-shadow: 0 0 18px rgba(255, 65, 65, 0.45), inset 0 0 8px rgba(255, 65, 65, 0.15);
}

.at-tracking-target.at-hp-low .at-tracking-bull {
  background: rgba(255, 65, 65, 0.9);
  box-shadow: 0 0 10px rgba(255, 65, 65, 0.8);
}

/* ── Kill explosion ── */
.at-track-kill-burst {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(255, 190, 50, 0.9);
  animation: at-kill-burst 0.45s ease forwards;
  pointer-events: none;
}

@keyframes at-kill-burst {
  0%   { transform: scale(0.6); opacity: 1; border-color: rgba(255, 210, 80, 1); }
  40%  { border-color: rgba(0, 212, 255, 0.9); }
  100% { transform: scale(2.5); opacity: 0; border-color: var(--cyan); }
}

/* ── Tracking-mode hint below HUD ── */
.at-track-hint {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: rgba(255, 190, 50, 0.55);
  text-transform: uppercase;
  z-index: 12;
  pointer-events: none;
  white-space: nowrap;
}
