/* ==========================================================================
   1. RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #06090e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #f7fafc;
}

/* WebGL Globe Canvas */
#globeCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
  cursor: grab;
}
#globeCanvas.dragging {
  cursor: grabbing;
}

/* ==========================================================================
   2. UI OVERLAY & LAYOUT
   ========================================================================== */
.ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.top-bar, .bottom-bar, .timeline-sidebar, .timer-badge, .modal-card {
  pointer-events: auto;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.route-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  flex: 1 1 auto;
  min-width: 0;
}

.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  max-width: min(220px, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

.badge:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.route-arrow {
  color: #718096;
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-btn {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Sidebar Timeline */
.timeline-sidebar {
  position: absolute;
  top: 72px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 180px);
  max-width: min(260px, 45vw);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.2s ease;
  min-width: 0;
}

.timeline-item:hover {
  background: rgba(30, 41, 59, 0.85);
}

.timeline-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-item .label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bottom Input Area */
.bottom-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.status-label {
  font-size: 0.85rem;
  color: #f56565;
  font-weight: 500;
  min-height: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.status-label.success {
  color: #48bb78;
}

.input-container {
  display: flex;
  gap: 8px;
  width: 100%;
}

.autocomplete-wrapper {
  position: relative;
  flex: 1;
}

input[type="text"] {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: text;
  -webkit-user-select: text;
}

input[type="text"]:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.25);
}

.suggestions-list {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  margin-bottom: 6px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.suggestion-item {
  padding: 10px 16px;
  font-size: 0.9rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.suggestion-item:hover {
  background: rgba(49, 130, 206, 0.3);
  color: #fff;
}

/* Speedrun Timer Badge */
.timer-badge {
  position: absolute;
  top: 72px;
  right: 16px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  color: #48bb78;
}

.timer-badge.warning {
  color: #f56565;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Hover Tooltip */
.country-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  transform: translate(-50%, -130%);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   3. BUTTONS & UI CONTROLS
   ========================================================================== */
.btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn {
  background: #3182ce;
  color: #fff;
}

.primary-btn:hover {
  background: #2b6cb0;
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.35);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #a0aec0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.full-width {
  width: 100%;
}

/* ==========================================================================
   4. MODALS & SETTINGS MENU
   ========================================================================== */

.modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.modal-actions .btn {
  flex: 1;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-card {
  background: #0f172a;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f7fafc;
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: -8px;
}

.modal-message {
  font-size: 0.95rem;
  color: #a0aec0;
  line-height: 1.5;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group.disabled-group {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.8);
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.setting-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #718096;
}

.button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-btn {
  flex: 1;
  min-width: 80px; /* aumentato per evitare tagli */
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #a0aec0;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  word-break: break-word;
  transition: all 0.2s ease;
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.choice-btn.active {
  background: #3182ce;
  border-color: #3182ce;
  color: #fff;
  font-weight: 600;
}

/* --- Nuova regola: l'ultimo bottone della griglia modalità (Personalizzata) occupa tutta la larghezza --- */
.button-grid[data-choice-group="mode"] .choice-btn:last-child {
  flex-basis: 100%;
}

/* ==========================================================================
   5. SEGMENTED CONTROL (DESIGN DIFFICOLTÀ A PILLOLE)
   ========================================================================== */
.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.segment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: #a0aec0;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segment-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.segment-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.diff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.diff-dot.easy {
  background: #00c853;
  box-shadow: 0 0 6px rgba(0, 200, 83, 0.5);
}

.diff-dot.medium {
  background: #ffb300;
  box-shadow: 0 0 6px rgba(255, 179, 0, 0.5);
}

.diff-dot.hard {
  background: #ff1744;
  box-shadow: 0 0 6px rgba(255, 23, 68, 0.5);
}

/* Custom Game Inputs */
.custom-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 0.75rem;
  color: #a0aec0;
  font-weight: 500;
}

.checkbox-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #3182ce;
  cursor: pointer;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 34px;
  height: 34px;

  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);

  background: rgba(255,255,255,0.06);
  color: #fff;

  font-size: 1.1rem;
  font-weight: 600;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   6. VICTORY STATS & PATH REVIEW
   ========================================================================== */
.victory-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #718096;
  font-weight: 600;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f7fafc;
}

.path-comparison {
  display: flex;
  gap: 10px;
  text-align: left;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
}

.path-comparison-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.path-comparison-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #718096;
  font-weight: 600;
}

