/* ==========================================================================
   StreetWise Modern Cartography Aesthetic (Mobile-First & Streamlined)
   ========================================================================== */

:root {
  /* Default Level 1 Palette (Electric Cyan & Oceanic Emerald) */
  --bg-deep: #050a14;
  --bg-card: rgba(13, 24, 46, 0.88);
  --bg-card-hover: rgba(22, 38, 70, 0.95);
  --bg-card-solid: #0d1a30;
  --bg-surface: #152745;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-glow: rgba(0, 240, 255, 0.35);
  --border-gold: rgba(245, 158, 11, 0.35);

  --accent-primary: #00f0ff;
  --accent-primary-glow: rgba(0, 240, 255, 0.45);
  --accent-secondary: #10b981;
  --accent-secondary-glow: rgba(16, 185, 129, 0.45);
  --btn-primary-bg: linear-gradient(135deg, #00f0ff 0%, #0284c7 100%);
  --theme-gradient: radial-gradient(ellipse at 50% -10%, #0d2745 0%, #061122 45%, #050a14 100%);
  --radar-bg: radial-gradient(circle at center, #0f233f 0%, #071120 100%);

  /* Neon Accents */
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.45);
  --neon-gold: #f59e0b;
  --neon-gold-glow: rgba(245, 158, 11, 0.45);
  --neon-emerald: #10b981;
  --neon-emerald-glow: rgba(16, 185, 129, 0.45);
  --neon-rose: #f43f5e;
  --neon-rose-glow: rgba(244, 63, 94, 0.45);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dark: #0f172a;

  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --shadow-subtle: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-primary-glow);
  --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Distinct Game Mode Themes
   ========================================================================== */

/* Level 1: Cool Oceanic Cyan & Emerald */
body[data-theme="level-1"], body:not([data-theme]) {
  --bg-deep: #050a14;
  --bg-card: rgba(13, 24, 46, 0.88);
  --bg-card-hover: rgba(22, 38, 70, 0.95);
  --bg-card-solid: #0d1a30;
  --bg-surface: #152745;
  --border-glow: rgba(0, 240, 255, 0.35);
  --accent-primary: #00f0ff;
  --accent-primary-glow: rgba(0, 240, 255, 0.45);
  --accent-secondary: #10b981;
  --accent-secondary-glow: rgba(16, 185, 129, 0.45);
  --btn-primary-bg: linear-gradient(135deg, #00f0ff 0%, #0284c7 100%);
  --theme-gradient: radial-gradient(ellipse at 50% -10%, #0d2745 0%, #061122 45%, #050a14 100%);
  --radar-bg: radial-gradient(circle at center, #0f233f 0%, #071120 100%);
}

/* Level 2: Cyber Emerald & Electric Mint (Distinct Non-Red, Non-Orange Theme) */
body[data-theme="level-2"] {
  --bg-deep: #03120e;
  --bg-card: rgba(6, 26, 18, 0.90);
  --bg-card-hover: rgba(10, 38, 26, 0.95);
  --bg-card-solid: #082016;
  --bg-surface: #0e3022;
  --border-glow: rgba(0, 245, 155, 0.38);
  --accent-primary: #00f59b;
  --accent-primary-glow: rgba(0, 245, 155, 0.45);
  --accent-secondary: #10b981;
  --accent-secondary-glow: rgba(16, 185, 129, 0.45);
  --btn-primary-bg: linear-gradient(135deg, #00f59b 0%, #059669 100%);
  --theme-gradient: radial-gradient(ellipse at 50% -10%, #0c3322 0%, #061810 45%, #03120e 100%);
  --radar-bg: radial-gradient(circle at center, #0e3b27 0%, #051810 100%);
}

/* Practice Mode: Astral Twilight Violet & Royal Indigo */
body[data-theme="practice"] {
  --bg-deep: #0a0618;
  --bg-card: rgba(26, 17, 49, 0.90);
  --bg-card-hover: rgba(38, 26, 70, 0.95);
  --bg-card-solid: #1b1134;
  --bg-surface: #2d1c54;
  --border-glow: rgba(168, 85, 247, 0.38);
  --accent-primary: #c084fc;
  --accent-primary-glow: rgba(192, 132, 252, 0.45);
  --accent-secondary: #818cf8;
  --accent-secondary-glow: rgba(129, 140, 248, 0.45);
  --btn-primary-bg: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --theme-gradient: radial-gradient(ellipse at 50% -10%, #291556 0%, #150b2e 45%, #0a0618 100%);
  --radar-bg: radial-gradient(circle at center, #2e1857 0%, #110924 100%);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.45;
  background-image: var(--theme-gradient);
  background-attachment: fixed;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, background-image 0.35s ease;
}

.hidden {
  display: none !important;
}

/* App Container */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   Pinned Visual Dashboard (Sticky to top on scroll)
   ========================================================================== */

.pinned-visual-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 10, 18, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  padding-bottom: 8px;
  margin-left: -4px;
  margin-right: -4px;
  padding-left: 4px;
  padding-right: 4px;
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.75);
  transition: border-color 0.35s ease;
}

/* ==========================================================================
   Compact 2-Row Mobile-First Header
   ========================================================================== */

.game-header {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  gap: 8px;
  position: relative;
  z-index: 50;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radar-dot-pulse {
  width: 8px;
  height: 8px;
  background: var(--neon-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-cyan);
  animation: pulseBeacon 2s infinite ease-in-out;
}

@keyframes pulseBeacon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.dropdown-chevron {
  font-size: 0.55rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Mode Dropdown (Daily vs Practice) */
.mode-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.mode-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-pill-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.mode-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 1000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), var(--shadow-glow);
  min-width: 120px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.mode-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.mode-dropdown-item:hover {
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
}

.mode-dropdown-item.active {
  background: rgba(0, 240, 255, 0.18);
  color: var(--neon-cyan);
  font-weight: 700;
}

/* Map City Zoom Hint Badge */
.map-city-zoom-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border-glow);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--neon-cyan);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 240, 255, 0.2);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  user-select: none;
}

.map-city-zoom-hint:hover {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--neon-cyan);
  transform: scale(1.04);
}

/* ==========================================================================
   Hangman Word Template Banner
   ========================================================================== */

.hangman-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 8px 12px 10px;
  box-shadow: var(--shadow-subtle);
}

.hangman-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hangman-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hangman-hint-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--neon-gold);
}

.hangman-tiles-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.word-group {
  display: inline-flex;
  gap: 4px;
}

.letter-tile {
  width: 24px;
  height: 30px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid var(--border-subtle);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.letter-tile.revealed {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
  animation: popLetter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.letter-tile.suffix-revealed {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.letter-tile.blank {
  border-bottom: 2px solid rgba(0, 240, 255, 0.4);
  background: rgba(0, 0, 0, 0.3);
  color: transparent;
}

@keyframes popLetter {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Compact Status Bar
   ========================================================================== */

.status-bar-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
}

.status-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
}

.status-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
}

.highlight-cyan { color: var(--neon-cyan); }
.highlight-gold { color: var(--neon-gold); }
.highlight-emerald { color: var(--neon-emerald); }

/* ==========================================================================
   Alternating Gameplay Feed (Clues Left, Guesses Right)
   ========================================================================== */

.game-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-section {
  width: 100%;
}

.gameplay-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.feed-item {
  display: flex;
  width: 100%;
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
}

.feed-item.feed-clue-item {
  justify-content: flex-start;
  animation-name: slideInLeft;
}

.feed-item.feed-guess-item {
  justify-content: flex-end;
  animation-name: slideInRight;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Feed Cards */
.feed-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 13px;
  box-shadow: var(--shadow-subtle);
  position: relative;
  transition: all 0.2s ease;
}

/* Clue Card (Left-Justified) */
.feed-clue-card {
  max-width: 88%;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(0, 240, 255, 0.08);
}

.feed-clue-card.highlight-card {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(245, 158, 11, 0.12);
}

.clue-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.clue-step-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.clue-step-badge.highlight-radar {
  background: rgba(245, 158, 11, 0.15);
  color: var(--neon-gold);
  border-color: rgba(245, 158, 11, 0.4);
}

.clue-type-title {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clue-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.92rem;
}

.clue-highlight {
  font-weight: 700;
  color: var(--text-primary);
}

.clue-divider {
  color: var(--text-muted);
}

.clue-detail {
  color: var(--text-secondary);
  font-weight: 500;
}

.clue-pin-indicator {
  font-size: 0.72rem;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Guess Card (Right-Justified) */
.feed-guess-card {
  max-width: 84%;
  background: rgba(24, 33, 52, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.feed-guess-card.hot {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(24, 33, 52, 0.95) 0%, rgba(16, 185, 129, 0.15) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px var(--neon-emerald-glow);
}

.feed-guess-card.warm {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, rgba(24, 33, 52, 0.95) 0%, rgba(245, 158, 11, 0.14) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px var(--neon-gold-glow);
}

.feed-guess-card.cold {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(24, 33, 52, 0.95) 0%, rgba(56, 189, 248, 0.1) 100%);
}

.feed-guess-card.intersects {
  border-color: rgba(249, 115, 22, 0.7);
  background: linear-gradient(135deg, rgba(24, 33, 52, 0.95) 0%, rgba(249, 115, 22, 0.22) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 16px rgba(249, 115, 22, 0.35);
}

.feed-guess-card.skipped {
  opacity: 0.85;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.7);
}

.feed-guess-card.win-guess {
  border-color: var(--neon-cyan);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(0, 240, 255, 0.22) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 18px var(--neon-cyan-glow);
}

.guess-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.guess-attempt-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.guess-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.guess-card-name {
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.guess-card-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clue-pin-indicator {
  font-size: 0.75rem;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ==========================================================================
   Vector Silhouette Radar Screen
   ========================================================================== */

.silhouette-section {
  width: 100%;
  animation: slideInClue 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.radar-card {
  background: var(--radar-bg, radial-gradient(circle at center, #0f1c30 0%, #080d19 100%));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow), var(--shadow-card);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.radar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compass-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--neon-cyan);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.compass-arrow {
  font-size: 0.7rem;
}

.radar-tag {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.game-map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  background: radial-gradient(circle at center, #0e1a2f 0%, #060913 100%);
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.map-beacon-tooltip {
  background: rgba(15, 23, 42, 0.94) !important;
  color: #ffffff !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 6px !important;
  font-family: var(--font-display) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

.map-beacon-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.94) !important;
}

.map-beacon-tooltip.beacon-1 {
  border-color: var(--neon-cyan) !important;
  color: #e0f2fe !important;
}

.map-beacon-tooltip.beacon-2 {
  border-color: var(--neon-gold) !important;
  color: #fef3c7 !important;
}

.map-beacon-tooltip.beacon-3 {
  border-color: var(--neon-emerald) !important;
  color: #d1fae5 !important;
}

.radar-scale-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.radar-screen {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 220px;
  border-radius: var(--radius-sm);
  background: #060911;
  border: 1px solid rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Wrong Guess Graphic & Animation Overlay on Radar/Map Screen (Softened & Toned Down) */
.wrong-radar-flash {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 18, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
  animation: wrongRadarFlash 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wrongRadarFlash {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 0.92;
  }
  70% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
  }
}

.wrong-graphic-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(244, 63, 94, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 10px rgba(244, 63, 94, 0.15);
  padding: 8px 15px;
  border-radius: var(--radius-md);
  animation: wrongBadgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes wrongBadgePop {
  0% {
    transform: scale(0.75) translateY(-4px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.wrong-cross-ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.12);
  border: 1.5px solid rgba(244, 63, 94, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.wrong-cross-icon {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fb7185;
  line-height: 1;
}

.wrong-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.wrong-title-text {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fb7185;
  text-transform: uppercase;
}

.wrong-distance-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
}

/* Intersects Overlay Styling */
.wrong-radar-flash.intersects {
  background: rgba(20, 12, 6, 0.7);
}

.wrong-radar-flash.intersects .wrong-graphic-badge {
  border-color: rgba(249, 115, 22, 0.6);
  background: rgba(22, 14, 8, 0.95);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 10px rgba(249, 115, 22, 0.2);
}

.wrong-radar-flash.intersects .wrong-cross-ring {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: none;
}

.wrong-radar-flash.intersects .wrong-cross-icon {
  color: #ff9800;
}

.wrong-radar-flash.intersects .wrong-title-text {
  color: #ff9800;
  text-shadow: none;
}

/* Also flash the entire radar-card border gently */
.radar-card.radar-flash-error {
  border-color: rgba(244, 63, 94, 0.45) !important;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.25), var(--shadow-card) !important;
  transition: all 0.2s ease;
}

.radar-grid-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center center;
  pointer-events: none;
}

.radar-reticle {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.15);
  pointer-events: none;
}

.street-svg-display {
  width: 100%;
  height: 100%;
  max-width: 250px;
  max-height: 190px;
  filter: drop-shadow(0 0 7px var(--accent-primary-glow, var(--neon-cyan-glow)));
  z-index: 2;
}

.street-svg-display path {
  fill: none;
  stroke: var(--accent-primary, var(--neon-cyan));
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.35s ease;
}

/* Intersection SVG Markers & Labels */
.junction-marker-1 {
  fill: var(--neon-cyan);
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px var(--neon-cyan));
  animation: pulseJunction 1.5s infinite;
}

.junction-marker-2 {
  fill: var(--neon-gold);
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px var(--neon-gold));
  animation: pulseJunction 1.5s infinite 0.5s;
}

.junction-marker-3 {
  fill: var(--neon-emerald);
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px var(--neon-emerald));
  animation: pulseJunction 1.5s infinite 1.0s;
}

@keyframes pulseJunction {
  0%, 100% { r: 6; opacity: 1; }
  50% { r: 9; opacity: 0.75; }
}

.junction-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  fill: #ffffff;
  paint-order: stroke fill;
  stroke: #070a12;
  stroke-width: 4px;
  stroke-linejoin: round;
  letter-spacing: 0.02em;
}

.junction-label.junction-1 {
  fill: #e0f2fe;
}

.junction-label.junction-2 {
  fill: #fef3c7;
}

.junction-label.junction-3 {
  fill: #d1fae5;
}

.highlight-emerald {
  color: var(--neon-emerald) !important;
}

.highlight-rose {
  color: var(--neon-rose) !important;
}

.highlight-purple {
  color: #c084fc !important;
}

.highlight-cyan {
  color: var(--neon-cyan) !important;
}

/* Give Up Button */
.btn-give-up {
  background: rgba(244, 63, 94, 0.15) !important;
  border: 1px solid var(--neon-rose) !important;
  color: var(--neon-rose) !important;
}

.btn-give-up:hover {
  background: rgba(244, 63, 94, 0.25) !important;
  box-shadow: 0 0 15px var(--neon-rose-glow) !important;
}

.guess-row.skipped-row {
  opacity: 0.8;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.02);
}

.guess-row.skipped-row .guess-name {
  color: var(--text-muted);
  font-weight: 500;
  font-style: italic;
}

/* ==========================================================================
   Guess Input & Controls
   ========================================================================== */

.input-section {
  margin-top: 2px;
  position: relative;
}

/* Floating Wrong Guess Feedback Toast */
.wrong-feedback-toast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid var(--neon-rose);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 18px var(--neon-rose-glow);
  margin-bottom: 8px;
  animation: toastDrop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

@keyframes toastDrop {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wrong-feedback-toast .toast-sep {
  opacity: 0.5;
  color: var(--text-muted);
}

.guess-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease;
}

/* Wrong Guess Form Shake */
.guess-form.input-shake-error {
  animation: inputShakeError 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes inputShakeError {
  0%, 100% {
    transform: translateX(0);
  }
  15%, 55%, 90% {
    transform: translateX(-14px);
  }
  35%, 75% {
    transform: translateX(14px);
  }
}

.autocomplete-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-row-main {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  position: relative;
}

.input-row-main .autocomplete-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
}

.street-input {
  width: 100%;
  padding: 12px 38px 12px 40px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.98rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.street-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px var(--accent-primary-glow);
  background: var(--bg-card-solid);
}

.street-input.error-glow {
  border-color: var(--neon-rose) !important;
  box-shadow: 0 0 18px var(--neon-rose-glow) !important;
  color: #ffa1b2 !important;
}

.street-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.clear-input-btn {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.clear-input-btn.visible {
  display: flex;
}

/* Guess Button (Inline adjacent to input) */
.guess-btn-action {
  flex-shrink: 0;
  padding: 0 22px;
  min-height: 46px;
  font-family: var(--font-main);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  background: var(--btn-primary-bg);
  color: #050a14;
  box-shadow: 0 4px 14px var(--accent-primary-glow);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.guess-btn-action:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.guess-btn-action:active:not(:disabled) {
  transform: translateY(1px);
}

.guess-btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
  box-shadow: none;
}

.action-buttons-subrow {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: 6px;
}

.skip-btn-action {
  width: auto;
  padding: 5px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: none;
}

.skip-btn-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text-primary);
  transform: none;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--accent-primary-glow);
}

.autocomplete-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.autocomplete-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Action Buttons Row */
.action-buttons-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: #050a14;
  box-shadow: 0 4px 14px var(--accent-primary-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-subtext {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.8;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Guesses History & Feedback
   ========================================================================== */

.guesses-history-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.guess-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guess-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  animation: slideInClue 0.3s ease forwards;
}

.guess-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guess-idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.guess-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.guess-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
}

.distance-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.distance-badge.hot { color: var(--neon-emerald); }
.distance-badge.warm { color: var(--neon-gold); }
.distance-badge.cold { color: #38bdf8; }

.distance-badge.intersects {
  color: #ff9800;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(255, 152, 0, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@keyframes firePulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #ff5722); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 8px #ff9800); }
}

.fire-icon {
  display: inline-block;
  animation: firePulse 1.2s ease-in-out infinite;
}

.direction-indicator {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.modal-dialog {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Result Modal (Compressed non-map elements to easily fit mobile screens) */
.modal-dialog.result-dialog {
  text-align: center;
  max-width: 580px;
  width: 95vw;
  max-height: 95vh;
  padding: 14px 14px 16px;
  gap: 8px;
}

.result-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.result-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--neon-emerald);
}

.result-badge.lost { color: var(--neon-rose); }

.result-street-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}

.result-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}

.result-map-container {
  position: relative;
  width: 100%;
  height: 350px;
  min-height: 290px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glow);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
  .modal-dialog.result-dialog {
    padding: 10px 10px 12px;
    width: 96vw;
    max-height: 96vh;
    gap: 6px;
  }

  .result-street-name {
    font-size: 1.25rem;
  }

  .result-subtitle {
    font-size: 0.74rem;
  }

  .result-map-container {
    height: 42vh;
    min-height: 290px;
    max-height: 380px;
  }
}

.leaflet-map-reveal {
  width: 100%;
  height: 100%;
  background: #080d1a;
}

.leaflet-map-reveal .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(185deg) brightness(85%) contrast(95%);
}

