* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-blue: #001a4d;
  --primary-red: #ff3333;
  --accent-blue: #0033cc;
  --light-blue: #e6f0ff;
  --dark: #0a0e27;
  --light: #f5f5f5;
  --border: #ddd;
  --text: #222;
}

body {
  font-family: 'Roboto', 'Arial', sans-serif;
  background-color: #ffffff;
  background-image:
    repeating-linear-gradient(
      -55deg,
      transparent,
      transparent 16px,
      rgba(255, 51, 51, 0.12) 16px,
      rgba(255, 51, 51, 0.12) 18px,
      transparent 18px,
      transparent 34px,
      rgba(0, 51, 204, 0.10) 34px,
      rgba(0, 51, 204, 0.10) 36px
    );
  min-height: 100vh;
  color: var(--text);
  padding: 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HEADER & NAVIGATION */
header {
  background: linear-gradient(180deg, var(--primary-blue) 0%, #001540 100%);
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-brand {
  font-weight: bold;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-img {
  height: 60px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(255, 51, 51, 0.3));
  transition: all 0.3s;
}

.logo-img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(255, 51, 51, 0.5));
}

.logo-text {
  color: white;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(255, 51, 51, 0.5);
}

.nav-links {
  display: flex;
  gap: 5px;
  list-style: none;
  align-items: center;
}

.nav-links li {
  list-style: none;
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  padding: 8px 12px;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  letter-spacing: 1px;
}

.nav-link:hover {
  color: var(--primary-red);
  border-bottom: 3px solid var(--primary-red);
}

.nav-link.active {
  color: var(--primary-red);
  border-bottom: 3px solid var(--primary-red);
}

/* ADMIN nav — rosso acceso con sfondo */
.nav-link-admin {
  color: #ff3333 !important;
  border: 1px solid rgba(255,51,51,0.4);
  border-radius: 6px;
  padding: 6px 12px !important;
}
.nav-link-admin:hover, .nav-link-admin.active {
  background: rgba(255,51,51,0.15);
  border-color: #ff3333;
  border-bottom: 3px solid #ff3333 !important;
}

/* PILOTI nav — bianco brillante */
.nav-link-piloti {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* MAIN CONTENT */
main {
  padding: 40px 0;
  min-height: 80vh;
}

.section {
  display: none;
  animation: fadeIn 0.5s ease-in;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-switcher {
  display: flex;
  gap: 6px;
  margin-left: 20px;
}

.lang-btn {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}

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

.lang-btn.active {
  background: var(--primary-red);
  color: #fff;
  border-color: var(--primary-red);
}

/* ── LANGUAGE DROPDOWN ───────────────────────────────────── */
.lang-dropdown {
  position: relative;
  margin-left: 20px;
}

.lang-selected {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.2s;
}

.lang-flag {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  object-fit: cover;
  flex-shrink: 0;
}

.lang-label {
  font-size: 13px;
}

.lang-selected:hover { background: rgba(255,255,255,0.18); }

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  min-width: 150px;
  z-index: 999;
}

.lang-dropdown.open .lang-menu { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  transition: background 0.15s;
}

.lang-option .lang-flag {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  object-fit: cover;
  flex-shrink: 0;
}

.lang-option:hover { background: #f0f4ff; color: var(--primary-blue); }

/* HERO SECTION */
.hero {
  background-image: url('RoadCourse.jpg');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  color: white;
  border-radius: 15px;
  margin-bottom: 50px;
  box-shadow: 0 8px 30px rgba(255, 51, 51, 0.3);
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 10, 40, 0.82) 0%,
    rgba(0, 26, 77, 0.70) 50%,
    rgba(180, 0, 0, 0.30) 100%
  );
  border-radius: 15px;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 80px 40px;
  width: 100%;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(20px); }
}

.hero h1 {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 15px;
  letter-spacing: 3px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
  font-size: 22px;
  margin-bottom: 30px;
  color: #e8e8e8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  padding: 14px 35px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 15px;
  letter-spacing: 1px;
  display: inline-block;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--primary-red);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 51, 51, 0.3);
}

.btn-primary:hover {
  background: #e60000;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 51, 51, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
}

