/* ========================================================
   SAN MICHELE - CACCIA AGLI IDOLI - FOGLIO DI STILE
   ======================================================== */

:root {
  --bg-primary: #0a0f1d;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --border-color: #334155;
  --gold-primary: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.4);
  --blue-primary: #2563eb;
  --cyan-accent: #06b6d4;
  --emerald-success: #10b981;
  --rose-danger: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-heading: 'Cinzel', serif, Georgia;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html {
  height: 100%;
  height: 100dvh;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100%;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==================== HEADER ==================== */
.app-header {
  position: relative;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: margin-top 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: margin-top;
}

.app-header.shutter-collapsed {
  margin-top: calc(-1 * var(--header-actual-height, 74px));
}

.header-content {
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-parish-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.parish-header-icon {
  color: #fbbf24;
  font-size: 11px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ==================== MANIGLIA TAPPARELLA (SHUTTER HANDLE) ==================== */
.header-shutter-handle {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  height: 18px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-top: none;
  border-radius: 0 0 10px 10px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  color: #fbbf24;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.header-shutter-handle:hover,
.header-shutter-handle:active {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.shutter-grip {
  display: block;
  width: 22px;
  height: 2.5px;
  background: rgba(251, 191, 36, 0.7);
  border-radius: 2px;
}

.shutter-arrow {
  font-size: 8px;
  line-height: 1;
  color: #fbbf24;
  transition: transform 0.25s ease;
}

.app-header.shutter-collapsed .shutter-arrow {
  transform: rotate(180deg);
}

.app-header.shutter-collapsed .header-shutter-handle {
  border-color: rgba(245, 158, 11, 0.75);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 12px var(--gold-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.parish-quick-select {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  outline: none;
  max-width: 140px;
}

.parish-quick-select:hover {
  border-color: rgba(245, 158, 11, 0.6);
}

.parish-quick-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* Switcher Giocatore / Admin */
.mode-switch-container {
  display: flex;
  background: var(--bg-primary);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--blue-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* Badge Punteggio */
.player-score-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold-primary);
  padding: 5px 12px;
  border-radius: 20px;
  color: var(--gold-primary);
  font-size: 13px;
  font-weight: 700;
}

/* ==================== MAPPA & LAYOUT ==================== */
.map-wrapper {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#gameMap {
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #0f172a;
}

/* Disabilita focus outline blu predefinito del browser su SVG, percorsi e layer Leaflet */
#gameMap:focus,
#gameMap:focus-visible,
.leaflet-container:focus,
.leaflet-container:focus-visible,
.leaflet-container svg,
.leaflet-container svg:focus,
.leaflet-container svg:focus-visible,
.leaflet-container svg path,
.leaflet-container svg path:focus,
.leaflet-container svg path:focus-visible,
.leaflet-interactive,
.leaflet-interactive:focus,
.leaflet-interactive:focus-visible,
path.leaflet-interactive,
path.leaflet-interactive:focus,
path.leaflet-interactive:focus-visible,
.active-game-zone-polygon,
.active-game-zone-polygon:focus,
.active-game-zone-polygon:focus-visible,
path.active-game-zone-polygon,
path.active-game-zone-polygon:focus,
path.active-game-zone-polygon:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* ==================== CONTROLLI IN OVERLAY SULLA MAPPA ==================== */
.map-floating-top {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 998;
  pointer-events: auto;
}

/* Controlli Zoom Flottanti sulla Mappa (+ / -) */
.map-floating-zoom {
  position: absolute;
  right: 14px;
  bottom: 200px;
  z-index: 998;
  display: flex;
  flex-direction: column;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: auto;
}

.zoom-drag-handle {
  height: 18px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 10px;
  cursor: grab;
  touch-action: none;
  transition: background 0.2s, color 0.2s;
}

.zoom-drag-handle:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.zoom-btn {
  width: 42px;
  height: 42px;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #38bdf8;
}

.zoom-btn:active {
  background: rgba(37, 99, 235, 0.4);
  color: #60a5fa;
  transform: scale(0.92);
}

.zoom-divider {
  width: 75%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto;
}

.map-overlay-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.map-overlay-controls > * {
  pointer-events: auto;
}

/* Controlli Giocatore In Basso A Sinistra (Radar Quadrato Stile Pokémon GO) */
.map-overlay-bottom,
.map-overlay-bottom-left {
  position: absolute;
  bottom: 10px;
  left: 12px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}

.map-overlay-bottom > *,
.map-overlay-bottom-left > * {
  pointer-events: auto;
}

/* Radar Card Quadrata */
.radar-card {
  background: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 150px;
  min-height: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

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

.radar-header-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.radar-action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-round-btn-xs {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-round-btn-xs:hover, .icon-round-btn-xs:active {
  background: var(--blue-primary);
}

.radar-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  width: 100%;
  padding-top: 6px;
  gap: 4px;
}

.radar-empty-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 2px;
}

/* Radar a scomparsa (Minimizzato a pillola compatta nell'angolo sinistro) */
.radar-card.collapsed {
  width: auto;
  min-height: unset;
  padding: 6px 10px;
  border-radius: 20px;
}

.radar-card.collapsed .radar-card-body {
  display: none !important;
}

.radar-card.collapsed .radar-label {
  display: none !important;
}

.radar-card.collapsed #radarCollapseIcon {
  transform: rotate(180deg);
}

.radar-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--emerald-success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { transform: scale(0.95) translate3d(0,0,0); opacity: 0.85; }
  50% { transform: scale(1.1) translate3d(0,0,0); opacity: 1; }
}

/* Allarmi Radar Dinamici - Prestazioni Ottimizzate GPU */
.radar-card.alert-orange {
  border-color: #f97316;
  background: rgba(26, 18, 11, 0.95);
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.4);
}

.radar-card.alert-red {
  border-color: #ef4444;
  background: rgba(30, 10, 15, 0.95);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.5);
}

.radar-pulse.orange {
  background: #f97316;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.8);
}

.radar-pulse.red {
  background: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.9);
}

/* Bussola / Freccia Direzionale */
.compass-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(249, 115, 22, 0.25);
  border: 2px solid #f97316;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.35);
}