/* Glowing Street Highlight over Dark Mode Map */
.target-reveal-glow {
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.9));
  animation: streetGlowPulse 2.4s ease-in-out infinite alternate;
}

@keyframes streetGlowPulse {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 0.85;
  }
}

.target-reveal-stroke {
  filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.95));
}

.map-overlay-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.9);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 1000;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--neon-cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--neon-cyan);
}

/* Streamlined Inline Stat Chips */
.result-info-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.result-info-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
}

.chip-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.chip-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

/* Daily Challenge Multi-Level Scorecard (Compressed) */
.daily-scorecard {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scorecard-title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.scorecard-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: center;
}

.scorecard-card.active-lvl {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

.scorecard-card.done-lvl {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.08);
}

.scorecard-lvl-tag {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-primary);
}

.scorecard-pts {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--neon-gold);
}

.scorecard-status {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 600;
}

.scorecard-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.total-pts-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--neon-cyan);
}

/* Modal Celebration & Lost Pulse Animations */
.modal-dialog.celebrate-animation {
  border-color: var(--neon-emerald) !important;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.45), 0 25px 60px rgba(0, 0, 0, 0.8) !important;
  animation: modalCelebratePulse 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalCelebratePulse {
  0% { transform: scale(0.92); box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
  50% { transform: scale(1.02); box-shadow: 0 0 55px rgba(16, 185, 129, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 40px rgba(16, 185, 129, 0.45); }
}

.modal-dialog.lost-animation {
  border-color: var(--neon-rose) !important;
  box-shadow: 0 0 45px rgba(244, 63, 94, 0.5), 0 25px 60px rgba(0, 0, 0, 0.8) !important;
  animation: modalLostPulse 0.85s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes modalLostPulse {
  0% { transform: scale(0.93); box-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }
  20% { transform: translateX(-8px) scale(1.01); box-shadow: 0 0 50px rgba(244, 63, 94, 0.7); }
  40% { transform: translateX(7px) scale(1.01); box-shadow: 0 0 50px rgba(244, 63, 94, 0.7); }
  60% { transform: translateX(-4px) scale(1.005); }
  80% { transform: translateX(2px); }
  100% { transform: scale(1); box-shadow: 0 0 40px rgba(244, 63, 94, 0.5); }
}

/* Fullscreen crimson vignette on loss */
.screen-lose-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(244, 63, 94, 0.4) 0%, rgba(244, 63, 94, 0.18) 70%, transparent 100%);
  pointer-events: none;
  z-index: 9999;
  animation: loseFlashFade 0.85s ease-out forwards;
}

@keyframes loseFlashFade {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

/* Daily Total Score Hero Banner (Level 2 Completion) - Compressed */
.daily-score-hero {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(16, 185, 129, 0.12));
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 240, 255, 0.12);
}