.path-comparison-list {
  list-style: decimal;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.path-comparison-list li {
  overflow-wrap: break-word;
}

.path-comparison-list li:first-child {
  color: #48bb78;
  font-weight: 700;
}

.path-comparison-list li:last-child {
  color: #dc143c;
  font-weight: 700;
}

#victoryReviewActions {
  flex-wrap: wrap;
}

#victoryReviewActions .btn {
  flex: 1;
  min-width: 140px;
}

.path-review-bar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 10px 8px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}

.small-btn {
  padding: 8px 14px;
  font-size: 0.82rem;
  white-space: nowrap;
}
/* ==========================================================================
   7. IMPOSTAZIONI COMPATTE (ottimizzazione spazio verticale)
   ========================================================================== */
#settingsMenu .modal-card {
  gap: 12px;
  padding: 18px 20px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
#settingsMenu .modal-title { font-size: 1.15rem; }
#settingsMenu .setting-group { gap: 5px; }
#settingsMenu .setting-label { font-size: 0.72rem; }
#settingsMenu .segmented-control { padding: 3px; gap: 3px; }
#settingsMenu .segment-btn { padding: 7px 10px; font-size: 0.82rem; }
#settingsMenu .choice-btn { padding: 7px 9px; font-size: 0.8rem; min-width: 74px; }
#settingsMenu .custom-options { padding: 10px; gap: 8px; }
#settingsMenu .modal-actions { margin-top: 4px; }

/* ==========================================================================
   8. INDICATORE ERRORI & PULSANTE INDIZIO
   ========================================================================== */
.errors-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 10px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 0.95rem;
}
.errors-badge .err-heart { line-height: 1; }
.errors-badge .err-heart.lost { opacity: 0.9; }

.hint-btn { position: relative; }
.hint-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.hint-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #f6ad2c;
  color: #1a202c;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

/* ==========================================================================
   9. SCHERMATA DI SCELTA GIOCO
   ========================================================================== */
.game-select-overlay {
  align-items: center;
  justify-content: center;
}
.game-select-wrap {
  pointer-events: auto;
  width: 100%;
  max-width: 720px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.game-select-heading {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.game-select-subheading {
  color: #a0aec0;
  font-size: 1rem;
  margin-top: -10px;
}
.game-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.game-select-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 28px 20px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: #f7fafc;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.game-select-card:hover {
  transform: translateY(-4px);
  border-color: #3182ce;
  background: #111d38;
  box-shadow: 0 16px 40px rgba(49, 130, 206, 0.25);
}
.game-select-emoji {
  font-size: 3.2rem;
  line-height: 1;
}
.game-select-title {
  font-size: 1.25rem;
  font-weight: 700;
}
.game-select-desc {
  font-size: 0.88rem;
  color: #a0aec0;
  line-height: 1.4;
  max-width: 240px;
}

@media (max-width: 560px) {
  .game-select-grid { grid-template-columns: 1fr; }
  .game-select-card { min-height: 148px; padding: 22px 18px; }
  .game-select-emoji { font-size: 2.6rem; }
  .game-select-heading { font-size: 1.6rem; }
}

/* ==========================================================================
   10. OTTIMIZZAZIONE MOBILE (evita scroll orizzontale/verticale su telefono)
   ========================================================================== */
@media (max-width: 680px) {
  .ui-container { padding: 10px; }

  /* Header più compatto */
  .top-bar { gap: 6px; }
  .route-display { padding: 6px 10px; gap: 6px; }
  .badge { font-size: 0.78rem; padding: 5px 8px; max-width: 32vw; }
  .route-arrow { font-size: 0.72rem; }
  .header-actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; font-size: 0.95rem; border-radius: 8px; }
  .errors-badge { height: 34px; padding: 0 8px; font-size: 0.82rem; gap: 1px; }
  .hint-count {
    min-width: 14px;
    height: 14px;
    font-size: 0.6rem;
    line-height: 14px;
  }

  /* Sidebar timeline più stretta e più in alto */
  .timeline-sidebar {
    top: 60px;
    left: 10px;
    max-width: 38vw;
    max-height: calc(100vh - 150px);
    gap: 6px;
    padding-right: 4px;
  }
  .timeline-item { padding: 5px 9px; font-size: 0.72rem; gap: 8px; }

  /* Timer speedrun */
  .timer-badge { top: 60px; right: 10px; font-size: 0.9rem; padding: 6px 10px; }

  /* Area input in basso */
  .bottom-bar { gap: 6px; }
  .status-label { font-size: 0.78rem; }
  .input-container { gap: 6px; }
  input[type="text"] { padding: 11px 14px; }
  .btn { padding: 11px 16px; font-size: 0.85rem; }

  /* Modali più compatte */
  .modal-overlay { padding: 10px; }
  .modal-card { padding: 18px; gap: 14px; max-height: calc(100vh - 20px); }
  .modal-title { font-size: 1.1rem; }
  .modal-message { font-size: 0.88rem; }
  .modal-icon { font-size: 2.1rem; }

  #victoryReviewActions .btn { min-width: 0; }
  .path-comparison { max-height: 140px; }

  /* Menu impostazioni: pulsanti più stretti per stare su meno righe */
  #settingsMenu .choice-btn { min-width: 64px; padding: 6px 8px; font-size: 0.78rem; }
  #settingsMenu .segment-btn { padding: 6px 8px; font-size: 0.78rem; }
}