/* Animazione di prossimità idolo (solo quando il giocatore è a meno di 30m) */
.idol-near-alert {
  animation: idolNearPulse 1.4s ease-in-out infinite;
  will-change: transform;
}

@keyframes idolNearPulse {
  0%, 100% { transform: scale(1) translate3d(0,0,0); }
  50% { transform: scale(1.08) translate3d(0,0,0); }
}

.compass-arrow {
  width: 32px;
  height: 32px;
  color: #ffffff;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.compass-deg {
  font-size: 10px;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.5px;
}

.radar-info {
  flex: 1;
}

.radar-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan-accent);
}

.radar-target {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.icon-round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-round-btn:hover {
  background: var(--blue-primary);
}

.gps-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pill-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.pill-btn.active {
  background: linear-gradient(135deg, #059669, #10b981);
  border-color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.6);
}

.pill-btn.loading {
  background: #d97706;
  border-color: #fbbf24;
}

.pill-btn:hover {
  transform: translateY(-1px);
}

.gps-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== CONTROLLI ADMIN: BARRA FLOTTANTE & DASHBOARD ==================== */
.admin-floating-bar {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 998;
  display: flex;
  flex-direction: column; /* Disposizione verticale dall'alto verso il basso (Pannello Admin, Piazza Idolo, ecc.) */
  align-items: stretch;
  gap: 8px;
  pointer-events: auto;
  min-width: 140px;
}

.admin-bar-drag-handle {
  height: 16px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 10px;
  cursor: grab;
  touch-action: none;
  transition: background 0.2s, color 0.2s;
  backdrop-filter: blur(8px);
}

.admin-bar-drag-handle:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.btn-admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid var(--border-color);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transition: all 0.2s ease;
}

.btn-admin-pill.gold {
  border-color: var(--gold-primary);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(17, 24, 39, 0.92));
  color: #fef08a;
}

.btn-admin-pill:hover, .btn-admin-pill:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

/* Modale / Scheda Dashboard Amministratore (Spaziosa, Friendly & Moderna) */
.admin-dashboard-card {
  max-width: 1200px;
  width: 95%;
  height: 90vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  contain: paint;
}

.admin-dashboard-header {
  padding: 18px 24px;
  background: #0f172a;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-dashboard-header h3 {
  font-size: 18px;
  margin: 0;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-parish-subtitle {
  font-size: 13px;
  color: #cbd5e1;
  display: inline-block;
  font-weight: 600;
}

.admin-dashboard-body {
  overflow-y: auto;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) rgba(15, 23, 42, 0.5);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 20px;
  align-items: start;
}