.daily-score-hero .hero-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neon-gold);
}

.daily-score-hero .hero-score {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  line-height: 1.05;
}

.daily-score-hero .hero-breakdown {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.result-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.result-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  min-height: 38px;
}

/* Temporarily hide tags and markers during whole-city zoom */
#game-map.zooming-city-view .leaflet-tooltip-pane,
#game-map.zooming-city-view .leaflet-marker-pane {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease;
}

/* Satellite Descent transition */
#game-map canvas {
  transition: opacity 0.15s ease-out;
}

#game-map.zooming-descent canvas {
  filter: none;
}

/* Incorrect Guessed Street Highlights on Game Map */
.wrong-guess-map-glow {
  filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.8));
}

.wrong-guess-map-stroke {
  filter: drop-shadow(0 0 3px rgba(244, 63, 94, 0.9));
}

.map-wrong-guess-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid var(--neon-rose) !important;
  color: #ffffff !important;
  font-family: var(--font-display) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.5) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

.map-wrong-guess-tooltip::before {
  border-top-color: var(--neon-rose) !important;
}

.btn-share {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
}

.share-toast {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--neon-emerald);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px var(--neon-emerald-glow);
}

/* Stats Modal */
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-subheading {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.guess-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  width: 12px;
  color: var(--text-muted);
}

