/* ==========================================================================
   ALLINEAMENTO PERFETTO ZERO-GAP TRA COLONNA # E COLONNA GOVERNATORE
   ========================================================================== */

/* Colonna 1: # (Rank) - Larghezza fissa esatta 48px su Desktop */
.data-table thead tr:first-child th:nth-child(1),
.rok-governors-table thead tr:first-child th:nth-child(1),
.data-table tbody td:nth-child(1),
.rok-governors-table tbody td:nth-child(1) {
  position: sticky !important;
  left: 0 !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  text-align: center !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
  box-sizing: border-box !important;
  z-index: 15 !important;
  background-color: #12161f !important;
}

/* Colonna 2: Governatore - Attaccata esattamente a 48px (ZERO GAP) */
.data-table thead tr:first-child th:nth-child(2),
.rok-governors-table thead tr:first-child th:nth-child(2),
.data-table tbody td:nth-child(2),
.rok-governors-table tbody td:nth-child(2) {
  position: sticky !important;
  left: 48px !important;
  z-index: 15 !important;
  background-color: #12161f !important;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.5) !important;
  border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
}

/* Header Corners Sticky Intersections */
.data-table thead tr:first-child th:nth-child(1),
.rok-governors-table thead tr:first-child th:nth-child(1) {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  text-align: center !important;
  z-index: 35 !important;
  background-color: #1e2536 !important;
}

.data-table thead tr:first-child th:nth-child(2),
.rok-governors-table thead tr:first-child th:nth-child(2) {
  position: sticky !important;
  top: 0 !important;
  left: 48px !important;
  z-index: 35 !important;
  background-color: #1e2536 !important;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.6) !important;
  border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
}

@media (max-width: 768px) {
  /* Su Mobile: Colonna # 40px, Colonna Governatore attaccata esattamente a 40px (ZERO GAP) */
  .data-table thead tr:first-child th:nth-child(1),
  .rok-governors-table thead tr:first-child th:nth-child(1),
  .data-table tbody td:nth-child(1),
  .rok-governors-table tbody td:nth-child(1),
  .data-table tbody tr td:nth-child(1),
  .rok-governors-table tbody tr td:nth-child(1) {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    left: 0 !important;
    padding: 6px 2px !important;
    box-sizing: border-box !important;
  }

  .data-table thead tr:first-child th:nth-child(2),
  .rok-governors-table thead tr:first-child th:nth-child(2),
  .data-table tbody td:nth-child(2),
  .rok-governors-table tbody td:nth-child(2),
  .data-table tbody tr td:nth-child(2),
  .rok-governors-table tbody tr td:nth-child(2) {
    left: 40px !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    box-sizing: border-box !important;
  }
}
/* ==========================================================================
   FORMATAZIONE NUMERICA TABELLARE DUAL-MODE (DESKTOP FULL / MOBILE COMPACT)
   ========================================================================== */
.num-compact {
  display: none !important;
}
.num-full {
  display: inline !important;
}

.gov-cell-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gov-cell-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 13.5px;
  line-height: 1.25;
}

.gov-cell-id {
  font-size: 11px;
  color: #94a3b8;
  font-weight: normal;
  line-height: 1.2;
}

.gov-table-badges-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

/* Allineamento centrato per tutte le colonne numeriche dopo la seconda (# e Governatore) */
.rok-governors-table th:nth-child(n+3),
.rok-governors-table td:nth-child(n+3),
.data-table th:nth-child(n+3),
.data-table td:nth-child(n+3),
.rok-governors-table th.col-num,
.rok-governors-table td.col-num,
.data-table th.col-num,
.data-table td.col-num {
  text-align: center !important;
}

:root {
  --bg-page: #0b0e14;
  --bg-card: #12161f;
  --border-card: rgba(255, 255, 255, 0.07);
  
  --text-main: #ffffff;
  --text-sub: #8e9bb0;
  --text-muted: #94a3b8;

  --green-main: #10b981;
  --red-main: #ef4444;
  --purple-main: #8b5cf6;
  --gold-main: #f59e0b;
  --blue-main: #3b82f6;
  
  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  background-color: #0b0e14 !important;
  color: #ffffff;
}

/* ==========================================================================
   ✨ SCROLLBAR PERSONALIZZATE & MODERNE PER TABELLE E CONTENITORI (X & Y)
   ========================================================================== */
/* Standard W3C per Firefox e browser moderni */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.45) rgba(15, 23, 42, 0.6);
}

/* Scrollbar globale WebKit (Chrome, Safari, Edge, Opera) */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(11, 14, 20, 0.75);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(217, 119, 6, 0.5) 100%);
  border-radius: 8px;
  border: 1.5px solid rgba(15, 23, 42, 0.8);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.8) 0%, rgba(217, 119, 6, 0.95) 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

::-webkit-scrollbar-corner {
  background: rgba(11, 14, 20, 0.9);
}

/* SCROLLBAR PREMIUM SPECIFICHE PER LE TABELLE (SCORRIMENTO ORIZZONTALE E VERTICALE) */
.table-responsive,
.supervision-table-wrapper,
.classifica-leaderboard-list,
.table-scroll-wrapper,
.concilio-table-container,
.calc-table-wrapper {
  scrollbar-width: auto;
  scrollbar-color: rgba(245, 158, 11, 0.6) rgba(15, 23, 42, 0.85);
  scroll-behavior: smooth;
}

/* Barra orizzontale (Destra/Sinistra) e Verticale (Su/Giù) per le tabelle */
.table-responsive::-webkit-scrollbar,
.supervision-table-wrapper::-webkit-scrollbar,
.classifica-leaderboard-list::-webkit-scrollbar,
.table-scroll-wrapper::-webkit-scrollbar,
.concilio-table-container::-webkit-scrollbar,
.calc-table-wrapper::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

.table-responsive::-webkit-scrollbar-track,
.supervision-table-wrapper::-webkit-scrollbar-track,
.classifica-leaderboard-list::-webkit-scrollbar-track,
.table-scroll-wrapper::-webkit-scrollbar-track,
.concilio-table-container::-webkit-scrollbar-track,
.calc-table-wrapper::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
  margin: 4px;
}

.table-responsive::-webkit-scrollbar-thumb,
.supervision-table-wrapper::-webkit-scrollbar-thumb,
.classifica-leaderboard-list::-webkit-scrollbar-thumb,
.table-scroll-wrapper::-webkit-scrollbar-thumb,
.concilio-table-container::-webkit-scrollbar-thumb,
.calc-table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.6) 0%, rgba(217, 119, 6, 0.75) 100%);
  border-radius: 10px;
  border: 2px solid rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
  cursor: grab;
  transition: all 0.25s ease;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.supervision-table-wrapper::-webkit-scrollbar-thumb:hover,
.classifica-leaderboard-list::-webkit-scrollbar-thumb:hover,
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover,
.concilio-table-container::-webkit-scrollbar-thumb:hover,
.calc-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border-color: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.75);
}

.table-responsive::-webkit-scrollbar-thumb:active,
.supervision-table-wrapper::-webkit-scrollbar-thumb:active,
.classifica-leaderboard-list::-webkit-scrollbar-thumb:active,
.table-scroll-wrapper::-webkit-scrollbar-thumb:active,
.concilio-table-container::-webkit-scrollbar-thumb:active,
.calc-table-wrapper::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 100%);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.95);
  cursor: grabbing;
}

.table-responsive::-webkit-scrollbar-corner,
.supervision-table-wrapper::-webkit-scrollbar-corner,
.classifica-leaderboard-list::-webkit-scrollbar-corner,
.table-scroll-wrapper::-webkit-scrollbar-corner,
.concilio-table-container::-webkit-scrollbar-corner,
.calc-table-wrapper::-webkit-scrollbar-corner {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 6px;
}

/* ==========================================================================
   TABELLA 300 GOVERNATORI & FILTRI (RICERCA, ALLEANZE, PAGINAZIONE)
   ========================================================================== */
.filter-bar-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 20px;
  border-radius: 14px;
}

.filter-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.alliance-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-label {
  font-size: 0.8rem;
  color: var(--text-sub);
  font-weight: 600;
}

.count-badge {
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold-main);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}

.stylish-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.stylish-search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.85rem;
  opacity: 0.6;
  pointer-events: none;
}

.stylish-search-wrapper input {
  background-color: var(--bg-card);
  color: #ffffff;
  border: 1px solid var(--border-card);
  padding: 10px 36px 10px 36px;
  border-radius: 10px;
  font-family: var(--font-inter);
  font-size: 0.85rem;
  width: 280px;
  outline: none;
  transition: var(--transition-smooth);
}

.stylish-search-wrapper input::placeholder {
  color: #94a3b8;
}

.stylish-search-wrapper input:focus {
  border-color: var(--gold-main);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
  width: 320px;
  background-color: #1e293b;
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.clear-search-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Chip Filtri Rapidi */
.filter-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-sub);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-chip:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.filter-chip.active {
  background-color: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--gold-main);
}

.gold-chip:hover { border-color: var(--gold-main); }
.red-chip:hover { border-color: var(--red-main); }
.purple-chip:hover { border-color: var(--purple-main); }

.rok-governors-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: auto;
}

.rok-governors-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
}

.rok-governors-table th.sortable:hover {
  color: var(--gold-main);
}

.rok-governors-table th {
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  background-color: rgba(255, 255, 255, 0.03);
  letter-spacing: 0.3px;
}

.rok-governors-table td {
  padding: 16px 20px;
  font-size: 0.96rem;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.rok-governors-table tbody tr {
  transition: var(--transition-smooth);
  cursor: pointer;
}

.rok-governors-table tbody tr:hover {
  background-color: rgba(245, 158, 11, 0.08);
}

/* Colonna Governatore (Avatar + Nome + ID) */
.gov-profile-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gov-table-avatar-frame {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 2px;
  background: radial-gradient(circle, #fcd34d 0%, #d97706 70%, #92400e 100%);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.gov-table-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.gov-table-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gov-table-name {
  font-weight: 800;
  color: #ffffff;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.gov-table-id {
  font-size: 0.84rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Colonna Alleanza */
.gov-alliance-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gov-alliance-tag {
  font-weight: 800;
  color: var(--gold-main);
  font-size: 0.95rem;
}

.gov-alliance-name {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.gov-power-cell {
  font-weight: 900;
  color: #fbbf24;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}

.gov-num-cell {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.96rem;
}

/* Footer Paginazione */
.table-pagination-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.table-pagination-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-page {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-page:hover:not(:disabled) {
  border-color: var(--gold-main);
  color: var(--gold-main);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-current-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-main);
}

.per-page-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.custom-select-sm {
  background-color: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-card);
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  font-size: 0.8rem;
}

/* ==========================================================================
   PROFILO PLAYER (KPI CARDS, RADAR, STATISTICHE BELLICHE)
   ========================================================================== */
.profile-info-wrapper { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.profile-name-row { display: flex; align-items: center; gap: 8px; }
#player-name { font-size: 1.8rem; font-weight: 900; letter-spacing: -0.4px; line-height: 1.2; }
.verified-badge { background-color: #3b82f6; color: white; width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; }
.profile-meta-row { display: flex; gap: 14px; font-size: 0.8rem; color: var(--text-sub); }
.role-badge { background-color: rgba(255, 255, 255, 0.08); padding: 2px 8px; border-radius: 4px; font-weight: 600; }

.player-profile-body-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .player-profile-body-grid {
    grid-template-columns: 1fr;
  }
}

.player-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.pkpi-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.pkpi-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
}

.pkpi-title { font-size: 0.82rem; font-weight: 700; color: #cbd5e1; margin-bottom: 4px; letter-spacing: 0.3px; padding-right: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkpi-value { font-size: 1.25rem; font-weight: 800; position: relative; z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkpi-icon { position: absolute; top: 8px; right: 10px; opacity: 0.85; font-size: 1.05rem; pointer-events: none; }

.border-green { border-bottom: 3px solid var(--green-main); }
.border-red { border-bottom: 3px solid var(--red-main); }
.border-purple { border-bottom: 3px solid var(--purple-main); }
.border-gold { border-bottom: 3px solid var(--gold-main); }
.border-yellow { border-bottom: 3px solid #eab308; }
.border-orange { border-bottom: 3px solid #f97316; }
.border-blue { border-bottom: 3px solid #3b82f6; }
.border-cyan { border-bottom: 3px solid #06b6d4; }
.border-emerald { border-bottom: 3px solid #10b981; }

.text-green { color: var(--green-main); }
.text-red { color: var(--red-main); }
.text-purple { color: var(--purple-main); }
.text-gold { color: var(--gold-main); }
.text-yellow { color: #eab308; }
.text-orange { color: #f97316; }
.text-blue { color: #3b82f6; }
.text-cyan { color: #06b6d4; }
.text-emerald { color: #10b981; }

.token-t4 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d8b4fe 0%, #a855f7 50%, #6b21a8 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.68rem;
  border: 1.5px solid #f3e8ff;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 3px 8px rgba(168, 85, 247, 0.5);
  font-family: var(--font-inter);
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.token-t5 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef08a 0%, #f59e0b 50%, #92400e 100%);
  color: #1c1917;
  font-weight: 900;
  font-size: 0.68rem;
  border: 1.5px solid #fef9c3;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 3px 8px rgba(245, 158, 11, 0.6);
  font-family: var(--font-inter);
  flex-shrink: 0;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.player-radar-section {
  background: radial-gradient(circle at 50% 40%, rgba(245, 158, 11, 0.08) 0%, rgba(12, 16, 24, 0.95) 75%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 20px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(245, 158, 11, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.radar-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.radar-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 14px;
}

.radar-chart-container {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 380px;
  margin: 0 auto;
}


.th-zone-z4 { background: rgba(59, 130, 246, 0.15) !important; color: #60a5fa !important; border-bottom: 2px solid #3b82f6 !important; text-align: center !important; font-weight:800; }
.th-zone-z5 { background: rgba(168, 85, 247, 0.15) !important; color: #c084fc !important; border-bottom: 2px solid #a855f7 !important; text-align: center !important; font-weight:800; }
.th-zone-z6 { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; border-bottom: 2px solid #ef4444 !important; text-align: center !important; font-weight:800; }
.th-zone-kl { background: rgba(245, 158, 11, 0.15) !important; color: #fbbf24 !important; border-bottom: 2px solid #f59e0b !important; text-align: center !important; font-weight:800; }
.th-zone-tiers { background: rgba(16, 185, 129, 0.15) !important; color: #34d399 !important; border-bottom: 2px solid #10b981 !important; text-align: center !important; font-weight:800; }
.th-zone-totals { background: rgba(234, 179, 8, 0.15) !important; color: #fde047 !important; border-bottom: 2px solid #eab308 !important; text-align: center !important; font-weight:800; }
.th-zone-gold { background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.35) 100%) !important; color: #fef08a !important; border-bottom: 2px solid #f59e0b !important; text-align: center !important; font-weight:900 !important; }

.cell-real-data {
  background: rgba(245, 158, 11, 0.08) !important;
}

tbody tr:hover .cell-real-data {
  background: rgba(245, 158, 11, 0.15) !important;
}

.filter-chip.gold-chip {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde047;
}

.filter-chip.gold-chip.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.4) 100%);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.zone-divider-right {
  border-right: 2px solid rgba(255, 255, 255, 0.15) !important;
}
  
  /* ==========================================================================
   RIGHE E COLONNE BLOCCATE (STICKY HEADER & COLUMNS) PER TABELLE
   ========================================================================== */
.table-responsive {
  position: relative !important;
  width: 100% !important;
  max-height: 72vh !important;
  overflow: auto !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.th-zone-tiers { background: rgba(10, 185, 129, 0.15) !important; color: #34d399 !important; border-bottom: 2px solid #10b981 !important; text-align: center !important; font-weight:800; }
.data-table,
.rok-governors-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: max-content;
  min-width: 100%;
}

/* Sticky Header Row per tutte le tabelle */
.data-table thead,
.rok-governors-table thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 25 !important;
}

.data-table thead th,
.rok-governors-table thead th {
  background-color: #1a202c !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
  border-bottom: 2px solid rgba(245, 158, 11, 0.5) !important;
}

/* 1. Colonna 1 Bloccata nel Corpo Tabella: Rank (# / 🏆) - Esatta 48px su Desktop */
.data-table tbody tr td:nth-child(1),
.rok-governors-table tbody tr td:nth-child(1) {
  position: sticky !important;
  left: 0 !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  box-sizing: border-box !important;
  z-index: 15 !important;
  background-color: #0f172a !important;
  text-align: center !important;
}

/* 2. Colonna 2 Bloccata nel Corpo Tabella: Governatore & ID (Attaccata a 48px ZERO GAP su Desktop) */
.data-table tbody tr td:nth-child(2),
.rok-governors-table tbody tr td:nth-child(2) {
  position: sticky !important;
  left: 48px !important;
  z-index: 15 !important;
  background-color: #0f172a !important;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.7) !important;
  border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
}

/* 3. Intestazione Header - SOLO LA PRIMA RIGA (Fissata sia in alto che a sinistra) */
.data-table thead tr:first-child th:nth-child(1),
.rok-governors-table thead tr:first-child th:nth-child(1) {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  box-sizing: border-box !important;
  z-index: 45 !important;
  background-color: #1e293b !important;
  text-align: center !important;
}

.data-table thead tr:first-child th:nth-child(2),
.rok-governors-table thead tr:first-child th:nth-child(2) {
  position: sticky !important;
  top: 0 !important;
  left: 48px !important;
  z-index: 45 !important;
  background-color: #1e293b !important;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.7) !important;
  border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
}

/* 4. Seconda Riga di Header (Sottotitoli Scansioni): NON bloccata a sinistra, scorre libera */
.data-table thead tr:nth-child(2) th,
.rok-governors-table thead tr:nth-child(2) th {
  position: static !important;
  left: auto !important;
  z-index: 20 !important;
  background-color: #1a202c !important;
}

.data-table tbody tr:hover td:nth-child(1),
.data-table tbody tr:hover td:nth-child(2),
.rok-governors-table tbody tr:hover td:nth-child(1),
.rok-governors-table tbody tr:hover td:nth-child(2) {
  background-color: #1e293b !important;
}
.th-zone-totals { background: rgba(234, 179, 8, 0.15) !important; color: #fde047 !important; border-bottom: 2px solid #eab308 !important; text-align: center !important; font-weight:800; }
.th-zone-gold { background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.35) 100%) !important; color: #fef08a !important; border-bottom: 2px solid #f59e0b !important; text-align: center !important; font-weight:900 !important; }

.cell-real-data {
  background: rgba(245, 158, 11, 0.08) !important;
}

tbody tr:hover .cell-real-data {
  background: rgba(245, 158, 11, 0.15) !important;
}

.filter-chip.gold-chip {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde047;
}

.filter-chip.gold-chip.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.4) 100%);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.zone-divider-right {
  border-right: 2px solid rgba(255, 255, 255, 0.15) !important;
}
  
  /* ==========================================================================
   RIGHE E COLONNE BLOCCATE (STICKY HEADER & COLUMNS) PER TABELLE
   ========================================================================== */
.table-responsive {
  position: relative !important;
  width: 100% !important;
  max-height: 72vh !important;
  overflow: auto !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.data-table,
.rok-governors-table {
  border-collapse: collapse !important;
  width: max-content;
  min-width: 100%;
}

/* Sticky Header Row in Alto (Solo Verticale) */
.data-table thead,
.rok-governors-table thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 25 !important;
}

.data-table thead th,
.rok-governors-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 25 !important;
  background-color: #1a202c !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
  border-bottom: 2px solid rgba(245, 158, 11, 0.5) !important;
}

.data-table tbody tr:hover td,
.rok-governors-table tbody tr:hover td {
  background-color: rgba(245, 158, 11, 0.08) !important;
}

.app-wrapper {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

/* ==========================================================================
   TOP NAVIGATION BAR (IDENTICA ALLO SCREENSHOT)
   ========================================================================== */
.top-nav {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(18, 22, 31, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  padding: 12px 24px;
  border-radius: 14px;
  position: sticky;
  top: 16px;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

.menu-toggle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  flex: 1;
}

.nav-auth-section {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  flex: 1;
  margin-left: auto;
}

.nav-logo {
  font-size: 1.3rem;
}

.nav-title {
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--gold-main) 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sub);
  font-family: var(--font-inter);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--gold-main);
}

/* ==========================================================================
   VIEW PANELS (PAGE SWITCHING)
   ========================================================================== */
.view-panel {
  display: none;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   1. PAGINA DI BENVENUTO (IMMAGINE HERO IN ALTO + PULSANTI SOTTO)
   ========================================================================== */
.data-table,
.rok-governors-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: max-content;
  min-width: 100%;
}

/* Sticky Header Row per tutte le tabelle */
.data-table thead,
.rok-governors-table thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
}

.data-table thead th,
.rok-governors-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  background-color: #1e293b !important;
  color: #f8fafc !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  padding: 10px 12px !important;
  border-bottom: 2px solid #f59e0b !important;
  border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
  white-space: nowrap !important;
}

/* Griglia Excel: Bordi e spaziatura celle */
.data-table td,
.rok-governors-table td {
  padding: 8px 12px !important;
  font-size: 0.82rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

/* Celle con testo a capo abilitato (es. Descrizioni / Note) */
.data-table td.cell-wrap,
.data-table td.kvk-desc-cell,
.rok-governors-table td.cell-wrap,
.rok-governors-table td.kvk-desc-cell,
.cell-wrap,
.kvk-desc-cell {
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  line-height: 1.5 !important;
  min-width: 220px !important;
  max-width: 450px !important;
}

/* Righe Alternate Stile Zebra Excel */
.data-table tbody tr:nth-child(even),
.rok-governors-table tbody tr:nth-child(even) {
  background-color: rgba(30, 41, 59, 0.35) !important;
}

.data-table tbody tr:nth-child(odd),
.rok-governors-table tbody tr:nth-child(odd) {
  background-color: rgba(15, 23, 42, 0.7) !important;
}

/* Righe al tocco / hover */
.data-table tbody tr:hover td,
.rok-governors-table tbody tr:hover td {
  background-color: rgba(245, 158, 11, 0.15) !important;
}

.welcome-hero-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 440px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  margin-bottom: 32px;
  background-color: #0b0e14;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.banner-full-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: var(--transition-smooth);
}

.welcome-hero-banner:hover .banner-full-img {
  transform: scale(1.015);
}

.banner-text-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 32px 32px 32px;
  background: linear-gradient(180deg, rgba(11, 14, 20, 0) 0%, rgba(11, 14, 20, 0.85) 60%, rgba(11, 14, 20, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.hero-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  backdrop-filter: blur(10px);
}

.welcome-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
  margin-bottom: 12px;
}

/* Pulsanti Sovrapposti all'Immagine (Senza Descrizione) */
.banner-buttons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 680px;
  margin-top: 8px;
}

.hero-glass-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 32px;
  border-radius: 14px;
  font-family: var(--font-inter);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  min-width: 260px;
}

.gold-glass {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #ffffff;
}

.gold-glass:hover {
  background: rgba(245, 158, 11, 0.45);
  border-color: #f59e0b;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(245, 158, 11, 0.4);
}

.blue-glass {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #ffffff;
}

.blue-glass:hover {
  background: rgba(59, 130, 246, 0.45);
  border-color: #3b82f6;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

.purple-glass {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #ffffff;
}

.purple-glass:hover {
  background: rgba(168, 85, 247, 0.45);
  border-color: #a855f7;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(168, 85, 247, 0.4);
}

.emerald-glass {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #ffffff;
}

.emerald-glass:hover {
  background: rgba(16, 185, 129, 0.45);
  border-color: #10b981;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.amber-glass {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(234, 179, 8, 0.55);
  color: #fde68a;
}

.amber-glass:hover {
  background: rgba(234, 179, 8, 0.38);
  border-color: #eab308;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(234, 179, 8, 0.4);
}

.cyan-glass {
  background: rgba(6, 182, 212, 0.25);
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: #ffffff;
}

.cyan-glass:hover {
  background: rgba(6, 182, 212, 0.45);
  border-color: #06b6d4;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(6, 182, 212, 0.4);
}

.red-glass {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ffffff;
}

.red-glass:hover {
  background: rgba(239, 68, 68, 0.42);
  border-color: #ef4444;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(239, 68, 68, 0.4);
}

/* Layout Sezione KvK */
.kvk-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.badge-green { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-yellow { background: rgba(234, 179, 8, 0.2); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.4); }
.badge-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

.btn-icon {
  font-size: 1.3rem;
}

.welcome-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* I 2 Pulsanti di Selezione sotto l'immagine (All'esterno) */
.welcome-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.hub-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hub-card:hover {
  transform: translateY(-5px);
  background-color: rgba(9, 13, 20, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
}

.gold-border { border-top: 2px solid var(--gold-main); }
.blue-border { border-top: 2px solid var(--blue-main); }

.gold-border:hover { box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25); }
.blue-border:hover { box-shadow: 0 10px 30px rgba(59, 130, 246, 0.25); }

.hub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hub-icon {
  font-size: 1.8rem;
}

.hub-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-sub);
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
}

.hub-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.hub-description {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.4;
  flex-grow: 1;
}

.btn-hub {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-gold { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #000; }
.btn-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff; }
.btn-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: #fff; }
.btn-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; }

.btn-hub:hover {
  filter: brightness(1.1);
}

/* ==========================================================================
   2. OVERVIEW REGNO
   ========================================================================== */
:root {
  --bg-page: #0b0e14;
  --bg-card: #12161f;
  --border-card: rgba(255, 255, 255, 0.07);
  
  --text-main: #ffffff;
  --text-sub: #8e9bb0;
  --text-muted: #94a3b8;
}

/* Global Hidden Utility Class */
.hidden {
  display: none !important;
}

.kingdom-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.header-main-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 600;
}

.kingdom-name {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* King Card */
.king-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px 20px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.king-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.king-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.king-title-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-main);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--green-main);
  font-weight: 600;
}

.live-dot {
  width: 6px;
  height: 6px;
  background-color: var(--green-main);
  border-radius: 50%;
}

.king-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.king-avatar-frame {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(135deg, #fcd34d 0%, #d97706 100%);
  position: relative;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.king-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.king-crest {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background-color: #f59e0b;
  color: #000;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
}

.king-details {
  display: flex;
  flex-direction: column;
}

.king-name { font-size: 1.1rem; font-weight: 800; }
.king-alliance { font-size: 0.8rem; color: var(--text-sub); }
.king-reign { font-size: 0.75rem; color: var(--text-muted); }

/* KPI Trend Row */
.kpi-trend-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) { .kpi-trend-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .kpi-trend-row { grid-template-columns: 1fr; } }

.trend-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.card-label-group { display: flex; align-items: center; gap: 6px; }
.card-label { font-size: 0.68rem; font-weight: 800; color: var(--text-sub); }
.sparkline-container { width: 65px; height: 24px; }
.card-value { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.card-bottom { display: flex; align-items: center; gap: 8px; }
.badge-delta { font-size: 0.75rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.delta-red { background-color: rgba(239, 68, 68, 0.15); color: var(--red-main); }
.card-subtext { font-size: 0.75rem; color: var(--text-muted); }

/* Radar Section */
.radar-panel-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-header-row { display: flex; justify-content: space-between; align-items: center; }
.panel-title-group { display: flex; align-items: center; gap: 8px; }
.panel-title-text { font-size: 1.1rem; font-weight: 700; }
.snapshot-date { font-size: 0.8rem; color: var(--text-muted); }

.radar-content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: center;
}

@media (max-width: 900px) { .radar-content-grid { grid-template-columns: 1fr; } }

.radar-chart-box { width: 100%; max-width: 480px; height: 400px; margin: 0 auto; }
.radar-table-box { display: flex; flex-direction: column; gap: 12px; }
.radar-table-row { display: flex; justify-content: space-between; align-items: center; background-color: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.03); border-radius: 8px; padding: 12px 16px; }
.radar-category { display: flex; align-items: center; gap: 12px; }
.grade-badge { font-size: 0.85rem; font-weight: 900; font-style: italic; padding: 2px 8px; border-radius: 4px; }
.badge-b { background-color: rgba(16, 185, 129, 0.2); color: var(--green-main); border: 1px solid rgba(16, 185, 129, 0.4); }
.cat-name { font-size: 0.95rem; font-weight: 600; }
.cat-percent { font-size: 0.95rem; font-weight: 700; color: var(--text-sub); }

/* ==========================================================================
   3. PLAYER VIEW & TABELLE
   ========================================================================== */
.player-search-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon { position: absolute; left: 10px; opacity: 0.6; }
#player-search-input {
  background-color: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-card);
  padding: 10px 14px 10px 32px;
  border-radius: 8px;
  outline: none;
  font-family: var(--font-inter);
  width: 220px;
}

.custom-select {
  background-color: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-card);
  padding: 10px 16px;
  border-radius: 8px;
  outline: none;
  font-family: var(--font-inter);
}

.btn-action-sm {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Profilo Player Pit IX Compact */
.player-profile-card {
  position: relative;
  background-color: rgba(18, 22, 31, 0.85);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.profile-marine-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  pointer-events: none;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transition: all 0.3s ease;
}

/* ================= AMPIO BANNER SFUMATO ED ARMONIOSO ================= */
.discord-profile-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  opacity: 0.70;
  mix-blend-mode: overlay;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.75) 50%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.75) 50%, rgba(0, 0, 0, 0) 100%);
  transition: all 0.4s ease;
  display: none;
}

.discord-profile-banner.has-banner-img {
  display: block !important;
}

.discord-profile-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(18, 22, 31, 0.2) 60%, rgba(18, 22, 31, 0.9) 100%);
  pointer-events: none;
}

