/* -------------------------------------------------------------
 * Cyber-Alster Neon-Dark UI Design System
 * Highly optimized, responsive, and compatible with modern Safari.
 * ------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* Theme Base Colors */
  --bg-main: hsl(230, 28%, 7%);
  --bg-surface: rgba(17, 24, 39, 0.65);
  --bg-surface-hover: rgba(26, 36, 56, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(255, 255, 255, 0.16);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 12%, 50%);

  /* Neon Glow Districts */
  --color-altona: hsl(295, 100%, 65%);       /* Purple/Magenta */
  --color-bergedorf: hsl(32, 100%, 55%);     /* Warm Orange */
  --color-eimsbuettel: hsl(175, 100%, 45%);   /* Turquoise Cyan */
  --color-hamburg-mitte: hsl(345, 100%, 60%); /* Rose Red */
  --color-hamburg-nord: hsl(210, 100%, 60%);  /* electric Blue */
  --color-harburg: hsl(100, 95%, 55%);       /* Lime Green */
  --color-wandsbek: hsl(260, 100%, 65%);     /* Deep Violet */
  --color-default-path: hsl(225, 20%, 18%);
  --color-neutral-glow: hsl(200, 100%, 60%);

  /* UI Game Colors */
  --color-correct: hsl(142, 76%, 45%);
  --color-incorrect: hsl(350, 89%, 60%);
  --color-xp: hsl(47, 95%, 55%);
  
  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  
  /* Radii & Transitions */
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
    radial-gradient(at 100% 0%, hsla(220,53%,10%,1) 0, transparent 50%),
    radial-gradient(at 50% 100%, hsla(280,30%,8%,1) 0, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.overlay-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  touch-action: none;
}

/* Webkit Custom Scrollbar (Safari compatible) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Footer & privacy notice */
.app-footer {
  margin-top: auto;
  padding-top: 0.25rem;
  text-align: center;
}

.privacy-notice {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 40rem;
  margin: 0 auto;
}

.privacy-notice strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.footer-credit {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  opacity: 0.75;
}

/* Container & Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  gap: 1.5rem;
}

/* Header & Progress Stats */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  
  h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--color-neutral-glow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    color: var(--color-neutral-glow);
    text-transform: uppercase;
  }
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  
  .label {
    color: var(--text-secondary);
    font-weight: 500;
  }
  
  .value {
    color: #fff;
    font-family: var(--font-display);
  }
  
  &.xp-pill .value {
    color: var(--color-xp);
    text-shadow: 0 0 10px rgba(255, 191, 0, 0.3);
  }
  
  &.streak-pill {
    background: rgba(255, 51, 119, 0.05);
    border-color: rgba(255, 51, 119, 0.2);
    .streak-info {
      display: flex;
      flex-direction: column;
      gap: 0.1rem;
      line-height: 1.2;
    }
    .streak-current .value {
      color: var(--color-hamburg-mitte);
      text-shadow: 0 0 10px rgba(255, 51, 119, 0.3);
    }
    .streak-best {
      font-size: 0.68rem;
      font-weight: 500;
      color: var(--text-muted);
    }
  }
}

.level-tracker {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 180px;

  .level-info {
    display: flex;
    font-size: 0.8rem;
    font-weight: 600;
    
    .rank-name {
      color: var(--color-xp);
      text-shadow: 0 0 10px rgba(255, 191, 0, 0.3);
    }
  }

  .progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-neutral-glow), var(--color-xp));
    border-radius: 999px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 10px rgba(255, 191, 0, 0.45);
  }
}

.audio-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  
  &:hover {
    border-color: var(--border-color-glow);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: stretch;
  flex: 1;
}

/* Left Panel - Game Console */
.console-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  
  &:hover {
    border-color: var(--border-color-glow);
  }
}

/* Mode Selection Cards */
.mode-selector {
  h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .modes-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  
  .mode-icon {
    font-size: 1.25rem;
    filter: grayscale(1);
    transition: var(--transition-fast);
  }
  
  &:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    .mode-icon {
      filter: grayscale(0);
      transform: scale(1.1);
    }
  }
  
  &.active {
    color: #fff;
    background: rgba(0, 162, 255, 0.1);
    border-color: rgba(0, 162, 255, 0.4);
    box-shadow: inset 0 0 10px rgba(0, 162, 255, 0.15);
    .mode-icon {
      filter: grayscale(0);
    }
  }
}

/* Segment selector (Stadtteile / Bezirke) */
.segment-selector {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  gap: 0.3rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;

  &:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
  }

  &.active {
    background: rgba(0, 162, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(0, 162, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 162, 255, 0.1);
  }
}

/* Text input & autocomplete (game modes) */
.autocomplete-container {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 15, 30, 0.95);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-md);
  max-height: 180px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  margin-bottom: 5px;
  display: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.autocomplete-item {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-fast);

  &:hover,
  &.active {
    background: rgba(0, 162, 255, 0.15);
    color: #fff;
  }
}

.text-input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: #fff;
  font-family: var(--font-sans);
  font-size: max(1rem, 16px);
  transition: var(--transition-fast);
  outline: none;

  &:focus {
    border-color: rgba(0, 162, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 162, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
  }
}

.round-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.round-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-neutral-glow);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Gameplay Interactive Section */
.game-play-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
}

.prompt-box {
  text-align: center;
  margin-bottom: 1.5rem;
  
  .prompt-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-neutral-glow);
    margin-bottom: 0.4rem;
  }
  
  .prompt-target {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    
    &.highlight {
      color: var(--color-neutral-glow);
      text-shadow: 0 0 15px rgba(0, 162, 255, 0.4);
    }
  }
  
  .prompt-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
  }
}

/* Multiple Choice Grid */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  width: 100%;
}

.choice-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  
  .choice-letter {
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
  }
  
  &:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(2px);
  }

  &:active {
    transform: scale(0.98);
  }

  &.correct {
    background: rgba(20, 184, 166, 0.15);
    border-color: var(--color-correct);
    color: #fff;
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.25);
    pointer-events: none;
  }

  &.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--color-incorrect);
    color: #fff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
    pointer-events: none;
  }
}

/* Info Panels (Stadtteil details) */
.info-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.3s ease-out;

  .detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    
    h2 {
      font-family: var(--font-display);
      font-size: 1.4rem;
      font-weight: 700;
      color: #fff;
    }
    
    .bezirk-tag {
      display: inline-block;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-top: 0.25rem;
      padding: 0.15rem 0.5rem;
      border-radius: var(--radius-sm);
    }
  }

  .detail-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .detail-stat {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    
    .ds-label {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-bottom: 0.25rem;
    }
    
    .ds-value {
      font-family: var(--font-display);
      font-weight: 700;
      font-size: 1.1rem;
      color: #fff;
    }
  }
  
  .detail-trivia {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    background: rgba(0, 162, 255, 0.03);
    border: 1px solid rgba(0, 162, 255, 0.15);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
    
    &::before {
      content: "💡";
      margin-right: 0.4rem;
    }
  }
}