.btn-secondary:hover {
  background: var(--primary-red);
  color: white;
  transform: translateY(-3px);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

/* STATS SECTION */
.stats-section {
  margin-bottom: 60px;
}

.stats-section h2 {
  color: white;
  margin-bottom: 30px;
  font-size: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
  color: white;
  padding: 35px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(255, 51, 51, 0.2);
  border-left: 5px solid var(--primary-red);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(255, 51, 51, 0.3);
}

.stat-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.stat-number {
  font-size: 42px;
  font-weight: 900;
  margin: 15px 0;
  letter-spacing: 2px;
}

.stat-label {
  font-size: 16px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* FEATURED SECTION */
.featured-section h2 {
  color: #111;
  margin: 60px 0 30px;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(255,51,51,0.4);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.event-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  border-left: 5px solid var(--primary-red);
}

.event-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 35px rgba(255, 51, 51, 0.25);
}

.event-badge {
  background: var(--primary-red);
  color: white;
  padding: 8px 15px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.event-card h3 {
  padding: 20px 20px 10px;
  color: var(--primary-blue);
  font-size: 22px;
  font-weight: 900;
}

.event-meta {
  padding: 0 20px;
  color: #666;
  font-size: 14px;
  margin: 5px 0;
}

.event-card p {
  padding: 0 20px;
  color: #555;
  line-height: 1.6;
  margin: 15px 0;
}

.event-card .btn {
  margin: 20px;
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-blue);
  font-weight: 600;
  letter-spacing: 0.5px;
}

input, textarea, select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--light-blue);
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(255, 51, 51, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* TABLES */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

th {
  background: var(--primary-blue);
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
}

td {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:hover {
  background: var(--light-blue);
}

tr:nth-child(even) {
  background: #f9f9f9;
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 30px 15px;
}

.modal-content {
  background: white;
  padding: 35px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
  border-top: 5px solid var(--primary-red);
  margin: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--light-blue);
  padding-bottom: 15px;
}

.modal-header h2 {
  margin: 0;
  color: var(--primary-blue);
  font-size: 26px;
  letter-spacing: 1px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: var(--primary-red);
  transition: all 0.3s;
}

.close-btn:hover {
  color: var(--dark);
  transform: scale(1.2);
}

/* INFO SECTION */
.info-section {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
  color: white;
  padding: 40px;
  border-radius: 12px;
  margin-top: 60px;
}

.info-section h2 {
  color: white;
  margin-bottom: 20px;
  font-size: 28px;
  letter-spacing: 2px;
}

.info-section p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 15px;
  color: #ddd;
}

/* RACE BANNER */
.race-banner {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  border-radius: 0;
}

.race-banner-placeholder {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
}

/* PILOT AVATAR */
.pilot-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px 5px;
}

.pilot-header h3 {
  padding: 0;
  margin: 0;
}

.pilot-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-red);
  flex-shrink: 0;
}

.pilot-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  border: 3px solid var(--primary-red);
}

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-red);
  flex-shrink: 0;
}

.leaderboard-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid var(--primary-red);
  flex-shrink: 0;
}

/* ── RACE CARD CLICKABLE ─────────────────────────────────── */
.race-card-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.race-card-clickable:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(255, 51, 51, 0.25);
}

.card-click-hint {
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary-red);
  padding: 10px 20px 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.race-card-clickable:hover .card-click-hint {
  opacity: 1;
}

/* ── RACE DETAIL PAGE ────────────────────────────────────── */
.race-detail-page {
  animation: fadeInUp 0.35s ease;
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
  margin-bottom: 40px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0f4ff;
  color: #001a4d;
  border: 1px solid rgba(0,26,77,0.2);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  transition: background 0.2s, border-color 0.2s;
}

.back-btn:hover {
  background: rgba(255,51,51,0.15);
  border-color: var(--primary-red);
}

.detail-hero {
  width: 100%;
  min-height: 340px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  margin-bottom: 30px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05) 0%,
    rgba(0,10,40,0.92) 100%
  );
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  padding: 36px 40px;
  width: 100%;
}

.detail-status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.detail-hero-content h1 {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.detail-hero-content p {
  color: rgba(255,255,255,0.75);
  font-size: 16px;
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.detail-top-row {
  display: flex;
  gap: 20px;
}

.detail-mini-card {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  min-height: 360px;
}

.detail-mini-card--photo {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0d1b3e;
  padding: 0;
}

.detail-info-header {
  margin-bottom: 20px;
}

.detail-info-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary-blue);
  margin: 8px 0 4px;
  line-height: 1.2;
}

.detail-info-subtitle {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.detail-info-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.detail-info-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-blue);
  border-bottom: 3px solid var(--primary-red);
  padding-bottom: 12px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.detail-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row:nth-last-child(-n+2) {
  border-bottom: none;
}