.chart-bar-container {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  height: 20px;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  background: var(--neon-cyan);
  color: var(--text-dark);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  min-width: 20px;
  border-radius: var(--radius-sm);
  transition: width 0.6s ease;
}

/* How to play */
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-lead {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.help-step {
  display: flex;
  gap: 10px;
}

.help-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.help-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.help-text strong {
  color: var(--text-primary);
}

.help-text ul {
  margin-top: 4px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

}

/* Town Switcher & Onboarding Modal */
.town-modal-dialog {
  max-width: 440px;
  width: 92%;
  padding: 22px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-header-block {
  text-align: center;
  margin-bottom: 16px;
}

.modal-icon-badge {
  display: inline-block;
  font-size: 1.8rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 240, 255, 0.4));
}

.modal-header-block .modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.modal-header-block .modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.town-search-wrapper {
  margin-bottom: 14px;
}

.town-search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.town-search-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.available-towns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.town-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.town-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.town-card.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.15);
}

.town-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.town-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.town-card.active .town-card-name {
  color: var(--neon-cyan);
}

.town-card-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.town-card-action {
  display: flex;
  align-items: center;
}

.town-card-badge.active-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.15);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.town-card-select-btn {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.town-card:hover .town-card-select-btn {
  background: var(--neon-cyan);
  color: #0b0f19;
  border-color: var(--neon-cyan);
}

.town-empty-state {
  text-align: center;
  padding: 24px 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.town-modal-footer-note {
  margin-top: 14px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

/* Global Town Search & Nominatim Results */
.search-worldwide-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px dashed rgba(168, 85, 247, 0.45);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.search-worldwide-card:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: var(--neon-purple);
  transform: translateY(-1px);
}

.search-worldwide-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #c084fc;
}

.search-worldwide-badge {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.25);
  color: #f3e8ff;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.nominatim-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 10px 0 6px 2px;
}

