/* -------------------------------------------------------------
 * Kiez-Signal Design System
 * Brand CI 2026 — highly optimized, responsive, Safari-compatible.
 * ------------------------------------------------------------- */

@import url('fonts.css');

:root {
  /* Brand palette */
  --signal: #FF5233;
  --signal-tief: #E23E22;
  --tinte: #0F1118;
  --strom: #C6F24E;
  --himmel: #5AA9FF;
  --papier: #F1ECE0;
  --kreide: #FCFBF8;
  --beton: #252938;
  --nebel: #9AA0B0;
  --bernstein: #F4B53C;
  --pflaume: #9B7BFF;
  --tuerkis: #2BC4B4;

  /* Theme Base Colors (aliases) */
  --bg-main: var(--tinte);
  --bg-surface: rgba(37, 41, 56, 0.72);
  --bg-surface-hover: rgba(37, 41, 56, 0.88);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(255, 82, 51, 0.25);
  
  --text-primary: var(--kreide);
  --text-secondary: var(--nebel);
  --text-muted: #6B7289;

  /* District tints (CI d1–d7) */
  --color-altona: var(--signal);
  --color-bergedorf: var(--bernstein);
  --color-eimsbuettel: var(--tuerkis);
  --color-hamburg-mitte: #FF8A5B;
  --color-hamburg-nord: var(--himmel);
  --color-harburg: var(--strom);
  --color-wandsbek: var(--pflaume);
  --color-default-path: var(--beton);
  --color-neutral-glow: var(--himmel);

  /* UI Game Colors */
  --color-correct: #3DD68C;
  --color-incorrect: #FF4D6D;
  --color-xp: var(--strom);
  
  /* Fonts */
  --font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Bricolage Grotesque', var(--font-sans);
  --font-mono: 'Space Mono', ui-monospace, monospace;
  
  /* 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%, rgba(255, 82, 51, 0.08) 0, transparent 45%),
    radial-gradient(at 100% 0%, rgba(90, 169, 255, 0.07) 0, transparent 45%),
    radial-gradient(at 50% 100%, rgba(37, 41, 56, 0.9) 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;
}

.footer-credit a {
  color: inherit;
  text-decoration: none;
}

.footer-credit a:hover {
  color: var(--signal);
}

.footer-links {
  margin: 0.5rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.footer-links-sep {
  color: var(--text-muted);
  font-size: 0.78rem;
  user-select: none;
}

.footer-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-link-btn:hover {
  color: var(--kreide);
  border-color: var(--border-color-glow);
  background: rgba(255, 255, 255, 0.07);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.45rem;
  margin: 0.35rem 0 0;
}

.footer-legal-links a,
.footer-legal-links .footer-legal-btn {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-legal-links a:hover,
.footer-legal-links .footer-legal-btn:hover {
  color: var(--signal);
}

.footer-legal-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.footer-copyright {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-legal-sep {
  color: var(--text-muted);
  font-size: 0.65rem;
  user-select: none;
  opacity: 0.6;
}

/* “Was ist neu?” — header & footer entry points */
.changelog-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.42rem 0.72rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 191, 0, 0.48);
  background: linear-gradient(135deg, rgba(255, 191, 0, 0.16), rgba(255, 191, 0, 0.06));
  color: var(--color-xp);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.changelog-header-btn:hover,
.changelog-header-btn:focus-visible {
  border-color: rgba(255, 191, 0, 0.75);
  background: linear-gradient(135deg, rgba(255, 191, 0, 0.24), rgba(255, 191, 0, 0.1));
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 191, 0, 0.22);
  outline: none;
}

.changelog-header-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.changelog-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.48rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 191, 0, 0.4);
  background: rgba(255, 191, 0, 0.1);
  color: var(--color-xp);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.changelog-footer-btn:hover,
.changelog-footer-btn:focus-visible {
  border-color: rgba(255, 191, 0, 0.65);
  background: rgba(255, 191, 0, 0.18);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 191, 0, 0.22);
  outline: none;
}

/* Changelog modal */
.changelog-modal-content {
  max-width: 560px;
  text-align: left;
}

.changelog-intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  text-align: center;
}