.profile-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.profile-header-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000 !important;
  overflow: visible !important;
  transition: all 0.3s ease;
}

/* Quando c'è un'immagine di sfondo personalizzata attiva -> Rimuovi il rettangolo scuro! */
.player-profile-card.has-custom-banner .profile-header-container {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

.player-profile-card.has-custom-banner #player-name {
  color: #ffffff !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 0, 0, 0.9), 0 0 6px #000 !important;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  color: #e2e8f0;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.player-profile-card.has-custom-banner .meta-item {
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7) !important;
  color: #ffffff !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  display: inline-flex !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  margin-top: 0 !important;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.fill-red { background: linear-gradient(90deg, #ef4444, #f87171); }
.fill-yellow { background: linear-gradient(90deg, #eab308, #fbbf24); }
.fill-green { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* Ultra-Compact KPI Row Style */
.compact-kpi-row {
  margin-top: 10px !important;
  gap: 12px !important;
}

.compact-kpi-row .trend-card {
  padding: 10px 14px !important;
  border-radius: 10px !important;
}

.compact-kpi-row .trend-card-title {
  font-size: 0.72rem !important;
  font-weight: 700;
}

.compact-kpi-row .trend-badge {
  font-size: 0.68rem !important;
  padding: 2px 6px !important;
}

.compact-kpi-row .trend-main-value {
  font-size: 1.12rem !important;
  font-weight: 800;
}

.compact-kpi-row .trend-sub-value {
  font-size: 0.72rem !important;
}

/* ==========================================================================
   ALTEZZA E SPAZIATURA GRAFICI KVK (TALL & SPACIOUS CHARTS)
   ========================================================================== */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
  margin-top: 16px;
}

.kvk-charts-grid .panel {
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(18, 22, 31, 0.92) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.4) !important;
  border-radius: 16px !important;
  padding: 22px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transition: all 0.3s ease;
}

.kvk-charts-grid .panel:hover {
  border-color: rgba(245, 158, 11, 0.7) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.2) !important;
}

.kvk-charts-grid .chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 360px;
  margin-top: 16px;
  background: rgba(11, 14, 20, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

  .welcome-title {
    font-size: 1.8rem;
  }

  .welcome-hub-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .trend-kpi-grid {
    grid-template-columns: 1fr;
  }

  .radar-flex-grid {
    grid-template-columns: 1fr;
  }

  /* Barra di filtraggio mobile */
  .filter-bar-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .stylish-search-wrapper input {
    width: 100% !important;
  }

  .stylish-search-wrapper {
    width: 100%;
  }

  /* Tabella Mobile: Scorrimento Orizzontale Fluido con Touch */
  .no-horizontal-scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .rok-governors-table {
    table-layout: auto !important;
    min-width: 680px;
  }

  .rok-governors-table th, 
  .rok-governors-table td {
    padding: 12px 8px;
  }

  /* Footer paginazione mobile */
  .table-pagination-footer {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
  }

.auth-btn-pill {
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.auth-btn-pill:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(217, 119, 6, 0.6) 100%);
  border-color: #fbbf24;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.auth-btn-pill.hidden, .user-badge-container.hidden {
  display: none !important;
}

.user-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.master-status-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.user-name-text {
  color: #f8fafc;
  font-weight: 700;
  font-size: 13.5px;
}

.logout-pill-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-weight: 600;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-pill-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

/* Master Header Panel */
.master-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 24px 30px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
}

.master-restricted-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.master-header-title {
  color: #f8fafc;
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px 0;
}

.master-header-subtitle {
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
}

.master-badge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 12px 20px;
  border-radius: 14px;
}

.master-badge-icon {
  font-size: 32px;
}

.master-role-title {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.master-user-name {
  color: #fbbf24;
  font-size: 16px;
  font-weight: 800;
}

/* Master Cards Grid */
.master-section-box {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-sizing: border-box;
}

/* ==========================================================================
   MASTER KVK MANAGEMENT (DESKTOP)
   ========================================================================== */
.master-kvk-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.master-kvk-top-grid .master-section-box {
  margin: 0;
  box-sizing: border-box;
  max-width: 100%;
}

.master-kvk-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}

.master-kvk-legend-grid .custom-legend-item {
  grid-column: span 2;
}

.master-kvk-status-legend {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
}

.master-kvk-datetime-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
}

.master-section-title {
  color: #f8fafc;
  font-size: 20px;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 20px;
}

.master-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.master-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.master-card:hover {
  transform: translateY(-4px);
  border-color: #fbbf24;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.2);
}

.master-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.master-badge-pill {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
}

.badge-king { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); }
.badge-rally { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.5); }
.badge-garrison { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.5); }

.master-card-name {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px 0;
}

.master-card-id {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 14px;
}

.master-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: rgba(15, 23, 42, 0.5);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.master-stat-item label {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.master-stat-item span {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 800;
}

.master-action-btn {
  width: 100%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.master-action-btn:hover {
  background: #f59e0b;
  color: #0f172a;
}

/* Master Notes Section */
.notes-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.save-notes-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.save-notes-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.master-notes-area {
  width: 100%;
  min-height: 140px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  color: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.master-notes-area:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.notes-status-label {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-top: 8px;
}

/* AUTH MODAL STYLES */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.auth-modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.auth-modal-card {
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  box-sizing: border-box;
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth-modal-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

.auth-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.auth-form-header h3 {
  color: #f8fafc;
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px 0;
}

.auth-form-header p {
  color: #94a3b8;
  font-size: 13px;
  margin: 0 0 20px 0;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #f59e0b;
}

.auth-submit-btn {
  width: 100%;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  padding: 12px 0;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.gold-glow {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.blue-glow {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.demo-access-divider {
  text-align: center;
  margin: 18px 0;
  position: relative;
}

.demo-access-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.demo-access-divider span {
  position: relative;
  background: #1e293b;
  padding: 0 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.demo-master-btn {
  width: 100%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-master-btn:hover {
  background: rgba(245, 158, 11, 0.3);
}

.auth-error-msg {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.id-validation-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.id-validation-badge.valid {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.id-validation-badge.invalid {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* ==========================================================================
   STILI UFFICIALI R4, CONCILIO & SUPERVISIONE UTENTI
   ========================================================================== */

.r4-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 7px;
  margin-left: 6px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4) 0%, rgba(126, 34, 206, 0.65) 100%);
  border: 1px solid #c084fc;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
  vertical-align: middle;
}

.rally-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 7px;
  margin-left: 6px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(185, 28, 28, 0.65) 100%);
  border: 1px solid #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  vertical-align: middle;
}

.garrison-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 7px;
  margin-left: 6px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(29, 78, 216, 0.65) 100%);
  border: 1px solid #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  vertical-align: middle;
}

.king-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 7px;
  margin-left: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(217, 119, 6, 0.65) 100%);
  border: 1px solid #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  vertical-align: middle;
}

.queen-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 7px;
  margin-left: 6px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.5) 0%, rgba(219, 39, 119, 0.75) 100%);
  border: 1px solid #f472b6;
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.7);
  vertical-align: middle;
}

/* Badge di Verifica Minimalista (Solo Simbolo ✅ Senza Testo) */
.verified-symbol-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #3b82f6 0%, #1d4ed8 100%);
  border: 1.5px solid #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  font-size: 0.75rem;
  margin-left: 6px;
  vertical-align: middle;
  cursor: help;
}

/* Badge Diamante Contributore Economico (Supporter $) */
.supporter-diamond-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  background-image: url('images/supporter_badge.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7), 0 0 14px rgba(245, 158, 11, 0.5);
  vertical-align: middle;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
}

.supporter-diamond-badge:hover {
  transform: scale(1.2) rotate(5deg);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

/* Badge Fuorilegge / Player Killer Inline */
.outlaw-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-left: 6px;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.9));
  vertical-align: middle;
  cursor: help;
  animation: pulse-outlaw 2s infinite ease-in-out;
  user-select: none;
}

@keyframes pulse-outlaw {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.8)); }
  50% { transform: scale(1.2); filter: drop-shadow(0 0 12px rgba(220, 38, 38, 1)); }
}

/* Badge Grande Fuorilegge nel Profilo */
.outlaw-profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.88) 0%, rgba(69, 10, 10, 0.96) 100%);
  color: #fecaca;
  border: 1.5px solid #ef4444;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-top: 6px;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.45);
  text-transform: uppercase;
  user-select: none;
}

/* Box Privato di Sblocco PIN nel Profilo Utente */
.private-pin-unlock-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(180, 83, 9, 0.25) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.private-pin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.private-pin-icon {
  font-size: 1.8rem;
}

.private-pin-titles h4 {
  margin: 0;
  color: #fbbf24;
  font-size: 1rem;
  font-weight: 800;
}

.private-pin-titles p {
  margin: 4px 0 0 0;
  color: var(--text-sub);
  font-size: 0.82rem;
}

.private-pin-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.private-pin-input {
  flex-grow: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.private-pin-input:focus {
  outline: none;
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.private-pin-submit-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: #000000;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.private-pin-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
}

/* ================= TEMA PROFILO PERSONALIZZABILE (SOLO UTENTI REGISTRATI) ================= */

.profile-theme-customizer {
  position: relative;
  z-index: 20;
  margin-left: auto;
}

.theme-palette-btn {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, rgba(99, 102, 241, 0.4) 100%);
  border: 1px solid rgba(244, 114, 182, 0.6);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}

.theme-palette-btn:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.5) 0%, rgba(168, 85, 247, 0.6) 100%);
  border-color: #f472b6;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 24px rgba(244, 114, 182, 0.6);
}

.theme-palette-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 250px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9), 0 0 25px rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999 !important;
}

.theme-palette-dropdown.hidden {
  display: none !important;
}

.palette-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.close-palette-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.close-palette-btn:hover { color: #f87171; }

.palette-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.palette-option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-align: left;
}

.palette-option-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(3px);
}

.swatch-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.swatch-default { background: linear-gradient(135deg, #1e293b, #0f172a); border: 1px solid #3b82f6; }
.swatch-pink { background: linear-gradient(135deg, #f472b6, #db2777); border: 1px solid #f472b6; }
.swatch-gold { background: linear-gradient(135deg, #fbbf24, #d97706); border: 1px solid #fbbf24; }
.swatch-purple { background: linear-gradient(135deg, #c084fc, #7e22ce); border: 1px solid #c084fc; }
.swatch-red { background: linear-gradient(135deg, #fca5a5, #b91c1c); border: 1px solid #fca5a5; }
.swatch-green { background: linear-gradient(135deg, #34d399, #047857); border: 1px solid #34d399; }
.swatch-cyan { background: linear-gradient(135deg, #22d3ee, #0e7490); border: 1px solid #22d3ee; }
.swatch-brown { background: linear-gradient(135deg, #b45309, #451a03); border: 1px solid #d97706; }
.swatch-king { background: linear-gradient(135deg, #06b6d4 0%, #10b981 40%, #0369a1 100%); border: 1px solid #22d3ee; }
.swatch-ruby-red { background: linear-gradient(135deg, #f43f5e, #9f1239); border: 1px solid #f43f5e; }

/* 1. Theme Pink (Rosa) */
.player-profile-card.theme-pink,
.player-profile-card.pink-player-bg {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35) 0%, rgba(190, 24, 93, 0.5) 45%, rgba(24, 14, 28, 0.95) 100%) !important;
  border: 2px solid rgba(244, 114, 182, 0.75) !important;
  box-shadow: 0 0 35px rgba(236, 72, 153, 0.45) !important;
}
.player-profile-card.theme-pink .profile-marine-bg,
.player-profile-card.pink-player-bg .profile-marine-bg { background: radial-gradient(circle at top right, rgba(244, 114, 182, 0.45) 0%, transparent 70%) !important; }
.player-profile-card.theme-pink .kvk-gauges-container,
.player-profile-card.pink-player-bg .kvk-gauges-container { background: rgba(45, 18, 38, 0.22) !important; border-color: rgba(244, 114, 182, 0.3) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
.player-profile-card.theme-pink .pkpi-card,
.player-profile-card.pink-player-bg .pkpi-card { background: rgba(244, 114, 182, 0.08) !important; border-color: rgba(244, 114, 182, 0.25) !important; }

/* 2. Theme Gold (Oro Reale) */
.player-profile-card.theme-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(180, 83, 9, 0.5) 45%, rgba(24, 20, 14, 0.95) 100%) !important;
  border: 2px solid rgba(251, 191, 36, 0.75) !important;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.45) !important;
}
.player-profile-card.theme-gold .profile-marine-bg { background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.45) 0%, transparent 70%) !important; }
.player-profile-card.theme-gold .kvk-gauges-container { background: rgba(45, 35, 14, 0.22) !important; border-color: rgba(251, 191, 36, 0.3) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
.player-profile-card.theme-gold .pkpi-card { background: rgba(251, 191, 36, 0.08) !important; border-color: rgba(251, 191, 36, 0.25) !important; }

/* 3. Theme Purple (Viola Ufficiale) */
.player-profile-card.theme-purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(126, 34, 206, 0.5) 45%, rgba(20, 14, 28, 0.95) 100%) !important;
  border: 2px solid rgba(192, 132, 252, 0.75) !important;
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.45) !important;
}
.player-profile-card.theme-purple .profile-marine-bg { background: radial-gradient(circle at top right, rgba(192, 132, 252, 0.45) 0%, transparent 70%) !important; }
.player-profile-card.theme-purple .kvk-gauges-container { background: rgba(35, 14, 45, 0.22) !important; border-color: rgba(192, 132, 252, 0.3) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
.player-profile-card.theme-purple .pkpi-card { background: rgba(192, 132, 252, 0.08) !important; border-color: rgba(192, 132, 252, 0.25) !important; }

/* 4. Theme Red (Rosso Rally) */
.player-profile-card.theme-red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35) 0%, rgba(185, 28, 28, 0.5) 45%, rgba(28, 14, 14, 0.95) 100%) !important;
  border: 2px solid rgba(252, 165, 165, 0.75) !important;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.45) !important;
}
.player-profile-card.theme-red .profile-marine-bg { background: radial-gradient(circle at top right, rgba(252, 165, 165, 0.45) 0%, transparent 70%) !important; }
.player-profile-card.theme-red .kvk-gauges-container { background: rgba(45, 14, 14, 0.22) !important; border-color: rgba(252, 165, 165, 0.3) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
.player-profile-card.theme-red .pkpi-card { background: rgba(252, 165, 165, 0.08) !important; border-color: rgba(252, 165, 165, 0.25) !important; }

/* 5. Theme Green (Verde Smeraldo) */
.player-profile-card.theme-green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(4, 120, 87, 0.5) 45%, rgba(14, 28, 20, 0.95) 100%) !important;
  border: 2px solid rgba(52, 211, 153, 0.75) !important;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.45) !important;
}
.player-profile-card.theme-green .profile-marine-bg { background: radial-gradient(circle at top right, rgba(52, 211, 153, 0.45) 0%, transparent 70%) !important; }
.player-profile-card.theme-green .kvk-gauges-container { background: rgba(14, 45, 28, 0.22) !important; border-color: rgba(52, 211, 153, 0.3) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
.player-profile-card.theme-green .pkpi-card { background: rgba(52, 211, 153, 0.08) !important; border-color: rgba(52, 211, 153, 0.25) !important; }

/* 6. Theme Cyan (Ciano Cyber) */
.player-profile-card.theme-cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.35) 0%, rgba(14, 116, 144, 0.5) 45%, rgba(14, 24, 28, 0.95) 100%) !important;
  border: 2px solid rgba(34, 211, 238, 0.75) !important;
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.45) !important;
}
.player-profile-card.theme-cyan .profile-marine-bg { background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.45) 0%, transparent 70%) !important; }
.player-profile-card.theme-cyan .kvk-gauges-container { background: rgba(14, 38, 45, 0.22) !important; border-color: rgba(34, 211, 238, 0.3) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
.player-profile-card.theme-cyan .pkpi-card { background: rgba(34, 211, 238, 0.08) !important; border-color: rgba(34, 211, 238, 0.25) !important; }

/* 7. Theme Brown / Mud (Marrone Fango Blacklist) */
.player-profile-card.theme-brown,
.player-profile-card.theme-mud {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.5) 0%, rgba(69, 26, 3, 0.8) 45%, rgba(26, 12, 4, 0.96) 100%) !important;
  border: 2px solid rgba(180, 83, 9, 0.7) !important;
  box-shadow: 0 0 35px rgba(120, 53, 15, 0.45) !important;
}
.player-profile-card.theme-brown .profile-marine-bg,
.player-profile-card.theme-mud .profile-marine-bg { background: radial-gradient(circle at top right, rgba(180, 83, 9, 0.45) 0%, transparent 70%) !important; }
.player-profile-card.theme-brown .kvk-gauges-container,
.player-profile-card.theme-mud .kvk-gauges-container { background: rgba(35, 18, 8, 0.22) !important; border-color: rgba(180, 83, 9, 0.3) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
.player-profile-card.theme-brown .pkpi-card,
.player-profile-card.theme-mud .pkpi-card { background: rgba(120, 53, 15, 0.12) !important; border-color: rgba(180, 83, 9, 0.25) !important; }

/* 8. Theme King (Blu Oltremare con Effetto Diamante - Riservato Esclusivamente al Re) */
.player-profile-card.theme-king {
  background: linear-gradient(135deg, rgba(0, 47, 167, 0.9) 0%, rgba(30, 144, 255, 0.45) 25%, rgba(255, 255, 255, 0.28) 45%, rgba(0, 24, 113, 0.95) 70%, rgba(5, 16, 59, 0.98) 100%) !important;
  border: 2.5px solid #60a5fa !important;
  box-shadow: 0 0 55px rgba(59, 130, 246, 0.75), 0 0 25px rgba(255, 255, 255, 0.5), inset 0 0 35px rgba(147, 197, 253, 0.4) !important;
  position: relative;
  backdrop-filter: blur(12px) !important;
}
.player-profile-card.theme-king .profile-marine-bg {
  background: radial-gradient(circle at 85% 15%, rgba(147, 197, 253, 0.75) 0%, rgba(59, 130, 246, 0.45) 35%, transparent 75%) !important;
  filter: blur(20px) !important;
}
.player-profile-card.theme-king .kvk-gauges-container {
  background: rgba(5, 20, 55, 0.88) !important;
  border: 1.5px solid rgba(147, 197, 253, 0.65) !important;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.35) !important;
  backdrop-filter: blur(8px) !important;
}
.player-profile-card.theme-king .pkpi-card {
  background: rgba(59, 130, 246, 0.14) !important;
  border: 1.5px solid rgba(147, 197, 253, 0.45) !important;
  box-shadow: 0 0 15px rgba(147, 197, 253, 0.25) !important;
  backdrop-filter: blur(6px) !important;
}

/* 9. Theme Verde Smeraldo Lucido & Rosso Rubino Dorato (Riservato Esclusivamente al Player 37838524) */
.player-profile-card.theme-verde-rubino,
.player-profile-card.theme-ruby-red,
.player-profile-card.theme-ruby {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.88) 0%, rgba(16, 185, 129, 0.5) 25%, rgba(251, 191, 36, 0.38) 48%, rgba(225, 29, 72, 0.58) 75%, rgba(15, 23, 42, 0.98) 100%) !important;
  border: 2.5px solid #34d399 !important;
  box-shadow: 0 0 55px rgba(16, 185, 129, 0.7), 0 0 30px rgba(251, 191, 36, 0.5), 0 0 20px rgba(225, 29, 72, 0.45), inset 0 0 35px rgba(52, 211, 153, 0.35) !important;
  position: relative;
  backdrop-filter: blur(14px) !important;
}
.player-profile-card.theme-verde-rubino .profile-marine-bg,
.player-profile-card.theme-ruby-red .profile-marine-bg,
.player-profile-card.theme-ruby .profile-marine-bg {
  background: radial-gradient(circle at 85% 15%, rgba(52, 211, 153, 0.75) 0%, rgba(251, 191, 36, 0.45) 35%, rgba(225, 29, 72, 0.4) 65%, transparent 80%) !important;
  filter: blur(22px) !important;
}
.player-profile-card.theme-verde-rubino .kvk-gauges-container,
.player-profile-card.theme-ruby-red .kvk-gauges-container,
.player-profile-card.theme-ruby .kvk-gauges-container {
  background: rgba(4, 38, 28, 0.88) !important;
  border: 1.5px solid rgba(52, 211, 153, 0.65) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35) !important;
  backdrop-filter: blur(8px) !important;
}
.player-profile-card.theme-verde-rubino .pkpi-card,
.player-profile-card.theme-ruby-red .pkpi-card,
.player-profile-card.theme-ruby .pkpi-card {
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1.5px solid rgba(52, 211, 153, 0.45) !important;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.25) !important;
  backdrop-filter: blur(6px) !important;
}