.detail-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.detail-label {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 90px;
  flex-shrink: 0;
}

.detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-blue);
}

/* Results table */
.detail-results {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.detail-results h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-blue);
  border-bottom: 3px solid var(--primary-red);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th {
  background: var(--primary-blue);
  color: #fff;
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  letter-spacing: 1px;
}

.results-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
}

.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: #f8f9ff; }

@media (max-width: 480px) {
  .results-table td,
  .results-table th { padding: 8px 6px; font-size: 12px; }
  .results-table td:first-child,
  .results-table th:first-child { padding-left: 10px; min-width: 28px; }
  .results-table td:last-child,
  .results-table th:last-child  { padding-right: 10px; min-width: 36px; }
  .results-table td div[style*="display:flex"] { gap: 4px !important; }
  .results-table td img { width: 22px !important; height: 22px !important; margin-right: 4px !important; }
}

/* Responsive detail */
@media (max-width: 768px) {
  .detail-rows { grid-template-columns: 1fr; }
  .detail-hero-content h1 { font-size: 24px; }
  .detail-hero { min-height: 250px; }
}

/* ── LEADERBOARD CLICKABLE ROWS ──────────────────────────── */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-row-clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.leaderboard-row-clickable:hover td { background: #eef2ff; }
.leaderboard-row-clickable:hover td:first-child { border-left: 4px solid var(--primary-red); }

/* ── DRIVER DETAIL PAGE ──────────────────────────────────── */
.driver-hero {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  margin-bottom: 28px;
  min-height: 220px;
  display: flex;
  align-items: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.driver-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-blue) 0%, #0a1a5c 50%, #1a0030 100%);
}
.driver-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(255,51,51,0.15) 0%, transparent 60%);
}
.driver-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 40px;
  width: 100%;
}
.driver-detail-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-red);
  box-shadow: 0 0 30px rgba(255,51,51,0.4);
  flex-shrink: 0;
}
.driver-detail-avatar-placeholder {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 4px solid var(--primary-red);
  flex-shrink: 0;
}
.driver-hero-info { color: #fff; }
.driver-level-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
}
.driver-hero-info h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.driver-tag-line { color: rgba(255,255,255,0.6); font-size: 14px; margin-bottom: 4px; }
.driver-team { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 600; }

.driver-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.driver-stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  transition: transform 0.2s;
}
.driver-stat-card:hover { transform: translateY(-3px); }
.driver-stat-icon { font-size: 28px; margin-bottom: 8px; }
.driver-stat-value { font-size: 28px; font-weight: 900; color: var(--primary-blue); margin-bottom: 4px; }
.driver-stat-label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

.driver-races-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.driver-races-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-blue);
  border-bottom: 3px solid var(--primary-red);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .driver-hero-content { flex-direction: column; text-align: center; padding: 28px 20px; }
  .driver-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .driver-hero-info h1 { font-size: 26px; }
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-red {
  background: rgba(255, 51, 51, 0.2);
  color: var(--primary-red);
}

.badge-blue {
  background: rgba(0, 51, 204, 0.2);
  color: var(--accent-blue);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   ══════════════════════════════════════════════════ */

/* ── HAMBURGER BUTTON ─────────────────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.hamburger-btn:hover { background: rgba(255,255,255,0.18); }

/* ── MOBILE MENU ──────────────────────────────── */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 998;
  backdrop-filter: blur(2px);
}
.mobile-menu-overlay.active { display: block; }

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: linear-gradient(180deg, #001a4d 0%, #0a0e27 100%);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 6px 0 40px rgba(0,0,0,0.5);
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  background: linear-gradient(135deg, var(--primary-red) 0%, #cc0000 100%);
  flex-shrink: 0;
}
.mobile-menu-logo { height: 36px; width: auto; }
.mobile-menu-title {
  color: white;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1.5px;
  flex: 1;
}
.mobile-menu-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.mobile-menu-close:hover { background: rgba(255,255,255,0.35); }

.mobile-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
}
.mobile-nav-link {
  display: block;
  padding: 15px 24px;
  color: #ccd6f6;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1.5px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  color: white;
  border-left-color: var(--primary-red);
  background: rgba(255,255,255,0.06);
}
.mobile-admin-link { color: var(--primary-red) !important; }