.changelog-scroll {
  max-height: min(52vh, 28rem);
  overflow-y: auto;
  margin-bottom: 1.25rem;
  padding-right: 0.35rem;
  text-align: left;
}

.changelog-entry {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.changelog-entry:first-child {
  padding-top: 0;
}

.changelog-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.changelog-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.changelog-version {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-xp);
}

.changelog-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.changelog-entry-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
}

.changelog-items {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.changelog-items li + li {
  margin-top: 0.35rem;
}

.changelog-modal-content .primary-btn {
  width: 100%;
}

/* 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);
}

.admin-header-strip {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.15rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(168, 28, 28, 0.92), rgba(120, 18, 18, 0.88));
  border: 1px solid rgba(255, 100, 100, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.admin-header-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffe8e8;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-header-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 200, 200, 0.45);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}

.admin-header-btn:hover {
  background: rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 220, 220, 0.65);
}

.admin-header-btn--ghost {
  background: transparent;
  border-color: rgba(255, 200, 200, 0.28);
  color: rgba(255, 235, 235, 0.92);
}

.admin-header-btn--ghost:hover {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 220, 220, 0.5);
}

.admin-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #8a1515;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  &.brand-link {
    text-decoration: none;
    color: inherit;
    border: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
    transition: var(--transition-fast);
  }

  &.brand-link:hover .brand-logo {
    transform: scale(1.04) translateY(-1px);
    filter: drop-shadow(0 2px 14px rgba(198, 242, 78, 0.4));
  }

  &.brand-link:focus-visible {
    outline: none;
  }

  &.brand-link:focus-visible .brand-logo {
    outline: 2px solid var(--signal);
    outline-offset: 4px;
    border-radius: 2px;
  }

  .brand-logo {
    height: 2rem;
    width: auto;
    max-width: min(148px, 42vw);
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    background: transparent;
    transition: transform 0.2s ease, filter 0.2s ease;
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  
  h1,
  h2.brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.65rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--kreide) 30%, var(--himmel) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
  }
  
  .badge {
    background: rgba(255, 82, 51, 0.12);
    border: 1px solid rgba(255, 82, 51, 0.35);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    color: var(--signal);
    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;

  &.stat-pill-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
  }

  &.stat-pill-link:hover {
    border-color: var(--border-color-glow);
    background: rgba(198, 242, 78, 0.08);
  }
  
  .label {
    color: var(--text-secondary);
    font-weight: 500;
  }
  
  .value {
    color: #fff;
    font-family: var(--font-display);
  }
  
  &.xp-pill.xp-pill--hub {
    cursor: pointer;
  }

  &.xp-pill {
    min-width: 10.5rem;
    padding: 0.4rem 0.75rem 0.45rem;
    --xp-rank-pct: 0%;

    .xp-pill-body {
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
      width: 100%;
    }

    .xp-pill-row {
      display: flex;
      align-items: baseline;
      gap: 0.35rem;
      flex-wrap: wrap;
      line-height: 1.2;
    }

    .rank-name {
      margin-left: auto;
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--color-xp);
      text-shadow: 0 0 8px rgba(255, 191, 0, 0.25);
    }

    .xp-pill-progress {
      width: 100%;
      height: 5px;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 999px;
      overflow: hidden;
    }

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

  &.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: start;
  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 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}

#game-play-area-card.game-play-area {
  flex: 0 0 auto;
}

.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 {
  flex: 0 1 auto;
  min-height: 0;

  .district-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.75rem;
    max-height: min(240px, 32vh, 32dvh);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

.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;
  align-self: start;
}

/* During rounds the map frame should match the SVG viewport, not an oversized flex box */
body.in-round .map-container-wrapper {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(72vh, 72dvh);
  height: auto;
}

.map-island-dock {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}

.map-island-dock .island-overlay,
.map-island-dock .islands-stack .europe-island-overlay {
  position: static;
  top: auto;
  right: auto;
}

.map-island-dock .islands-stack {
  position: static;
  flex-direction: row;
  flex-wrap: wrap;
  max-width: none;
  gap: 0.45rem;
}

.map-center-btn {
  align-self: stretch;
  background: rgba(0, 162, 255, 0.08);
  border: 1px solid rgba(0, 162, 255, 0.3);
  color: var(--color-neutral-glow);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.85rem;
  transition: var(--transition-fast);

  &:hover {
    background: rgba(0, 162, 255, 0.15);
    border-color: rgba(0, 162, 255, 0.5);
    color: #fff;
  }
}

.map-container-wrapper {
  flex: 0 1 auto;
  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: min(500px, 70vh, 70dvh);
  max-height: min(70vh, 70dvh);
  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 — anchored to map container, scrolls with the map */
.map-tooltip {
  position: absolute;
  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;
  shape-rendering: geometricPrecision;
}

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

.hamburg-map-svg.map-panning,
.city-map-svg.map-panning {
  will-change: transform;
}

/* 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;
}

/* Name Sprint 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: hsl(var(--map-h, 200) 85% 58% / 0.28) !important;
  stroke: hsl(var(--map-h, 200) 90% 65% / 0.85) !important;
  stroke-width: 1.2px !important;
}

/* Detektiv (Stadtteile): einzelner Ortsteil bleibt markiert */
.stadtteil-path.map-hover-highlight {
  fill: hsl(var(--map-h, 200) 85% 58% / 0.48) !important;
  stroke: #fff !important;
  stroke-width: 1.5px !important;
  filter: drop-shadow(0 0 6px hsl(var(--map-h, 200) 85% 58% / 0.85)) !important;
  z-index: 12;
}

.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;
}

/* Europe: per-country hue via --map-h set in JS */
#city-view[data-city="europe"] .stadtteil-path.selected {
  fill: hsl(var(--map-h, 200) 85% 58% / 0.45) !important;
  stroke: hsl(var(--map-h, 200) 85% 58%) !important;
  filter: drop-shadow(0 0 8px hsl(var(--map-h, 200) 85% 58%)) !important;
}
.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;
}