/* 10. Theme Rosa Queen Reale (Riservato Esclusivamente al Player ID 5525781) */
.player-profile-card.theme-queen-pink,
.player-profile-card.theme-queen {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.45) 0%, rgba(219, 39, 119, 0.55) 30%, rgba(253, 224, 71, 0.28) 50%, rgba(131, 24, 67, 0.85) 75%, rgba(26, 10, 20, 0.96) 100%) !important;
  border: 2.5px solid #f472b6 !important;
  box-shadow: 0 0 55px rgba(244, 114, 182, 0.7), 0 0 25px rgba(253, 224, 71, 0.4), inset 0 0 35px rgba(244, 114, 182, 0.3) !important;
  position: relative;
  backdrop-filter: blur(12px) !important;
}
.player-profile-card.theme-queen-pink .profile-marine-bg,
.player-profile-card.theme-queen .profile-marine-bg {
  background: radial-gradient(circle at 85% 15%, rgba(244, 114, 182, 0.75) 0%, rgba(219, 39, 119, 0.45) 35%, rgba(253, 224, 71, 0.35) 65%, transparent 80%) !important;
  filter: blur(20px) !important;
}
.player-profile-card.theme-queen-pink .kvk-gauges-container,
.player-profile-card.theme-queen .kvk-gauges-container {
  background: rgba(45, 12, 35, 0.25) !important;
  border: 1.5px solid rgba(244, 114, 182, 0.45) !important;
  box-shadow: 0 0 25px rgba(244, 114, 182, 0.3) !important;
  backdrop-filter: blur(6px) !important;
}
.player-profile-card.theme-queen-pink .pkpi-card,
.player-profile-card.theme-queen .pkpi-card {
  background: rgba(244, 114, 182, 0.12) !important;
  border: 1.5px solid rgba(244, 114, 182, 0.4) !important;
  box-shadow: 0 0 15px rgba(244, 114, 182, 0.2) !important;
  backdrop-filter: blur(6px) !important;
}

.badge-icon-img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}

/* ================= DISTINTIVI E MEDAGLIE IN GRANDE NEL PROFILO PLAYER ================= */

.player-medals-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 0;
  margin-left: auto;
}

/* Layout Riservato Esclusivamente ai Contributori Economici per Sfondo Banner Personalizzato & Badges 2ª Fila */
.player-profile-card.supporter-contributor-profile .profile-header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.player-profile-card.supporter-contributor-profile .profile-info-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.player-profile-card.supporter-contributor-profile .profile-name-row {
  justify-content: center;
}

.player-profile-card.supporter-contributor-profile .profile-meta-row {
  justify-content: center;
  flex-wrap: wrap;
}

.player-profile-card.supporter-contributor-profile .player-medals-row {
  display: flex !important;
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  margin-left: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  gap: 12px;
}

.player-profile-card.supporter-contributor-profile .profile-marine-bg {
  border-radius: 16px 16px 0 0;
  transition: all 0.3s ease;
}

/* Quando il profilo ha un banner personalizzato attivo */
.player-profile-card.has-custom-banner {
  background-image: var(--custom-banner-url) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.player-profile-card.has-custom-banner .profile-marine-bg {
  background-image: var(--custom-banner-url) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  opacity: 0.95 !important;
  filter: none !important;
  display: block !important;
}

.large-profile-badge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.large-badge-img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.large-badge-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.large-badge-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.large-profile-badge-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.large-profile-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.large-badge-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.large-badge-text-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.large-badge-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.large-badge-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.medal-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.5) 100%);
  border: 1px solid rgba(245, 158, 11, 0.8);
  color: #fef3c7;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.medal-purple {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.3) 0%, rgba(126, 34, 206, 0.55) 100%);
  border: 1px solid #c084fc;
  color: #f3e8ff;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.medal-red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(185, 28, 28, 0.55) 100%);
  border: 1px solid #fca5a5;
  color: #ffe4e6;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.medal-blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(29, 78, 216, 0.55) 100%);
  border: 1px solid #93c5fd;
  color: #eff6ff;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.gold-border-box { border-color: rgba(245, 158, 11, 0.4) !important; }
.blue-border-box { border-color: rgba(59, 130, 246, 0.4) !important; }
.purple-border-box { border-color: rgba(168, 85, 247, 0.4) !important; }
.red-border-box { border-color: rgba(239, 68, 68, 0.4) !important; }

.section-desc-text {
  color: #94a3b8;
  font-size: 13.5px;
  margin-top: -10px;
  margin-bottom: 18px;
}

.r4-count-pill {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
}

.blue-pill { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.4); color: #60a5fa; }
.red-pill { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); color: #f87171; }

.master-picker-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.searchable-picker-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.picker-search-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
}

.picker-search-input::placeholder {
  color: #64748b;
}

.custom-select-lg, .custom-input-lg {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 12px;
}

.custom-select-lg:focus, .custom-input-lg:focus {
  outline: none;
  border-color: #f59e0b;
}

.add-role-btn {
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gold-btn { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #0f172a; }
.blue-btn { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #ffffff; }
.purple-btn { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); color: #ffffff; }
.red-btn { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #ffffff; }

.r4-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.r4-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 12px;
  transition: border-color 0.2s ease;
}

.r4-card-item:hover {
  border-color: #f59e0b;
}

.r4-info-box {
  display: flex;
  flex-direction: column;
}

.r4-item-name {
  color: #f8fafc;
  font-weight: 700;
  font-size: 14px;
}

.r4-item-id {
  color: #64748b;
  font-size: 11.5px;
}

.remove-r4-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.remove-r4-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Supervision Master Table */
.supervision-table-wrapper {
  overflow-x: auto;
  margin-top: 10px;
  width: 100%;
}

.supervision-master-table {
  width: 100%;
  border-collapse: collapse;
}

.supervision-table-wrapper .supervision-master-table th,
.supervision-table-wrapper .supervision-master-table td {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  min-width: auto !important;
  max-width: none !important;
  box-shadow: none !important;
  border-right: none !important;
  vertical-align: middle;
  padding: 10px 12px;
}

.supervision-player-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}

.supervision-badges-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.supervision-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  line-height: 1.2;
}

.supervision-status-badge.verified {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.supervision-status-badge.pending {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.supervision-status-badge.photo {
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: #fb923c;
}

.status-active-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.status-migrated-badge {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.supervision-actions-wrapper {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.master-action-btn,
.toggle-access-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
}

.master-action-btn.approve-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fef08a;
}

.master-action-btn.approve-btn:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
}

.master-action-btn.remove-photo-btn {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.5);
  color: #fb923c;
}

.master-action-btn.remove-photo-btn:hover {
  background: #ea580c;
  color: #ffffff;
}

.master-action-btn.deny-btn,
.deny-btn {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.master-action-btn.deny-btn:hover,
.deny-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.master-action-btn.allow-btn,
.allow-btn {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.master-action-btn.allow-btn:hover,
.allow-btn:hover {
  background: #10b981;
  color: #ffffff;
}

.master-action-btn.delete-btn,
.delete-user-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.master-action-btn.delete-btn:hover,
.delete-user-btn:hover {
  background: #dc2626;
  color: #ffffff;
}

/* ================= VIGNETTA SPEECH BUBBLE POP-OVER ================= */

.auth-vignetta-bubble {
  position: absolute;
  z-index: 10000;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1px solid rgba(245, 158, 11, 0.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.35);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 12px 16px;
  color: #f8fafc;
  font-size: 13px;
  max-width: 280px;
  animation: vignettaBounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-vignetta-arrow {
  position: absolute;
  top: -8px;
  left: 24px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #f59e0b;
}

@keyframes vignettaBounce {
  0% { opacity: 0; transform: translateY(-8px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.vignetta-title {
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vignetta-desc {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.vignetta-actions {
  display: flex;
  gap: 8px;
}

.vignetta-btn {
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.vignetta-btn:hover {
  transform: scale(1.05);
}

.add-role-btn {
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gold-btn { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #0f172a; }
.blue-btn { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #ffffff; }
.purple-btn { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); color: #ffffff; }
.red-btn { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #ffffff; }

.r4-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.r4-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 12px;
  transition: border-color 0.2s ease;
}

.r4-card-item:hover {
  border-color: #f59e0b;
}

.r4-info-box {
  display: flex;
  flex-direction: column;
}

.r4-item-name {
  color: #f8fafc;
  font-weight: 700;
  font-size: 14px;
}

.r4-item-id {
  color: #64748b;
  font-size: 11.5px;
}

.remove-r4-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.remove-r4-btn:hover {
  background: #ef4444;
  color: #ffffff;
}



/* ================= VIGNETTA SPEECH BUBBLE POP-OVER ================= */

.auth-vignetta-bubble {
  position: absolute;
  z-index: 10000;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1px solid rgba(245, 158, 11, 0.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.35);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 12px 16px;
  color: #f8fafc;
  font-size: 13px;
  max-width: 280px;
  animation: vignettaBounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-vignetta-arrow {
  position: absolute;
  top: -8px;
  left: 24px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #f59e0b;
}

@keyframes vignettaBounce {
  0% { opacity: 0; transform: translateY(-8px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.vignetta-title {
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vignetta-desc {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.vignetta-actions {
  display: flex;
  gap: 8px;
}

.vignetta-btn {
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.vignetta-btn:hover {
  transform: scale(1.05);
}

.vignetta-login-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
}

.vignetta-reg-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

/* Master Privacy Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(239, 68, 68, 0.6);
  transition: .3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: rgba(16, 185, 129, 0.4);
  border-color: rgba(16, 185, 129, 0.8);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* ================= OBIETTIVI KVK SPEEDOMETER GAUGES ================= */

.kvk-gauges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.gauge-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease;
}

.gauge-card:hover {
  transform: translateY(-2px);
}

.gauge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.gauge-header-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.gauge-header-val {
  font-size: 17px;
  font-weight: 800;
  margin-top: 2px;
}

.gauge-chart-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.gauge-center-text {
  position: absolute;
  top: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-center-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.gauge-center-percent {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.gauge-scale-labels {
  display: flex;
  justify-content: space-between;
  width: 250px;
  margin-top: -10px;
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 700;
}

/* ================= SEZIONE CLASSIFICA KVK ================= */

.podiums-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.podium-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.podium-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.podium-icon {
  font-size: 24px;
}

.podium-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.5px;
  display: flex;
  gap: 8px;
}

.vignetta-btn {
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.vignetta-btn:hover {
  transform: scale(1.05);
}

.vignetta-login-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
}

.vignetta-reg-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

/* Master Privacy Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(239, 68, 68, 0.6);
  transition: .3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: rgba(16, 185, 129, 0.4);
  border-color: rgba(16, 185, 129, 0.8);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* ================= OBIETTIVI KVK SPEEDOMETER GAUGES (IDENTICO AL GRAFICO RENDIMENTO) ================= */

.kvk-gauges-container {
  margin-top: 20px;
  padding: 20px 16px;
  background: radial-gradient(circle at 50% 45%, rgba(245, 158, 11, 0.05) 0%, rgba(12, 16, 24, 0.40) 80%) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
  box-sizing: border-box !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

.player-profile-card.has-custom-banner .kvk-gauges-container,
.player-profile-card.has-custom-banner .player-radar-section,
.player-radar-section {
  background: radial-gradient(circle at 50% 45%, rgba(245, 158, 11, 0.05) 0%, rgba(12, 16, 24, 0.38) 80%) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

.kvk-gauges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.gauge-card {
  background: transparent !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 8px 12px;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.gauge-card:hover {
  transform: none !important;
}

.gauge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.gauge-header-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.gauge-header-val {
  font-size: 17px;
  font-weight: 800;
  margin-top: 2px;
}

.gauge-chart-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.gauge-center-text {
  position: absolute;
  top: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-center-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.gauge-center-percent {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.gauge-scale-labels {
  display: flex;
  justify-content: space-between;
  width: 250px;
}

/* ================= SEZIONE CLASSIFICA KVK (RETTANGOLI SEMI-TRASPARENTI MEDAGLIA) ================= */
.podiums-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.podium-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.podium-card.border-red {
  border-color: rgba(239, 68, 68, 0.35);
}
.podium-card.border-yellow {
  border-color: rgba(245, 158, 11, 0.35);
}
.podium-card.border-cyan {
  border-color: rgba(56, 189, 248, 0.35);
}

.podium-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.podium-icon {
  font-size: 24px;
}

.podium-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.5px;
}

.podium-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Rettangolo Giocatore Podio */
.podium-row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
}

.podium-row-item:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.07);
}

/* 1° Oro Semi-Trasparente */
.podium-row-item.gold-rank,
.leaderboard-card-row.gold-rank {
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1.5px solid rgba(251, 191, 36, 0.45) !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.12);
}

/* 2° Argento Semi-Trasparente */
.podium-row-item.silver-rank,
.leaderboard-card-row.silver-rank {
  background: rgba(203, 213, 225, 0.14) !important;
  border: 1.5px solid rgba(226, 232, 240, 0.4) !important;
  box-shadow: 0 4px 15px rgba(148, 163, 184, 0.1);
}

/* 3° Bronzo Semi-Trasparente */
.podium-row-item.bronze-rank,
.leaderboard-card-row.bronze-rank {
  background: rgba(217, 119, 6, 0.14) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.1);
}

/* Rettangolo Giocatore Classifica Generale */
.leaderboard-card-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.leaderboard-card-row:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.lb-rank {
  font-weight: 900;
  font-size: 16px;
  min-width: 44px;
  text-align: center;
  color: #fbbf24;
  flex-shrink: 0;
}

.lb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid #fbbf24;
  flex-shrink: 0;
}

.lb-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.lb-name-row {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lb-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-id {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.lb-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 14px;
  transition: all 0.2s ease;
  cursor: default;
}

.podium-item:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateX(4px);
}

.podium-item-rank {
  font-weight: 800;
  font-size: 13.5px;
  width: 55px;
  flex-shrink: 0;
}

.podium-item-name {
  font-weight: 700;
  font-size: 13.5px;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

/* Leaderboard Row Card Layout */
.classifica-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.classifica-row-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 18px;
  transition: all 0.2s ease;
  cursor: default;
}

.classifica-row-card:hover {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(30, 41, 59, 0.8) 100%);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateX(6px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.classifica-row-card.top-rank-card {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
}

.classifica-rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 34px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  color: #94a3b8;
  flex-shrink: 0;
}

.classifica-rank-badge.rank-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(180, 83, 9, 0.3) 100%);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.classifica-rank-badge.rank-silver {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.25) 0%, rgba(71, 85, 105, 0.3) 100%);
  border-color: rgba(148, 163, 184, 0.6);
  color: #e2e8f0;
}

.classifica-rank-badge.rank-bronze {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.25) 0%, rgba(120, 53, 15, 0.3) 100%);
  border-color: rgba(217, 119, 6, 0.6);
  color: #f59e0b;
}

.classifica-gov-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   VIGNETTA COMPATTA MENU (PULSANTE ☰ MENÙ & POPUP HIGH-TECH)
   ========================================================================== */
.menu-toggle-wrapper {
  position: relative;
}

.menu-trigger-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.25) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  color: #fef08a;
  font-family: var(--font-inter);
  font-size: 1.1rem;
  font-weight: 900;
  padding: 10px 22px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.4) 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.hamburger-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.menu-btn-label {
  letter-spacing: 0.5px;
}

.compact-menu-vignette {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 260px;
  background: linear-gradient(145deg, rgba(20, 27, 45, 0.98) 0%, rgba(10, 15, 29, 0.98) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  z-index: 200;
  animation: vignetteSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes vignetteSlide {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.vignette-header {
  font-size: 11.5px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.vignette-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vignette-menu-list .nav-item {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 12px;
}

.vignette-version-box {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
}

.portal-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: monospace, ui-monospace, sans-serif;
  user-select: none;
}

.portal-version-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  display: inline-block;
}

.classifica-gov-name {
  font-weight: 800;
  font-size: 15px;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.classifica-gov-id {
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
}

/* ================= SEZIONE CONCILIO DEL REGNO ================= */

.concilio-tabs-bar {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.concilio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.concilio-tab-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.concilio-tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.3) 100%);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fef08a;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.concilio-tab-content {
  display: block;
}

.concilio-tab-content.hidden {
  display: none;
}

.master-tab-content {
  display: block;
  margin-top: 16px;
}

.master-tab-content.hidden {
  display: none !important;
}

.border-red-badge {
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}

.profile-header-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 20px;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.profile-header-bg-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 14px;
  display: none;
  opacity: 0.95;
}

.profile-header-container .profile-info-wrapper,
.profile-header-container .profile-theme-customizer {
  position: relative;
  z-index: 2;
}

.profile-header-container.has-custom-header-banner,
.player-profile-card.has-custom-banner .profile-header-container {
  border: 1px solid rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), inset 0 0 50px rgba(0, 0, 0, 0.4) !important;
  min-height: 120px;
}

.killer-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 14px;
  padding: 12px 20px;
  transition: all 0.2s ease;
}

.killer-row-card:hover {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-color: rgba(239, 68, 68, 0.6);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.killer-left-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.killer-danger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 10px;
  font-size: 20px;
  flex-shrink: 0;
}

.killer-name {
  font-weight: 800;
  font-size: 15.5px;
  color: #f87171;
}

.killer-id {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
}

.killer-ban-tag {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* 🆔 CARTA D'IDENTITÀ 3D STILE PASSAPORTO HIGH-TECH & DOSSIER TATTICO */
.passport-card-3d {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 2px solid rgba(245, 158, 11, 0.5);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}
.passport-card-3d:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.8), 0 0 45px rgba(245, 158, 11, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}
.passport-watermark {
  position: absolute;
  right: -25px;
  bottom: -35px;
  font-size: 180px;
  font-weight: 900;
  color: rgba(245, 158, 11, 0.04);
  pointer-events: none;
  letter-spacing: -6px;
  user-select: none;
  font-family: var(--font-inter), sans-serif;
}
.passport-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.passport-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.passport-seal {
  font-size: 38px;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.5));
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  border-radius: 16px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.passport-main-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.passport-sub-title {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-top: 2px;
}
.passport-vip-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  border: 1.5px solid #fbbf24;
  padding: 8px 16px;
  border-radius: 14px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}
.passport-vip-badge .vip-label {
  font-size: 12px;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 1px;
}
.passport-vip-badge .vip-val {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.passport-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .passport-body-grid {
    grid-template-columns: 1fr;
  }
}
.passport-col-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.passport-avatar-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px 20px;
}
.p-avatar-frame {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 2px solid #fbbf24;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
}
.p-gov-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.p-gov-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.p-gov-name {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.3px;
}
.p-gov-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #cbd5e1;
}
.p-gov-meta .p-gov-id strong {
  color: #fbbf24;
  font-family: monospace;
}
.p-gov-meta .p-gov-alliance strong {
  color: #38bdf8;
}
.p-gov-type-badge {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 8px;
  text-transform: uppercase;
}
.passport-stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
}
.p-stat-box {
  background: rgba(15, 23, 42, 0.75);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.p-stat-box:hover {
  transform: translateY(-2px);
}
.p-stat-box.border-green { border-color: rgba(16, 185, 129, 0.35); }
.p-stat-box.border-red { border-color: rgba(239, 68, 68, 0.35); }
.p-stat-box.border-gold { border-color: rgba(245, 158, 11, 0.35); }
.p-stat-box.border-yellow { border-color: rgba(234, 179, 8, 0.35); }
.p-stat-box.border-cyan { border-color: rgba(56, 189, 248, 0.35); }
.p-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.p-stat-val {
  font-size: 20px;
  font-weight: 900;
  margin-top: 4px;
}
.passport-col-tactical {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tactical-section-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}
.tactical-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
}
.tactical-item-row .t-icon {
  font-size: 20px;
  margin-top: 1px;
}
.tactical-item-row .t-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.tactical-item-row .t-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}
.tactical-item-row .t-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.4;
}
.passport-farms-section {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.farms-section-title {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.farms-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.farm-chip {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fef08a;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.farm-chip:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.65);
  transform: translateY(-1px);
}
/* --- GOLD GLASS BUTTONS & PASSPORT ACTIONS --- */
.gold-glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 119, 6, 0.38) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  color: #ffffff;
  font-family: var(--font-inter, sans-serif);
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  user-select: none;
  text-decoration: none;
  outline: none;
}
.gold-glass-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.45) 0%, rgba(217, 119, 6, 0.6) 100%);
  border-color: #fbbf24;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.35);
}
.gold-glass-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.p-gov-farm-owner-row {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(15, 23, 42, 0.75) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fef08a;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.farm-owner-info-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.farm-owner-header-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.farm-owner-name-line {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.farm-owner-crown {
  font-size: 15px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.farm-owner-label {
  color: #fbbf24;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.farm-owner-name {
  color: #ffffff;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.farm-owner-name:hover {
  color: #fbbf24;
  text-decoration: underline;
}

.farm-owner-id {
  color: #94a3b8;
  font-family: monospace;
  font-size: 10.5px;
}

.farm-owner-unassigned {
  color: #94a3b8;
  font-style: italic;
}

/* ── Passport Owner Buttons ─────────────────────────────────── */

/* Piccolo (inline, compact row) */
.passport-owner-btn-sm {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 13px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 20px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 60%, #92400e 100%);
  border: 1.5px solid rgba(255,215,0,0.9);
  color: #1a0800;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(217,119,6,0.6), inset 0 1px 0 rgba(255,255,255,0.5);
  text-shadow: none;
  letter-spacing: 0.4px;
  outline: none;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}
.passport-owner-btn-sm::before {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
  transform: skewX(-20deg);
  transition: left 0.45s ease;
  pointer-events: none;
}
.passport-owner-btn-sm:hover::before { left: 130%; }
.passport-owner-btn-sm:hover {
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 55%, #b45309 100%);
  border-color: #fff176;
  color: #1a0800;
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 5px 18px rgba(251,191,36,0.75), inset 0 1px 0 rgba(255,255,255,0.55);
}
.passport-owner-btn-sm:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 6px rgba(217,119,6,0.5);
}

/* Grande (CTA nella sezione farm) */
@keyframes passport-btn-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(245,158,11,0.4), inset 0 1.5px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.2); }
  50%       { box-shadow: 0 7px 30px rgba(251,191,36,0.75), inset 0 1.5px 0 rgba(255,255,255,0.45), inset 0 -2px 0 rgba(0,0,0,0.15); }
}