.mobile-nav-sub { background: rgba(0,0,0,0.2); }
.mobile-nav-sublink {
  display: block;
  padding: 11px 24px 11px 36px;
  color: #8899cc;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 0.2s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
}
.mobile-nav-sublink:hover { color: white; }

.mobile-menu-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

@media (max-width: 768px) {

  /* ── NAVBAR ──────────────────────────────────── */
  .nav-links   { display: none; }
  .lang-label  { display: none; }
  .hamburger-btn { display: flex; }

  .navbar { padding: 0 14px; gap: 10px; }
  .logo-img { height: 42px; }
  .logo-text { font-size: 14px; letter-spacing: 1px; }

  header { padding: 10px 0; }

  /* ── CONTAINER ───────────────────────────────── */
  .container { padding: 0 14px; }
  main { padding: 20px 0; }

  /* ── HERO ────────────────────────────────────── */
  .hero { min-height: 260px; margin-bottom: 30px; border-radius: 10px; }
  .hero-content { padding: 40px 20px; }
  .hero h1 { font-size: 22px; letter-spacing: 1px; }
  .hero-subtitle { font-size: 14px; margin-bottom: 20px; }
  .hero-buttons { flex-direction: column; align-items: center; gap: 12px; }
  .hero-buttons .btn { width: 100%; max-width: 280px; padding: 13px 20px; font-size: 14px; }

  /* ── STATS ───────────────────────────────────── */
  .stats-section h2 { font-size: 22px; margin-bottom: 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stat-card { padding: 22px 14px; }
  .stat-icon { font-size: 28px; }
  .stat-number { font-size: 30px; margin: 8px 0; }
  .stat-label { font-size: 12px; }

  /* ── FEATURED / GRID ─────────────────────────── */
  .featured-section h2 { font-size: 22px; margin: 30px 0 18px; }
  .grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 30px; }

  /* ── INFO / ABOUT ────────────────────────────── */
  .info-section { padding: 24px 20px; margin-top: 30px; border-radius: 10px; }
  .info-section h2 { font-size: 20px; margin-bottom: 12px; }
  .info-section p { font-size: 14px; }

  /* ── COMMUNITY SECTION ───────────────────────── */
  .community-section {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
    margin-top: 16px;
    gap: 16px;
    border-radius: 10px;
  }
  .community-section h2 { font-size: 20px; }
  .community-buttons { width: 100%; flex-direction: column; gap: 10px; }
  .btn-community-discord, .btn-community-login { width: 100%; justify-content: center; text-align: center; }

  /* ── TABLES ──────────────────────────────────── */
  .table-responsive-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  }
  table { font-size: 13px; min-width: 500px; }
  th, td { padding: 10px 12px; }

  /* ── LEADERBOARD TABLE ───────────────────────── */
  .leaderboard-table { min-width: 460px; }

  /* ── CARDS ───────────────────────────────────── */
  .event-card h3 { font-size: 18px; padding: 15px 15px 8px; }
  .event-meta { padding: 0 15px; }
  .event-card p { padding: 0 15px; font-size: 14px; }
  .event-card .btn { margin: 14px 15px; }

  /* ── CHAMP GRID ──────────────────────────────── */
  .champ-grid { grid-template-columns: 1fr; gap: 16px; }

  /* ── ADMIN TABS ──────────────────────────────── */
  .admin-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab { flex-shrink: 0; font-size: 13px; padding: 8px 14px; }
  .admin-nav-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .admin-nav-card { padding: 14px 8px 12px; }
  .admin-nav-icon { font-size: 22px; }
  .admin-nav-label { font-size: 12px; }
  .admin-nav-desc { display: none; }

  /* ── ADMIN OVERVIEW GRID ─────────────────────── */
  .admin-overview-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .admin-stat-card { padding: 18px 12px !important; }

  /* ── DRIVER PROFILE ──────────────────────────── */
  .driver-hero-content { flex-direction: column; text-align: center; padding: 24px 16px; gap: 16px; }
  .driver-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .driver-hero-info h1 { font-size: 24px; }

  /* ── DETAIL IMAGE CARDS ───────────────────────── */
  .detail-top-row { gap: 10px; }
  .detail-mini-card { min-height: 150px; border-radius: 12px; }
  .detail-rows { grid-template-columns: 1fr; }
  .detail-hero-content h1 { font-size: 20px; }
  .detail-hero { min-height: 200px; }
  .detail-body { gap: 14px; }
  .detail-info-card { padding: 20px 16px; }
  .detail-results { padding: 20px 16px; overflow: hidden; }
  .results-table { table-layout: fixed; width: 100%; }
  .results-table th:nth-child(1) { width: 36px; }
  .results-table th:nth-child(3) { width: 50px; }
  .results-table td, .results-table th { padding: 8px 6px; font-size: 13px; }
  .detail-value { font-size: 14px; }

  /* ── DRAWER ──────────────────────────────────── */
  .drawer {
    width: 100% !important;
    max-width: 100% !important;
    right: auto !important;
    left: 0 !important;
    top: auto !important;
    bottom: -100% !important;
    height: auto !important;
    max-height: 90vh !important;
    border-radius: 20px 20px 0 0;
    transition: bottom 0.35s cubic-bezier(0.4,0,0.2,1) !important;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.25) !important;
  }
  .drawer.open {
    bottom: 0 !important;
    right: auto !important;
  }

  /* ── LOGIN MODAL ─────────────────────────────── */
  .login-modal-box { max-width: 100%; margin: 0 16px; }
  .login-modal-header { padding: 24px 20px 18px; }
  .login-modal-logo { font-size: 32px; }
  .login-modal-title { font-size: 17px; }
  .login-modal-body { padding: 22px 20px 28px; }

  /* ── SECTIONS TITLE ──────────────────────────── */
  .section-title { font-size: 22px !important; }

  /* ── ORGANIZZATORI / STREAMING ───────────────── */
  .streaming-grid { grid-template-columns: 1fr !important; }

  /* ── GENERAL BUTTONS ─────────────────────────── */
  .btn { font-size: 14px; padding: 12px 20px; }
  .btn-small { font-size: 12px; padding: 7px 13px; }

  /* ── LANG DROPDOWN position ──────────────────── */
  .lang-dropdown { margin-left: 0; }
  .lang-selected { padding: 7px 10px; }
  .lang-label { display: none; }
}

