:root {
  --bg: #0b0e14;
  --panel: #111726;
  --line: #1a2236;
  --text: #e8eefc;
  --muted: #9aa3b2;
  --gold: #ffd166;
  --silver: #d1d5db;
  --bronze: #d3956b;
  --header-height: 58px;
  --bottom-safe: 20px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}

body {
  margin: 0;
  background: #0b0e14;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font:
    16px/1.45 Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
}

.lang-switcher {
  display: inline-flex !important;
  align-items: center !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}
.lang-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.35) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  padding: 0 5px !important;
  text-shadow: none !important;
}
.lang-btn.active {
  color: #fff !important;
}
.lang-btn:focus,
.lang-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.lang-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  pointer-events: none;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0b0e14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.main-content {
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  box-sizing: border-box;
}

.header-bar {
  max-width: 1100px;
  margin: 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}

.brand {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.header-tabs {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Nav right ── */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.profile-link,
.stats-button,
.records-button,
.suggest-button,
.likes-button {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.profile-link:hover,
.stats-button:hover,
.records-button:hover,
.likes-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.stats-button {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.3);
}
.records-button {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}
.likes-button {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.3);
}
.suggest-button {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
}

.logout-button {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s;
}

.logout-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.google-icon {
  width: 18px;
  height: 18px;
}

/* ── Container ── */
.top10-container,
main.top10-container {
  max-width: 1100px;
  margin: 28px auto 40px;
  padding: 0 16px;
}

h1 {
  margin: 0 0 12px;
  font-weight: 700;
}

h1 .sub {
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
  font-size: 0.9em;
}

/* ── Table desktop ── */
.top10-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.top10-table thead th {
  text-align: left;
  font-weight: 600;
  color: #cdd6f4;
  background: #0f1629;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 14px;
}

.top10-table thead th:nth-child(1) {
  width: 65%;
}
.top10-table thead th:nth-child(2) {
  width: 20%;
  text-align: center;
}
.top10-table thead th:nth-child(3) {
  width: 15%;
}

.top10-table tbody td {
  padding: 16px 16px 22px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.top10-table tbody tr:last-child td {
  border-bottom: 0;
  padding-bottom: 26px;
}

/* ── Joueur ── */
td.player {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

td.player .medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 26px;
  text-align: center;
  flex-shrink: 0;
}

tr:not(.medal-1):not(.medal-2):not(.medal-3) td.player .medal {
  font-size: 15px;
  width: 24px;
  height: 24px;
  line-height: 24px;
  background: #1e293b;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
}

td.player .user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
}

td.player .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

td.player .username {
  font-weight: 600;
}

td.player .song {
  margin-left: 6px;
  color: var(--muted);
  font-size: 14px;
}

td.player .cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* ── Temps badge ── */
td.time {
  text-align: center;
  font-size: 0 !important;
}

.time-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 70px !important;
  height: 32px !important;
  background: var(--gold);
  color: #000;
  font-weight: 800;
  border-radius: 10px;
  font-size: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.15);
  line-height: 1 !important;
}

.medal-2 .time-badge {
  background: var(--silver);
}
.medal-3 .time-badge {
  background: var(--bronze);
}

/* ── Date ── */
td.date {
  color: var(--muted);
  font-size: 14px;
}