.passport-owner-btn-lg {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 14px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 45%, #92400e 100%);
  border: 2px solid rgba(255,215,0,0.9);
  color: #1a0800;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(245,158,11,0.45), inset 0 1.5px 0 rgba(255,255,255,0.45), inset 0 -2px 0 rgba(0,0,0,0.2);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  letter-spacing: 0.5px;
  outline: none;
  overflow: hidden;
  animation: passport-btn-glow 2.5s ease-in-out infinite;
}
.passport-owner-btn-lg::before {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  transform: skewX(-18deg);
  transition: left 0.5s ease;
  pointer-events: none;
}
.passport-owner-btn-lg:hover::before { left: 140%; }
.passport-owner-btn-lg:hover {
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 45%, #b45309 100%);
  border-color: #fff176;
  color: #1a0800;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 36px rgba(251,191,36,0.8), inset 0 1.5px 0 rgba(255,255,255,0.55), inset 0 -2px 0 rgba(0,0,0,0.1);
  animation: none;
}
.passport-owner-btn-lg:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 14px rgba(217,119,6,0.6);
  animation: none;
}
.passport-owner-btn-lg .btn-crown {
  font-size: 17px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.passport-owner-btn-lg:hover .btn-crown {
  transform: rotate(-14deg) scale(1.28);
}
.passport-owner-btn-lg .btn-arrow {
  font-size: 13px;
  color: rgba(26,8,0,0.65);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.passport-owner-btn-lg:hover .btn-arrow {
  transform: translateX(5px);
}
.passport-owner-btn-lg:hover .btn-arrow {
  transform: translateX(3px);
}

.passport-footer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-family: var(--font-inter);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  transform: translateY(-1px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.25) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fef08a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.passport-stamp-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 12px 20px;
  border-radius: 18px;
  backdrop-filter: blur(8px);
}

.stamp-icon {
  font-size: 31px;
}

.passport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

.border-glow-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, transform 0.2s ease;
}

.border-glow-box:hover {
  border-color: rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
}

.passport-box-title {
  font-size: 19.5px;
  font-weight: 900;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.archetype-badge-pill {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 21px;
  border: 1.5px solid;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.commander-pair-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
}

.skill-max-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-weight: 900;
  font-size: 17px;
  padding: 4px 12px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.equip-perk-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 19px;
  font-weight: 800;
}

.green-equip {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.blue-equip {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.purple-equip {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.perk-val {
  font-size: 19.5px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 8px;
}

.passport-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.passport-stat-pill {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid;
}

.stat-label {
  font-size: 18px;
  font-weight: 800;
  opacity: 0.9;
}

.stat-val {
  font-size: 23px;
  font-weight: 900;
  margin-top: 4px;
}

.gold-stat { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); color: #fef08a; }
.purple-stat { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.35); color: #e9d5ff; }
.silver-stat { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.35); color: #f1f5f9; }
.royal-stat { background: rgba(234, 179, 8, 0.15); border-color: rgba(234, 179, 8, 0.45); color: #fde047; }
.red-stat { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.emerald-stat { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); color: #6ee7b7; }

.passport-tactical-footer {
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: inset 0 0 15px rgba(245, 158, 11, 0.05);
}

.stylish-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.stylish-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   SELETTORE MULTILINGUA INTERNAZIONALE (i18n)
   ========================================================================== */
.lang-selector-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 6px 14px;
  border-radius: 24px;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease-in-out;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(245, 158, 11, 0.15);
  height: 38px;
  box-sizing: border-box;
}

.lang-selector-wrapper:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.lang-globe-icon {
  font-size: 15px;
  line-height: 1;
  user-select: none;
  display: flex;
  align-items: center;
}

.lang-selector-select {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-weight: 700;
  font-size: 13.5px;
  outline: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.lang-selector-select option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 8px 12px;
  font-weight: 600;
}

/* ==========================================================================
   STILI PER IL CALCOLATORE MGE & ADDESTRA MENTO TRUPPE
   ========================================================================== */
.calculator-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 1024px) {
  .calculator-grid-container {
    grid-template-columns: 1fr;
  }
}

#calculator-view,
#calculator-view * {
  box-sizing: border-box;
}

.calc-card-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.calc-section-title {
  font-size: 16px;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.full-width-card {
  width: 100%;
  max-width: 100%;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.calc-buffs-grid-wide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .calc-buffs-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 640px) {
  /* Selettore Modalità Calcolatore */
  .calc-mode-switcher {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .calc-mode-btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  /* Griglia Buff e Card Base */
  .calc-buffs-grid-wide {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .calc-card-box {
    padding: 16px 14px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
  }

  .calc-section-title {
    font-size: 14.5px !important;
    line-height: 1.35 !important;
  }

  .calc-toggle-btn {
    min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
  }

  .calc-select-input,
  .calc-number-input {
    min-height: 44px !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
  }

  .calc-total-buff-badge {
    padding: 12px 14px !important;
    font-size: 13px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .calc-total-buff-badge strong {
    font-size: 16px !important;
    white-space: nowrap !important;
  }

  /* Sezioni 2 & 3: Righe Truppe & Upgrade con allineamento a filo destro */
  .calc-troop-row-compact {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 4px 0 !important;
  }

  .calc-troop-row-compact .troop-row-label {
    flex: 1 !important;
    font-size: 12.5px !important;
    color: #cbd5e1 !important;
  }

  .calc-troop-input {
    width: 90px !important;
    min-width: 80px !important;
    max-width: 100px !important;
    min-height: 40px !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
    text-align: right !important;
    border-radius: 8px !important;
  }

  .troop-category-card {
    padding: 12px 14px !important;
    border-radius: 12px !important;
  }

  .category-card-title {
    font-size: 14px !important;
    padding-bottom: 6px !important;
    margin-bottom: 4px !important;
  }

  /* Tasto Reset a tutta larghezza */
  .calc-reset-row {
    width: 100% !important;
    justify-content: stretch !important;
  }

  .calc-reset-btn {
    width: 100% !important;
    min-height: 44px !important;
    text-align: center !important;
    padding: 12px 16px !important;
    font-size: 13.5px !important;
  }

  /* Sezione 4: Dashboard Risultati Live & Risorse */
  .calc-result-card {
    padding: 16px 14px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
  }

  .result-card-title {
    font-size: 14.5px !important;
    margin-bottom: 12px !important;
  }

  .time-breakdown-box {
    padding: 14px !important;
  }

  .time-main-display {
    font-size: clamp(22px, 5.5vw, 28px) !important;
    letter-spacing: -0.3px !important;
    margin-bottom: 8px !important;
    word-break: break-word !important;
  }

  .time-details-row {
    font-size: 12.5px !important;
    padding: 5px 0 !important;
  }

  .calc-batch-kpi-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .calc-batch-kpi-item {
    padding: 8px 10px !important;
  }

  .rss-cost-grid {
    gap: 8px !important;
  }

  .rss-cost-item {
    padding: 10px 10px !important;
    gap: 8px !important;
  }

  .rss-icon {
    font-size: 20px !important;
  }

  .rss-amount {
    font-size: 13.5px !important;
    word-break: break-all !important;
  }

  .metric-box {
    padding: 12px 14px !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .calc-result-card.glow-gold .result-card-title {
    justify-content: center !important;
    text-align: center !important;
  }

  .metric-value {
    font-size: 20px !important;
    text-align: center !important;
  }
}

.calc-troops-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.calc-queue-info-banner {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(30, 41, 59, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

.info-banner-icon {
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

.info-banner-text {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

.info-banner-text strong {
  color: #38bdf8;
}

/* ==========================================================================
   🧮 CALCOLATORE ADDESTRAMENTO (SEZIONE TRUPPE & UPGRADE SENZA TAGLI)
   ========================================================================== */
#calculator-view .calc-troop-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1500px) {
  #calculator-view .calc-troop-categories-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 768px) {
  #calculator-view .calc-troop-categories-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.troop-category-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.troop-category-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.85);
}

.category-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin: 0;
}

.category-inputs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-troop-row-compact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.troop-row-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  min-width: 45px;
}

.calc-troop-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.calc-troop-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.calc-troop-card.gold-border {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(45, 35, 15, 0.4);
}

.troop-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-results-full-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .calc-results-full-grid {
    grid-template-columns: 1fr;
  }
}

.calc-buffs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-input-group.full-width {
  grid-column: span 2;
}

.calc-input-group label {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}

.calc-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  justify-content: flex-start;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.calc-toggle-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.calc-toggle-btn.gold-toggle.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
  border-color: rgba(245, 158, 11, 1);
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.calc-toggle-btn.cyan-toggle.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(14, 165, 233, 0.9));
  border-color: rgba(56, 189, 248, 1);
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.45);
}

.calc-toggle-btn.purple-toggle.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(147, 51, 234, 0.9));
  border-color: rgba(168, 85, 247, 1);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.45);
}

.calc-toggle-btn.active .toggle-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transform: scale(1.15);
}

.calc-select-input,
.calc-number-input,
.calc-troop-input {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.calc-select-input:focus,
.calc-number-input:focus,
.calc-troop-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.calc-troop-input.input-disabled,
.calc-troop-input:disabled {
  opacity: 0.3;
  background: rgba(15, 23, 42, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  cursor: not-allowed !important;
  filter: grayscale(80%);
  pointer-events: none;
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  padding-right: 36px;
}

.suffix-text {
  position: absolute;
  right: 12px;
  color: #f59e0b;
  font-weight: 800;
}

.calc-total-buff-badge {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 12px 18px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14.5px;
  color: #fef08a;
}

.calc-total-buff-badge strong {
  font-size: 18px;
  font-weight: 900;
  color: #f59e0b;
}

.calc-troops-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-troop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.5);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.troop-tier-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 12px;
  min-width: 44px;
  text-align: center;
}