.admin-dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-section-box {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.admin-section-box:hover {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(30, 41, 59, 0.65);
}

.admin-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-section-title i {
  color: #fbbf24;
  font-size: 15px;
}

.admin-section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.coords-badge {
  font-size: 11px;
  color: var(--cyan-accent);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: monospace;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.btn-action-sm {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-primary), #b45309);
  color: #000;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action-outline-sm {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action-outline-sm:hover, .btn-action-outline-sm:active {
  background: var(--bg-surface-elevated);
  color: #fff;
}

.btn-action-danger-sm {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pulse-gold {
  box-shadow: 0 0 14px var(--gold-glow);
}

.admin-idols-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.admin-idol-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  gap: 12px;
  transition: all 0.2s ease;
}

.admin-idol-item:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.admin-idol-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-idol-item-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.admin-idol-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-idol-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.badge-difficulty {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.15);
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.admin-idol-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.btn-action-icon:hover:not(:disabled) {
  background: var(--blue-primary);
  color: #fff;
  transform: scale(1.05);
}

.btn-action-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
  transform: none;
}

.admin-tip-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  color: #fef08a;
  font-size: 11px;
  line-height: 1.4;
}

.admin-tip-card i {
  font-size: 14px;
  margin-top: 2px;
  color: var(--gold-primary);
  flex-shrink: 0;
}

/* ==================== RADAR GIOCATORI LIVE (ADMIN) ==================== */
.badge-live-pulse {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 7px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-live-pulse i {
  font-size: 7px;
  color: #10b981;
}

.admin-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.admin-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 10px;
  gap: 12px;
  transition: all 0.2s ease;
}

.admin-player-row:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(14, 165, 233, 0.45);
  transform: translateY(-1px);
}

.admin-player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.admin-player-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-player-meta {
  font-size: 10px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== TRASCINAMENTO WIDGET HUD ==================== */
.radar-grip-icon,
.joystick-grip-icon {
  font-size: 11px;
  color: var(--text-muted);
  cursor: grab;
  opacity: 0.65;
  transition: opacity 0.2s, color 0.2s;
  touch-action: none;
  margin-right: 2px;
}

.radar-card-header,
.joystick-title {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.radar-card-header:hover .radar-grip-icon,
.joystick-title:hover .joystick-grip-icon {
  opacity: 1;
  color: #38bdf8;
}

/* Stato durante il trascinamento attivo */
.is-dragging {
  cursor: grabbing !important;
  opacity: 0.96;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(56, 189, 248, 0.5) !important;
  transform: scale(1.02);
  transition: box-shadow 0.15s ease, transform 0.15s ease !important;
  z-index: 1005 !important;
}

.is-dragging * {
  cursor: grabbing !important;
}

/* ==================== JOYSTICK VIRTUALE (In basso a destra) ==================== */
.virtual-joystick-panel {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: 16px;
  z-index: 998;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.55);
}

.joystick-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan-accent);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dpad-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dpad-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dpad-btn:active {
  background: var(--blue-primary);
}

.dpad-center {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
}

.joystick-sub {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  max-width: 140px;
}

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
  height: 60px;
  background: rgba(17, 24, 39, 0.98);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-bottom);
  z-index: 1000;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 25%;
}

.nav-item i {
  font-size: 18px;
}

.nav-item.active {
  color: var(--gold-primary);
}

/* ==================== SCHERMATA ENCOUNTER: L'ABBATTIMENTO ==================== */
.encounter-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.encounter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}

.encounter-card {
  position: relative;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid var(--gold-primary);
  border-radius: 20px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px var(--gold-glow);
  animation: zoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.encounter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.warning-tag {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid var(--rose-danger);
  color: #fda4af;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.timer-ring-container {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--gold-primary);
}

.timer-countdown {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 900;
  color: var(--gold-primary);
}

.timer-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.idol-visual {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.idol-aura {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.6) 0%, transparent 70%);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.idol-big-icon {
  font-size: 54px;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.8));
}

.idol-encounter-title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.idol-encounter-desc {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.weapon-box {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--cyan-accent);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.weapon-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan-accent);
  margin-bottom: 4px;
}

.weapon-title {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  margin-bottom: 4px;
}

.weapon-text {
  font-size: 12px;
  color: #cbd5e1;
  font-style: italic;
  line-height: 1.4;
}

/* Area Riconoscimento Vocale */
.speech-interaction-area {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.mic-status-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mic-pulse-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--blue-primary);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
}

.mic-pulse-btn.listening {
  background: var(--rose-danger);
  animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.speech-status-text {
  font-size: 12px;
  color: #e2e8f0;
  font-weight: 500;
  line-height: 1.3;
}

.live-transcript-box {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 50px;
}

.transcript-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.transcript-content {
  font-size: 13px;
  color: #fef08a;
  font-weight: 600;
}

.match-meter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.match-meter-bar {
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
}

.match-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transition: width 0.3s ease;
}