.empty-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  gap: 0.75rem;
  
  .ei-icon {
    font-size: 2rem;
    opacity: 0.5;
  }
}

/* Progression & District Unlocker Card */
.unlocker-card {
  .district-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.75rem;
  }
}

.district-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  
  .dp-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 6px var(--text-muted);
  }
  
  .dp-name {
    font-weight: 600;
    flex: 1;
    color: var(--text-secondary);
  }
  
  .dp-score {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-muted);
  }
  
  .dp-lock {
    font-size: 0.8rem;
    opacity: 0.5;
  }
  
  &.unlocked {
    .dp-name {
      color: #fff;
    }
    .dp-score {
      color: var(--text-primary);
    }
  }
  
  &.locked {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.03);
    opacity: 0.5;
    
    .dp-indicator {
      background: transparent;
      border: 1px solid var(--text-muted);
      box-shadow: none;
    }
  }
  
  &.active-unlock {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
  }
}

/* Right Panel - Map Section */
.map-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.map-container-wrapper {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 500px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  
  &:hover {
    border-color: var(--border-color-glow);
  }
  
  &:active {
    cursor: grabbing;
  }
}

.map-prompt-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.65rem 1rem 0.75rem;
  background: rgba(10, 15, 30, 0.92);
  border-top: 1px solid var(--border-color);
  text-align: center;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  &[hidden] {
    display: none !important;
  }

  .map-prompt-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-neutral-glow);
    margin-bottom: 0.15rem;
  }

  .map-prompt-target {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;

    &.highlight {
      color: var(--color-neutral-glow);
      text-shadow: 0 0 15px rgba(0, 162, 255, 0.4);
    }
  }

  .map-prompt-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
  }
}

/* Floating Tooltip — fixed to viewport so it follows the cursor */
.map-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  background: rgba(10, 15, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  z-index: 10000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  display: none;
  transform: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  max-width: min(280px, 90vw);
  
  .tooltip-bezirk {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.1rem;
  }
}

/* SVG city map styling */
.hamburg-map-svg,
.city-map-svg {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  transform-origin: center;
  will-change: transform;
}

.hamburg-map-svg.smooth-transition,
.city-map-svg.smooth-transition {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Water styling (Elbe, Alster) — subtle, integrated with map */
.water-group {
  pointer-events: none;
}

.water-group .water-body {
  fill: hsl(215, 22%, 11%);
  stroke: none;
  opacity: 0.92;
}

.water-group .water-outline {
  fill: none;
  stroke: hsl(210, 18%, 18%);
  stroke-width: 0.45;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.7;
}

/* Legacy water classes (kept for name-all-active overrides) */
.water-group .water-fill {
  fill: hsl(215, 22%, 11%);
  stroke: hsl(210, 18%, 18%);
  stroke-width: 0.45;
  stroke-linejoin: round;
}

.water-group .water-shimmer {
  display: none;
}

.water-group .water-channel-bed,
.water-group .water-channel-glow,
.water-group .water-channel {
  display: none;
}

/* Sporcle round feedback on map */
.stadtteil-path.round-correct {
  fill: hsla(142, 70%, 42%, 0.55) !important;
  stroke: var(--color-correct) !important;
  stroke-width: 2px !important;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.45)) !important;
}

.stadtteil-path.round-incorrect {
  fill: hsla(350, 85%, 55%, 0.5) !important;
  stroke: var(--color-incorrect) !important;
  stroke-width: 2px !important;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.4)) !important;
}

.stadtteil-path.bezirk-hover-highlight {
  fill: rgba(0, 162, 255, 0.12) !important;
  stroke: rgba(0, 200, 255, 0.65) !important;
  stroke-width: 1.2px !important;
}

.map-text-label {
  font-family: var(--font-sans);
  font-size: 7px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(7, 10, 20, 0.92);
  stroke-width: 2.5px;
  stroke-linejoin: round;
  fill: #fff;
}

.map-text-label.label-correct {
  fill: #bbf7d0;
  stroke: rgba(20, 80, 40, 0.95);
}

.map-text-label.label-incorrect {
  fill: #fecaca;
  stroke: rgba(100, 20, 30, 0.95);
}

/* SVG Path States — uniform thin Stadtteil outlines */
.stadtteil-path {
  fill: var(--color-default-path);
  stroke: var(--bg-main);
  stroke-width: 0.35px;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.25s ease, stroke 0.25s ease, stroke-width 0.2s ease, filter 0.2s ease;
  transform-origin: center;
}

/* Hover and Glowing borders based on Bezirk CSS Classes */
.stadtteil-path:hover {
  stroke-width: 1.5px !important;
  stroke: #fff !important;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6)) !important;
  z-index: 10;
}

/* Styling paths per Bezirk when active/discovered */
.stadtteil-path.unlocked-bezirk {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(255, 255, 255, 0.1);
}

.stadtteil-path[data-bezirk="Altona"].discovered { fill: hsla(295, 100%, 65%, 0.15); stroke: hsla(295, 100%, 65%, 0.4); }
.stadtteil-path[data-bezirk="Bergedorf"].discovered { fill: hsla(32, 100%, 55%, 0.15); stroke: hsla(32, 100%, 55%, 0.4); }
.stadtteil-path[data-bezirk="Eimsbüttel"].discovered { fill: hsla(175, 100%, 45%, 0.15); stroke: hsla(175, 100%, 45%, 0.4); }
.stadtteil-path[data-bezirk="Hamburg-Mitte"].discovered { fill: hsla(345, 100%, 60%, 0.15); stroke: hsla(345, 100%, 60%, 0.4); }
.stadtteil-path[data-bezirk="Hamburg-Nord"].discovered { fill: hsla(210, 100%, 60%, 0.15); stroke: hsla(210, 100%, 60%, 0.4); }
.stadtteil-path[data-bezirk="Harburg"].discovered { fill: hsla(100, 95%, 55%, 0.15); stroke: hsla(100, 95%, 55%, 0.4); }
.stadtteil-path[data-bezirk="Wandsbek"].discovered { fill: hsla(260, 100%, 65%, 0.15); stroke: hsla(260, 100%, 65%, 0.4); }