.t1-badge { background: #64748b; color: #fff; }
.t2-badge { background: #16a34a; color: #fff; }
.t3-badge { background: #2563eb; color: #fff; }
.t4-badge { background: #9333ea; color: #fff; }
.t5-badge { background: #d97706; color: #fff; }
.up-badge { background: linear-gradient(135deg, #2563eb, #9333ea); color: #fff; font-size: 11px; min-width: 58px; padding: 3px 6px; text-align: center; }
.up-gold-badge { background: linear-gradient(135deg, #9333ea, #d97706); color: #fff; font-size: 11px; min-width: 58px; padding: 3px 6px; text-align: center; }

.troop-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: #e2e8f0;
}

.calc-troop-input {
  width: 100px;
  max-width: 120px;
  text-align: right;
  box-sizing: border-box;
}

.calc-reset-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.calc-reset-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-reset-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
}

/* RISULTATI CARDS */
.calc-result-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.calc-result-card.glow-gold {
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.calc-result-card.glow-blue {
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.calc-result-card.glow-emerald {
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.result-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.troop-category-card.fanteria-card {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(45, 20, 25, 0.6));
}

.troop-category-card.fanteria-card:hover {
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25);
}

.troop-category-card.fanteria-card .category-card-title {
  color: #fca5a5;
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
}

.troop-category-card.arceria-card {
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 45, 30, 0.6));
}

.troop-category-card.arceria-card:hover {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.troop-category-card.arceria-card .category-card-title {
  color: #6ee7b7;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
}

.troop-category-card.cavalleria-card {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(45, 35, 15, 0.6));
}

.troop-category-card.cavalleria-card:hover {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.troop-category-card.cavalleria-card .category-card-title {
  color: #fde047;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.troop-category-card.assedio-card {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 30, 55, 0.6));
}

.troop-category-card.assedio-card:hover {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}

.troop-category-card.assedio-card .category-card-title {
  color: #7dd3fc;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.result-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .result-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-box {
  background: rgba(30, 41, 59, 0.7);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.calc-result-card.glow-gold .result-card-title {
  justify-content: center;
  text-align: center;
}

.metric-label {
  font-size: 12.5px;
  color: #94a3b8;
  font-weight: 600;
}

.metric-value {
  font-size: 24px;
  font-weight: 900;
}

.gold-text { color: #f59e0b; text-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
.cyan-text { color: #38bdf8; text-shadow: 0 0 12px rgba(56, 189, 248, 0.4); }

.metric-sub {
  font-size: 11px;
  color: #64748b;
}

.time-breakdown-box {
  background: rgba(30, 41, 59, 0.7);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.time-main-display {
  font-size: 32px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.time-details-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: #cbd5e1;
  padding: 6px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.rss-cost-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rss-cost-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.7);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rss-icon {
  font-size: 24px;
}

.rss-info {
  display: flex;
  flex-direction: column;
}

.rss-name {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.rss-amount {
  font-size: 16px;
  font-weight: 800;
  color: #f1f5f9;
}

.rss-food .rss-amount { color: #f87171; }
.rss-wood .rss-amount { color: #4ade80; }
.rss-stone .rss-amount { color: #94a3b8; }
.rss-gold .rss-amount { color: #fbbf24; }

.calc-info-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 18px;
  border-radius: 14px;
}

.info-box-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #f59e0b;
  margin-bottom: 10px;
}

.calc-mode-btn {
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  transition: all 0.25s ease;
}

.calc-mode-btn:hover {
  border-color: rgba(245, 158, 11, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.calc-mode-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.3) 100%);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.calc-batch-kpi-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calc-batch-kpi-item {
  background: rgba(15, 23, 42, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-batch-kpi-item .kpi-sublabel {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.calc-batch-kpi-item .kpi-mainval {
  font-size: 13.5px;
  font-weight: 800;
  color: #38bdf8;
}

.points-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
}

/* ==========================================================================
   STILI CODEX HELPER CRAFTING & DIAMOND MANNEQUIN GRID
   ========================================================================== */
.codex-diamond-slot {
  width: 88px;
  height: 88px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  transform: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.codex-diamond-slot:hover {
  border-color: #fbbf24;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.7), inset 0 0 12px rgba(251, 191, 36, 0.2);
  transform: translateY(-3px) scale(1.05);
}

.codex-diamond-slot.active {
  border-color: #38bdf8;
  background: rgba(14, 116, 144, 0.35);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.85), inset 0 0 14px rgba(56, 189, 248, 0.3);
}

.codex-diamond-slot.equipped {
  border-color: #f59e0b;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
}

.codex-diamond-slot .d-icon {
  transform: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.codex-item-card {
  cursor: pointer;
  padding: 10px 6px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.codex-item-card:hover {
  transform: translateY(-2px);
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.codex-item-card.rarity-legendary { border-color: rgba(245, 158, 11, 0.6); }
.codex-item-card.rarity-epic { border-color: rgba(168, 85, 247, 0.6); }
.codex-item-card.rarity-elite { border-color: rgba(59, 130, 246, 0.6); }

.equipment-3col-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.35fr) minmax(280px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.comparator-3col-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.25fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1080px) {
  .equipment-3col-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Subtab 1: Manichino in primo piano su mobile, seguito da Stats e poi Crafting */
  .equipment-3col-grid > div:nth-child(2) {
    order: 1 !important;
  }
  .equipment-3col-grid > div:nth-child(1) {
    order: 2 !important;
  }
  .equipment-3col-grid > div:nth-child(3) {
    order: 3 !important;
  }

  /* Subtab 2: Comparatore Set A, Set B e poi Confronto */
  .comparator-3col-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .comparator-3col-grid > div:nth-child(1) { order: 1 !important; }
  .comparator-3col-grid > div:nth-child(3) { order: 2 !important; }
  .comparator-3col-grid > div:nth-child(2) { order: 3 !important; }
}

/* Sotto-navigazione schede (.equip-subtabs-nav) su mobile */
@media (max-width: 768px) {
  .equip-subtabs-nav {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
  }

  .equip-subtabs-nav button,
  .equip-subtabs-nav .gold-glass-btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    font-size: 13.5px !important;
  }

  #equipment-view .calc-card-box {
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }
}

/* Scaling fluido anti-overflow e centratura geometrica assoluta del Manichino su smartphone */
@media (max-width: 768px) {
  #equipment-view .calc-card-box {
    padding: 16px 10px !important;
    overflow-x: hidden !important;
  }

  .codex-diamond-mannequin-grid {
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    transform-origin: top center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 480px) {
  .codex-diamond-mannequin-grid:not(.comp-mannequin-grid) {
    left: 50% !important;
    transform: translateX(-50%) scale(0.82) !important;
    transform-origin: top center !important;
    margin-bottom: -85px !important;
  }

  .comp-mannequin-grid {
    left: 50% !important;
    transform: translateX(-50%) scale(0.85) !important;
    transform-origin: top center !important;
    margin: 4px 0 -65px 0 !important;
  }
}

@media (max-width: 380px) {
  .codex-diamond-mannequin-grid:not(.comp-mannequin-grid) {
    left: 50% !important;
    transform: translateX(-50%) scale(0.72) !important;
    transform-origin: top center !important;
    margin-bottom: -135px !important;
  }

  .comp-mannequin-grid {
    left: 50% !important;
    transform: translateX(-50%) scale(0.76) !important;
    transform-origin: top center !important;
    margin: 2px 0 -105px 0 !important;
  }
}

/* Pop-up Modale Picker Equipaggiamento su Mobile */
@media (max-width: 640px) {
  #equip-picker-modal-overlay .auth-modal-card {
    width: 96vw !important;
    height: 92vh !important;
    max-height: 94vh !important;
    padding: 14px 12px !important;
    border-radius: 16px !important;
  }

  #equip-picker-modal-overlay .auth-modal-header {
    padding-right: 42px !important;
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
  }

  #equip-picker-modal-overlay .auth-modal-close {
    top: 12px !important;
    right: 12px !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    font-size: 18px !important;
  }

  /* Barra di Ricerca 100% width e Filtri a 3 colonne uguali touch-friendly */
  #equip-picker-search {
    width: 100% !important;
    min-height: 40px !important;
    font-size: 13.5px !important;
    margin-bottom: 2px !important;
  }

  #equip-picker-search + div {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
  }

  #equip-filter-all,
  #equip-filter-legendary,
  #equip-filter-epic {
    flex: 1 !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    font-size: 12.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Griglia articoli a colonna singola con scorrimento touch fluido */
  #equip-picker-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding-right: 2px !important;
    padding-bottom: 14px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Card articolo: layout compatto ma comodo */
  .equip-picker-card {
    padding: 12px 10px !important;
    border-radius: 12px !important;
    gap: 10px !important;
  }

  /* Controlli Talento ⭐ & Iconico 💎 */
  .equip-picker-card label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    background: rgba(251, 191, 36, 0.08) !important;
    border: 1px solid rgba(251, 191, 36, 0.25) !important;
    border-radius: 8px !important;
    min-height: 34px !important;
    box-sizing: border-box !important;
  }

  .equip-picker-card label input[type="checkbox"] {
    width: 17px !important;
    height: 17px !important;
  }

  .equip-picker-card select {
    min-height: 32px !important;
    padding: 4px 8px !important;
    font-size: 11.5px !important;
  }

  /* Pulsante Equipaggia Questo Armamento a tutta larghezza e touch-friendly */
  .equip-picker-card button[onclick*="confirmPickerEquip"] {
    min-height: 40px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    letter-spacing: 0.2px !important;
  }

  .ra-picker-modal-content {
    width: 96% !important;
    padding: 14px 12px !important;
    max-height: 90vh !important;
  }
}

.comp-mannequin-grid {
  position: relative;
  width: 350px;
  height: 530px;
  margin: 6px auto 12px auto;
}

.comp-diamond-slot {
  width: 80px;
  height: 80px;
  border-radius: 14px;
}

.comp-diamond-slot:hover {
  transform: translateY(-2px) scale(1.04);
}







/* ==========================================================================
   REGOLE MOBILE PHONE & TABLET (PERFETTA RESA SENZA DEFORMAZIONI)
   ========================================================================== */
@media (max-width: 900px) {
  .top-nav {
    padding: 10px 14px;
  }
  
  .welcome-hero-banner {
    aspect-ratio: auto !important;
    min-height: 540px !important;
    margin-bottom: 20px;
    border-radius: 16px;
    justify-content: space-between !important;
  }

  .banner-full-img {
    object-position: center top !important;
  }

  .hero-top-right-auth-wrapper {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
    gap: 6px !important;
    z-index: 20 !important;
  }

  .hero-top-right-lang {
    padding: 4px 10px !important;
    border-radius: 16px !important;
  }

  .hero-lang-select {
    font-size: 12.5px !important;
  }

  .hero-auth-btn {
    padding: 5px 10px !important;
    font-size: 12px !important;
  }

  .banner-text-overlay {
    position: relative !important;
    padding: 24px 16px 20px 16px !important;
    background: linear-gradient(180deg, rgba(11, 14, 20, 0) 0%, rgba(11, 14, 20, 0.88) 30%, rgba(11, 14, 20, 0.98) 100%) !important;
    margin-top: auto !important;
    z-index: 10 !important;
  }

  .welcome-title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
    margin-bottom: 12px !important;
  }

  .hero-badge {
    font-size: 0.7rem !important;
    padding: 3px 10px !important;
    margin-bottom: 4px !important;
  }

  .banner-buttons-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .hero-glass-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 14px 18px !important;
    font-size: 0.98rem !important;
  }
}

@media (max-width: 500px) {
  .welcome-hero-banner {
    min-height: 560px !important;
  }

  .welcome-title {
    font-size: 1.45rem !important;
    letter-spacing: 0 !important;
  }

  .hero-badge {
    font-size: 0.65rem !important;
  }

  .hero-glass-btn {
    padding: 12px 14px !important;
    font-size: 0.9rem !important;
    gap: 8px !important;
  }

  .hero-auth-btns-row {
    gap: 5px !important;
  }

  .hero-auth-btn {
    padding: 4px 8px !important;
    font-size: 11.5px !important;
  }
}


/* Global Mobile Anti-Overflow & App Wrapper Scaling */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

@media (max-width: 600px) {
  .app-wrapper {
    padding: 10px 8px !important;
    gap: 14px !important;
  }

  .top-nav {
    padding: 8px 12px !important;
    border-radius: 12px !important;
  }

  .nav-title {
    font-size: 0.95rem !important;
  }
}


/* ==========================================================================
   MOBILE APP NATIVE EXPERIENCE (BOTTOM BAR, QUICK HUB 2x2, SLIDE SHEET)
   ========================================================================== */

/* Nascosti su Desktop (Default) */
.mobile-bottom-bar,
.mobile-quick-hub,
.mobile-sheet-backdrop {
  display: none;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 768px) {
  /* Spazio di sicurezza inferiore per non sovrapporsi alla barra in basso */
  body {
    padding-bottom: 70px !important;
  }

  .app-wrapper {
    padding-bottom: 75px !important;
  }

  /* 1. Header Desktop Compatto su Mobile */
  .top-nav {
    padding: 8px 14px !important;
    position: sticky !important;
    top: 0 !important;
    border-radius: 0 0 14px 14px !important;
    z-index: 900 !important;
  }

  .menu-toggle-wrapper {
    display: none !important; /* Su mobile usiamo il tasto Menù nella Bottom Bar! */
  }

  /* 2. Hero Banner Snello su Mobile */
  .welcome-hero-banner {
    aspect-ratio: 16 / 9 !important;
    min-height: 200px !important;
    max-height: 240px !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
  }

  .hero-top-right-auth-wrapper {
    display: flex !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 25 !important;
  }

  .banner-buttons-row {
    display: none !important; /* Sostituiti dall'Hub a Tessere 2x2 molto più pulito */
  }

  .banner-text-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 16px 14px !important;
    background: linear-gradient(180deg, rgba(11, 14, 20, 0) 0%, rgba(11, 14, 20, 0.85) 40%, rgba(11, 14, 20, 0.98) 100%) !important;
    margin-top: 0 !important;
  }

  .welcome-title {
    font-size: 1.35rem !important;
    margin-bottom: 4px !important;
    letter-spacing: -0.3px !important;
  }

  .hero-badge {
    font-size: 0.62rem !important;
    padding: 2px 8px !important;
    margin-bottom: 2px !important;
  }

  /* 3. Hub Mobile a Tessere 2x2 */
  .mobile-quick-hub {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 6px !important;
  }

  .mobile-hub-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-hub-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 0.8px;
  }

  .mobile-hub-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #f8fafc;
  }

  .mobile-tiles-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .mobile-tile-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 12px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, border-color 0.15s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    text-align: left !important;
  }

  .mobile-tile-card:active {
    transform: scale(0.96) !important;
    border-color: #fbbf24 !important;
  }

  .tile-gold { border-top: 2.5px solid #f59e0b !important; }
  .tile-blue { border-top: 2.5px solid #3b82f6 !important; }
  .tile-amber { border-top: 2.5px solid #eab308 !important; }
  .tile-purple { border-top: 2.5px solid #a855f7 !important; }
  .tile-emerald { border-top: 2.5px solid #10b981 !important; }
  .tile-cyan { border-top: 2.5px solid #06b6d4 !important; }

  .mobile-tile-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
  }

  .mobile-tile-icon {
    font-size: 22px;
  }

  .mobile-tile-tag {
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: 0.4px;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    color: #94a3b8;
  }

  .mobile-tile-name {
    font-size: 12.5px;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.25;
  }

  .mobile-tile-sub {
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 4. Bottom Navigation Bar Mobile Fissa */
  .mobile-bottom-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid rgba(245, 158, 11, 0.35) !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 9999 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7) !important;
  }

  .m-nav-btn {
    background: transparent !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    flex: 1 !important;
    height: 100% !important;
    padding: 4px 0 !important;
    transition: all 0.15s ease !important;
  }

  .m-nav-icon {
    font-size: 18px !important;
    line-height: 1 !important;
  }

  .m-nav-btn.active {
    color: #fbbf24 !important;
  }

  .m-nav-btn.active .m-nav-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
  }

  /* 5. Mobile Slide-Up Drawer Sheet */
  .mobile-sheet-backdrop {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 10000 !important;
    align-items: flex-end !important;
  }

  .mobile-sheet-backdrop.hidden {
    display: none !important;
  }

  .mobile-sheet-panel {
    width: 100% !important;
    max-height: 78vh !important;
    background: #0f172a !important;
    border-top: 2px solid rgba(245, 158, 11, 0.5) !important;
    border-radius: 22px 22px 0 0 !important;
    padding: 18px 16px 24px 16px !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9) !important;
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .mobile-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-sheet-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .m-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #f8fafc;
    font-size: 13.5px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .m-sheet-item:active {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fbbf24;
  }

  .m-sheet-icon {
    font-size: 18px;
  }
}


/* ==========================================================================
   OTTIMIZZAZIONE COMPLETA ANTI-DEFORMAZIONE PER TUTTE LE 11 PAGINE SU MOBILE
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Reset Spaziature Globali */
  .app-wrapper {
    padding: 10px 8px 80px 8px !important;
    gap: 14px !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .view-panel {
    gap: 14px !important;
    width: 100% !important;
  }

  /* 2. Header & King Card (Overview) */
  .kingdom-header {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: stretch !important;
    min-width: 0 !important;
  }

  .header-main-info {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .kingdom-name {
    font-size: 1.35rem !important;
    letter-spacing: -0.3px !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
  }

  .king-card {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .king-profile {
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .king-avatar-frame {
    width: 46px !important;
    height: 46px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .king-details {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .king-name {
    font-size: 0.98rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .king-alliance {
    font-size: 0.74rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* 3. KPI Trend Cards a Griglia 2 Colonne Compatte & Simmetriche */
  .kpi-trend-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .kpi-trend-row .trend-card:nth-child(3) {
    grid-column: span 2 !important;
  }

  .trend-card {
    min-height: auto !important;
    padding: 10px 10px !important;
    border-radius: 10px !important;
  }

  .card-value {
    font-size: 1.2rem !important;
    margin-bottom: 2px !important;
  }

  .card-label {
    font-size: 0.65rem !important;
  }

  .card-subtext {
    font-size: 0.62rem !important;
  }

  /* 4. Barre di Ricerca, Filtri & Menu a Tendina (Overview, KvK, Profilo, Concilio) */
  .filter-bar-container {
    padding: 14px 10px !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }

  .filter-bar-top {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .filter-controls-right {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .stylish-search-wrapper {
    width: 100% !important;
  }

  .stylish-search-wrapper input {
    width: 100% !important;
    font-size: 14px !important;
    padding: 10px 14px 10px 36px !important;
    box-sizing: border-box !important;
  }

  .stylish-search-wrapper input:focus {
    width: 100% !important;
  }

  .alliance-select-wrapper {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .custom-select-sm {
    flex: 1 !important;
    font-size: 13.5px !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
  }

  .filter-chips-row {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .filter-chip {
    flex-shrink: 0 !important;
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }

  /* 5. Tabelle Scorrevoli con Colonne Bloccate (Overview, KvK, Concilio, Supervisione) */
  .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    margin-bottom: 12px !important;
  }

  .table-responsive table,
  .data-table,
  .rok-governors-table {
    width: max-content !important;
    min-width: 460px !important;
    border-collapse: collapse !important;
  }

  /* Override per Real Data e Concilio su Mobile */
  #real-data-tbody td,
  #concilio-targets-table th,
  #concilio-targets-table td {
    padding: 6px 6px !important;
    font-size: 11px !important;
  }

  #real-data-thead th {
    padding: 5px 3px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.15 !important;
    text-align: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
  }

  #real-data-table thead tr:first-child th.col-num {
    min-width: 70px !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  #real-data-table thead tr:first-child th.col-rank {
    min-width: 40px !important;
    width: 40px !important;
    max-width: 40px !important;
    box-sizing: border-box !important;
    left: 0 !important;
    top: 0 !important;
    position: sticky !important;
    z-index: 45 !important;
    padding: 6px 2px !important;
    font-size: 11px !important;
    text-align: center !important;
    background-color: #1e293b !important;
  }

  #real-data-table tbody td.col-rank {
    min-width: 40px !important;
    width: 40px !important;
    max-width: 40px !important;
    box-sizing: border-box !important;
    left: 0 !important;
    position: sticky !important;
    z-index: 15 !important;
    padding: 6px 2px !important;
    font-size: 11px !important;
    text-align: center !important;
    background-color: #0f172a !important;
  }

  #real-data-table thead tr:first-child th.col-gov {
    min-width: 120px !important;
    width: 120px !important;
    max-width: 120px !important;
    box-sizing: border-box !important;
    left: 40px !important;
    top: 0 !important;
    position: sticky !important;
    z-index: 45 !important;
    padding: 6px 6px !important;
    text-align: left !important;
    background-color: #1e293b !important;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.7) !important;
    border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
  }

  #real-data-table tbody td.col-gov {
    min-width: 120px !important;
    width: 120px !important;
    max-width: 120px !important;
    box-sizing: border-box !important;
    left: 40px !important;
    position: sticky !important;
    z-index: 15 !important;
    padding: 6px 6px !important;
    text-align: left !important;
    background-color: #0f172a !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.7) !important;
    border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
  }

  #real-data-table thead tr:nth-child(2) th {
    position: static !important;
    left: auto !important;
    z-index: 5 !important;
    padding: 4px 2px !important;
    font-size: 9.5px !important;
    background-color: #1a202c !important;
    min-width: 50px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.15 !important;
  }

  #concilio-targets-table th,
  #concilio-targets-table td {
    padding: 8px 8px !important;
    font-size: 11.5px !important;
  }

  .rok-governors-table th,
  .rok-governors-table td,
  .data-table th,
  .data-table td {
    padding: 6px 6px !important;
    font-size: 0.74rem !important;
    white-space: nowrap !important;
  }

  /* Dual-mode numeri su Mobile: compatti visibili, estesi nascosti */
  .num-full {
    display: none !important;
  }
  .num-compact {
    display: inline !important;
    font-weight: 700 !important;
  }

  /* Celle governatore su mobile */
  .gov-cell-name {
    font-size: 11.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 104px !important;
  }

  .gov-cell-id {
    font-size: 9.5px !important;
    color: #94a3b8 !important;
  }

  .gov-table-badges-row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    margin-top: 2px !important;
  }

  /* Mini-Badge ridimensionati compatti (15px) */
  .gov-table-badges-row .badge-icon-img,
  .gov-table-badges-row .king-inline-badge,
  .gov-table-badges-row .queen-inline-badge,
  .gov-table-badges-row .r4-inline-badge,
  .gov-table-badges-row .rally-inline-badge,
  .gov-table-badges-row .garrison-inline-badge,
  .gov-table-badges-row .supporter-diamond-badge,
  .gov-table-badges-row .outlaw-inline-badge {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    padding: 1px !important;
    font-size: 9px !important;
    margin-left: 0 !important;
    border-radius: 3px !important;
  }

  .gov-table-badges-row .badge-icon-img {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    max-width: 13px !important;
  }

  /* Colonne numeriche snelle e centrate su mobile */
  .rok-governors-table th.col-num,
  .rok-governors-table td.col-num,
  .data-table th.col-num,
  .data-table td.col-num,
  .rok-governors-table th:nth-child(n+3),
  .rok-governors-table td:nth-child(n+3),
  .data-table th:nth-child(n+3),
  .data-table td:nth-child(n+3) {
    padding: 6px 6px !important;
    font-size: 11px !important;
    text-align: center !important;
    font-variant-numeric: tabular-nums !important;
    min-width: 52px !important;
  }

  .gov-table-avatar-frame {
    width: 30px !important;
    height: 30px !important;
  }

  .gov-table-name {
    font-size: 0.82rem !important;
    max-width: 130px !important;
  }

  .gov-table-id {
    font-size: 0.7rem !important;
  }

  /* 6. Profilo Player (KPI Cards, Search Dropdown & Radar) */
  .profile-search-container {
    width: 100% !important;
  }

  #profile-search-input {
    width: 100% !important;
    font-size: 14px !important;
  }

  #profile-search-dropdown-results {
    width: 100% !important;
    max-height: 240px !important;
    z-index: 1000 !important;
  }

  .player-profile-body-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .player-kpi-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .pkpi-card {
    padding: 8px 10px !important;
  }

  .pkpi-title {
    font-size: 0.78rem !important;
  }

  .pkpi-value {
    font-size: 1.1rem !important;
  }

  .player-radar-section {
    padding: 16px 12px !important;
    margin-top: 14px !important;
  }

  .radar-chart-container {
    height: 280px !important;
  }

  /* 7. Grafici KvK & Andamento */
  .kvk-charts-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 14px !important;
  }

  .kvk-charts-grid .panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: auto !important;
    padding: 14px 10px !important;
    box-sizing: border-box !important;
  }

  .chart-wrapper,
  .kvk-charts-grid .chart-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: 250px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 8px 6px !important;
    margin-top: 10px !important;
  }

  /* 8. Calcolatore Addestramento & Risorse */
  .calc-container {
    padding: 14px 10px !important;
  }

  .calc-troop-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .troop-category-card {
    padding: 14px 12px !important;
  }

  .calc-number-input {
    font-size: 14px !important;
    padding: 8px 10px !important;
  }

  .rss-cost-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .rss-cost-item {
    padding: 8px 10px !important;
  }

  .rss-amount {
    font-size: 14px !important;
  }

  /* 9. Calcolatore Attrezzature & Manichino */
  .codex-mannequin-wrapper {
    transform: scale(0.9) !important;
    margin: 0 auto !important;
  }

  .codex-materials-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* 10. Concilio Tabs & War Room */
  .concilio-tabs-row {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding-bottom: 6px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .concilio-tab-btn {
    flex-shrink: 0 !important;
    padding: 8px 12px !important;
    font-size: 12.5px !important;
  }

  /* 11. Master View Grids */
  .master-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .master-r4-grid {
    grid-template-columns: 1fr !important;
  }

  .supervision-table-wrapper {
    overflow-x: auto !important;
    width: 100% !important;
  }

  .rok-governors-table th, 
  .rok-governors-table td {
    padding: 12px 8px;
  }

  /* 12. Footer paginazione mobile */
  .table-pagination-footer {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 6px !important;
    margin-top: 14px !important;
    text-align: center !important;
  }

  .pagination-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .btn-page {
    padding: 7px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    cursor: pointer !important;
    min-width: 90px !important;
  }

  .page-current-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
  }

  .per-page-selector {
    width: 100% !important;
    justify-content: center !important;
    font-size: 12px !important;
    gap: 6px !important;
  }
}





/* ==========================================================================
   BARRA SUPERIORE TOP-NAV ULTRA-COMPATTA ED ELEGANTE PER SMARTPHONE
   ========================================================================== */
@media (max-width: 768px) {
  .top-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 10px !important;
    min-height: 48px !important;
    height: 48px !important;
    box-sizing: border-box !important;
    background: rgba(15, 23, 42, 0.97) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: 1.5px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: 0 0 14px 14px !important;
    margin: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 900 !important;
  }

  .nav-brand {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  .nav-logo {
    font-size: 1.15rem !important;
  }

  .nav-title {
    font-size: 0.88rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.2px !important;
  }

  .nav-auth-section {
    display: flex !important;
    flex-direction: row !important; /* Allineamento orizzontale su un'unica riga */
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
  }

  .lang-selector-wrapper {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: 28px !important;
    box-sizing: border-box !important;
  }

  .lang-globe-icon,
  .lang-icon {
    font-size: 12px !important;
  }

  .lang-selector-select {
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    max-width: 38px !important;
    padding: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
  }

  .nav-auth-buttons {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .auth-btn-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3px 8px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    gap: 3px !important;
    height: 28px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    transition: none !important;
  }

  .auth-btn-pill.gold-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.35) 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.6) !important;
    color: #fef08a !important;
  }

  .auth-btn-pill.blue-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(29, 78, 216, 0.35) 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.6) !important;
    color: #93c5fd !important;
  }

  .user-badge-container {
    display: inline-flex !important;
    align-items: center !important;
    height: 28px !important;
    padding: 2px 7px !important;
    gap: 5px !important;
    border-radius: 10px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    box-sizing: border-box !important;
  }

  .master-status-badge {
    font-size: 8.5px !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
    background: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
  }

  .user-name-text {
    font-size: 11px !important;
    font-weight: 800 !important;
    max-width: 65px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #f8fafc !important;
  }

  .logout-pill-btn {
    padding: 2px 6px !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    border-radius: 6px !important;
    background: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: #fca5a5 !important;
    cursor: pointer !important;
  }
}

@media (max-width: 400px) {
  .top-nav {
    padding: 4px 6px !important;
  }

  .nav-title {
    font-size: 0.8rem !important;
  }

  .lang-selector-select {
    max-width: 48px !important;
    font-size: 10px !important;
  }

  .auth-btn-pill {
    padding: 2px 6px !important;
    font-size: 9.5px !important;
    gap: 2px !important;
  }

  .master-status-badge {
    display: none !important;
  }

  .user-name-text {
    max-width: 55px !important;
    font-size: 10px !important;
  }
}





/* ==========================================================================
   MOBILE APP: FILTRI IMPILATI VERTICALMENTE & NESSUNA TRANSIZIONE/ANIMAZIONE
   ========================================================================== */
@media (max-width: 768px) {
  /* ⚡ 1. DISATTIVAZIONE TOTALE TRANSIZIONI ED ANIMAZIONI SU MOBILE PER MASSIMA VELOCITÀ ED EFFETTO ISTANTANEO */
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }

  .view-panel.active {
    animation: none !important;
  }

  .mobile-sheet-panel {
    animation: none !important;
  }

  /* 📐 2. FILTRI E MENU A TENDINA IMPILATI UNO SOTTO L'ALTRO (VERTICAL STACK) */
  .filter-bar-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .filter-bar-top {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .filter-title-group {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }

  .filter-controls-right {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* Barra di ricerca a tutta larghezza */
  .stylish-search-wrapper {
    width: 100% !important;
    display: flex !important;
    box-sizing: border-box !important;
  }

  .stylish-search-wrapper input {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    padding: 10px 36px !important;
  }

  .stylish-search-wrapper input:focus {
    width: 100% !important;
  }

  /* Menu a tendina Alleanze impilato a tutta larghezza */
  .alliance-select-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .custom-select-sm,
  .alliance-select-wrapper select {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 13.5px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  /* Chip filtri rapidi disposti uno sotto l'altro */
  .filter-chips-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    overflow-x: visible !important;
  }

  .filter-chip {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 9px 12px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
  }

  /* Selettore Scan KvK impilato verticalmente */
  .kvk-scan-selector-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .kvk-scan-btn {
    width: 100% !important;
    text-align: center !important;
    padding: 10px 12px !important;
  }

  /* Tab del Concilio impilati verticalmente */
  .concilio-tabs-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    overflow-x: visible !important;
  }

  .concilio-tab-btn {
    width: 100% !important;
    text-align: center !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
  }
}


/* ==========================================================================
   PULSANTI TAB DEL CONCILIO IMPILATI UNO SOPRA L'ALTRO (VERSIONE APP/MOBILE)
   ========================================================================== */