.islands-stack {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  z-index: 50;
  max-width: min(16rem, 42vw);

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

  .europe-island-overlay {
    position: relative;
    top: auto;
    right: auto;
    font-size: 0.7rem;
    padding: 0.45rem 0.65rem;
  }
}

.map-panel > .europe-microstates-bar,
.map-panel > .map-microstates-dock {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 48;
  flex-shrink: 0;
  margin: 0 0.75rem 0.65rem;
}

.map-container-wrapper > .europe-microstates-bar {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.65rem;
}

.europe-microstates-bar {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.65rem;
  z-index: 48;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0.55rem;
  background: color-mix(in srgb, var(--bg-surface) 58%, transparent);
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;

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

.europe-microstates-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.europe-microstates-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.1rem;
}

.europe-microstate-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
  background: color-mix(in srgb, var(--bg-surface) 68%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 0.68rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;

  &:hover,
  &:focus-visible {
    border-color: var(--border-color-glow, var(--border-color));
    background: color-mix(in srgb, var(--text-primary) 10%, var(--bg-surface));
    outline: none;
  }

  &.active {
    border-color: hsla(var(--acc-h, 210), 90%, 60%, 0.65);
    background: hsla(var(--acc-h, 210), 70%, 45%, 0.25);
    box-shadow: 0 0 12px hsla(var(--acc-h, 210), 90%, 55%, 0.25);
  }
}

.micro-hit-group {
  pointer-events: none;
}

.micro-hit-group .micro-hit-target {
  pointer-events: all;
}

#city-view[data-city="europe"] .stadtteil-path.micro-hit-target {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2px;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
  touch-action: manipulation;
}

#city-view[data-city="europe"] .stadtteil-path.micro-hit-target:hover,
#city-view[data-city="europe"] .stadtteil-path.micro-hit-target:focus-visible {
  fill: rgba(255, 255, 255, 0.14);
  stroke: hsla(var(--map-h, 200), 100%, 70%, 0.65);
  stroke-width: 2.5px !important;
}

@media (hover: none) and (pointer: coarse) {
  #city-view[data-city="europe"] .stadtteil-path.micro-hit-target {
    fill: rgba(255, 255, 255, 0.1);
    stroke-width: 2.5px;
  }
}