/* ── CHAMPIONSHIP CARDS ─────────────────────────────────────────────────────── */
.champ-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.champ-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.champ-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.champ-banner {
  position: relative;
  height: 180px;
  background-size: cover;
  background-position: center;
}
.champ-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 100%);
}
.champ-banner-content {
  position: absolute; bottom: 16px; left: 20px;
}
.champ-title {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  margin: 8px 0 0;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.champ-body {
  padding: 20px;
}
.champ-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
}
.champ-next {
  font-size: 13px;
  color: #333;
  margin-bottom: 14px;
}
.champ-progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.champ-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0033cc, #e63946);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.champ-progress-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 10px;
}

/* ── CHAMPIONSHIP DETAIL - RACE LIST ────────────────────────────────────────── */
.champ-race-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.champ-race-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.champ-race-row:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}

.champ-race-num {
  font-size: 20px;
  font-weight: 900;
  color: #ccc;
  width: 28px;
  flex-shrink: 0;
  text-align: center;
}

.champ-race-thumb {
  width: 90px;
  height: 60px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.champ-race-info {
  flex: 1;
  min-width: 0;
}
.champ-race-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.champ-race-meta {
  font-size: 12px;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── CHAMP LEADERS PREVIEW ──────────────────────────────────────────────────── */
.champ-leaders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #444;
  margin-bottom: 4px;
}
.champ-leaders span {
  background: #f5f7ff;
  border-radius: 8px;
  padding: 4px 10px;
}

/* ── NAV DROPDOWN ───────────────────────────────────────────────────────────── */
.nav-has-dropdown {
  position: relative;
}
.nav-has-dropdown > a {
  cursor: pointer;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0a1628;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 999;
}
.nav-has-dropdown:hover .nav-dropdown {
  display: block;
}
.nav-dropdown-item {
  display: block;
  padding: 12px 20px;
  color: #ccd6f6;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(255,255,255,0.1);
}

/* ── RISULTATI PODIO ────────────────────────────────────────────────────────── */
.risultati-podio {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 12px;
  color: #444;
}
.risultati-podio span {
  background: #f5f7ff;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
}
.risultati-pending {
  margin-top: 5px;
  font-size: 12px;
  color: #bbb;
  font-style: italic;
}

/* ── NEWS ───────────────────────────────────────────────────────────────────── */
.news-empty {
  text-align: center;
  padding: 80px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-top: 30px;
}
.news-empty-icon { font-size: 64px; margin-bottom: 16px; }
.news-empty h3 { font-size: 22px; color: var(--primary-blue); margin-bottom: 10px; }
.news-empty p  { color: #888; font-size: 15px; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.news-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}
.news-img {
  height: 200px;
  background-size: cover;
  background-position: center;
}
.news-body   { padding: 20px; }
.news-tag    { display: inline-block; background: var(--primary-red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; }
.news-title  { font-size: 18px; font-weight: 800; color: var(--primary-blue); margin-bottom: 6px; }
.news-date   { font-size: 12px; color: #999; margin-bottom: 10px; }
.news-text   { font-size: 14px; color: #555; line-height: 1.6; }

/* ══════════════════════════════════════════════════════
   ADMIN PANEL — Tab + Drawer system
   ══════════════════════════════════════════════════════ */

/* Tab bar */
/* ── ADMIN NAV CARD GRID ─────────────────────────────────────────── */
.admin-nav-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.admin-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 10px 16px;
  background: #fff;
  border: 2px solid #e4eaff;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  transition: all 0.22s;
  box-shadow: 0 2px 8px rgba(0,26,77,0.06);
  user-select: none;
}
.admin-nav-card:hover {
  border-color: var(--accent-blue);
  background: #f0f4ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,51,204,0.15);
}
.admin-nav-card.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  box-shadow: 0 6px 20px rgba(0,26,77,0.3);
  transform: translateY(-3px);
}
.admin-nav-icon {
  font-size: 26px;
  line-height: 1;
}
.admin-nav-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-blue);
  letter-spacing: 0.5px;
}
.admin-nav-card.active .admin-nav-label {
  color: #fff;
}
.admin-nav-desc {
  font-size: 10px;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.3px;
}
.admin-nav-card.active .admin-nav-desc {
  color: rgba(255,255,255,0.7);
}
@media (max-width: 900px) {
  .admin-nav-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 560px) {
  .admin-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* keep legacy tab vars for mobile override below */
.admin-tabs { display: flex; gap: 4px; background: #f0f4ff; border-radius: 12px; padding: 6px; margin-bottom: 28px; flex-wrap: wrap; }
.admin-tab  { flex: 1; min-width: 120px; padding: 10px 14px; border: none; border-radius: 8px; background: transparent; color: #555; font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.admin-tab:hover { background: #dce4ff; color: var(--primary-blue); }
.admin-tab.active { background: var(--primary-blue); color: #fff; box-shadow: 0 2px 8px rgba(0,26,77,0.25); }

/* Tab content panes */
.admin-pane { display: none; }
.admin-pane.active { display: block; }

/* Overview stat cards */
.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.admin-stat-num  { font-size: 36px; font-weight: 900; color: var(--primary-blue); }
.admin-stat-lbl  { font-size: 12px; font-weight: 700; color: #888; letter-spacing: 0.5px; margin-top: 4px; }
.admin-stat-icon { font-size: 28px; margin-bottom: 8px; }

/* List/table area */
.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-list-header h3 { margin: 0; font-size: 18px; color: var(--primary-blue); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.admin-table th {
  background: var(--primary-blue);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f7;
  font-size: 14px;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8f9ff; }
.admin-table .td-actions { display: flex; gap: 6px; white-space: nowrap; }

/* Drawer overlay + panel */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 900;
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0; right: -42%;
  width: 42%;
  min-width: 340px;
  max-width: 600px;
  height: 100%;
  background: #fff;
  z-index: 901;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}
.drawer.open { right: 0; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--primary-blue);
  color: #fff;
  flex-shrink: 0;
}
.drawer-header h3 { margin: 0; font-size: 18px; }
.drawer-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.drawer-close:hover { opacity: 1; }

.drawer-body { padding: 24px; flex: 1; }

/* Form sections inside drawer */
.drawer-section {
  margin-bottom: 24px;
  border-left: 3px solid var(--primary-red);
  padding-left: 14px;
}
.drawer-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-red);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #dde1f0;
  border-radius: 8px;
  font-size: 14px;
  color: #222;
  background: #fafbff;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  background: #fff;
}
.form-group textarea { min-height: 80px; resize: vertical; }

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid #eef;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Results section (disabled state) */
.drawer-section.disabled { opacity: 0.4; pointer-events: none; }

/* ── COMMUNITY SECTION ─────────────────────────────── */
.community-section {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
  color: white;
  padding: 28px 40px;
  border-radius: 12px;
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.community-section h2 {
  color: white;
  font-size: 26px;
  letter-spacing: 2px;
  margin: 0;
  white-space: nowrap;
}

.community-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-community-discord {
  background: #5865F2;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.btn-community-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88,101,242,0.5);
}

.btn-community-login {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.7);
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-community-login:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
  transform: translateY(-2px);
}

/* ── LOGIN MODAL ────────────────────────────────────── */
.login-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.login-modal-overlay.active {
  display: flex;
}

.login-modal-box {
  background: linear-gradient(160deg, #001a4d 0%, #0a0e27 100%);
  border: 1px solid rgba(255,51,51,0.3);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 40px rgba(255,51,51,0.1);
  overflow: hidden;
  animation: loginModalIn 0.3s ease;
}

@keyframes loginModalIn {
  from { opacity:0; transform: scale(0.9) translateY(20px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.login-modal-header {
  background: linear-gradient(135deg, var(--primary-red) 0%, #cc0000 100%);
  padding: 32px 24px 24px;
  text-align: center;
  position: relative;
}

.login-modal-logo {
  font-size: 40px;
  margin-bottom: 8px;
}

.login-modal-title {
  color: white;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.login-modal-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  letter-spacing: 1px;
}

.login-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.login-modal-close:hover { background: rgba(255,255,255,0.3); }

.login-modal-body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-label {
  color: #aac;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}

.login-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 13px 16px;
  color: white;
  font-size: 15px;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary-red);
  background: rgba(255,255,255,0.11);
}

.login-input::placeholder { color: rgba(255,255,255,0.3); }

.login-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: rgba(255,255,255,0.5);
  padding: 0;
  transition: color 0.2s;
}

.login-eye-btn:hover { color: white; }

.login-error {
  background: rgba(255,51,51,0.15);
  border: 1px solid rgba(255,51,51,0.4);
  color: #ff6666;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.login-submit-btn {
  background: linear-gradient(135deg, var(--primary-red) 0%, #cc0000 100%);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(255,51,51,0.4);
  margin-top: 4px;
}

.login-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,51,51,0.6);
}

/* ── DISCORD NAVBAR BUTTON ──────────────────────── */
.nav-discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5865F2;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  color: white;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
}
.nav-discord-btn:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(88,101,242,0.5);
}

/* ── ULTIME GARE SECTION (HOME) ─────────────────────────────── */
.ultime-gare-section {
  padding: 40px 0 20px;
}
.ultime-gare-section h2 {
  color: #111;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
  text-shadow: 0 2px 10px rgba(255,51,51,0.4);
}
.ultima-gara-card {
  background: linear-gradient(135deg, #0d1333 0%, #1a2050 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
}
.ultima-gara-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(255,51,51,0.25);
}
.ultima-gara-banner {
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.ultima-gara-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.55));
}
.ultima-gara-num {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
}
.ultima-gara-body {
  padding: 16px 18px 18px;
}
.ultima-gara-name {
  color: white;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: .5px;
}
.ultima-gara-meta {
  color: rgba(255,255,255,0.65);
  font-size: .82rem;
  margin-bottom: 4px;
}
.ultima-gara-winner {
  color: #f59e0b;
  font-weight: 700;
  font-size: .88rem;
  margin-top: 8px;
}

/* ── CALENDARIO ──────────────────────────────────────────────── */
.calendario-wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 0 40px;
}
.calendario-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.calendario-header h2 {
  color: #111;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: none;
  text-align: center;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.cal-nav-btn {
  background: rgba(0,0,0,0.07);
  border: 1px solid rgba(0,0,0,0.15);
  color: #111;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}
.cal-nav-btn:hover:not(:disabled) { background: rgba(255,51,51,0.15); }
.cal-nav-btn:disabled { opacity: .35; cursor: default; }
.cal-mese-label {
  color: #111;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  min-width: 220px;
  text-align: center;
}
.calendario-legenda {
  display: flex;
  gap: 22px;
  justify-content: center;
  margin-bottom: 16px;
  color: #444;
  font-size: 1rem;
  font-weight: 600;
}
.calendario-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-head {
  color: #666;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 0;
}
.cal-cell {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  min-height: 74px;
  padding: 8px 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cal-cell-empty {
  background: transparent;
  border: none;
}
.cal-cell-today {
  border-color: rgba(255,51,51,0.5);
  background: rgba(255,51,51,0.05);
}
.cal-cell-race {
  background: rgba(245,158,11,0.13);
  border-color: #f59e0b;
  cursor: pointer;
}
.cal-cell-race:hover {
  background: rgba(245,158,11,0.25);
  transform: scale(1.04);
}
.cal-day-num {
  color: #333;
  font-size: .85rem;
  font-weight: 600;
}
.cal-today-num {
  background: var(--primary-red);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .8rem;
}
.cal-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}
.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.cal-race-label {
  font-size: .65rem;
  color: #b97700;
  font-weight: 700;
  letter-spacing: .5px;
}

/* Cal event detail panel */
.cal-event-detail {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.cal-detail-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.cal-detail-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(255,51,51,0.15);
}
.cal-detail-banner {
  height: 100px;
  background-size: cover;
  background-position: center;
}
.cal-detail-body {
  padding: 14px 16px 16px;
}
.cal-detail-body h3 {
  color: #111;
  font-size: .95rem;
  font-weight: 800;
  margin: 6px 0 8px;
}
.cal-detail-body p {
  color: #555;
  font-size: .8rem;
  margin-bottom: 4px;
}

@media (max-width: 600px) {
  .calendario-grid { gap: 3px; }
  .cal-cell { min-height: 54px; padding: 5px 3px 4px; border-radius: 7px; }
  .cal-race-label { font-size: .55rem; }
  .cal-day-num { font-size: .72rem; }
}

/* ── LOGO MINIATURA NELLE CARD HOME ─────────────────────────── */
.card-game-logo {
  height: 36px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
  flex-shrink: 0;
  border-radius: 4px;
}

/* ── NEWS LINK ESTERNI ───────────────────────────────────────── */
.news-card-link {
  cursor: pointer;
  transition: transform .22s, box-shadow .22s;
}
.news-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,51,204,0.18);
}
.news-link-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: .78rem;
  font-weight: 700;
  color: #0033cc;
  letter-spacing: .5px;
}