@media (max-width: 768px) {
  /* Griglia 2x2 super-compatta per i 4 Tab del Concilio: risparmia 140px di altezza */
  .concilio-tabs-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .concilio-tab-btn {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 8px !important;
    min-height: 44px !important;
    border-radius: 10px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    box-sizing: border-box !important;
    text-align: center !important;
    line-height: 1.25 !important;
  }

  .concilio-tab-btn .tab-btn-icon {
    font-size: 16px !important;
    flex-shrink: 0 !important;
  }
}


/* ==========================================================================
   STILE DEDICATO PER TABELLA VALUTAZIONE MINIMI KVK (#concilio-targets-table)
   ========================================================================== */

/* Griglia KPI Summary Minimi KvK (Desktop & Base) */
.targets-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.targets-kpi-grid .pkpi-card {
  padding: 14px 16px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 84px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.targets-kpi-grid .pkpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.targets-kpi-grid .pkpi-card.border-green {
  background: rgba(16, 185, 129, 0.1) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

.targets-kpi-grid .pkpi-card.border-gold {
  background: rgba(245, 158, 11, 0.1) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

.targets-kpi-grid .pkpi-card.border-red {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.targets-kpi-grid .pkpi-card.border-purple {
  background: rgba(139, 92, 246, 0.1) !important;
  border: 1px solid rgba(139, 92, 246, 0.35) !important;
}

.targets-kpi-grid .pkpi-card.border-cyan {
  background: rgba(56, 189, 248, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.targets-kpi-grid .pkpi-title {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
  margin: 0;
  word-break: break-word;
  position: relative;
  z-index: 2;
}

.targets-kpi-grid .pkpi-title.text-purple {
  color: #c4b5fd;
}

.targets-kpi-grid .pkpi-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
  position: relative;
  z-index: 2;
}

/* Icona filigrana di sfondo elegante: NON collide e non fa MAI sbordare il testo */
.targets-kpi-grid .pkpi-icon {
  position: absolute !important;
  right: 10px !important;
  bottom: 8px !important;
  font-size: 34px !important;
  opacity: 0.16 !important;
  pointer-events: none !important;
  z-index: 1 !important;
  line-height: 1 !important;
  transform: none !important;
}

#concilio-targets-table {
  width: 100% !important;
  min-width: 680px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/* Intestazioni Tabella Minimi KvK: Testo a capo consentito se supera la larghezza della colonna */
#concilio-targets-table thead th {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
  text-align: center !important;
}

#concilio-targets-table thead th:first-child {
  text-align: left !important;
}

/* Colonna 1: Nome, ID & Potere sotto ID (Sticky a Sinistra, larghezza snella 165px) */
#concilio-targets-table thead tr th:nth-child(1),
#concilio-targets-table tbody tr td:nth-child(1),
#concilio-targets-table tbody tr td.col-targets-gov {
  position: sticky !important;
  left: 0 !important;
  width: 165px !important;
  min-width: 165px !important;
  max-width: 175px !important;
  text-align: left !important;
  padding: 8px 10px !important;
  z-index: 20 !important;
  background-color: #12161f !important;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.45) !important;
  border-right: 2px solid rgba(56, 189, 248, 0.4) !important;
  box-sizing: border-box !important;
}

#concilio-targets-table thead tr th:nth-child(1) {
  top: 0 !important;
  z-index: 40 !important;
  background-color: #1e2536 !important;
}

/* Tipografia della Colonna Governatore (Compatta su 3 Livelli) */
.col-targets-gov .gov-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  line-height: 1.25;
}

.col-targets-gov .gov-rank-num {
  font-size: 11px;
  color: #64748b;
  font-weight: 800;
  flex-shrink: 0;
}

.col-targets-gov .gov-fullname {
  font-weight: 800;
  color: #f8fafc;
  font-size: 13px;
  white-space: normal !important;
  word-break: break-word;
}

.col-targets-gov .gov-id-row {
  color: #fbbf24;
  font-weight: 700;
  font-family: monospace;
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.2;
}

.col-targets-gov .gov-power-row {
  color: #94a3b8;
  font-weight: 600;
  font-size: 11px;
  margin-top: 1px;
  line-height: 1.2;
}

/* Colonne 2, 3, 4, 5: Scorrevoli a destra (ZERO SOVRAPPOSIZIONE) */
#concilio-targets-table thead tr th:nth-child(2),
#concilio-targets-table thead tr th:nth-child(3),
#concilio-targets-table thead tr th:nth-child(4),
#concilio-targets-table thead tr th:nth-child(5),
#concilio-targets-table tbody tr td:nth-child(2),
#concilio-targets-table tbody tr td:nth-child(3),
#concilio-targets-table tbody tr td:nth-child(4),
#concilio-targets-table tbody tr td:nth-child(5) {
  position: static !important;
  left: auto !important;
  box-shadow: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.04) !important;
  padding: 10px 12px !important;
}

#concilio-targets-table thead tr th:nth-child(2),
#concilio-targets-table thead tr th:nth-child(3),
#concilio-targets-table thead tr th:nth-child(4),
#concilio-targets-table thead tr th:nth-child(5) {
  position: sticky !important;
  top: 0 !important;
  z-index: 25 !important;
  background-color: #1a202c !important;
}

#concilio-targets-table tbody tr:hover td {
  background-color: rgba(56, 189, 248, 0.06) !important;
}

#concilio-targets-table tbody tr:hover td:nth-child(1) {
  background-color: #1e2536 !important;
}

/* Stili Mobile Specifici per Valutazione Minimi KvK */
@media (max-width: 768px) {
  #concilio-tab-targets .governors-table-panel {
    padding: 12px 8px !important;
  }

  .targets-header-panel {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
  }

  .targets-controls-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .targets-search-box,
  .targets-filter-select {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Layout 2x2 per i 4 KPI + 5° KPI (Tasso Idoneità) in banner orizzontale a tutta larghezza */
  .targets-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }

  .targets-kpi-grid .pkpi-card {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    min-height: 72px !important;
  }

  .targets-kpi-grid .pkpi-title {
    font-size: 9.5px !important;
    letter-spacing: 0.2px !important;
    line-height: 1.25 !important;
  }

  .targets-kpi-grid .pkpi-value {
    font-size: 18px !important;
    margin-top: 4px !important;
  }

  .targets-kpi-grid .pkpi-icon {
    font-size: 26px !important;
    right: 8px !important;
    bottom: 6px !important;
    opacity: 0.14 !important;
  }

  /* 5° KPI: Tasso Idoneità Main - Banner esteso orizzontale a tutta larghezza */
  .targets-kpi-grid .pkpi-card:last-child {
    grid-column: 1 / -1 !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 11px 14px !important;
    min-height: auto !important;
  }

  .targets-kpi-grid .pkpi-card:last-child .pkpi-title {
    font-size: 11px !important;
  }

  .targets-kpi-grid .pkpi-card:last-child .pkpi-value {
    margin-top: 0 !important;
    font-size: 20px !important;
  }

  .targets-kpi-grid .pkpi-card:last-child .pkpi-icon {
    display: none !important;
  }

  .targets-chart-card {
    flex-direction: column !important;
    padding: 12px !important;
    gap: 12px !important;
  }

  .targets-chart-card p {
    font-size: 11px !important;
    margin-bottom: 8px !important;
    line-height: 1.3 !important;
  }

  .targets-chart-card > div:last-child {
    width: 170px !important;
    height: 170px !important;
  }

  /* Su Mobile: Tabella scorrevole con Colonna 1 bloccata compatta a 125px (ZERO SOVRAPPOSIZIONI) */
  #concilio-targets-table {
    min-width: 580px !important;
  }

  #concilio-targets-table thead th {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
  }

  #concilio-targets-table thead tr th:nth-child(1),
  #concilio-targets-table tbody tr td:nth-child(1),
  #concilio-targets-table tbody tr td.col-targets-gov {
    width: 125px !important;
    min-width: 125px !important;
    max-width: 130px !important;
    padding: 7px 8px !important;
    font-size: 0.76rem !important;
  }

  .col-targets-gov .gov-fullname {
    font-size: 11.5px !important;
  }

  .col-targets-gov .gov-id-row {
    font-size: 10px !important;
  }

  .col-targets-gov .gov-power-row {
    font-size: 10px !important;
  }

  #concilio-targets-table thead tr th:nth-child(n+2),
  #concilio-targets-table tbody tr td:nth-child(n+2) {
    padding: 7px 8px !important;
    font-size: 0.74rem !important;
  }
}

/* ==========================================================================
   OTTIMIZZAZIONE CARTA D'IDENTITÀ (DOSSIER / PASSAPORTO) SU MOBILE APP
   ========================================================================== */
@media (max-width: 768px) {
  #concilio-tab-passport .governors-table-panel {
    padding: 12px 8px !important;
  }

  #concilio-tab-passport .stylish-search-wrapper {
    max-width: 100% !important;
    width: 100% !important;
  }

  .passport-select-row {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
  }

  #passport-player-select,
  .stylish-select {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    font-size: 13px !important;
    padding: 8px 10px !important;
  }

  .passport-card-3d {
    padding: 12px 10px !important;
    border-radius: 16px !important;
    border-width: 1.5px !important;
  }

  .passport-watermark {
    font-size: 80px !important;
    right: -5px !important;
    bottom: -10px !important;
    opacity: 0.5 !important;
  }

  .passport-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
  }

  .passport-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .passport-seal {
    width: 38px !important;
    height: 38px !important;
    font-size: 22px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .passport-main-title {
    font-size: 13.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
    line-height: 1.25 !important;
  }

  .passport-sub-title {
    font-size: 9.5px !important;
    letter-spacing: 0.2px !important;
    line-height: 1.2 !important;
  }

  .passport-vip-badge {
    padding: 3px 8px !important;
    border-radius: 8px !important;
    gap: 6px !important;
    align-self: flex-start !important;
  }

  .passport-vip-badge .vip-label {
    font-size: 10px !important;
  }

  .passport-vip-badge .vip-val {
    font-size: 12px !important;
  }

  .passport-body-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
  }

  .passport-avatar-box {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    gap: 10px !important;
  }

  .p-avatar-frame {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    font-size: 22px !important;
    flex-shrink: 0 !important;
  }

  .p-gov-name {
    font-size: 15px !important;
    letter-spacing: -0.2px !important;
  }

  .p-gov-meta {
    font-size: 11px !important;
    gap: 6px !important;
  }

  .p-gov-type-badge {
    font-size: 9.5px !important;
    padding: 2px 6px !important;
  }

  .passport-stats-mini-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .p-stat-box {
    padding: 7px 9px !important;
    border-radius: 10px !important;
  }

  .p-stat-label {
    font-size: 9px !important;
    letter-spacing: 0.2px !important;
  }

  .p-stat-val {
    font-size: 12.5px !important;
    font-weight: 800 !important;
  }

  .passport-col-tactical {
    padding: 10px !important;
    border-radius: 12px !important;
  }

  .tactical-section-title {
    font-size: 12px !important;
    margin-bottom: 8px !important;
  }

  .tactical-item-row {
    gap: 8px !important;
    padding: 5px 0 !important;
  }

  .tactical-item-row .t-icon {
    font-size: 15px !important;
  }

  .tactical-item-row .t-label {
    font-size: 10px !important;
  }

  .tactical-item-row .t-val {
    font-size: 11.5px !important;
    line-height: 1.25 !important;
  }

  .passport-footer-actions {
    margin-top: 12px !important;
    display: flex !important;
    justify-content: center !important;
  }

  .passport-footer-actions .hero-glass-btn {
    width: 100% !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
  }

  /* Layout a 3 livelli per Farm Owner: Riga 1 (Corona + PROPRIETARIO:), Riga 2 (Nome + ID), Riga 3 (Pulsante Apri) */
  .p-gov-farm-owner-row {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
    padding: 10px 12px !important;
    font-size: 11.5px !important;
    border-radius: 10px !important;
    margin-top: 8px !important;
  }

  .farm-owner-info-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
  }

  /* Riga 1: Corona + PROPRIETARIO: */
  .farm-owner-header-line {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .farm-owner-crown {
    font-size: 14px !important;
    flex-shrink: 0 !important;
  }

  .farm-owner-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  /* Riga 2: NOME + ID */
  .farm-owner-name-line {
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .farm-owner-name {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
  }

  .farm-owner-id {
    font-size: 11px !important;
    color: #94a3b8 !important;
    font-family: monospace !important;
  }

  /* Riga 3: Pulsante Apri posizionato SOTTO a tutta larghezza */
  .p-gov-farm-owner-row .passport-owner-btn-sm {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 12px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
    gap: 6px !important;
    min-height: 34px !important;
    margin-top: 3px !important;
  }

  .passport-owner-btn-lg {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    min-height: 38px !important;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35) !important;
    letter-spacing: 0.3px !important;
  }

  .passport-owner-btn-lg .btn-crown {
    font-size: 14px !important;
  }

  .passport-owner-btn-lg .btn-arrow {
    font-size: 11px !important;
  }

  /* --- CURA DIMAGRANTE COMPATTA ESTESA SU TUTTO IL SITO MOBILE --- */

  /* 1. Pannelli, Riquadri e Titoli Generali */
  .panel,
  .full-width-panel,
  .governors-table-panel {
    padding: 12px 10px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
  }

  .panel-title,
  .panel-title-text,
  .section-title {
    font-size: 1.15rem !important;
    line-height: 1.25 !important;
  }

  .panel-desc,
  .panel-subtitle,
  .section-desc-text {
    font-size: 11px !important;
    line-height: 1.35 !important;
    margin-top: 3px !important;
    margin-bottom: 10px !important;
  }

  /* 2. KPI Cards (Overview Regno & Trend) a 2 Colonne Compatte */
  .kpi-trend-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .trend-card {
    padding: 10px 10px !important;
    min-height: auto !important;
    border-radius: 10px !important;
  }

  .card-label {
    font-size: 0.65rem !important;
  }

  .card-value {
    font-size: 1.15rem !important;
    margin-bottom: 2px !important;
  }

  /* 3. Manichino Comparatore Equipaggiamento (Anti-Sforamento e Centrato) */
  .comp-mannequin-grid {
    left: 50% !important;
    transform: translateX(-50%) scale(0.85) !important;
    transform-origin: top center !important;
    margin: 4px 0 -65px 0 !important;
  }

  /* 4. Grafico Ciambella e Legenda Minimi KvK */
  .targets-chart-card {
    padding: 12px !important;
    gap: 12px !important;
    border-radius: 14px !important;
  }

  #targets-chart-legend {
    gap: 6px !important;
    font-size: 11.5px !important;
  }

  /* 5. Modali Generali Popup */
  .auth-modal-card {
    padding: 18px 14px !important;
    border-radius: 16px !important;
    max-width: 95% !important;
  }

  .auth-modal-card h2,
  .auth-modal-card h3 {
    font-size: 1.2rem !important;
  }

  /* 6. Barra di Ricerca e Campi Input */
  .search-wrapper,
  .stylish-search-wrapper {
    padding: 6px 10px !important;
    font-size: 12.5px !important;
  }

  .custom-input-lg,
  .custom-select-lg {
    padding: 8px 10px !important;
    font-size: 12.5px !important;
  }
}

@media (max-width: 420px) {
  /* Ulteriore rifinitura ultra-compatta per smartphone stretti (iPhone SE / compatti) */
  .comp-mannequin-grid {
    left: 50% !important;
    transform: translateX(-50%) scale(0.78) !important;
    transform-origin: top center !important;
    margin: 2px 0 -95px 0 !important;
  }

  .panel,
  .full-width-panel {
    padding: 10px 8px !important;
  }

  .panel-title-text,
  .panel-title {
    font-size: 1.05rem !important;
  }

  .trend-card {
    padding: 8px 8px !important;
  }
}


/* ==========================================================================
   VISIBILITÀ PERFETTA DELL'IMMAGINE DI SFONDO / BANNER CARICATA NEL PROFILO
   ========================================================================== */

/* Quando è presente un'immagine caricata personalizzata */
.discord-profile-banner.has-banner-img {
  display: block !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 100% !important;
  min-height: 320px !important;
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  border-radius: 16px !important;
  z-index: 1 !important;
}

.player-profile-card.has-custom-banner .profile-marine-bg {
  display: none !important;
}

.player-profile-card.has-custom-banner .discord-profile-banner::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(15, 23, 42, 0.35) 50%, rgba(15, 23, 42, 0.88) 100%) !important;
  pointer-events: none !important;
}

/* Quando il profilo ha un'immagine caricata, rendi il background della card neutro per far risaltare la foto */
.player-profile-card.has-custom-banner,
.player-profile-card.has-custom-banner.theme-queen-pink,
.player-profile-card.has-custom-banner.theme-queen,
.player-profile-card.has-custom-banner.theme-king,
.player-profile-card.has-custom-banner.theme-ruby-red,
.player-profile-card.has-custom-banner.theme-verde-rubino,
.player-profile-card.has-custom-banner.theme-ruby,
.player-profile-card.has-custom-banner.theme-pink,
.player-profile-card.has-custom-banner.theme-purple,
.player-profile-card.has-custom-banner.theme-gold,
.player-profile-card.has-custom-banner.theme-red,
.player-profile-card.has-custom-banner.theme-green,
.player-profile-card.has-custom-banner.theme-cyan,
.player-profile-card.has-custom-banner.theme-brown {
  background: rgba(10, 14, 24, 0.50) !important;
}

/* Mantieni il bordo colorato del tema anche con l'immagine (identità visiva) */
.player-profile-card.has-custom-banner.theme-king {
  border-color: #60a5fa !important;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.45) !important;
}
.player-profile-card.has-custom-banner.theme-ruby-red,
.player-profile-card.has-custom-banner.theme-verde-rubino,
.player-profile-card.has-custom-banner.theme-ruby {
  border-color: #34d399 !important;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4) !important;
}
.player-profile-card.has-custom-banner.theme-queen-pink,
.player-profile-card.has-custom-banner.theme-queen {
  border-color: #f472b6 !important;
  box-shadow: 0 0 30px rgba(244, 114, 182, 0.4) !important;
}
.player-profile-card.has-custom-banner.theme-pink {
  border-color: #f9a8d4 !important;
  box-shadow: 0 0 30px rgba(249, 168, 212, 0.4) !important;
}

@media (max-width: 768px) {
  .player-profile-card {
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .profile-card-content {
    padding: 14px 10px !important;
    gap: 12px !important;
    position: relative !important;
    z-index: 2 !important;
  }

  .discord-profile-banner.has-banner-img {
    display: block !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 100% !important;
    min-height: 240px !important;
    background-size: cover !important;
    background-position: center top !important;
    border-radius: 16px !important;
    z-index: 1 !important;
  }
}


/* ==========================================================================
   PERSONALIZZA TEMA & CARICAMENTO IMMAGINI PROFILO SU SMARTPHONE (APP)
   ========================================================================== */
@media (max-width: 768px) {
  .profile-header-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .profile-theme-customizer {
    width: 100% !important;
    margin: 4px 0 0 0 !important;
    position: relative !important;
  }

  .theme-palette-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .theme-palette-dropdown {
    position: static !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 10px !important;
    background: #0f172a !important;
    border: 1.5px solid rgba(56, 189, 248, 0.5) !important;
    border-radius: 14px !important;
    padding: 14px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
  }

  .palette-options-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .palette-option-btn {
    padding: 8px 10px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }

  .supporter-banner-section {
    margin-top: 14px !important;
    padding-top: 12px !important;
    border-top: 1px dashed rgba(56, 189, 248, 0.4) !important;
  }

  .supporter-banner-section input[type="text"] {
    font-size: 13px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
  }

  .supporter-banner-section label,
  .supporter-banner-section button {
    padding: 9px 12px !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
  }
}


/* ==========================================================================
   PERFEZIONAMENTO SIMMETRIA & ALLINEAMENTO SCHEDA PROFILO GOVERNATORE
   ========================================================================== */

/* Card Principale del Profilo */
.player-profile-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 15, 29, 0.98) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  width: 100%;
  box-sizing: border-box;
}

.profile-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.profile-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  box-sizing: border-box;
}

.profile-info-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#player-name {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0;
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Griglia Body Profilo Simmetrica (Desktop) */
.player-profile-body-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* Griglia 12 KPI Simmetrica a 4 Righe da 3 */
.player-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-content: start;
}

/* Schede KPI con Simmetria Interna */
.pkpi-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-height: 82px;
  box-sizing: border-box;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.pkpi-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.pkpi-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  margin: 4px 0 0 0;
  line-height: 1.2;
}

.pkpi-icon {
  position: absolute;
  top: 8px;
  right: 10px;
  bottom: auto;
  font-size: 1.05rem;
  opacity: 0.85;
  pointer-events: none;
}

/* Sezione Pentagono Radar Chart Simmetrico */
.player-radar-section {
  background: radial-gradient(circle at 50% 45%, rgba(245, 158, 11, 0.08) 0%, rgba(12, 16, 24, 0.95) 75%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 18px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.radar-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.radar-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0 0 12px 0;
}

.radar-chart-container {
  width: 100%;
  max-width: 320px;
  height: 290px;
  position: relative;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ================= SIMMETRIA PERFETTA SU MOBILE APP ================= */
@media (max-width: 768px) {
  .profile-card-content {
    padding: 14px 10px !important;
    gap: 14px !important;
  }

  .profile-header-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding-bottom: 14px !important;
    margin-bottom: 14px !important;
  }

  #player-name {
    font-size: 1.45rem !important;
  }

  .profile-meta-row {
    font-size: 0.78rem !important;
    gap: 8px !important;
  }

  .player-profile-body-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  /* 2 Colonne Perfettamente Bilanciate su Telefono (6x2) */
  .player-kpi-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .pkpi-card {
    min-height: 68px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
  }

  .pkpi-title {
    font-size: 0.68rem !important;
    letter-spacing: 0.3px !important;
    padding-right: 22px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 2px !important;
  }

  .pkpi-value {
    font-size: 1.05rem !important;
    font-weight: 900 !important;
    position: relative !important;
    z-index: 2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .pkpi-icon {
    font-size: 0.95rem !important;
    top: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    pointer-events: none !important;
  }

  .player-radar-section {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 16px !important;
    padding: 16px 8px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  .radar-chart-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 270px !important;
    box-sizing: border-box !important;
    position: relative !important;
    margin: 0 auto !important;
  }

  .kvk-gauges-container {
    padding: 14px 10px !important;
    border-radius: 16px !important;
    margin-top: 14px !important;
  }

  .kvk-gauges-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .gauge-card {
    padding: 12px !important;
    border-radius: 12px !important;
  }
}


/* ==========================================================================
   CENTRATURA PERFETTA DI NOME, BADGE, ID E RUOLO NEL PROFILO GOVERNATORE
   ========================================================================== */

.table-responsive {
  position: relative !important;
  width: 100% !important;
  min-height: 520px !important;
  max-height: 72vh !important;
  overflow: auto !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.profile-header-container {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: relative !important;
  width: 100% !important;
  padding-bottom: 18px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-sizing: border-box !important;
}

.profile-info-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.profile-name-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 10px !important;
  width: 100% !important;
}

#player-name {
  font-size: 1.85rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  letter-spacing: -0.5px !important;
  text-align: center !important;
  margin: 0 !important;
}