.encounter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==================== MODALI GENERICHE & ADMIN ==================== */
.admin-modal, .drawer-modal, .result-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(3, 7, 18, 0.90);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.admin-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 36px rgba(0,0,0,0.8);
}

.admin-modal-card.large {
  max-width: 650px;
}

.admin-modal-header, .drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal-header h3, .drawer-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--gold-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.admin-modal-body, .drawer-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Modale Risultato */
.result-card {
  background: var(--bg-surface);
  border: 2px solid var(--gold-primary);
  border-radius: 20px;
  padding: 30px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.9);
}

.result-icon-anim {
  font-size: 64px;
  margin-bottom: 12px;
}

.result-score-change {
  font-size: 18px;
  font-weight: 800;
  color: var(--emerald-success);
  margin: 16px 0;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 12px;
}

.col-6 { width: 50%; }
.col-8 { width: 66.6%; }
.col-4 { width: 33.3%; }
.col-7 { width: 58%; }
.col-5 { width: 42%; }

.form-control {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  border-color: var(--blue-primary);
}

.field-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.coordinates-preview {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--cyan-accent);
}

/* Buttons */
.btn-primary {
  background: var(--blue-primary);
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn-primary-large {
  width: 100%;
  background: linear-gradient(135deg, var(--gold-primary), #b45309);
  color: #000;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.btn-primary-sm {
  background: var(--blue-primary);
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary-sm {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--rose-danger);
  color: #fca5a5;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--rose-danger);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

/* Classifica & Profilo */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
  padding: 10px 14px;
  border-radius: 10px;
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
}

.rank-1 { background: #eab308; color: #000; }
.rank-2 { background: #94a3b8; color: #000; }
.rank-3 { background: #b45309; color: #fff; }

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-info #profileNicknameInput {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.profile-id-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: fit-content;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-primary);
}

.stat-title {
  font-size: 11px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

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

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==================== RESPONSIVE & MOBILE OPTIMIZATION ==================== */

/* Layout Desktop Header (1 riga orizzontale) */
@media (min-width: 900px) {
  .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 16px;
    gap: 12px;
  }

  .header-row-top,
  .header-row-bottom {
    display: contents;
  }

  .header-brand {
    order: 1;
  }

  .header-parish-wrap {
    order: 2;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 2px 8px;
  }

  .active-game-banner {
    order: 3;
    flex: 1;
    max-width: 520px;
    margin: 0 12px;
  }

  .header-right {
    order: 4;
  }
}

/* Layout Smartphone & Tablet Header: 2 righe pulite, mai accalcate */
@media (max-width: 899px) {
  .app-header {
    height: auto;
    min-height: unset;
    padding: 0;
    background: rgba(10, 15, 29, 0.96);
  }

  .header-content {
    display: flex;
    flex-direction: column;
    padding: 6px 10px 4px 10px;
    gap: 6px;
  }

  /* RIGA 1: Brand a sinistra, Modalità e Punti a destra */
  .header-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

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

  .logo-badge {
    width: 28px;
    height: 28px;
    font-size: 13px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 13px;
    letter-spacing: 0.8px;
    margin: 0;
  }

  .brand-sub {
    display: none; /* Nasconde sottotitolo lungo per non occupare spazio verticale */
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .mode-switch-container {
    padding: 2px;
  }

  .mode-btn {
    padding: 3px 8px;
    font-size: 11px;
    gap: 4px;
    border-radius: 12px;
  }

  .player-score-badge {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 14px;
  }

  .score-label {
    display: none; /* Mostra solo icona + numero su schermi piccoli */
  }

  /* RIGA 2: Parrocchia a sinistra, Banner Partita al centro/destra */
  .header-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .header-parish-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    padding: 2px 6px;
    max-width: 140px;
    flex-shrink: 0;
  }

  .parish-header-icon {
    color: #fbbf24;
    font-size: 11px;
  }

  .parish-quick-select {
    background: transparent;
    color: #e2e8f0;
    border: none;
    font-size: 11px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    outline: none;
    padding: 0;
    max-width: 115px;
    text-overflow: ellipsis;
  }

  .active-game-banner {
    flex: 1;
    min-width: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
  }

  .active-game-banner-inner {
    padding: 2px 7px;
    gap: 5px;
    max-width: 100%;
    min-width: 0;
  }

  .game-banner-text-group {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .game-banner-title {
    font-size: 11px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .game-banner-sub {
    font-size: 8.5px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .game-banner-counter-badge {
    font-size: 9.5px;
    padding: 2px 6px;
    gap: 3px;
    flex-shrink: 0;
  }

  .game-banner-counter-badge i {
    font-size: 9px;
  }

  .admin-game-banner-inner {
    padding: 2px 6px;
    gap: 6px;
  }

  .custom-game-dropdown-btn {
    min-width: 95px;
    max-width: 135px;
    font-size: 11px;
    padding: 2px 4px;
  }

  .admin-game-count-pill {
    font-size: 10px;
    padding: 1px 4px;
  }

  .badge-game-status {
    font-size: 9px;
    padding: 1px 4px;
  }

  .admin-game-select-label span {
    display: none;
  }
}

@media (max-width: 420px) {
  .header-parish-wrap {
    max-width: 105px;
    padding: 2px 4px;
  }
  .parish-quick-select {
    max-width: 85px;
    font-size: 10px;
  }
  .game-banner-title {
    max-width: 95px;
    font-size: 10.5px;
  }
  .game-banner-sub {
    max-width: 95px;
    font-size: 8px;
  }
  .game-banner-counter-badge {
    font-size: 9px;
    padding: 1.5px 5px;
    gap: 2.5px;
  }
}
  .bottom-nav {
    height: 52px;
  }
  .map-overlay-bottom,
  .map-overlay-bottom-left {
    bottom: 8px;
    left: 8px;
  }
  .map-floating-zoom {
    right: 10px;
    bottom: 185px;
    border-radius: 10px;
  }
  .zoom-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .radar-card {
    width: 142px;
    min-height: 132px;
    padding: 8px;
    border-radius: 14px;
  }
  .radar-target {
    font-size: 11px;
  }
  .virtual-joystick-panel {
    bottom: 8px;
    right: 8px;
    padding: 6px;
    border-radius: 14px;
  }
  .joystick-sub {
    display: none;
  }
  .dpad-btn {
    width: 32px;
    height: 32px;
  }
  .dpad-center {
    width: 32px;
    height: 32px;
  }
}

/* Ottimizzazione Orientamento Orizzontale (Landscape - Telefono Inclinato) */
@media (orientation: landscape) and (max-height: 550px) {
  .app-header {
    height: 38px;
    padding: 0 12px;
    background: rgba(10, 15, 29, 0.94);
  }
  .brand-title {
    font-size: 12px;
  }
  .brand-sub {
    display: none;
  }
  .logo-badge {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .mode-btn {
    padding: 3px 8px;
    font-size: 10px;
  }
  .player-score-badge {
    padding: 2px 8px;
    font-size: 11px;
  }
  .bottom-nav {
    height: 42px;
  }
  .nav-item {
    font-size: 10px;
    gap: 2px;
  }
  .nav-item i {
    font-size: 14px;
  }

  /* In orizzontale: Radar a sinistra, Joystick a destra, centro mappa sempre visibile */
  .map-overlay-bottom,
  .map-overlay-bottom-left {
    bottom: 6px;
    left: 8px;
    right: auto;
  }

  .radar-card {
    width: 136px;
    min-height: 118px;
    padding: 6px 8px;
    border-radius: 12px;
  }

  .map-floating-top {
    top: 6px;
    left: 6px;
  }

  .map-floating-zoom {
    right: 8px;
    bottom: 125px;
    border-radius: 10px;
  }
  .zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .virtual-joystick-panel {
    bottom: 6px;
    right: 8px;
    left: auto;
    padding: 4px 6px;
    border-radius: 12px;
  }
  .dpad-btn {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }
  .dpad-center {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
  .joystick-title, .joystick-sub {
    display: none;
  }

  .admin-floating-bar {
    top: 6px;
    right: 8px;
  }
  .btn-admin-pill {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* Modale Scontro a 2 Colonne in Orizzontale (Perfetto senza scrollare!) */
  .encounter-card {
    max-width: 640px;
    padding: 12px 18px;
    max-height: 94vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .encounter-header {
    grid-column: span 2;
    margin-bottom: 2px;
  }
  .idol-visual {
    width: 44px;
    height: 44px;
    margin: 0 auto;
  }
  .idol-big-icon {
    font-size: 28px;
  }
  .idol-encounter-title {
    font-size: 14px;
    margin-bottom: 2px;
  }
  .idol-encounter-desc {
    font-size: 10px;
    margin-bottom: 4px;
    line-height: 1.2;
  }
  .weapon-box {
    padding: 6px 8px;
    margin-bottom: 4px;
  }
  .weapon-title {
    font-size: 12px;
  }
  .weapon-text {
    font-size: 10px;
    max-height: 45px;
    overflow-y: auto;
  }
  .speech-interaction-area {
    padding: 6px 10px;
    gap: 6px;
    margin-bottom: 4px;
  }
  .mic-pulse-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .live-transcript-box {
    min-height: 35px;
    padding: 4px 8px;
  }
  .transcript-content {
    font-size: 11px;
  }
  .encounter-actions {
    grid-column: span 2;
  }
}

/* ==================== BANNER PARTITA PARROCCHIALE (INTEGRATO NELLA BARRA SUPERIORE) ==================== */
.active-game-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  max-width: 520px;
  margin: 0 10px;
  z-index: 1005;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.active-game-banner-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 12px;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  max-width: 100%;
}

.active-game-banner.no-game .active-game-banner-inner {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.75);
}

.game-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.game-status-dot.inactive {
  background: #94a3b8;
  box-shadow: none;
}

.game-status-dot.pulse {
  background: var(--emerald-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.game-banner-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.game-banner-title {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-game-banner.no-game .game-banner-title {
  color: #94a3b8;
  font-weight: 600;
}

.game-banner-sub {
  font-size: 10px;
  color: #cbd5e1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge Contatore Idoli da scoprire (Pillola elegante e reattiva) */
.game-banner-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
  user-select: none;
}

.game-banner-counter-badge i {
  font-size: 10.5px;
  color: #f59e0b;
}

.game-banner-counter-badge.all-cleared {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #34d399;
}

.game-banner-counter-badge.all-cleared i {
  color: #10b981;
}

.active-game-banner.no-game .game-banner-counter-badge {
  display: none !important;
}

/* Banner Partita di Riferimento in Modalità Admin (Regola 3) */
.admin-game-banner-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 3px 10px;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  max-width: 100%;
}

.admin-game-select-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.admin-game-select {
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  max-width: 240px;
}

.admin-game-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

/* Custom Dropdown Partita di Riferimento (Colori uniformi e hover più scuro - Richiesta 1) */
.custom-game-dropdown {
  position: relative;
  display: inline-block;
}

.custom-game-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #1e293b; /* Colore unico */
  color: #f8fafc;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  min-width: 170px;
  max-width: 270px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.custom-game-dropdown-btn:hover {
  background: #141f32;
  border-color: #f59e0b;
}

.custom-dropdown-caret {
  font-size: 9px;
  color: #fbbf24;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.custom-game-dropdown.is-open .custom-dropdown-caret {
  transform: rotate(180deg);
}

.custom-game-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 260px;
  max-width: 330px;
  background: #1e293b; /* Colore unico di base */
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 10050;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Righe con colore unico uniforme (#1e293b) */
.custom-game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #1e293b; /* Colore unico */
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.custom-game-item:last-child {
  border-bottom: none;
}

/* Quando il mouse si posiziona sulla riga: diventa un po' più scuro (#0f172a) */
.custom-game-item:hover {
  background: #0f172a !important; /* Più scuro */
  color: #fbbf24;
}

.custom-game-item.is-selected {
  background: #141f32;
  border-left: 3px solid #f59e0b;
  font-weight: 700;
  color: #fbbf24;
}

.custom-game-item.is-selected:hover {
  background: #090e17 !important;
}

.admin-game-quick-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-game-count-pill {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .admin-game-select {
    max-width: 155px;
    font-size: 11px;
    padding: 3px 6px;
  }
  .admin-game-banner-inner {
    padding: 4px 9px;
    gap: 6px;
  }
}

/* ==================== ADMIN PARTITE LIST ==================== */
.admin-games-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-game-item {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.admin-game-item:hover:not(.is-selected-game-row) {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
}

.admin-game-item.is-active-game:not(.is-selected-game-row) {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.06);
}

.admin-game-item.is-selected-game-row {
  border: 2px solid #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.admin-game-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-game-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.admin-game-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-game-selected {
  background: #f59e0b;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-game-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.badge-game-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-game-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-game-status.scheduled {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-game-status.ended {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.admin-game-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2px;
}

.admin-game-item-actions-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-game-item-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.btn-action-team-manage {
  background: linear-gradient(135deg, #7e22ce, #9333ea);
  color: #ffffff !important;
  border: 1px solid #c084fc;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.35);
  transition: all 0.15s ease;
}

.btn-action-team-manage:hover {
  background: linear-gradient(135deg, #6b21a8, #7e22ce);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.55);
  transform: translateY(-1px);
}

/* ==================== WELCOME GATE / LANDING ONBOARDING ==================== */
.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(circle at 50% 25%, #1e293b 0%, #0f172a 70%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.welcome-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 430px;
  padding: 24px 20px;
  color: #fff;
  animation: fadeInGate 0.3s ease-out;
}

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

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

.welcome-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 10px auto;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.welcome-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fbbf24;
  margin: 0;
}

.welcome-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.welcome-intro {
  font-size: 13px;
  color: #cbd5e1;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 16px;
}

#adminLoginModal {
  z-index: 10050;
}

#adminDashboardModal {
  z-index: 10040 !important;
}

#prayersModal {
  z-index: 10120 !important;
}

#adminIdolModal,
#adminGameModal {
  z-index: 10150 !important;
}

#adminTeamsModal {
  z-index: 10160 !important;
}

#adminEditTeamModal {
  z-index: 10170 !important;
}

#superAdminLoginModal,
#superAdminParishModal,
#superAdminAdminModal,
#superAdminResetPassModal,
#superAdminPrayerModal,
#superAdminIdolTplModal {
  z-index: 10100;
}

#superAdminDashboardModal {
  z-index: 10080;
}

/* ==================== CONSOLE SUPERADMIN (SPAZIOSA, MODERNA & FRIENDLY) ==================== */
.super-dashboard-card {
  max-width: 1400px;
  width: 96%;
  height: 90vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-top: 4px solid #f59e0b;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  contain: paint;
}

.super-dashboard-header {
  padding: 18px 28px;
  background: #0f172a;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.super-dashboard-header h2 {
  font-size: 20px;
  margin: 0;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-super {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 600;
}

.super-header-sub {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}

.btn-logout-super {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-logout-super:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-1px);
}

.super-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 10px 28px 0 28px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: thin;
}

.super-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
}

.super-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.super-tab-btn.active {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  font-weight: 700;
}

.super-dashboard-body {
  padding: 24px 28px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) rgba(15, 23, 42, 0.5);
}

.super-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.super-tab-header h3 {
  font-size: 17px;
  margin: 0;
  color: #f8fafc;
  font-weight: 700;
}

.super-tab-header p {
  font-size: 13px;
  color: #94a3b8;
  margin: 3px 0 0 0;
}

.super-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.super-parish-card,
.super-admin-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.super-parish-card:hover,
.super-admin-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(30, 41, 59, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.super-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.super-card-actions .btn-action-icon {
  width: 34px;
  height: 34px;
  font-size: 13px;
  border-radius: 8px;
}

/* Esploratore Tabelle Database Spazioso */
.super-table-card {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.super-table-container {
  max-height: 52vh;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-width: thin;
}

.btn-table-selector {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-table-selector:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #f8fafc;
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.btn-table-selector.active {
  background: #d97706;
  color: white;
  border-color: #f59e0b;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.super-sql-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.super-sql-table th {
  background: #0f172a;
  color: #fbbf24;
  padding: 12px 18px;
  text-align: left;
  border-bottom: 2px solid rgba(245, 158, 11, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
  font-weight: 700;
  letter-spacing: 0.6px;
  font-size: 12px;
  text-transform: uppercase;
}

.super-sql-table td {
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.super-sql-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.super-sql-table tr:hover td {
  background: rgba(245, 158, 11, 0.08) !important;
}

@media (max-width: 900px) {
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .admin-dashboard-card,
  .super-dashboard-card {
    width: 98%;
    height: 94vh;
    max-height: 96vh;
    border-radius: 14px;
  }
  .super-grid-cards {
    grid-template-columns: 1fr;
  }
  .admin-dashboard-body,
  .super-dashboard-body {
    padding: 14px;
  }
  .super-tabs-bar {
    padding: 8px 14px 0 14px;
  }
}

/* Tooltip elegante idoli sulla mappa al passaggio cursore */
.san-michele-map-tooltip {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid #f59e0b !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75) !important;
  pointer-events: none !important;
}

.san-michele-map-tooltip::before {
  border-top-color: #f59e0b !important;
}

/* Tooltip informativo giocatori live al passaggio cursore (mouseover) */
.player-hover-tooltip {
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid #0284c7 !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8) !important;
  pointer-events: none !important;
}

.player-hover-tooltip::before {
  border-top-color: #0284c7 !important;
}

/* Etichetta nome idolo sulla mappa (attivata dal toggle admin "Idoli") */
.admin-idol-name-label {
  margin-top: 2px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* Effetto ottico temporaneo per idolo appena creato (10s o fino al trascinamento) */
.idol-newly-spawned {
  animation: spawnAttentionPulse 1s ease-in-out infinite alternate !important;
}

@keyframes spawnAttentionPulse {
  0% {
    transform: scale(1) translate3d(0,0,0);
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.9)) drop-shadow(0 0 16px rgba(56, 189, 248, 0.7));
  }
  100% {
    transform: scale(1.2) translate3d(0,0,0);
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 1)) drop-shadow(0 0 30px rgba(56, 189, 248, 1));
  }
}

.spawn-badge-tag {
  animation: bounceTag 1.2s ease-in-out infinite;
}

@keyframes bounceTag {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ==================== OTTIMIZZAZIONE PRESTAZIONI CPU / GPU ==================== */
/* Quando una modale o la console SuperAdmin è aperta, disattiva le animazioni pesanti in background */
body:has(#superAdminDashboardModal:not(.hidden)) #gameMap,
body:has(#adminDashboardModal:not(.hidden)) #gameMap {
  pointer-events: none;
}

body:has(#superAdminDashboardModal:not(.hidden)) .idol-pin-container,
body:has(#adminDashboardModal:not(.hidden)) .idol-pin-container,
body:has(#superAdminDashboardModal:not(.hidden)) .radar-pulse,
body:has(#adminDashboardModal:not(.hidden)) .radar-pulse {
  animation: none !important;
}

/* ==================== BARRA SELEZIONE AREA RANDOM SULLA BARRA SUPERIORE ==================== */
.random-area-header-bar {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  border: 1.5px solid #f59e0b;
  border-radius: 9999px;
  padding: 3px 8px 3px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 10px rgba(245, 158, 11, 0.2);
  max-width: 100%;
}

.random-area-header-info {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  color: #f1f5f9;
}

.random-area-header-icon {
  font-size: 13px;
  color: #f59e0b;
}

.random-area-header-text {
  font-size: 12px;
  font-weight: 500;
  color: #e2e8f0;
}

.random-area-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-random-header {
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-random-reset {
  background: #334155;
  color: #f8fafc;
}

.btn-random-reset:hover {
  background: #475569;
}

.btn-random-cancel {
  background: #b91c1c;
  color: #ffffff;
}

.btn-random-cancel:hover {
  background: #dc2626;
}

.custom-area-point-icon {
  background: transparent !important;
  border: none !important;
}

.game-zone-tooltip {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid #f59e0b !important;
  color: #fbbf24 !important;
  font-weight: bold !important;
  font-size: 11px !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

/* Notifiche Toast non bloccanti (Fase 3) */
.sm-toast-container {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 92vw;
}

.sm-toast {
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sm-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.sm-toast-success { border-color: rgba(16, 185, 129, 0.6); color: #a7f3d0; }
.sm-toast-error { border-color: rgba(244, 63, 94, 0.6); color: #fecdd3; }

/* ==================== SQUADRE NELLE PARTITE ==================== */
.player-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  margin-top: 4px;
}
.player-search-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s ease;
}
.player-search-item:last-child {
  border-bottom: none;
}
.player-search-item:hover {
  background: #334155;
}
.player-search-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0,0,0,0.2);
}
.team-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #f3e8ff;
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}
.team-player-chip .btn-remove-chip {
  background: none;
  border: none;
  color: #e9d5ff;
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}
.team-player-chip .btn-remove-chip:hover {
  color: #fca5a5;
}
.team-card-admin {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.team-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 14px;
  color: #f8fafc;
}
.team-card-score {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.team-card-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.team-card-member-pill {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.team-card-member-points {
  font-weight: bold;
  color: #38bdf8;
}
.badge-team-game {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.player-team-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

/* ==================== DOCK BAR MAPPA POSIZIONAMENTO CHIESA SUPERADMIN ==================== */
.super-parish-dock {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 95vw;
  width: auto;
  animation: dockSlideDown 0.25s ease-out;
}

@keyframes dockSlideDown {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.super-parish-dock .dock-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.super-parish-dock .dock-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.super-parish-dock .dock-coords {
  font-size: 11px;
  color: #94a3b8;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.super-parish-dock .dock-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .super-parish-dock {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: calc(100vw - 24px);
    padding: 8px 12px;
    top: 8px;
  }
  .super-parish-dock .dock-actions {
    justify-content: flex-end;
  }
}