#city-view[data-city="europe"] .stadtteil-path.micro-state-visible {
  stroke: hsla(var(--map-h, 200), 100%, 65%, 0.45);
  stroke-width: 1.25px !important;
  filter: drop-shadow(0 0 4px hsla(var(--map-h, 200), 100%, 55%, 0.35));
}

/* 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;
  }
}

.wish-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;

  th, td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
  }

  th {
    color: var(--text-secondary);
    font-weight: 700;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
  }
}

/* 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):not(.map-hover-highlight) {
  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):not(.map-hover-highlight) {
  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);
}

.bezirk-picker-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.bezirk-picker-action {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
}

#btn-history[hidden] {
  display: none !important;
}

.xp-global-popover {
  position: fixed;
  z-index: 1200;
  width: min(22rem, calc(100vw - 1.5rem));
  padding: 1rem 1.1rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.xp-global-popover-x {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.xp-global-popover-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
  padding-right: 1.25rem;
}

.xp-global-popover .log-rank-section,
.xp-global-popover .log-rank-current {
  margin: 0 0 0.5rem;
}

.xp-global-popover .rank-ladder {
  max-height: 12rem;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

.xp-global-popover-profile {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--himmel);
  text-decoration: none;
}

.xp-global-popover-profile:hover {
  text-decoration: underline;
}

.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, border-color 0.2s, transform 0.15s;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}

.trophy-tile:hover {
  border-color: rgba(255, 191, 0, 0.35);
  transform: translateY(-1px);
}

.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;
}

.trophy-detail-modal {
  text-align: center;
  max-width: 360px;
}

.trophy-detail-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.trophy-detail-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 0.35rem;
}

.trophy-detail-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.trophy-detail--earned .trophy-detail-status {
  color: var(--color-xp);
  background: rgba(255, 191, 0, 0.12);
  border: 1px solid rgba(255, 191, 0, 0.35);
}

.trophy-detail--locked .trophy-detail-status {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
}

.trophy-detail-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.trophy-detail-desc {
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.trophy-detail-modal .primary-btn {
  width: 100%;
}

.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: hsl(var(--map-h, 200) 72% 52% / 0.22);
  fill: hsl(var(--map-h, 200) 72% 52% / 0.12);
}

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: var(--signal);
  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 8px 22px -10px var(--signal);
  width: 100%;
  
  &:hover {
    background: var(--signal-tief);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -10px var(--signal);
  }
  
  &:active {
    transform: translateY(1px);
  }
}

.round-setup-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
}

.round-setup-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--signal) 13%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--signal) 26%, transparent);
  color: var(--signal);
}

.round-setup-icon svg {
  width: 24px;
  height: 24px;
}

.round-setup-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

.round-setup-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* 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); }
}

/* Device layouts: src/styles/device/ (phone, tablet, desktop, touch) */
/* Responsive Styles (moved to device/) */

/* 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);
}

a.auth-pill-profile-link {
  text-decoration: none;
  font-weight: 600;
}

a.auth-pill-profile-link:hover {
  color: var(--acc, hsl(205 100% 62%));
}

.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-pill:not(.auth-pill--logged-in) .auth-pill-action.btn-auth-login {
  pointer-events: auto;
}

.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-success {
  color: var(--color-neutral-glow);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.45;
}

.auth-forgot-wrap {
  margin: -0.35rem 0 0;
  text-align: right;
}

.auth-link-btn {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--color-neutral-glow);
  cursor: pointer;
  text-decoration: underline;
}

.auth-link-btn:hover {
  color: #fff;
}

.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);
}

/* =============================================================
 * 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,
.global-header .brand h2.brand-title {
  background: linear-gradient(135deg, var(--kreide) 30%, var(--himmel) 110%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  font-size: 1.65rem;
  font-family: var(--font-display);
  font-weight: 800;
}

.global-header .badge {
  background: rgba(255, 82, 51, 0.12);
  border-color: rgba(255, 82, 51, 0.35);
  color: var(--signal);
}

/* WCAG 2.1 AA — sichtbarer Tastaturfokus */
:focus-visible {
  outline: 2px solid var(--himmel);
  outline-offset: 2px;
}

/* WCAG 2.1 AA — Bewegungsreduzierung */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