.global-town-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.global-town-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--neon-cyan);
  transform: translateY(-1px);
}

.global-town-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.global-town-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.global-town-btn {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: #0b0f19;
  background: var(--neon-cyan);
  border: none;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.global-town-card:hover .global-town-btn {
  transform: scale(1.04);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.55);
}

/* Satellite Recon Loader Overlay */
.recon-dialog {
  max-width: 400px;
  width: 90%;
  padding: 32px 24px 28px;
  background: rgba(11, 15, 25, 0.95);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 45px rgba(0, 240, 255, 0.25), 0 25px 50px rgba(0, 0, 0, 0.85);
  text-align: center;
  backdrop-filter: blur(12px);
  position: relative;
}

.recon-radar-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  border: 2px solid rgba(0, 240, 255, 0.4);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, rgba(11, 15, 25, 0.4) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.2);
}

.recon-radar-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(0, 240, 255, 0.45) 60deg, transparent 60.1deg);
  border-radius: 50%;
  animation: reconRadarSpin 1.8s linear infinite;
}

.recon-radar-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid var(--neon-cyan);
  border-radius: 50%;
  animation: reconRadarPulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.recon-radar-icon {
  font-size: 2rem;
  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(0, 240, 255, 0.6));
}

@keyframes reconRadarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes reconRadarPulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.recon-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.recon-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 18px;
}

.recon-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.recon-progress-fill {
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  animation: reconIndeterminate 2s ease-in-out infinite;
}

@keyframes reconIndeterminate {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(50%); }
  100% { transform: translateX(200%); }
}

.recon-step-indicator {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--neon-cyan);
  font-weight: 600;
  letter-spacing: 0.02em;
}
