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

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--surface-0);
  color: var(--texte);
  padding: 16px;
  padding-top: 60px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px 28px 28px;
  max-width: 800px;
  width: 100%;
  text-align: center;
}

h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f2f5f8;
  margin-bottom: 24px;
}


.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--texte-doux);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tab-btn:hover {
  background: color-mix(in srgb, var(--color-light) 8%, var(--surface-2));
  border-color: var(--line-forte);
}

.tab-btn.active {
  background: color-mix(in srgb, var(--color-light) 14%, var(--surface-2));
  border-color: var(--color-light);
  color: #fff;
}


.mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.mode-tab {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  background: none;
  color: var(--texte-doux);
  transition: color 0.15s, border-color 0.15s;
}

.mode-tab:hover {
  color: var(--texte);
}

.mode-tab.active {
  border-bottom-color: var(--color-light);
  color: #fff;
}

.mode-section {
  display: none;
}

.mode-section.visible {
  display: block;
}


.leaderboard {
  text-align: left;
}

.lb-header {
  display: flex;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--texte-faible);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}

.lb-rank {
  width: 40px;
}

.lb-pseudo {
  flex: 1;
}

.lb-temps {
  width: 90px;
  text-align: right;
}

.lb-score {
  width: 90px;
  text-align: right;
}

.lb-tentatives {
  width: 80px;
  text-align: right;
}

.lb-coups {
  width: 80px;
  text-align: right;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  transition: background 0.15s;
}

.lb-row:hover {
  background: var(--surface-2);
}

.lb-row.top1 {
  background: rgba(255, 215, 0, 0.06);
}

.lb-row.top2 {
  background: rgba(192, 192, 192, 0.04);
}

.lb-row.top3 {
  background: rgba(205, 127, 50, 0.04);
}

.lb-row .lb-rank {
  font-weight: 800;
  color: var(--color-light);
}

.lb-row.top1 .lb-rank {
  color: #ffd700;
}

.lb-row.top2 .lb-rank {
  color: #c0c0c0;
}

.lb-row.top3 .lb-rank {
  color: #cd7f32;
}

.lb-row .lb-pseudo {
  font-weight: 600;
}

.lb-row .lb-temps {
  font-weight: 700;
  color: var(--color-mid);
}

.lb-row .lb-score {
  font-weight: 700;
  color: var(--color-mid);
}

.lb-row .lb-tentatives {
  font-weight: 700;
  color: #f59e0b;
}

.lb-row .lb-coups {
  font-weight: 700;
  color: var(--color-mid);
}

.no-data {
  font-size: 0.85rem;
  color: var(--texte-faible);
  padding: 24px 0;
}

.loading {
  color: var(--texte-faible);
  font-size: 0.85rem;
  padding: 24px 0;
}


.date-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.date-btn {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  background: transparent;
  border: 1px solid var(--line-forte);
  border-radius: 4px;
  color: var(--texte);
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, border-color 0.15s;
}

.date-btn:hover {
  background: var(--surface-2);
  border-color: var(--color-light);
}

.date-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-affichee {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--texte);
  min-width: 180px;
  text-align: center;
}

.date-input {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  padding: 5px 10px;
  border: 1px solid var(--line-forte);
  border-radius: 4px;
  background: var(--surface-0);
  color: var(--texte);
  cursor: pointer;
}


.podium {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.podium-item {
  text-align: center;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 90px;
}

.podium-item:first-child {
  border-color: rgba(255, 215, 0, 0.3);
}

.podium-rang {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.podium-pseudo {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--texte);
}

.podium-temps {
  font-size: 0.75rem;
  color: var(--texte-doux);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.podium-info {
  font-size: 0.7rem;
  color: var(--texte-faible);
  margin-top: 2px;
}

.defi-liste {
  text-align: left;
}

.defi-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.defi-row .lb-rank {
  width: 36px;
  font-weight: 800;
  color: var(--color-light);
}

.defi-row .lb-pseudo {
  flex: 1;
  font-weight: 600;
}

.defi-row .lb-temps {
  width: 100px;
  text-align: right;
  font-weight: 700;
  color: var(--color-mid);
  font-variant-numeric: tabular-nums;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--texte-doux);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  color: var(--color-light);
}

footer {
  font-size: 0.78rem;
  color: var(--texte-faible);
  margin-top: 16px;
}

footer a {
  color: var(--texte-doux);
  text-decoration: none;
}

footer a:hover {
  color: var(--color-light);
  text-decoration: underline;
}

@media (max-width: 480px) {

  .card {
    padding: 24px 10px 20px;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .mode-tabs {
    flex-wrap: wrap;
  }

  .podium {
    flex-direction: column;
    gap: 8px;
  }

  .podium-item {
    min-width: 0;
  }

  .lb-rank {
    width: 28px;
  }

  .lb-temps {
    width: 65px;
    font-size: 0.75rem;
  }

  .lb-score {
    width: 65px;
    font-size: 0.75rem;
  }

  .lb-coups {
    width: 50px;
    font-size: 0.75rem;
  }

  .lb-pseudo {
    font-size: 0.78rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lb-header {
    font-size: 0.68rem;
  }

  .date-nav {
    flex-wrap: wrap;
    gap: 6px;
  }

  .date-affichee {
    min-width: 0;
    font-size: 0.8rem;
  }

  .date-input {
    font-size: 0.75rem;
  }
}