/* ── Highlight 1er ── */
.medal-1 td.player {
  color: var(--gold);
}
.medal-1 .username {
  font-weight: 700;
}
.medal-1 .time-badge {
  box-shadow:
    0 0 8px rgba(255, 209, 102, 0.45),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

/* ── h1 ── */
h1 {
  font-size: clamp(20px, 3.5vw, 28px) !important;
  line-height: 1.1 !important;
}

h1 .sub {
  font-size: 0.8em !important;
}

/* ── Nav mobile 800px ── */
@media (max-width: 800px) {
  .nav-right .records-button,
  .nav-right .likes-button,
  .nav-right .logout-button,
  .nav-right .profile-link {
    display: none !important;
  }

  .lang-switcher {
    display: none !important;
  }

  .nav-right .stats-button {
    font-size: 11px !important;
    padding: 4px 7px !important;
  }
  .profile-img {
    width: 26px !important;
    height: 26px !important;
  }
  .username {
    font-size: 12px !important;
  }

  .login-button-google {
    font-size: 12px !important;
    padding: 6px 12px !important;
    gap: 6px !important;
  }
  .login-button-google .google-icon {
    width: 16px !important;
    height: 16px !important;
  }
  .login-button-google span {
    display: inline !important;
  }
}

/* ── Mobile 720px : cards ── */
@media (max-width: 720px) {
  :root {
    --header-height: 52px;
    --bottom-safe: 12px;
  }

  .header-bar {
    height: 48px !important;
    padding: 0 8px !important;
    gap: 6px !important;
  }
  .brand {
    font-size: 13px !important;
    white-space: nowrap;
  }
  .header-tabs {
    gap: 4px !important;
  }
  .tab-link {
    font-size: 10px !important;
    padding: 4px 5px !important;
    white-space: nowrap !important;
  }
  .username {
    display: none !important;
  }

  .top10-container {
    padding: 0 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .top10-table thead {
    display: none;
  }

  .top10-table,
  .top10-table tbody {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .top10-table tr {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 8px 0;
    background: var(--panel);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    width: 100%;
  }

  .top10-table td {
    display: flex !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  .top10-table td.date {
    display: none !important;
  }
  .top10-table td[data-label]::before {
    display: none !important;
  }

  td.player {
    flex: 1 !important;
    gap: 8px !important;
    min-width: 0 !important;
    overflow: hidden;
  }

  td.player .cover {
    width: 40px !important;
    height: 40px !important;
  }
  td.player .avatar {
    width: 30px !important;
    height: 30px !important;
  }

  td.player .username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }

  td.player .song {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }

  td.time {
    flex-shrink: 0 !important;
  }

  .time-badge {
    font-size: 13px !important;
    width: auto !important;
    min-width: 52px !important;
    height: 28px !important;
    padding: 0 10px !important;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 18px !important;
  }
  .time-badge {
    font-size: 12px !important;
    min-width: 46px !important;
  }
  .tab-link span {
    display: none;
  }
  .tab-link {
    padding: 6px;
  }
}

@media (max-width: 768px) {
  .suggest-button {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   MODAL AUTH (Google / Twitch)
══════════════════════════════════════════════════════════ */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.auth-modal-box {
  position: relative;
  z-index: 10000;
  background: linear-gradient(180deg, #141a2a, #0f1423);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 40px 32px 32px;
  width: min(420px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  overflow: hidden;
}

.auth-modal-close {
  all: unset;
  position: absolute;
  top: 14px;
  right: 16px;
  color: #9aa3b2;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  z-index: 1;
}
.auth-modal-close:hover {
  opacity: 1;
  color: #fff;
}
.auth-modal-close:focus,
.auth-modal-close:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.auth-modal-title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: #9aa3b2;
  margin: 0 0 28px;
}

.auth-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.15s,
    opacity 0.15s;
  cursor: pointer;
}
.auth-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.auth-btn-google {
  background: #fff;
  color: #1e1b4b;
}

.auth-btn-twitch {
  background: #9146ff;
  color: #fff;
}

.auth-btn-discord {
  background: #5865f2;
  color: #fff;
  border: none;
}
.auth-btn-discord:hover {
  background: #4752c4;
}

/* ── Bouton connexion header ── */
a.login-button-google {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #1e1b4b;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s;
}
a.login-button-google:hover {
  opacity: 0.9;
  color: #1e1b4b;
}

/* ── Bouton hero CTA ── */
a.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #081018;
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
a.hero-cta:hover {
  opacity: 0.9;
  color: #081018;
}


/* ── Hamburger ── */
.hamburger-btn {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  z-index: 998;
}
.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hamburger-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}
.hamburger-overlay.open {
  display: block;
}

.hamburger-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #111827;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 20px 0 32px;
  overflow-y: auto;
}
.hamburger-panel.open {
  transform: translateX(0);
}

.hamburger-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #9aa3b2;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.5;
}
.hamburger-close:hover {
  color: #fff;
  opacity: 1;
}

.hamburger-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 2px solid rgba(99, 120, 255, 0.5);
}
.hamburger-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.hamburger-username {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hamburger-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 12px;
  flex: 1;
}
.hamburger-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  color: #e8eefc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid transparent;
  transition:
    background 0.15s,
    border-left 0.15s;
}
.hamburger-link:last-child {
  border-bottom: none;
}
.hamburger-link:hover {
  background: rgba(99, 120, 255, 0.08);
  border-left: 3px solid rgba(99, 120, 255, 0.6);
  color: #fff;
}
.hamburger-logout {
  color: #9aa3b2;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  border-left: 3px solid transparent;
}
.hamburger-logout:hover {
  color: #fff;
  background: rgba(255, 80, 80, 0.08);
  border-left: 3px solid rgba(255, 80, 80, 0.5);
}
.hamburger-suggest {
  margin-top: 8px;
}
.hamburger-login {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.hamburger-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 20px 0;
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  .nav-right .profile-link,
  .nav-right .stats-button,
  .nav-right .records-button,
  .nav-right .likes-button,
  .nav-right .suggest-button,
  .nav-right .logout-button,
  .nav-right .login-button-google,
  .nav-right .lang-switcher,
  .nav-right .username,
  .nav-right .profile-img,
  .header-tabs {
    display: none !important;
  }
  .nav-right {
    margin-left: auto;
    display: flex !important;
    align-items: center;
    gap: 8px;
    overflow: visible !important;
  }
  .header-bar {
    height: 56px !important;
    padding: 0 12px !important;
    gap: 0 !important;
  }
}