/* ==========================================================================
   11. BANNER CONSENSO COOKIE
   ========================================================================== */
.cookie-consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.cookie-consent-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.cookie-consent-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.cookie-consent-link {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  font: inherit;
  font-size: 0.82rem;
  color: #63b3ed;
  text-decoration: underline;
  cursor: pointer;
}

.cookie-consent-link:hover {
  color: #90cdf4;
}

@media (max-width: 680px) {
  .cookie-consent-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 12px;
  }
  .cookie-consent-text { font-size: 0.78rem; }
  .cookie-consent-actions .btn { flex: 1; }
}

/* Finché il banner cookie è aperto riserviamo spazio in fondo allo schermo,
   così non copre (e non blocca i click su) i pulsanti dei modali o la barra
   di input di gioco, che stanno anch'essi in fondo. */
body.cookie-banner-open .modal-overlay,
body.cookie-banner-open .ui-container {
  padding-bottom: 150px;
}

@media (max-width: 680px) {
  body.cookie-banner-open .modal-overlay,
  body.cookie-banner-open .ui-container {
    padding-bottom: 210px;
  }
}

/* ==========================================================================
   12. BANNER PUBBLICITARI LATERALI
   ========================================================================== */
.ad-slot {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 600px;
  /* Sopra il globo (z-index 1) ma sotto l'interfaccia di gioco (10) e i
     modali (100): un banner non deve mai coprire pulsanti o testo cliccabile. */
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.ad-slot-left { left: 12px; }
.ad-slot-right { right: 12px; }

.ad-slot-label {
  padding: 0 12px;
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.4);
  text-align: center;
}

/* Niente banner dove non c'è spazio: schermi stretti (mobile/tablet
   verticale, dove tutta la larghezza serve al globo e all'input) o bassi
   (rischierebbero di finire sotto l'header o la barra di input). */
@media (max-width: 1100px), (max-height: 700px) {
  .ad-slot { display: none; }
}

/* ==========================================================================
   13. PRIVACY POLICY
   ========================================================================== */
.privacy-policy-card {
  max-width: 640px;
  text-align: left;
}

.privacy-policy-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.privacy-policy-content h3 {
  margin-top: 18px;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #718096;
}

.privacy-policy-content h3:first-child {
  margin-top: 0;
}

.privacy-policy-content p {
  margin-bottom: 10px;
}

.privacy-policy-content a {
  color: #63b3ed;
}

@media (max-width: 680px) {
  .privacy-policy-content { max-height: 55vh; font-size: 0.82rem; }
}