/* Highlight state (Explorer Selection or Target) */
.stadtteil-path.selected {
  stroke-width: 2px !important;
  z-index: 20;
}
.stadtteil-path[data-bezirk="Altona"].selected { fill: hsla(295, 100%, 65%, 0.45); stroke: var(--color-altona) !important; filter: drop-shadow(0 0 8px var(--color-altona)) !important; }
.stadtteil-path[data-bezirk="Bergedorf"].selected { fill: hsla(32, 100%, 55%, 0.45); stroke: var(--color-bergedorf) !important; filter: drop-shadow(0 0 8px var(--color-bergedorf)) !important; }
.stadtteil-path[data-bezirk="Eimsbüttel"].selected { fill: hsla(175, 100%, 45%, 0.45); stroke: var(--color-eimsbuettel) !important; filter: drop-shadow(0 0 8px var(--color-eimsbuettel)) !important; }
.stadtteil-path[data-bezirk="Hamburg-Mitte"].selected { fill: hsla(345, 100%, 60%, 0.45); stroke: var(--color-hamburg-mitte) !important; filter: drop-shadow(0 0 8px var(--color-hamburg-mitte)) !important; }
.stadtteil-path[data-bezirk="Hamburg-Nord"].selected { fill: hsla(210, 100%, 60%, 0.45); stroke: var(--color-hamburg-nord) !important; filter: drop-shadow(0 0 8px var(--color-hamburg-nord)) !important; }
.stadtteil-path[data-bezirk="Harburg"].selected { fill: hsla(100, 95%, 55%, 0.45); stroke: var(--color-harburg) !important; filter: drop-shadow(0 0 8px var(--color-harburg)) !important; }
.stadtteil-path[data-bezirk="Wandsbek"].selected { fill: hsla(260, 100%, 65%, 0.45); stroke: var(--color-wandsbek) !important; filter: drop-shadow(0 0 8px var(--color-wandsbek)) !important; }