/* ── NEWS MODE TOGGLE (admin drawer) ─────────────────────────── */
.news-mode-toggle {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.news-mode-btn {
  flex: 1;
  padding: 9px 14px;
  border: 2px solid #dde3f0;
  border-radius: 8px;
  background: #f5f7ff;
  color: #555;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
}
.news-mode-btn.active {
  background: #001a4d;
  color: #fff;
  border-color: #001a4d;
}

/* ── RSS FEED NEWS ───────────────────────────────────── */
.news-source-badge {
  display: inline-block;
  background: linear-gradient(135deg, #001a4d, #0033cc);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 20px;
}
.rss-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.55);
  font-size: .85rem;
  margin-bottom: 18px;
  padding: 10px 0;
}
.rss-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0033cc;
  animation: rssPulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes rssPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .35; transform: scale(.7); }
}

/* Badge per fonte feed */
.news-source-badge { display:inline-block; font-size:.68rem; font-weight:700; letter-spacing:.5px; padding:3px 8px; border-radius:20px; color:#fff; }
.news-source-iracing-arcade  { background: linear-gradient(135deg,#001a4d,#0033cc); }
.news-source-formula-legends { background: linear-gradient(135deg,#7b0000,#cc0000); }
.news-source-feed            { background: #444; }

/* ── LOGO GIOCO NELL'HEADER CAMPIONATO ───────────────── */
.champ-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.champ-header-game-logo {
  height: 64px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  flex-shrink: 0;
  border-radius: 8px;
  display: block;
}
@media (max-width: 600px) {
  .champ-header-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .champ-header-game-logo {
    height: 42px;
    max-width: 100px;
  }
}

/* ── TITOLO CAMPIONATO — effetto 3D ──────────────────── */
.champ-detail-header h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1.1;

  /* Gradient: rosso → bianco → blu */
  background: linear-gradient(135deg, #ff3333 0%, #ffffff 45%, #4488ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  /* Strati di ombra 3D */
  filter:
    drop-shadow(1px 1px 0px #990000)
    drop-shadow(2px 2px 0px #770000)
    drop-shadow(3px 3px 0px #001a66)
    drop-shadow(4px 4px 0px #000d33)
    drop-shadow(0px 8px 22px rgba(255, 51, 51, 0.45));
}

/* ── PATTERN HEADER CAMPIONATO ───────────────────────── */
.champ-detail-header {
  position: relative;
  border-radius: 16px;
  padding: 28px 30px;
  margin-bottom: 28px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 51, 51, 0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

.champ-detail-header p {
  color: #666;
  font-size: .88rem;
  letter-spacing: 1px;
  margin-top: 4px;
}