.profile-meta-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  font-size: 0.85rem !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  width: 100% !important;
}

.player-medals-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

/* Pulsante Personalizza Tema ancorato a destra su PC */
.profile-theme-customizer {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 25 !important;
}

@media (max-width: 768px) {
  .profile-header-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    position: relative !important;
    padding-bottom: 14px !important;
    gap: 10px !important;
  }

  .profile-info-wrapper {
    align-items: center !important;
    text-align: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .profile-name-row {
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
  }

  #player-name {
    font-size: 1.5rem !important;
    text-align: center !important;
  }

  .profile-meta-row {
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    font-size: 0.8rem !important;
    gap: 8px !important;
  }

  .player-medals-row {
    justify-content: center !important;
    width: 100% !important;
  }

  .profile-theme-customizer {
    position: static !important;
    width: 100% !important;
    margin-top: 6px !important;
  }

  .theme-palette-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}


/* ==========================================================================
   SPAZIATURA ARMONIOSA, ELEGANTE E ZERO SCHIACCIAMENTO NEL PROFILO PLAYER
   ========================================================================== */

#player-view {
  padding-top: 24px !important;
  padding-bottom: 48px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.player-profile-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 15, 29, 0.98) 100%) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.4) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  position: relative !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 10px !important;
}

.profile-card-content {
  padding: 32px 28px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  position: relative !important;
  z-index: 2 !important;
}

.profile-header-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 100% !important;
  padding-top: 10px !important;
  padding-bottom: 22px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-sizing: border-box !important;
  gap: 12px !important;
}

.profile-info-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
}

#player-name {
  font-size: 2rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  letter-spacing: -0.5px !important;
  text-align: center !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7) !important;
}

.profile-meta-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
  font-size: 0.92rem !important;
  color: #cbd5e1 !important;
  font-weight: 700 !important;
  width: 100% !important;
  margin-top: 4px !important;
}

.player-medals-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  margin-top: 6px !important;
}

.profile-theme-customizer {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  z-index: 30 !important;
}

@media (max-width: 768px) {
  #player-view {
    padding-top: 10px !important;
    padding-bottom: 80px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .player-profile-card {
    margin-top: 2px !important;
    border-radius: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .profile-card-content {
    padding: 14px 10px !important;
    gap: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .profile-header-container {
    padding-top: 6px !important;
    padding-bottom: 14px !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #player-name {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
  }

  .profile-meta-row {
    font-size: 0.76rem !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  .meta-item {
    padding: 4px 10px !important;
    font-size: 0.76rem !important;
  }

  .player-medals-row {
    gap: 6px !important;
    width: 100% !important;
  }

  .large-profile-badge-card {
    padding: 8px 12px !important;
    gap: 10px !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .large-badge-img {
    width: 42px !important;
    height: 42px !important;
  }

  .large-badge-title {
    font-size: 12px !important;
  }

  .large-badge-sub {
    font-size: 10px !important;
  }

  .profile-theme-customizer {
    position: static !important;
    width: 100% !important;
    margin-top: 6px !important;
  }

  /* Tachimetri Fluidi Anti-Sforamento */
  .kvk-gauges-container {
    padding: 12px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .gauge-card {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 8px !important;
  }

  .gauge-chart-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .gauge-chart-wrapper canvas {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
  }

  /* Sezione Classifica KvK & Podi su Mobile */
  #classifica-view {
    padding-top: 10px !important;
    padding-bottom: 80px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .podiums-grid-container {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 16px !important;
  }

  .podium-card {
    padding: 12px 10px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .podium-header {
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
    gap: 8px !important;
  }

  .podium-title {
    font-size: 14px !important;
  }

  .podium-row-item {
    padding: 7px 10px !important;
    gap: 10px !important;
    border-radius: 10px !important;
    margin-bottom: 5px !important;
  }

  .podium-row-item > div:first-child {
    min-width: 36px !important;
    font-size: 13px !important;
  }

  .podium-row-item div div:first-child {
    font-size: 13px !important;
  }

  .podium-row-item div div:last-child {
    font-size: 10px !important;
  }

  /* Cura Dimagrante Classifica Generale KvK su Mobile */
  .leaderboard-card-row {
    padding: 8px 10px !important;
    gap: 8px !important;
    border-radius: 10px !important;
    margin-bottom: 5px !important;
    min-height: 40px !important;
  }

  .lb-rank,
  .leaderboard-card-row > span:first-child {
    min-width: 32px !important;
    font-size: 13.5px !important;
  }

  .lb-avatar,
  .leaderboard-card-row > div:nth-child(2) {
    width: 30px !important;
    height: 30px !important;
    font-size: 14px !important;
  }

  .lb-info {
    min-width: 0 !important;
    flex: 1 !important;
  }

  .lb-name-row,
  .leaderboard-card-row > div:last-child > div:first-child {
    font-size: 13px !important;
    gap: 6px !important;
    line-height: 1.2 !important;
  }

  .lb-name {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .lb-id {
    font-size: 9.5px !important;
    padding: 1px 5px !important;
  }

  .lb-sub,
  .leaderboard-card-row > div:last-child > div:last-child {
    font-size: 10px !important;
    margin-top: 1px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}


/* ==========================================================================
   DIMENSIONI IDENTICHE ALLA CLASSIFICA GENERALE PER TABELLA DATI REALI KVK
   ========================================================================== */

/* Sticky columns for Real Data Table on Desktop */
#real-data-table thead tr:first-child th.col-rank {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 45 !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  box-sizing: border-box !important;
  background-color: #1e293b !important;
  text-align: center !important;
}

#real-data-table tbody td.col-rank {
  position: sticky !important;
  left: 0 !important;
  z-index: 15 !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  box-sizing: border-box !important;
  background-color: #0f172a !important;
  text-align: center !important;
}

#real-data-table thead tr:first-child th.col-gov {
  position: sticky !important;
  top: 0 !important;
  left: 48px !important;
  z-index: 45 !important;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  box-sizing: border-box !important;
  background-color: #1e293b !important;
  text-align: left !important;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.7) !important;
  border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
}

#real-data-table tbody td.col-gov {
  position: sticky !important;
  left: 48px !important;
  z-index: 15 !important;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  box-sizing: border-box !important;
  background-color: #0f172a !important;
  text-align: left !important;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.7) !important;
  border-right: 2px solid rgba(245, 158, 11, 0.4) !important;
}

#real-data-table thead tr:nth-child(2) th {
  position: static !important;
  left: auto !important;
  z-index: 5 !important;
  background-color: #1a202c !important;
  min-width: 65px !important;
  padding: 8px 4px !important;
  font-size: 0.78rem !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  line-height: 1.2 !important;
}

#real-data-thead th {
  padding: 9px 5px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  line-height: 1.2 !important;
  text-align: center !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

#real-data-table thead tr:first-child th.col-num {
  min-width: 85px !important;
}

#real-data-tbody td {
  padding: 13px 14px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

#real-data-tbody td.gov-info-cell {
  text-align: left !important;
}

#real-data-tbody .gov-table-name {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
}

#real-data-tbody .gov-table-id {
  font-size: 0.82rem !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  display: block !important;
  margin-top: 2px !important;
}

#real-data-thead th.col-rank {
  padding: 12px 6px !important;
  text-align: center !important;
}

#real-data-tbody td.col-rank {
  font-size: 1.02rem !important;
  font-weight: 800 !important;
  color: #fbbf24 !important;
  text-align: center !important;
  padding: 12px 6px !important;
}

.zone-divider-right {
  border-right: 2px solid rgba(245, 158, 11, 0.45) !important;
}


/* ==========================================================================
   UNIFICAZIONE TOTALE BADGE DESKTOP & MOBILE APP
   ========================================================================== */

.king-inline-badge,
.queen-inline-badge,
.r4-inline-badge,
.rally-inline-badge,
.garrison-inline-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  padding: 2px !important;
  border-radius: 6px !important;
  margin-left: 5px !important;
  flex-shrink: 0 !important;
}

.king-inline-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.5) 0%, rgba(217, 119, 6, 0.8) 100%) !important;
  border: 1px solid #fbbf24 !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6) !important;
}

.queen-inline-badge {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.5) 0%, rgba(219, 39, 119, 0.8) 100%) !important;
  border: 1px solid #f472b6 !important;
  box-shadow: 0 0 8px rgba(244, 114, 182, 0.6) !important;
}

.r4-inline-badge {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.5) 0%, rgba(126, 34, 206, 0.8) 100%) !important;
  border: 1px solid #c084fc !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6) !important;
}

.rally-inline-badge {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.5) 0%, rgba(185, 28, 28, 0.8) 100%) !important;
  border: 1px solid #f87171 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6) !important;
}

.garrison-inline-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.5) 0%, rgba(29, 78, 216, 0.8) 100%) !important;
  border: 1px solid #60a5fa !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6) !important;
}

.badge-icon-img {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  border-radius: 4px !important;
  object-fit: cover !important;
  display: block !important;
}

.verified-symbol-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, #3b82f6 0%, #1d4ed8 100%) !important;
  border: 1.5px solid #60a5fa !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.7) !important;
  font-size: 0.75rem !important;
  margin-left: 5px !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

.supporter-diamond-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  margin-left: 5px !important;
  background-image: url('images/supporter_badge.jpg') !important;
  background-size: cover !important;
  background-position: center !important;
  border-radius: 5px !important;
  border: 1px solid rgba(56, 189, 248, 0.8) !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7) !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

@media (max-width: 768px) {
  .gov-table-name,
  .classifica-gov-name {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
}


/* ==========================================================================
   OTTIMIZZAZIONE MOBILE MASTER VIEW (SMARTPHONE)
   ========================================================================== */

@media (max-width: 768px) {
  #master-view .master-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }

  #master-view .master-privacy-toggle-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    padding: 16px !important;
  }

  #master-view .master-picker-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  #master-view .searchable-picker-wrapper {
    width: 100% !important;
  }

  #master-view .add-role-btn {
    width: 100% !important;
    padding: 12px 14px !important;
    text-align: center !important;
  }

  #master-view .r4-grid-container {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #master-view .master-section-box {
    padding: 18px 14px !important;
    margin-bottom: 20px !important;
  }

  #master-view .notes-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  #master-view .supervision-table-wrapper,
  #master-view .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* ==========================================================================
     OTTIMIZZAZIONE SEZIONE 4 MASTER: AVVIO CALENDARIO KVK & TEMPLATE SU MOBILE
     ========================================================================== */

  /* Sotto-Navigazione Tab Master (Timeline vs Creazione Template) */
  .master-kvk-subtabs-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 16px !important;
    padding-bottom: 10px !important;
    box-sizing: border-box !important;
  }

  .master-kvk-subtabs-nav button {
    width: 100% !important;
    padding: 10px 6px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-align: center !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-height: 42px !important;
  }

  /* Contenitori Master blindati per prevenire qualsiasi scroll orizzontale */
  #master-view,
  #master-tab-kvk_management,
  #master-kvk-timeline-panel,
  #master-kvk-templates-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Scheda 1 - Griglia Top: Guida Rapida + Avvia Nuovo KvK */
  .master-kvk-top-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    margin-bottom: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .master-kvk-top-grid .master-section-box {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 16px 14px !important;
    margin: 0 !important;
  }

  /* Legenda Tipologie: colonna singola pulita per non sbordare mai */
  .master-kvk-legend-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .master-kvk-legend-grid div {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 11.5px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .master-kvk-legend-grid div .type-badge {
    flex-shrink: 0 !important;
    font-size: 10.5px !important;
    padding: 3px 6px !important;
  }

  .master-kvk-status-legend {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    font-size: 11px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 12px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .master-kvk-status-legend .status-legend-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
  }

  /* Form Avvio KvK: Data e Ora impilati verticalmente a larghezza piena */
  .master-kvk-datetime-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .master-kvk-datetime-grid input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    padding: 8px 10px !important;
  }

  #master-start-kvk-form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #master-start-kvk-form .form-group {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #master-start-kvk-template {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .master-start-btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    min-height: 44px !important;
  }

  /* Header & Pulsanti Timeline Attiva Eventi */
  .master-timeline-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .master-timeline-header-row > div:first-child {
    width: 100% !important;
  }

  .master-kvk-timeline-actions-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #master-active-map-badge-container {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  .master-kvk-timeline-actions-grid button {
    width: 100% !important;
    padding: 9px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
  }

  .master-kvk-timeline-actions-grid button[onclick*="confirmResetKvk"] {
    grid-column: 1 / -1 !important;
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fca5a5 !important;
    font-weight: 800 !important;
  }

  /* Tabella Eventi Attivi su Mobile */
  .master-kvk-events-table-wrapper {
    width: 100% !important;
    max-height: 440px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
    margin-top: 10px !important;
  }

  .master-active-events-table th {
    padding: 7px 5px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  .master-active-events-table td {
    padding: 7px 5px !important;
    font-size: 11px !important;
    vertical-align: middle !important;
  }

  .master-active-events-table .kvk-desc-cell {
    max-width: 180px !important;
    min-width: 120px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  .master-active-events-table .btn-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    font-size: 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }

  /* Scheda 2 - Creazione Calendario (Editor Template) */
  .master-tmpl-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .master-tmpl-select-block {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  #master-template-map-select {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
  }

  .master-tmpl-actions-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .master-tmpl-actions-grid button {
    width: 100% !important;
    padding: 9px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
  }

  #master-btn-save-tmpl {
    grid-column: 1 / -1 !important;
    font-weight: 800 !important;
    font-size: 12.5px !important;
    min-height: 42px !important;
  }

  /* Toolbar Statistiche & Cerca nel Template */
  .master-tmpl-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 10px !important;
  }

  #master-tmpl-stats-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
    font-size: 11px !important;
    width: 100% !important;
  }

  #master-tmpl-stats-bar .count-badge,
  #master-tmpl-stats-bar .type-badge {
    font-size: 10.5px !important;
    padding: 3px 8px !important;
  }

  .master-tmpl-toolbar .stylish-search-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Tabella Template */
  .master-tmpl-table-wrapper {
    width: 100% !important;
    max-height: 440px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
  }

  .master-template-events-table th {
    padding: 7px 5px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  .master-template-events-table td {
    padding: 7px 5px !important;
    font-size: 11px !important;
    vertical-align: middle !important;
  }

  .master-template-events-table .kvk-desc-cell {
    max-width: 170px !important;
    min-width: 110px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  .master-template-events-table .btn-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }

  /* Form Modali Master KvK */
  .master-modal-form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .master-modal-duration-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .master-kvk-datetime-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  .master-modal-form-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}


/* ==========================================================================
   PERFETTO CENTRAMENTO & CONTENIMENTO DEL GRAFICO RENDIMENTO SU MOBILE
   ========================================================================== */
@media (max-width: 1024px) {
  .player-profile-body-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
    box-sizing: border-box !important;
  }

  .player-kpi-row {
    order: 1 !important;
    width: 100% !important;
  }

  .player-radar-section {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 14px 0 0 0 !important;
    padding: 16px 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .radar-chart-container {
    width: 100% !important;
    max-width: 320px !important;
    height: 250px !important;
    margin: 0 auto !important;
    position: relative !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #playerRadarChart {
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   INTERACTIVE BANNER POSITIONER & CROPPER MODAL STYLES
   ========================================================================== */
.banner-cropper-card {
  animation: cropperModalFadeIn 0.25s ease-out;
}

@keyframes cropperModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cropper-dpad-btn {
  transition: all 0.15s ease;
  user-select: none;
}

.cropper-dpad-btn:hover {
  background: rgba(56, 189, 248, 0.35) !important;
  border-color: #38bdf8 !important;
  transform: scale(1.08);
}

.cropper-dpad-btn:active {
  transform: scale(0.92);
}

.cropper-zoom-step-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

.cropper-zoom-step-btn:active {
  transform: scale(0.9);
}

#bannerCropperCanvas {
  touch-action: none;
}

.cropper-mode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cropper-tab-btn {
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  user-select: none;
}

.cropper-tab-btn:hover {
  filter: brightness(1.15);
}

.cropper-tab-btn.active {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

.cropper-viewport-container.mode-desktop {
  width: 100% !important;
  max-width: 520px !important;
  aspect-ratio: 16 / 9 !important;
  max-height: 295px !important;
  margin: 0 auto !important;
}

.cropper-viewport-container.mode-mobile {
  width: 220px !important;
  max-width: 90% !important;
  aspect-ratio: 9 / 16 !important;
  max-height: 380px !important;
  margin: 0 auto !important;
}

/* ==========================================================================
   ⭐🌾🛡️ BADGE VIP CONTRIBUTORI (FULL, ADDESTRAMENTO, EQUIPAGGIAMENTO)
   ========================================================================== */
.vip-star-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  border: 1px solid #f59e0b;
  color: #fef08a;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  vertical-align: middle;
}

.vip-wheat-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(202, 138, 4, 0.35) 100%);
  border: 1px solid #eab308;
  color: #fef9c3;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 6px;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.35);
  vertical-align: middle;
}

.vip-shield-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.35) 100%);
  border: 1px solid #3b82f6;
  color: #bfdbfe;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 6px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
  vertical-align: middle;
}

.badge-vip-full {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.3) 100%) !important;
  color: #fef08a !important;
  border: 1px solid #f59e0b !important;
}

.badge-vip-training {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(202, 138, 4, 0.3) 100%) !important;
  color: #fef9c3 !important;
  border: 1px solid #eab308 !important;
}

.badge-vip-equipment {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.3) 100%) !important;
  color: #bfdbfe !important;
  border: 1px solid #3b82f6 !important;
}

.vip-crystal-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(147, 51, 234, 0.35) 100%);
  border: 1px solid #c084fc;
  color: #f3e8ff;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 6px;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
  vertical-align: middle;
}

.badge-vip-help-kvk {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(147, 51, 234, 0.3) 100%) !important;
  color: #f3e8ff !important;
  border: 1px solid #c084fc !important;
}


/* ==========================================================================
   KVK TIMETABLE & CALENDARIO SETTIMANALE ORIZZONTALE
   ========================================================================== */

.kvk-weekly-calendar-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-top: 14px;
}

.kvk-weekly-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(200px, 1fr));
  gap: 12px;
  min-width: 1200px;
}

@media (max-width: 1250px) {
  .kvk-weekly-grid {
    min-width: 1100px;
  }
}

.kvk-day-column {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  transition: all 0.2s ease;
}

.kvk-day-column:hover {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.kvk-day-column.today-column {
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
  background: rgba(20, 29, 47, 0.85);
}

.kvk-day-header {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  position: relative;
}

.today-column .kvk-day-header {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.kvk-day-name {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #f3f4f6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.today-column .kvk-day-name {
  color: #fbbf24;
}

.kvk-day-date {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 2px;
}

.kvk-day-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  margin-top: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.kvk-day-events-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.kvk-event-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.kvk-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* Event Types Card Accents */
.kvk-event-card.event-chronicle {
  border-left: 4px solid #06b6d4;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
}
.kvk-event-card.event-chronicle:hover {
  border-color: #06b6d4;
}

.kvk-event-card.event-chronicle_war {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
}
.kvk-event-card.event-chronicle_war:hover {
  border-color: #ef4444;
}

.kvk-event-card.event-ruins {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
}
.kvk-event-card.event-ruins:hover {
  border-color: #f59e0b;
}

.kvk-event-card.event-altar {
  border-left: 4px solid #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
}
.kvk-event-card.event-altar:hover {
  border-color: #8b5cf6;
}

.kvk-event-card.event-karuak {
  border-left: 4px solid #00e5ff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.08);
}
.kvk-event-card.event-karuak:hover {
  border-color: #00e5ff;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
}

.kvk-event-card.event-custom {
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
}
.kvk-event-card.event-custom:hover {
  border-color: #10b981;
}

.kvk-event-card.is-live-now {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.kvk-event-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 6px;
}

.kvk-event-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #f3f4f6;
  line-height: 1.3;
  margin-bottom: 4px;
}

.kvk-event-card-time {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kvk-event-card-local-time {
  font-size: 10px;
  color: #38bdf8;
  margin-top: 1px;
}

.kvk-event-duration-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.kvk-empty-day {
  text-align: center;
  padding: 30px 10px;
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-style: italic;
}

/* Badges & Dots */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.type-chronicle {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.type-chronicle_war {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.type-ruins {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.type-altar {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.type-karuak {
  background: rgba(0, 229, 255, 0.18);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.45);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.type-custom {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-active {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981, 0 0 16px #10b981;
  animation: pulse-green 2s infinite;
}

.status-closed {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.status-upcoming {
  background-color: #6b7280;
  box-shadow: 0 0 4px #6b7280;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}


/* ==========================================================================
   KVK CALENDARIO MENSILE (MONTHLY VIEW)
   ========================================================================== */

.kvk-monthly-calendar-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-top: 14px;
}

/* ==========================================================================
   📅 KVK MONTHLY VIEW: CONTINUOUS MULTI-DAY EVENT BARS WITH DIVIDED COLUMNS
   ========================================================================== */
.kvk-monthly-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 1050px;
}

.kvk-month-weekdays-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 2px;
}

.kvk-month-weekday-header {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  text-align: center;
  padding: 8px 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kvk-month-week-row {
  position: relative;
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.kvk-month-week-row:hover {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(20, 30, 48, 0.82);
}

/* Griglia di sfondo che disegna le 7 colonne ben divise verticalmente */
.kvk-month-week-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  pointer-events: none;
  z-index: 1;
}

.kvk-month-day-col-bg {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  height: 100%;
}

.kvk-month-day-col-bg:last-child {
  border-right: none;
}

.kvk-month-day-col-bg.is-other-month {
  background: rgba(0, 0, 0, 0.28);
  opacity: 0.45;
}

.kvk-month-day-col-bg.is-today-col {
  background: rgba(245, 158, 11, 0.06);
  border-left: 1px solid rgba(245, 158, 11, 0.35);
  border-right: 1px solid rgba(245, 158, 11, 0.35);
}

/* Layer dei contenuti (header dei giorni + barre eventi) */
.kvk-month-week-content-layer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 8px 0 10px 0;
  min-height: 125px;
}

.kvk-month-week-days-top {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 8px;
}

.kvk-month-day-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 10px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kvk-month-day-cell-header.is-other-month {
  opacity: 0.35;
}

.kvk-month-day-cell-header.today-header .kvk-month-day-number {
  color: #fbbf24;
}

.kvk-month-day-number {
  font-size: 13.5px;
  font-weight: 800;
  color: #f3f4f6;
}

.kvk-month-week-events-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 6px 0;
  padding: 0 4px;
  flex: 1;
  min-height: 52px;
  align-content: start;
}

.kvk-month-event-bar {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  margin: 0 4px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  z-index: 2;
  user-select: none;
}

.kvk-month-event-bar:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.kvk-month-event-bar.is-start-cont {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.4);
}

.kvk-month-event-bar.is-end-cont {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: 0;
  border-right: 2px dashed rgba(255, 255, 255, 0.4);
}

.kvk-month-event-bar.event-chronicle {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.35) 0%, rgba(6, 182, 212, 0.2) 100%);
  border-color: rgba(6, 182, 212, 0.5);
  color: #38bdf8;
}

.kvk-month-event-bar.event-chronicle_war {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.38) 0%, rgba(239, 68, 68, 0.22) 100%);
  border-color: rgba(239, 68, 68, 0.55);
  color: #f87171;
}