/* Berlin Bezirk colors */
[data-city="berlin"] .stadtteil-path[data-bezirk="Mitte"].discovered { fill: hsla(38, 95%, 58%, 0.15); stroke: hsla(38, 95%, 58%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Friedrichshain-Kreuzberg"].discovered { fill: hsla(350, 90%, 58%, 0.15); stroke: hsla(350, 90%, 58%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Pankow"].discovered { fill: hsla(160, 75%, 48%, 0.15); stroke: hsla(160, 75%, 48%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Charlottenburg-Wilmersdorf"].discovered { fill: hsla(270, 85%, 62%, 0.15); stroke: hsla(270, 85%, 62%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Spandau"].discovered { fill: hsla(200, 80%, 55%, 0.15); stroke: hsla(200, 80%, 55%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Steglitz-Zehlendorf"].discovered { fill: hsla(120, 70%, 48%, 0.15); stroke: hsla(120, 70%, 48%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Tempelhof-Schöneberg"].discovered { fill: hsla(45, 95%, 55%, 0.15); stroke: hsla(45, 95%, 55%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Neukölln"].discovered { fill: hsla(25, 100%, 55%, 0.15); stroke: hsla(25, 100%, 55%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Treptow-Köpenick"].discovered { fill: hsla(185, 80%, 45%, 0.15); stroke: hsla(185, 80%, 45%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Marzahn-Hellersdorf"].discovered { fill: hsla(300, 75%, 58%, 0.15); stroke: hsla(300, 75%, 58%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Lichtenberg"].discovered { fill: hsla(220, 85%, 58%, 0.15); stroke: hsla(220, 85%, 58%, 0.4); }
[data-city="berlin"] .stadtteil-path[data-bezirk="Reinickendorf"].discovered { fill: hsla(75, 85%, 52%, 0.15); stroke: hsla(75, 85%, 52%, 0.4); }

[data-city="berlin"] .stadtteil-path[data-bezirk="Mitte"].selected { fill: hsla(38, 95%, 58%, 0.45); stroke: hsl(38, 95%, 58%) !important; filter: drop-shadow(0 0 8px hsl(38, 95%, 58%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Friedrichshain-Kreuzberg"].selected { fill: hsla(350, 90%, 58%, 0.45); stroke: hsl(350, 90%, 58%) !important; filter: drop-shadow(0 0 8px hsl(350, 90%, 58%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Pankow"].selected { fill: hsla(160, 75%, 48%, 0.45); stroke: hsl(160, 75%, 48%) !important; filter: drop-shadow(0 0 8px hsl(160, 75%, 48%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Charlottenburg-Wilmersdorf"].selected { fill: hsla(270, 85%, 62%, 0.45); stroke: hsl(270, 85%, 62%) !important; filter: drop-shadow(0 0 8px hsl(270, 85%, 62%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Spandau"].selected { fill: hsla(200, 80%, 55%, 0.45); stroke: hsl(200, 80%, 55%) !important; filter: drop-shadow(0 0 8px hsl(200, 80%, 55%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Steglitz-Zehlendorf"].selected { fill: hsla(120, 70%, 48%, 0.45); stroke: hsl(120, 70%, 48%) !important; filter: drop-shadow(0 0 8px hsl(120, 70%, 48%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Tempelhof-Schöneberg"].selected { fill: hsla(45, 95%, 55%, 0.45); stroke: hsl(45, 95%, 55%) !important; filter: drop-shadow(0 0 8px hsl(45, 95%, 55%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Neukölln"].selected { fill: hsla(25, 100%, 55%, 0.45); stroke: hsl(25, 100%, 55%) !important; filter: drop-shadow(0 0 8px hsl(25, 100%, 55%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Treptow-Köpenick"].selected { fill: hsla(185, 80%, 45%, 0.45); stroke: hsl(185, 80%, 45%) !important; filter: drop-shadow(0 0 8px hsl(185, 80%, 45%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Marzahn-Hellersdorf"].selected { fill: hsla(300, 75%, 58%, 0.45); stroke: hsl(300, 75%, 58%) !important; filter: drop-shadow(0 0 8px hsl(300, 75%, 58%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Lichtenberg"].selected { fill: hsla(220, 85%, 58%, 0.45); stroke: hsl(220, 85%, 58%) !important; filter: drop-shadow(0 0 8px hsl(220, 85%, 58%)) !important; }
[data-city="berlin"] .stadtteil-path[data-bezirk="Reinickendorf"].selected { fill: hsla(75, 85%, 52%, 0.45); stroke: hsl(75, 85%, 52%) !important; filter: drop-shadow(0 0 8px hsl(75, 85%, 52%)) !important; }

[data-city="frankfurt"] .stadtteil-path[data-bezirk="Innenstadt I"].discovered { fill: hsla(352, 95%, 58%, 0.15); stroke: hsla(352, 95%, 58%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Innenstadt II"].discovered { fill: hsla(5, 90%, 58%, 0.15); stroke: hsla(5, 90%, 58%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Innenstadt III"].discovered { fill: hsla(20, 85%, 55%, 0.15); stroke: hsla(20, 85%, 55%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Bornheim/Ostend"].discovered { fill: hsla(340, 90%, 58%, 0.15); stroke: hsla(340, 90%, 58%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Süd"].discovered { fill: hsla(25, 100%, 55%, 0.15); stroke: hsla(25, 100%, 55%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="West"].discovered { fill: hsla(210, 80%, 55%, 0.15); stroke: hsla(210, 80%, 55%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Mitte-West"].discovered { fill: hsla(280, 85%, 62%, 0.15); stroke: hsla(280, 85%, 62%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nord-West"].discovered { fill: hsla(175, 75%, 48%, 0.15); stroke: hsla(175, 75%, 48%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Mitte-Nord"].discovered { fill: hsla(310, 80%, 58%, 0.15); stroke: hsla(310, 80%, 58%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nord-Ost"].discovered { fill: hsla(45, 95%, 55%, 0.15); stroke: hsla(45, 95%, 55%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Ost"].discovered { fill: hsla(185, 80%, 45%, 0.15); stroke: hsla(185, 80%, 45%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Kalbach-Riedberg"].discovered { fill: hsla(130, 70%, 48%, 0.15); stroke: hsla(130, 70%, 48%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nieder-Erlenbach"].discovered { fill: hsla(95, 85%, 52%, 0.15); stroke: hsla(95, 85%, 52%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Harheim"].discovered { fill: hsla(160, 75%, 48%, 0.15); stroke: hsla(160, 75%, 48%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nieder-Eschbach"].discovered { fill: hsla(220, 85%, 58%, 0.15); stroke: hsla(220, 85%, 58%, 0.4); }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Bergen-Enkheim"].discovered { fill: hsla(15, 100%, 55%, 0.15); stroke: hsla(15, 100%, 55%, 0.4); }

[data-city="frankfurt"] .stadtteil-path[data-bezirk="Innenstadt I"].selected { fill: hsla(352, 95%, 58%, 0.45); stroke: hsl(352, 95%, 58%) !important; filter: drop-shadow(0 0 8px hsl(352, 95%, 58%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Innenstadt II"].selected { fill: hsla(5, 90%, 58%, 0.45); stroke: hsl(5, 90%, 58%) !important; filter: drop-shadow(0 0 8px hsl(5, 90%, 58%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Innenstadt III"].selected { fill: hsla(20, 85%, 55%, 0.45); stroke: hsl(20, 85%, 55%) !important; filter: drop-shadow(0 0 8px hsl(20, 85%, 55%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Bornheim/Ostend"].selected { fill: hsla(340, 90%, 58%, 0.45); stroke: hsl(340, 90%, 58%) !important; filter: drop-shadow(0 0 8px hsl(340, 90%, 58%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Süd"].selected { fill: hsla(25, 100%, 55%, 0.45); stroke: hsl(25, 100%, 55%) !important; filter: drop-shadow(0 0 8px hsl(25, 100%, 55%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="West"].selected { fill: hsla(210, 80%, 55%, 0.45); stroke: hsl(210, 80%, 55%) !important; filter: drop-shadow(0 0 8px hsl(210, 80%, 55%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Mitte-West"].selected { fill: hsla(280, 85%, 62%, 0.45); stroke: hsl(280, 85%, 62%) !important; filter: drop-shadow(0 0 8px hsl(280, 85%, 62%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nord-West"].selected { fill: hsla(175, 75%, 48%, 0.45); stroke: hsl(175, 75%, 48%) !important; filter: drop-shadow(0 0 8px hsl(175, 75%, 48%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Mitte-Nord"].selected { fill: hsla(310, 80%, 58%, 0.45); stroke: hsl(310, 80%, 58%) !important; filter: drop-shadow(0 0 8px hsl(310, 80%, 58%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nord-Ost"].selected { fill: hsla(45, 95%, 55%, 0.45); stroke: hsl(45, 95%, 55%) !important; filter: drop-shadow(0 0 8px hsl(45, 95%, 55%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Ost"].selected { fill: hsla(185, 80%, 45%, 0.45); stroke: hsl(185, 80%, 45%) !important; filter: drop-shadow(0 0 8px hsl(185, 80%, 45%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Kalbach-Riedberg"].selected { fill: hsla(130, 70%, 48%, 0.45); stroke: hsl(130, 70%, 48%) !important; filter: drop-shadow(0 0 8px hsl(130, 70%, 48%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nieder-Erlenbach"].selected { fill: hsla(95, 85%, 52%, 0.45); stroke: hsl(95, 85%, 52%) !important; filter: drop-shadow(0 0 8px hsl(95, 85%, 52%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Harheim"].selected { fill: hsla(160, 75%, 48%, 0.45); stroke: hsl(160, 75%, 48%) !important; filter: drop-shadow(0 0 8px hsl(160, 75%, 48%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Nieder-Eschbach"].selected { fill: hsla(220, 85%, 58%, 0.45); stroke: hsl(220, 85%, 58%) !important; filter: drop-shadow(0 0 8px hsl(220, 85%, 58%)) !important; }
[data-city="frankfurt"] .stadtteil-path[data-bezirk="Bergen-Enkheim"].selected { fill: hsla(15, 100%, 55%, 0.45); stroke: hsl(15, 100%, 55%) !important; filter: drop-shadow(0 0 8px hsl(15, 100%, 55%)) !important; }

/* Blinking animation for Card quiz */
.stadtteil-path.blink {
  animation: mapPulse 1.5s infinite ease-in-out;
  stroke: #fff !important;
  stroke-width: 1.5px;
  z-index: 15;
}

/* Success / Failure visual responses on map */
.stadtteil-path.correct-flash {
  fill: hsla(142, 76%, 45%, 0.5) !important;
  stroke: var(--color-correct) !important;
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 0 12px var(--color-correct)) !important;
  z-index: 30;
}

.stadtteil-path.incorrect-flash {
  fill: hsla(350, 89%, 60%, 0.5) !important;
  stroke: var(--color-incorrect) !important;
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 0 12px var(--color-incorrect)) !important;
  z-index: 30;
  animation: mapShake 0.4s ease-in-out;
}

/* Locked paths: still receive clicks (handled in JS) so pan/drag does not steal focus */
.stadtteil-path.locked-path {
  fill: rgba(0, 0, 0, 0.4);
  stroke: rgba(255, 255, 255, 0.02);
  cursor: not-allowed;
}

/* Floating island Easter Egg overlays */
.island-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 50;

  &[hidden] {
    display: none !important;
  }

  .no-badge {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-incorrect);
    box-shadow: 0 0 6px var(--color-incorrect);

    &.is-unlocked {
      background: var(--color-correct);
      box-shadow: 0 0 6px var(--color-correct);
    }
  }
}

#city-view[data-city="hamburg"] .pfaueninsel-overlay {
  display: none !important;
}

#city-view[data-city="berlin"] .neuwerk-overlay {
  display: none !important;
}

.pfaueninsel-overlay {
  top: 3.75rem;
}

#city-view[data-city="berlin"] .pfaueninsel-overlay {
  top: 1rem;
}

.neuwerk-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 50;
  
  &:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(17, 24, 39, 0.95);
    transform: translateY(-1px);
  }
}

/* Map Controls (Zoom / Help) */
.map-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  
  .zoom-btns {
    display: flex;
    gap: 0.4rem;
  }
  
  .control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition-fast);
    
    &:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
    }
  }
  
  .map-hint {
    color: var(--text-muted);
    font-weight: 500;
  }
}

/* Onboarding & Overlay Modal */
.overlay-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.4s ease-out;
  overscroll-behavior: contain;
  overflow-y: auto;
}

.modal-content {
  background: radial-gradient(circle at top right, rgba(0, 162, 255, 0.08), transparent 60%), var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 40%, var(--color-neutral-glow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
  }
}

.modal-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  margin-bottom: 1.75rem;
}

.mf-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  
  .mf-icon {
    font-size: 1.25rem;
  }
  
  .mf-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    
    strong {
      color: #fff;
      display: block;
      margin-bottom: 0.1rem;
    }
  }
}

.action-btn-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.secondary-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;

  &:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
  }

  &:active {
    transform: scale(0.98);
  }
}

.secondary-btn.danger-outline {
  color: var(--color-incorrect);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);

  &:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
  }
}

.text-input-field.input-shake {
  animation: inputShake 0.35s ease-in-out;
  border-color: var(--color-incorrect) !important;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.name-all-active .stadtteil-path {
  fill: rgba(12, 18, 35, 0.28) !important;
  stroke: rgba(255, 255, 255, 0.06) !important;
}

.name-all-active .stadtteil-path.round-correct {
  fill: hsla(142, 70%, 42%, 0.55) !important;
  stroke: var(--color-correct) !important;
  stroke-width: 2px !important;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.45)) !important;
}

body.segment-stadtteile .stadtteil-path.unlocked-bezirk:not(.round-correct):not(.round-incorrect):not(.selected):not(.blink):not(.bezirk-excluded) {
  stroke-width: 0.35px;
  stroke: var(--bg-main);
}

/* Bezirk boundary overlay — always visible, thicker than Stadtteil lines */
.bezirk-boundaries-group {
  pointer-events: none;
  shape-rendering: crispEdges;
}

.bezirk-boundary-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1.75px;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

/* Berlin: Bezirksgrenzen deutlich dicker als Ortsteil-Grenzen */
#city-view[data-city="berlin"] .bezirk-boundary-line {
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 2.75px;
}

#city-view[data-city="frankfurt"] .bezirk-boundary-line {
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 2.75px;
}

#city-view[data-city="berlin"].segment-stadtteile .stadtteil-path.unlocked-bezirk:not(.round-correct):not(.round-incorrect):not(.selected):not(.blink):not(.bezirk-excluded) {
  stroke-width: 0.25px;
  stroke: rgba(255, 255, 255, 0.12);
}

#city-view[data-city="frankfurt"].segment-stadtteile .stadtteil-path.unlocked-bezirk:not(.round-correct):not(.round-incorrect):not(.selected):not(.blink):not(.bezirk-excluded) {
  stroke-width: 0.25px;
  stroke: rgba(255, 255, 255, 0.12);
}

/* Grayed-out Bezirke when not included in active game */
.stadtteil-path.bezirk-excluded {
  fill: rgba(4, 8, 18, 0.72) !important;
  stroke: rgba(255, 255, 255, 0.03) !important;
  stroke-width: 0.35px !important;
  filter: grayscale(0.85) brightness(0.45) !important;
  cursor: default !important;
  pointer-events: none !important;
}

.stadtteil-path.bezirk-excluded:hover {
  stroke-width: 0.35px !important;
  stroke: rgba(255, 255, 255, 0.03) !important;
  filter: grayscale(0.85) brightness(0.45) !important;
}

.round-end-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.round-end-actions .primary-btn,
.round-end-actions .secondary-btn {
  flex: 1;
  padding: 0.75rem;
}

.bezirk-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 160px;
  overflow-y: auto;
  text-align: left;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.bezirk-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.25rem 0.15rem;
  border-radius: var(--radius-sm);
}

.bezirk-picker-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.bezirk-picker-item input {
  accent-color: var(--color-neutral-glow);
}

.log-modal-content {
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.log-section-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

.log-trophy-section,
.log-rank-section,
.log-history-section {
  margin-bottom: 1.25rem;
  text-align: left;
}

.trophy-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.45rem;
}

.trophy-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  transition: filter 0.2s, opacity 0.2s;
}

.trophy-tile--locked {
  filter: grayscale(1);
  opacity: 0.38;
}

.trophy-tile--earned {
  border-color: rgba(255, 191, 0, 0.45);
  background: rgba(255, 191, 0, 0.08);
  box-shadow: 0 0 12px rgba(255, 191, 0, 0.15);
}

.trophy-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.trophy-name {
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.log-rank-current {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 0.65rem 0;
}

.rank-ladder {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.rank-ladder-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rank-ladder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border-color);
}

.rank-ladder-step--passed .rank-ladder-dot {
  background: var(--color-correct);
  border-color: var(--color-correct);
}

.rank-ladder-step--current .rank-ladder-dot {
  background: var(--color-xp);
  border-color: var(--color-xp);
  box-shadow: 0 0 8px rgba(255, 191, 0, 0.5);
}

.rank-ladder-step--upcoming .rank-ladder-name,
.rank-ladder-step--upcoming .rank-ladder-xp {
  opacity: 0.45;
}

.rank-ladder-step--current .rank-ladder-name {
  color: var(--color-xp);
  font-weight: 700;
}

.rank-ladder-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex: 1;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.rank-ladder-name {
  color: #fff;
  font-weight: 600;
}

.rank-ladder-xp {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.rank-xp-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.rank-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-neutral-glow), var(--color-xp));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.log-rank-progress-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0 0 0.35rem 0;
}

.log-xp-hints {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-xp-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

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

.game-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  text-align: left;
}

.game-history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
}

.game-history-item .gh-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.game-history-item .gh-mode {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.game-history-item .gh-score {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.game-history-item .gh-districts {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.game-history-item .gh-duration {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.timer-display.timer-warning {
  color: var(--color-incorrect);
  animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
  50% { opacity: 0.65; }
}

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10001;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  bottom: -12px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-rise 2.2s ease-out forwards;
}

@keyframes confetti-rise {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-110vh) translateX(var(--x-drift, 0px)) rotate(720deg);
    opacity: 0;
  }
}

.name-all-active .stadtteil-path.bezirk-excluded {
  fill: rgba(2, 5, 12, 0.82) !important;
  stroke: rgba(255, 255, 255, 0.02) !important;
  filter: grayscale(0.9) brightness(0.3) !important;
}

.name-all-active .water-group .water-body,
.name-all-active .water-group .water-outline,
.name-all-active .water-group .water-fill,
.name-all-active .water-group .water-shimmer,
.name-all-active .water-group .water-channel,
.name-all-active .water-group .water-channel-glow,
.name-all-active .water-group .water-channel-bed {
  opacity: 0.35;
}

.sad-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10001;
  background: rgba(10, 15, 30, 0.25);
  overflow: hidden;
}

.sad-raindrop {
  position: absolute;
  top: -20px;
  width: 2px;
  height: 14px;
  background: linear-gradient(to bottom, transparent, rgba(120, 140, 180, 0.35));
  border-radius: 1px;
  animation: sad-rain var(--fall-dur, 1.1s) linear forwards;
}

@keyframes sad-rain {
  0% { transform: translateY(0); opacity: 0.6; }
  100% { transform: translateY(110vh); opacity: 0; }
}

body.segment-bezirke .stadtteil-path.unlocked-bezirk {
  stroke-width: 0.35px;
  stroke: rgba(255, 255, 255, 0.08);
  fill: rgba(255, 255, 255, 0.03);
}

body.segment-bezirke .stadtteil-path[data-bezirk="Altona"].unlocked-bezirk { fill: hsla(295, 80%, 55%, 0.12); }
body.segment-bezirke .stadtteil-path[data-bezirk="Bergedorf"].unlocked-bezirk { fill: hsla(32, 80%, 50%, 0.12); }
body.segment-bezirke .stadtteil-path[data-bezirk="Eimsbüttel"].unlocked-bezirk { fill: hsla(175, 70%, 42%, 0.12); }
body.segment-bezirke .stadtteil-path[data-bezirk="Hamburg-Mitte"].unlocked-bezirk { fill: hsla(345, 80%, 55%, 0.12); }
body.segment-bezirke .stadtteil-path[data-bezirk="Hamburg-Nord"].unlocked-bezirk { fill: hsla(210, 75%, 52%, 0.12); }
body.segment-bezirke .stadtteil-path[data-bezirk="Harburg"].unlocked-bezirk { fill: hsla(100, 70%, 48%, 0.12); }
body.segment-bezirke .stadtteil-path[data-bezirk="Wandsbek"].unlocked-bezirk { fill: hsla(260, 75%, 55%, 0.12); }

.game-play-area .secondary-btn {
  width: 100%;
}

body.segment-bezirke .stadtteil-path:hover:not(.bezirk-hover-highlight):not(.selected):not(.blink) {
  stroke-width: 0.35px !important;
  stroke: rgba(255, 255, 255, 0.05) !important;
  filter: none !important;
}

.primary-btn {
  background: linear-gradient(135deg, var(--color-neutral-glow), var(--color-wandsbek));
  border: none;
  color: #fff;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 162, 255, 0.4);
  width: 100%;
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 162, 255, 0.6);
  }
  
  &:active {
    transform: translateY(1px);
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes mapPulse {
  0% { fill: rgba(255, 255, 255, 0.04); }
  50% { fill: rgba(255, 255, 255, 0.25); filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4)); }
  100% { fill: rgba(255, 255, 255, 0.04); }
}

@keyframes mapShake {
  0%, 100% { transform: translate(0, 0); }
  20%, 60% { transform: translate(-3px, 0); }
  40%, 80% { transform: translate(3px, 0); }
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .console-panel {
    order: 2;
  }
  
  .map-panel {
    order: 1;
  }
  
  .map-container-wrapper {
    min-height: 420px;
  }
  
  .hamburg-map-svg,
  .city-map-svg {
    max-height: 55vh;
    max-height: 55dvh;
  }

  .map-prompt-bar {
    display: block;
  }

  body.in-round .segment-selector,
  body.in-round .mode-selector {
    display: none;
  }

  body.in-round .map-container-wrapper {
    min-height: min(42vh, 42dvh, 320px);
  }
}

@media (min-width: 1025px) {
  .map-prompt-bar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 1rem 1.25rem;
  }
  
  .stats-bar {
    gap: 0.65rem;
  }
  
  .stat-pill {
    padding: 0.45rem 0.7rem;
    font-size: 0.82rem;
  }
  
  .level-tracker {
    min-width: 0;
    flex: 1 1 140px;
  }
  
  .map-container-wrapper {
    min-height: 380px;
  }
  
  .modal-content {
    padding: 1.5rem;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .overlay-modal {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    align-items: flex-start;
    padding-top: max(2rem, env(safe-area-inset-top));
  }
}

@media (max-width: 640px) {
  .app-container {
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    gap: 0.75rem;
  }
  
  .app-header {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: stretch;
  }
  
  .brand {
    justify-content: space-between;
    width: 100%;
  }
  
  .brand .badge {
    display: none;
  }
  
  .stats-bar {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
  }
  
  .level-tracker {
    width: 100%;
    order: 10;
  }
  
  .audio-toggle {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }
  
  .glass-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }
  
  .map-container-wrapper {
    min-height: min(52vh, 52dvh, 380px);
    border-radius: var(--radius-md);
    padding: 0.5rem;
  }

  body.in-round .map-container-wrapper {
    min-height: min(38vh, 38dvh, 280px);
  }
  
  .hamburg-map-svg {
    max-height: none;
  }

  .map-prompt-bar .map-prompt-target {
    font-size: 1.2rem;
  }
  
  .brand h1 {
    font-size: 1.25rem;
  }
  
  .segment-btn {
    min-height: 44px;
    font-size: 0.8rem;
    padding: 0.6rem 0.4rem;
  }
  
  .mode-btn {
    min-height: 48px;
    padding: 0.75rem 0.85rem;
  }
  
  .choice-btn {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    min-height: 48px;
  }
  
  .prompt-box .prompt-target {
    font-size: 1.5rem;
  }
  
  .map-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
  }
  
  .map-controls .zoom-btns {
    width: 100%;
    justify-content: center;
  }
  
  .map-controls .control-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    font-size: 1.1rem;
  }
  
  .map-controls .control-btn#btn-zoom-reset {
    flex: 1;
    min-height: 44px;
  }
  
  .map-hint {
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.35;
  }
  
  .neuwerk-overlay {
    top: max(0.5rem, env(safe-area-inset-top));
    right: 0.5rem;
    font-size: 0.7rem;
    padding: 0.5rem 0.65rem;
  }
  
  .primary-btn,
  .secondary-btn {
    min-height: 48px;
  }
  
  .autocomplete-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .privacy-notice {
    font-size: 0.68rem;
    padding: 0 0.25rem;
  }
}

/* Touch devices: reduce hover-only motion */
@media (hover: none) and (pointer: coarse) {
  .choice-btn:hover,
  .mode-btn:hover,
  .segment-btn:hover,
  .glass-card:hover {
    transform: none;
  }
  
  .choice-btn:active,
  .mode-btn:active,
  .segment-btn:active {
    transform: scale(0.98);
    opacity: 0.92;
  }
}

/* Slider Switch CSS */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  transition: 0.3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.3s;
  border-radius: 50%;
}
.switch input:checked + .slider {
  background-color: rgba(0, 162, 255, 0.15);
  border-color: rgba(0, 162, 255, 0.4);
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--color-neutral-glow);
  box-shadow: 0 0 8px var(--color-neutral-glow);
}

/* Auth pill & modal */
.auth-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.auth-pill:hover {
  border-color: rgba(0, 162, 255, 0.4);
  background: rgba(0, 162, 255, 0.06);
}

.auth-pill--logged-in {
  cursor: default;
}

.auth-pill--logged-in:hover {
  border-color: var(--border-color);
  background: rgba(255, 255, 255, 0.03);
}

.auth-pill-icon {
  font-size: 1rem;
  line-height: 1;
}

.auth-pill-label,
.auth-pill-name {
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-pill--logged-in .auth-pill-name {
  color: var(--color-neutral-glow);
}

.auth-pill-action {
  color: var(--color-neutral-glow);
  font-size: 0.8rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.auth-pill:not(.auth-pill--logged-in) .auth-pill-action {
  pointer-events: none;
}

.auth-modal-content {
  max-width: 420px;
}

.auth-modal-intro {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0.5rem 0 1rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-tab {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.auth-tab--active {
  background: rgba(0, 162, 255, 0.12);
  border-color: rgba(0, 162, 255, 0.45);
  color: var(--color-neutral-glow);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.auth-form[hidden] {
  display: none !important;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-field input {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(0, 162, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(0, 162, 255, 0.15);
}

.auth-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin: 0;
}

.auth-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.auth-cancel {
  width: 100%;
  margin-top: 0.5rem;
}

.settings-cloud-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.settings-cloud-status--active {
  color: var(--color-neutral-glow);
}

.settings-lang-block {
  margin-bottom: 1.2rem;
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.lang-btn {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.lang-btn.active {
  border-color: var(--color-neutral-glow);
  color: #fff;
  background: rgba(0, 162, 255, 0.15);
}

.lang-toggle {
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
}

.lang-toggle:hover {
  border-color: var(--color-neutral-glow);
  background: rgba(255, 255, 255, 0.06);
}

.sync-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 10001;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(0, 162, 255, 0.4);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sync-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .auth-pill {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
  }

  .auth-pill-name {
    max-width: 80px;
  }
}

/* =============================================================
 * Multi-City UI (Phase 1) — Hub, context bar, log zones
 * ============================================================= */
:root {
  --acc: var(--color-neutral-glow);
  --acc-bright: hsl(200 100% 70%);
  --acc-line: rgba(0, 162, 255, 0.42);
  --acc-fill: rgba(0, 162, 255, 0.14);
  --acc-fill-soft: rgba(0, 162, 255, 0.07);
  --acc-glow: rgba(0, 162, 255, 0.40);
  --gap: 1rem;
  --pad: 1rem;
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--pad);
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 100dvh;
}

.density-compact { --gap: 1rem; --pad: 1rem; }

.city-view-root .app-container {
  padding: 0;
  min-height: auto;
  gap: var(--gap);
}

.global-header .brand h1 {
  background: linear-gradient(135deg, #fff 30%, var(--color-neutral-glow) 110%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.global-header .badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

/* Hub */
.city-hub { display: flex; flex-direction: column; gap: var(--gap); }
.hub-top {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  padding: 1.1rem 1.6rem; background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.hub-account { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.hub-account-rank { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.hub-account-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hub-account-value { font-family: var(--font-display); font-weight: 700; color: var(--color-xp); text-shadow: 0 0 10px rgba(255, 191, 0, 0.3); }
.hub-intro { text-align: center; padding: 0.5rem 0; }
.hub-intro h2 {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin-bottom: 0.3rem;
  background: linear-gradient(135deg, #fff 45%, var(--color-neutral-glow) 120%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hub-intro p { color: var(--text-secondary); font-size: 0.95rem; }
.hub-intro strong { color: #fff; }

.hub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.city-tile {
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1rem; padding: 1.3rem;
  background: linear-gradient(160deg, var(--acc-fill-soft), transparent 60%), var(--bg-surface);
  border: 1px solid var(--acc-line); border-radius: var(--radius-lg); backdrop-filter: blur(16px);
  transition: var(--transition-smooth); font-family: var(--font-sans); position: relative; overflow: hidden;
}
.city-tile::before {
  content: ""; position: absolute; top: -40%; right: -20%; width: 60%; height: 80%; border-radius: 50%;
  background: radial-gradient(circle, var(--acc-glow), transparent 70%); opacity: 0.5; pointer-events: none;
}
.city-tile:hover:not(.is-coming-soon) { transform: translateY(-3px); border-color: var(--acc); box-shadow: 0 12px 34px -12px var(--acc-glow); }
.city-tile.is-coming-soon { cursor: default; opacity: 0.92; }
.city-tile.is-coming-soon:hover { transform: none; }
.coming-soon-badge { font-size: 0.62rem; vertical-align: middle; margin-left: 0.35rem; }
.city-tile-head { display: flex; align-items: center; gap: 0.9rem; position: relative; }
.city-tile-id { flex: 1; min-width: 0; }
.city-tile-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: #fff; display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }
.home-dot { color: var(--color-xp); font-size: 0.85rem; }
.city-tile-greet { font-size: 0.82rem; color: var(--acc-bright); font-weight: 600; }
.city-tile-blurb { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }
.city-tile-trophies {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); border-radius: var(--radius-md);
}
.ctt-icon { font-size: 1rem; }
.ctt-count { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); font-family: var(--font-display); }
.city-tile-levels { display: flex; flex-direction: column; gap: 0.6rem; position: relative; }
.hub-level-bar-head { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-secondary); font-weight: 600; }
.hub-level-tier { color: var(--acc-bright); font-weight: 700; }
.hub-level-pct { color: var(--text-muted); font-family: var(--font-display); }
.hub-level-track { height: 5px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden; margin-top: 0.35rem; }
.hub-level-fill { height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc-bright)); border-radius: 999px; box-shadow: 0 0 8px var(--acc-glow); }
.city-tile-cta {
  display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.9rem; border-radius: var(--radius-md);
  background: var(--acc-fill); border: 1px solid var(--acc-line); color: #fff; font-weight: 700; font-size: 0.9rem;
}
.city-tile-cta.is-disabled { opacity: 0.65; }
.city-tile-soon-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }
.cta-arrow { font-size: 1.1rem; }
.wish-tile { align-items: center; justify-content: center; text-align: center; border-style: dashed; border-color: var(--border-color-glow); background: rgba(255, 255, 255, 0.015); min-height: 220px; }
.wish-tile::before { display: none; }
.wish-plus { font-size: 2.2rem; color: var(--color-neutral-glow); line-height: 1; }
.wish-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: #fff; }
.wish-sub { font-size: 0.8rem; color: var(--text-muted); max-width: 22ch; }

/* City context bar */
.city-context-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--acc-fill), var(--acc-fill-soft) 60%, transparent), var(--bg-surface);
  border: 1px solid var(--acc-line); border-left: 4px solid var(--acc);
}
.ccb-left { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ccb-hub-btn {
  display: flex; align-items: center; gap: 0.3rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color);
  color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; padding: 0.45rem 0.7rem; border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font-sans); transition: var(--transition-fast);
}
.ccb-hub-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.ccb-switch-wrap { position: relative; }
.city-pill {
  display: flex; align-items: center; gap: 0.5rem; background: var(--acc-fill); border: 1px solid var(--acc);
  color: #fff; padding: 0.45rem 0.8rem; border-radius: 999px; cursor: pointer; font-family: var(--font-sans);
}
.city-pill-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc-glow); }
.city-pill-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.city-pill-greet { font-size: 0.74rem; opacity: 0.8; }
.city-switcher {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 200; min-width: 240px; padding: 0.5rem;
  background: rgba(12, 17, 32, 0.97); border: 1px solid var(--border-color-glow); border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.city-switcher-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.6rem; border-radius: var(--radius-sm);
  background: none; border: 1px solid transparent; cursor: pointer; font-family: var(--font-sans); color: var(--text-secondary);
}
.city-switcher-item:hover { background: var(--acc-fill); border-color: var(--acc-line); color: #fff; }
.city-switcher-item.active { background: var(--acc-fill); border-color: var(--acc-line); }
.city-switcher-item.is-soon { opacity: 0.75; }
.csi-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); }
.csi-name { font-weight: 700; color: #fff; flex: 1; text-align: left; }
.csi-meta { font-size: 0.74rem; color: var(--text-muted); font-family: var(--font-display); }
.csi-check { color: var(--acc-bright); font-weight: 700; }
.city-switcher-hub {
  width: 100%; margin-top: 0.35rem; padding: 0.55rem; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-color); color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: var(--font-sans);
}
.ccb-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.45rem; font-size: 0.82rem; }
.bc-step { white-space: nowrap; }
.bc-city { color: var(--acc-bright); font-weight: 700; }
.bc-tier {
  color: var(--acc-bright); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; padding: 0.12rem 0.4rem; border-radius: 999px;
  background: var(--acc-fill); border: 1px solid var(--acc-line);
}
.bc-level { color: var(--text-secondary); font-weight: 600; }
.bc-sep { color: var(--text-muted); font-size: 0.75rem; padding: 0 0.1rem; user-select: none; }
.bc-mode { color: #fff; font-weight: 600; }

.segment-selector.adaptive { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0; background: none; border: none; }
.segment-selector.adaptive .segment-btn {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.7rem 0.8rem; text-align: left;
}
.seg-num {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; flex-shrink: 0;
}
.segment-btn.active .seg-num { background: var(--acc); color: #06121f; border-color: var(--acc); }
.seg-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.seg-tier { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.segment-btn.active .seg-tier { color: var(--acc-bright); }
.seg-label { font-weight: 700; font-size: 0.92rem; color: var(--text-secondary); }
.segment-btn.active .seg-label { color: #fff; }
.seg-count { font-family: var(--font-display); font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.segment-btn.active .seg-count { color: var(--acc-bright); }

/* Log modal zones */
.log-modal-intro { margin-bottom: 1.25rem; font-size: 0.9rem; color: var(--text-secondary); }
.log-zone { border-radius: var(--radius-md); padding: 1rem; margin-bottom: 1rem; }
.log-zone-global { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); }
.log-zone-city { background: var(--acc-fill-soft); border: 1px solid var(--acc-line); }
.log-zone-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.log-zone-tag { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.2rem 0.6rem; border-radius: 999px; }
.log-zone-tag.global { background: rgba(255, 191, 0, 0.12); color: var(--color-xp); border: 1px solid rgba(255, 191, 0, 0.3); }
.log-zone-tag.city { background: var(--acc-fill); color: var(--acc-bright); border: 1px solid var(--acc-line); }
.log-zone-note { font-size: 0.72rem; color: var(--text-muted); }
.log-city-note { font-size: 0.74rem; color: var(--text-secondary); margin-top: 0.5rem; }
.modal-x {
  position: absolute; top: 1rem; right: 1rem; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: var(--text-secondary); cursor: pointer;
}

.wish-vote-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.1rem; }
.wish-vote-item {
  position: relative; display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); cursor: pointer; overflow: hidden; font-family: var(--font-sans);
}
.wvi-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 162, 255, 0.1); }
.wvi-name { position: relative; font-weight: 700; color: #fff; flex: 1; text-align: left; }
.wvi-count { position: relative; font-family: var(--font-display); font-weight: 700; color: var(--text-secondary); }
.wvi-action { position: relative; font-size: 0.72rem; font-weight: 700; color: var(--color-neutral-glow); width: 76px; text-align: right; }
.wish-propose { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.wish-submit-btn { width: auto !important; padding: 0.85rem 1.4rem !important; }
.wish-thanks { margin-top: 0.8rem; text-align: center; color: var(--color-correct); font-weight: 700; }

/* City progress card (dashboard console) */
.city-progress-card { gap: 0; }
.cpc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
.cpc-head h3 { font-family: var(--font-display); font-size: 1rem; color: #fff; }
.cpc-badge { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--acc-bright); background: var(--acc-fill);
  border: 1px solid var(--acc-line); padding: 0.2rem 0.55rem; border-radius: 999px; font-weight: 700; }
.cpc-rank-row {
  display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem; border-radius: var(--radius-md);
  background: var(--acc-fill-soft); border: 1px solid var(--acc-line);
}
.cpc-rank-info { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.cpc-rank-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.cpc-rank-name { font-family: var(--font-display); font-weight: 700; color: var(--acc-bright); font-size: 1rem; }
.cpc-rank-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.cpc-rank-fill { height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc-bright)); border-radius: 999px; transition: width 0.5s ease; }
.cpc-rank-hint { font-size: 0.72rem; color: var(--text-secondary); }
.cpc-rank-meta { font-size: 0.68rem; color: var(--text-muted); }
.cpc-unlock-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.7rem; }
.cpc-unlock { background: rgba(255,255,255,0.02); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; }
.cpc-unlock-num { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: #fff; }
.cpc-unlock-den { font-size: 0.9rem; color: var(--text-muted); }
.cpc-unlock-lbl { font-size: 0.7rem; color: var(--text-muted); }
.cpc-gate-hint { font-size: 0.72rem; color: var(--text-secondary); background: var(--acc-fill-soft); border: 1px solid var(--acc-line);
  border-radius: var(--radius-md); padding: 0.55rem 0.75rem; margin-bottom: 0.85rem; }
.cpc-trophies { margin-bottom: 0.9rem; }
.cpc-tro-head { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.5rem; }
.cpc-tro-count { color: var(--acc-bright); font-family: var(--font-display); }
.cpc-tro-strip { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.cpc-tro-chip { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-color); background: rgba(255,255,255,0.02); font-size: 1.2rem; }
.cpc-tro-chip.earned { border-color: var(--acc-line); background: var(--acc-fill); box-shadow: 0 0 12px -2px var(--acc-glow); }
.cpc-tro-chip.locked { filter: grayscale(1); opacity: 0.4; }

@media (max-width: 680px) {
  .hub-tiles { grid-template-columns: 1fr; }
  .hub-account { width: 100%; justify-content: space-between; }
  .city-context-bar { flex-direction: column; align-items: stretch; }
  .ccb-breadcrumb { justify-content: center; }
  .segment-selector.adaptive { grid-template-columns: 1fr; }
}