.kvk-month-event-bar.event-ruins {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.2) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.kvk-month-event-bar.event-altar {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.35) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-color: rgba(139, 92, 246, 0.5);
  color: #c084fc;
}

.kvk-month-event-bar.event-karuak {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.28) 0%, rgba(0, 229, 255, 0.16) 100%);
  border-color: rgba(0, 229, 255, 0.5);
  color: #00e5ff;
}

.kvk-month-event-bar.event-custom {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.35) 0%, rgba(16, 185, 129, 0.2) 100%);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}


.kvk-bar-time-chip {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.42);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  color: #f8fafc;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

/* ==========================================================================
   ⏰ KVK OFFICIAL GAME TIME: ENLARGED PROMINENT CLOCK WIDGET
   ========================================================================== */
.kvk-game-clock-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 20px 28px !important;
  min-width: 320px !important;
  min-height: 120px !important;
  align-self: center !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.88) 100%) !important;
  border-radius: 18px !important;
  border: 1.5px solid rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

.kvk-game-clock-card:hover {
  border-color: rgba(245, 158, 11, 0.7) !important;
  box-shadow: 0 10px 36px rgba(245, 158, 11, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.kvk-game-clock-header {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #fbbf24 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.kvk-game-clock-utc {
  font-size: 2.35rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  font-family: 'Outfit', sans-serif !important;
  letter-spacing: 1.5px !important;
  line-height: 1.1 !important;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.25) !important;
}

.kvk-game-clock-local {
  font-size: 13.5px !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
}

@media (max-width: 768px) {
  /* Clock Card */
  .kvk-game-clock-card {
    min-width: 0 !important;
    width: 100% !important;
    align-items: center !important;
    padding: 16px 20px !important;
  }
  .kvk-game-clock-utc {
    font-size: 1.9rem !important;
  }

  /* Banner KvK Attivo - Mobile Restyling */
  #kvk-cal-active-banner {
    padding: 14px 14px !important;
    gap: 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    border-radius: 14px !important;
  }
  #kvk-cal-active-banner > div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
  }
  #kvk-cal-active-banner > div:first-child > div:first-child {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.5rem !important;
    flex-shrink: 0 !important;
  }
  #kvk-cal-map-name {
    font-size: 15px !important;
  }
  #kvk-cal-active-banner > div:last-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .kvk-day-indicator-box {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 7px 12px !important;
  }
  .kvk-day-indicator-box > div:first-child {
    font-size: 10.5px !important;
  }
  #kvk-cal-day-counter {
    font-size: 14px !important;
  }
  .kvk-next-event-badge {
    width: 100% !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    text-align: center !important;
    word-break: break-word !important;
  }

  /* Barra di Controllo Vista & Ricerca */
  #kvk-calendar-view .master-card-box.full-width-card {
    padding: 12px 12px !important;
  }
  #kvk-calendar-view .stylish-search-wrapper {
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 6px;
  }

  /* Controlli Navigazione Settimana & Mese - Stile Paginazione Intercambiabile */
  .kvk-nav-controls-box:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .kvk-nav-controls-box.hidden,
  #kvk-week-nav-controls.hidden,
  #kvk-month-nav-controls.hidden {
    display: none !important;
  }
  .kvk-nav-btn-group {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .kvk-nav-btn-group .calc-reset-btn {
    flex: 1 !important;
    max-width: 125px !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
  }
  #kvk-week-range-label, #kvk-month-range-label {
    width: 100% !important;
    max-width: 320px !important;
    text-align: center !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    font-size: 12.5px !important;
    padding: 6px 12px !important;
  }
  #kvk-week-select-dropdown {
    width: 100% !important;
    min-width: 100% !important;
    margin-left: 0 !important;
    margin-top: 4px !important;
    font-size: 12.5px !important;
  }

  /* Chips Filtri per Tipo a Scorrimento Orizzontale Touch */
  #kvk-calendar-view .filter-chips-row {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    gap: 6px !important;
    scrollbar-width: thin;
  }
  #kvk-calendar-view .filter-chips-row .chip-label {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
  }
  #kvk-calendar-view .filter-chips-row .filter-chip {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 11.5px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
  }

  /* Griglia Settimanale Mobile con Touch Snap */
  .kvk-weekly-calendar-container {
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 10px;
    padding-bottom: 12px;
  }
  .kvk-weekly-grid {
    grid-template-columns: repeat(7, minmax(260px, 82vw)) !important;
    min-width: calc(7 * 272px) !important;
    gap: 10px !important;
  }
  .kvk-day-column {
    scroll-snap-align: center;
    min-height: 380px !important;
    border-radius: 12px !important;
  }
  .kvk-day-header {
    padding: 10px !important;
  }
  .kvk-day-name {
    font-size: 13px !important;
  }
  .kvk-day-date {
    font-size: 11.5px !important;
  }
  .kvk-day-events-list {
    padding: 8px !important;
    gap: 8px !important;
  }
  .kvk-event-card {
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }
  .kvk-event-card-title {
    font-size: 12.5px !important;
  }

  /* Modal Dettagli Evento */
  #kvk-event-details-modal-overlay .auth-modal-card {
    width: 94% !important;
    max-width: 94% !important;
    padding: 16px 14px !important;
    border-radius: 16px !important;
  }
  #kvk-modal-countdown-timer {
    font-size: 1.35rem !important;
  }

  /* =======================================================
     KVK MONTHLY VIEW: NATIVE FULL-WIDTH MOBILE 7-COL GRID
     ======================================================= */
  .kvk-monthly-calendar-container {
    overflow-x: hidden !important;
    padding-bottom: 4px !important;
  }
  .kvk-monthly-grid {
    min-width: 0 !important;
    width: 100% !important;
    gap: 6px !important;
  }
  .kvk-month-weekdays-header {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 4px !important;
  }
  .kvk-month-weekday-header {
    padding: 6px 2px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }
  .kvk-month-mobile-cells-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 100%;
  }
  .kvk-month-mobile-cell {
    min-height: 56px;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
    box-sizing: border-box;
  }
  .kvk-month-mobile-cell:active {
    transform: scale(0.95);
    background: rgba(30, 41, 59, 0.9);
  }
  .kvk-month-mobile-cell.is-other-month {
    opacity: 0.35;
    background: rgba(0, 0, 0, 0.2);
  }
  .kvk-month-mobile-cell.today-cell {
    border: 1.5px solid rgba(245, 158, 11, 0.8) !important;
    background: rgba(245, 158, 11, 0.12) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  }
  .kvk-month-mobile-cell.today-cell .kvk-month-day-number {
    color: #fbbf24;
    font-weight: 900;
  }
  .kvk-month-mobile-cell .today-pill-mini {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: #000;
    font-size: 8px;
    font-weight: 900;
    padding: 0 4px;
    border-radius: 99px;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .kvk-cell-dots-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin-top: 5px;
    max-width: 100%;
  }
  .kvk-cell-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
  }
  .kvk-cell-dot.dot-ruins { background-color: #f59e0b; box-shadow: 0 0 4px #f59e0b; }
  .kvk-cell-dot.dot-chronicle_war { background-color: #ef4444; box-shadow: 0 0 4px #ef4444; }
  .kvk-cell-dot.dot-war { background-color: #ef4444; box-shadow: 0 0 4px #ef4444; }
  .kvk-cell-dot.dot-altar { background-color: #8b5cf6; box-shadow: 0 0 4px #8b5cf6; }
  .kvk-cell-dot.dot-chronicle { background-color: #06b6d4; box-shadow: 0 0 4px #06b6d4; }
  .kvk-cell-dot.dot-karuak { background-color: #00e5ff; box-shadow: 0 0 4px #00e5ff; }
  .kvk-cell-dot.dot-custom { background-color: #10b981; box-shadow: 0 0 4px #10b981; }

  .kvk-mobile-month-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .kvk-mobile-month-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  /* Modal Livello 1: Dettagli Giorno */
  #kvk-day-events-modal-overlay .auth-modal-card {
    width: 94% !important;
    max-width: 480px !important;
    padding: 16px 14px !important;
    border-radius: 18px !important;
  }
  .kvk-day-modal-event-card {
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .kvk-day-modal-event-card:active {
    transform: scale(0.98);
    background: rgba(30, 41, 59, 0.95);
  }
  .kvk-day-modal-event-card.event-ruins { border-left: 4px solid #f59e0b; }
  .kvk-day-modal-event-card.event-chronicle_war { border-left: 4px solid #ef4444; }
  .kvk-day-modal-event-card.event-altar { border-left: 4px solid #8b5cf6; }
  .kvk-day-modal-event-card.event-chronicle { border-left: 4px solid #06b6d4; }
  .kvk-day-modal-event-card.event-karuak { border-left: 4px solid #00e5ff; }
  .kvk-day-modal-event-card.event-custom { border-left: 4px solid #10b981; }
}

@media (max-width: 420px) {
  .kvk-weekly-grid {
    grid-template-columns: repeat(7, minmax(240px, 86vw)) !important;
    min-width: calc(7 * 250px) !important;
  }
  #kvk-view-btn-week, #kvk-view-btn-month {
    padding: 5px 10px !important;
    font-size: 11.5px !important;
  }
  .kvk-month-mobile-cell {
    min-height: 52px;
    padding: 4px 1px;
  }
}

/* ==========================================================================
   OTTIMIZZAZIONE CURA DIMAGRANTE SEZIONE CONCILIO (KILLERS & VERSUS)
   ========================================================================== */
@media (max-width: 768px) {
  /* Tab 1: Blacklist Killers compatta */
  .killer-row-card {
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: 12px !important;
  }

  .killer-left-info {
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }

  .killer-danger-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }

  .killer-name {
    font-size: 13px !important;
    word-break: break-word !important;
  }

  .killer-id {
    font-size: 11px !important;
    display: block !important;
    margin-left: 0 !important;
    margin-top: 1px !important;
  }

  .killer-ban-tag {
    padding: 3px 8px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
    border-radius: 10px !important;
  }

    /* Tab 4: Selettori Versus Player A vs B a colonna singola ordinata */
  .versus-reset-btn {
    min-height: 38px !important;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
    box-sizing: border-box !important;
  }
  .versus-selector-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 12px 10px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
  }

  .versus-selector-bar > div:nth-child(1),
  .versus-selector-bar > div:nth-child(3) {
    width: 100% !important;
  }

  .versus-selector-bar > div:nth-child(2) {
    padding-top: 0 !important;
    padding: 2px 0 !important;
    margin: 0 auto !important;
  }

  .versus-selector-bar > div:nth-child(2) span {
    font-size: 15px !important;
    padding: 4px 12px !important;
  }

  /* Scorecard & Righe Confronto Versus su Mobile */
  #concilio-versus-display > div {
    padding: 14px 10px !important;
    border-radius: 16px !important;
  }

  #concilio-versus-display > div > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding-bottom: 14px !important;
    margin-bottom: 16px !important;
  }

  #concilio-versus-display > div > div:first-child > div:nth-child(1),
  #concilio-versus-display > div > div:first-child > div:nth-child(3) {
    width: 100% !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
  }

  #concilio-versus-display > div > div:first-child > div:nth-child(2) {
    margin: 0 auto !important;
  }

  #concilio-versus-display div[style*="grid-template-columns:1fr auto 1fr"],
  #concilio-versus-display div[style*="grid-template-columns: 1fr auto 1fr"] {
    grid-template-columns: 1fr auto 1fr !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    margin-bottom: 6px !important;
  }

  #concilio-versus-display div[style*="min-width:180px"],
  #concilio-versus-display div[style*="min-width: 180px"] {
    min-width: auto !important;
    font-size: 10px !important;
    letter-spacing: 0.1px !important;
    padding: 0 4px !important;
    line-height: 1.25 !important;
  }

  #concilio-versus-display div[style*="font-size:15.5px"],
  #concilio-versus-display div[style*="font-size: 15.5px"] {
    font-size: 13px !important;
  }
}

/* Banner Avviso Ufficiale Killers (Desktop vs Mobile) */
.killers-notice-text-mobile {
  display: none !important;
}
.killers-notice-text-desktop {
  display: inline !important;
}

@media (max-width: 768px) {
  .killers-notice-banner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 9px 12px !important;
    font-size: 11.5px !important;
    line-height: 1.35 !important;
  }

  /* Punto esclamativo / Icona ⚠️ a SINISTRA */
  .killers-notice-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 1 !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
    margin-right: 2px !important;
  }

  /* Blocco di testo a DESTRA */
  .killers-notice-text-mobile {
    display: block !important;
    flex: 1 !important;
    order: 2 !important;
    text-align: left !important;
  }

  .killers-notice-text-desktop {
    display: none !important;
  }
}

/* Stile Pulsante Reset Confronto Versus */
.versus-reset-btn {
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.versus-reset-btn:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35) !important;
}

.versus-reset-btn:active {
  transform: scale(0.97) !important;
}

/* ==========================================================================
   CONCORSI A TEMPO & PODIO PACCHETTI (ADDESTRAMENTO, EQUIPAGGIAMENTO, KVK)
   ========================================================================== */

.contest-podium-card {
  margin: 18px 0 22px 0;
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 41, 59, 0.75) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contest-podium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #eab308, #fbbf24);
  opacity: 0.85;
}

.contest-podium-card.gold-glow {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.12), inset 0 0 20px rgba(245, 158, 11, 0.04);
}
.contest-podium-card.gold-glow::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
}

.contest-podium-card.cyan-glow {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.12), inset 0 0 20px rgba(6, 182, 212, 0.04);
}
.contest-podium-card.cyan-glow::before {
  background: linear-gradient(90deg, #06b6d4, #38bdf8, #06b6d4);
}

.contest-podium-card.purple-glow {
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.12), inset 0 0 20px rgba(168, 85, 247, 0.04);
}
.contest-podium-card.purple-glow::before {
  background: linear-gradient(90deg, #a855f7, #c084fc, #a855f7);
}

.contest-podium-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.contest-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
  min-width: 0;
  box-sizing: border-box;
}

.contest-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.5));
}

.contest-card-title {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin: 0 0 3px 0;
  color: #f8fafc;
  word-break: break-word;
  overflow-wrap: break-word;
}

.contest-card-subtitle {
  font-size: 12.5px;
  font-weight: 500;
  color: #94a3b8;
  margin: 0;
  max-width: 780px;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Status Pill */
.contest-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.contest-status-pill.idle {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.contest-status-pill.running {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.contest-status-pill.expired {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot-anim 1.5s infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes pulse-dot-anim {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Griglia Podio a 3 Colonne */
.contest-podium-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  transition: all 0.2s ease;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100%;
  box-sizing: border-box !important;
  overflow: hidden;
}

.podium-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Gradi Podio */
.slot-rank-1 {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.09) 0%, rgba(15, 23, 42, 0.7) 100%);
}
.slot-rank-2 {
  border-color: rgba(203, 213, 225, 0.45);
  background: linear-gradient(180deg, rgba(203, 213, 225, 0.09) 0%, rgba(15, 23, 42, 0.7) 100%);
}
.slot-rank-3 {
  border-color: rgba(217, 119, 6, 0.45);
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.09) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.podium-slot-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.3px;
  flex-wrap: wrap;
  gap: 6px;
  word-break: break-word;
}

.podium-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  box-sizing: border-box;
}

.picker-search-input {
  font-size: 12px !important;
  padding: 8px 10px !important;
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  color: #f8fafc !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.podium-select {
  font-size: 12.5px !important;
  padding: 8px 10px !important;
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  color: #f8fafc !important;
  cursor: pointer;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.podium-select:disabled,
.picker-search-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: rgba(30, 41, 59, 0.6) !important;
}

/* Timer Live Row */
.podium-timer-row {
  margin-top: auto;
  padding-top: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.timer-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 7px 9px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.timer-live-badge.active {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}
.timer-live-badge.active strong {
  color: #fde047;
  font-size: 12px;
}

.timer-live-badge.expired {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-weight: 600;
}

.timer-live-badge.waiting {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.timer-live-badge.unassigned {
  background: rgba(148, 163, 184, 0.05);
  color: #64748b;
  font-style: italic;
}

/* Action Bar & Buttons */
.contest-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.contest-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  box-sizing: border-box;
}

.contest-start-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55);
}

.contest-start-btn:active {
  transform: scale(0.98);
}

.contest-stop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85) 0%, rgba(185, 28, 28, 0.95) 100%);
  color: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.contest-stop-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
}

.contest-stop-btn:active {
  transform: scale(0.98);
}

/* ==========================================================================
   MEDIA QUERIES MOBILE: PREVIENE FUORIUSCITA SU CELLULARE
   ========================================================================== */
@media (max-width: 900px) {
  .contest-podium-slots {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .contest-podium-card {
    padding: 14px 12px !important;
    margin: 14px 0 !important;
    border-radius: 12px !important;
  }

  .contest-podium-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .contest-title-wrap {
    width: 100% !important;
    gap: 10px !important;
    align-items: flex-start !important;
  }

  .contest-icon {
    font-size: 22px !important;
    margin-top: 2px;
  }

  .contest-card-title {
    font-size: 14.5px !important;
    line-height: 1.35 !important;
  }

  .contest-card-subtitle {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .contest-status-pill {
    align-self: flex-start !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
  }

  .podium-slot {
    padding: 12px 10px !important;
  }

  .podium-slot-badge {
    font-size: 12.5px !important;
  }

  .picker-search-input {
    font-size: 12px !important;
    padding: 7px 10px !important;
  }

  .podium-select {
    font-size: 12px !important;
    padding: 7px 8px !important;
  }

  .contest-action-bar {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
    padding-top: 12px !important;
  }

  .contest-start-btn,
  .contest-stop-btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
    white-space: normal !important;
  }

  .timer-live-badge {
    font-size: 11px !important;
    padding: 6px 8px !important;
    flex-wrap: wrap !important;
  }
}

/* Banner Notifica Vincitore nei Moduli Calcolatori */
.contest-winner-announcement-banner {
  position: relative;
  margin: 0 0 18px 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  animation: fadeInBanner 0.4s ease-out;
}

.contest-winner-announcement-banner.rank-2 {
  background: linear-gradient(135deg, rgba(203, 213, 225, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: rgba(203, 213, 225, 0.5);
  box-shadow: 0 8px 24px rgba(203, 213, 225, 0.15);
}

.contest-winner-announcement-banner.rank-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.15);
}

.winner-banner-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.winner-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}

.winner-badge-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.winner-trophy-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.6));
}

.winner-rank-pill {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1e293b;
  letter-spacing: 0.5px;
}

.winner-info-side {
  flex: 1 1 220px;
  min-width: 0;
  box-sizing: border-box;
}

.winner-banner-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 2px;
  word-break: break-word;
}

.winner-banner-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: break-word;
}

.winner-timer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(15, 23, 42, 0.7);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  flex-shrink: 0;
}

.winner-timer-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.winner-countdown-val {
  font-size: 16px;
  font-weight: 900;
  color: #fde047;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 768px) {
  .contest-winner-announcement-banner {
    padding: 12px 14px !important;
  }
  .winner-banner-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .winner-timer-side {
    width: 100% !important;
    align-items: center !important;
    text-align: center !important;
    margin-top: 4px;
  }
}

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

/* ==========================================================================
   ROTELLA PROVA GRATUITA A TEMPO (ACCESSO LIBERO GLOBALE REGNO)
   ========================================================================== */
.package-trial-control-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.package-trial-control-box.green-trial-glow {
  border-color: rgba(34, 197, 94, 0.4);
}
.package-trial-control-box.green-trial-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #22c55e, transparent);
}

.package-trial-control-box.cyan-trial-glow {
  border-color: rgba(6, 182, 212, 0.4);
}
.package-trial-control-box.cyan-trial-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #06b6d4, transparent);
}

.package-trial-control-box.purple-trial-glow {
  border-color: rgba(168, 85, 247, 0.45);
}
.package-trial-control-box.purple-trial-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #a855f7, transparent);
}

.trial-info-col {
  flex: 1 1 320px;
  min-width: 0;
}

.trial-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.trial-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.4));
}

.trial-title {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.2px;
}

.trial-desc {
  margin: 0;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.trial-actions-col {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.trial-time-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trial-duration-label {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
}

.trial-duration-select {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.trial-duration-select:focus {
  border-color: #38bdf8;
}

.trial-switch-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trial-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

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

.trial-status-badge.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(16, 185, 129, 0.3) 100%);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
  animation: pulseTrialBadge 2s infinite ease-in-out;
}

@keyframes pulseTrialBadge {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 16px rgba(34, 197, 94, 0.7); }
}

/* ==========================================================================
   BANNER ACCESSO LIBERO GLOBALE NELLE PAGINE MODULO
   ========================================================================== */
.global-trial-live-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin: 0 0 20px 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.25) 50%, rgba(59, 130, 246, 0.2) 100%);
  border: 1.5px solid rgba(52, 211, 153, 0.6);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
  position: relative;
  overflow: hidden;
  animation: fadeInBanner 0.4s ease-out;
  box-sizing: border-box;
}

.global-trial-live-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #34d399, #38bdf8, #818cf8, #34d399);
  background-size: 200% auto;
  animation: shimmerBorder 3s linear infinite;
}

.trial-banner-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(34, 197, 94, 0.5));
}

.trial-banner-content {
  flex: 1 1 auto;
  min-width: 0;
}

.trial-banner-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 2px;
}
.trial-banner-title strong {
  color: #4ade80;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.trial-banner-sub {
  font-size: 12.5px;
  color: #cbd5e1;
}

.trial-banner-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fde047;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 768px) {
  .package-trial-control-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 14px !important;
  }
  .trial-actions-col {
    width: 100% !important;
    justify-content: space-between !important;
  }
  .global-trial-live-banner {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 12px 14px !important;
  }
  .trial-banner-countdown {
    width: 100% !important;
    justify-content: center !important;
  }
}

