/* Neutralise les comportements mobile sur les chiffres */
table,
td,
.stat-value,
.number,
.score,
.count {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}
/* =========================================================
   SAURON — PUBLIC CORE
   ========================================================= */

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

html,
body {
  height: 100%;
  background-color: #0B0B0B;
  color: #E0E0E0;
  font-family: Inter, Roboto, Arial, sans-serif;
}

/* =========================================================
   PUBLIC MAIN SCROLL
   ========================================================= */

main {
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding-bottom: 40px;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

h2 {
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

p {
  color: #B5B5B5;
}

/* =========================================================
   PUBLIC NAVIGATION
   ========================================================= */

.public-nav {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid #1F1F1F;
}

.public-nav a {
  color: #B5B5B5;
  text-decoration: none;
  font-weight: 500;
}

.public-nav a:hover {
  color: #E0E0E0;
}
/* =========================================================
   PUBLIC NAV — LAYOUT SPLIT
   ========================================================= */

.public-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid #1F1F1F;
}

/* Zones */
.nav-left {
  display: flex;
  gap: 1.5rem;
}

.nav-center {
  display: flex;
  justify-content: center;
  pointer-events: none; /* déco pure */
}

.nav-right {
  display: flex;
  justify-content: flex-end;
}

/* =========================================================
   SAURON EYE — NAVBAR
   ========================================================= */

.nav-sauron-eye {
  height: 34px;
  opacity: 0.85;

  filter:
    drop-shadow(0 0 10px rgba(255, 60, 60, 0.6))
    drop-shadow(0 0 25px rgba(255, 0, 0, 0.35));

  animation: sauron-blink 8s infinite ease-in-out;
  transform-origin: center;
}

/* =========================================================
   HOME HEADER
   ========================================================= */

.home-header {
  text-align: center;
  margin: 40px 0 30px 0;
}

.home-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.home-subtitle {
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #7A0015;
}

/* =========================================================
   WEEKLY LEADERBOARD (HOME)
   ========================================================= */

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 30px;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.leaderboard td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  padding: 6px 6px;
}

.rank {
  width: 40px;
  text-align: right;
  opacity: 0.7;
}

.delta {
  text-align: right;
  font-weight: bold;
}

.new {
  color: #4caf50;
  margin-left: 4px;
}

/* =========================================================
   LEADERBOARD FOOTER (RESTORED)
   ========================================================= */

.leaderboard-footer {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* =========================================================
   LEADERBOARD BUTTON
   ========================================================= */

.toggle-btn {
  min-width: 180px;
  max-width: 280px;
  padding: 6px 8px;

  background: rgba(20, 20, 20, 0.35);
  color: #ddd;

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;

  cursor: pointer;
  text-align: center;
  text-decoration: none;

  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-btn:hover {
  background: rgba(30, 30, 30, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* =========================================================
   LEADERBOARD TABS
   ========================================================= */

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

.tab {
  padding: 6px 10px;
  border: 1px solid #333;
  background: #111;
  color: #ccc;
  text-decoration: none;
  font-size: 0.8rem;
}

.tab:hover {
  background: #222;
  color: #fff;
}

.tab.active {
  border-color: #7A0015;
  color: #7A0015;
}

.tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =========================================================
   MONTHLY TOP 3
   ========================================================= */

.monthly-top3 {
  margin-top: 40px;
  text-align: center;
}

.monthly-top3 h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.monthly-top3 li {
  margin: 6px 0;
  font-size: 0.95rem;
}

.monthly-top3 span {
  color: #7A0015;
  margin-left: 6px;
}

/* =========================================================
   NAV — SOON BADGE
   ========================================================= */

.nav-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.nav-soon {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: #888;
  margin-top: 2px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {
  .weekly-slot {
    flex: 0 0 100%;
  }

  .toggle-btn {
    width: 100%;
    max-width: none;
  }
}
/* =========================================================
   FIX — LEADERBOARD BUTTON ALIGNMENT
   ========================================================= */

/* Conteneur du bouton */
.leaderboard-footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

/* Bouton "Afficher le classement complet" */
.leaderboard-footer .toggle-btn {
  width: 100%;
  max-width: 260px;
  padding: 6px 8px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* =========================================================
   HOME — BANNIÈRE EN FOND (SAFE)
   ========================================================= */

/* Fond uniquement sur la home */
body:has(.home-page) {
  background-image: url("/static/img/hero-lords-sauron.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Assombrissement global pour lisibilité */
body:has(.home-page)::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}

body:has(.home-page) .weekly-slot {
  background: rgba(15, 15, 15, 0.80);
  border-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
}

body:has(.home-page) .card {
  background: rgba(15, 15, 15, 0.80); /* garde les autres cards lisibles */
}

/* Le menu reste dark */
body:has(.home-page) .public-nav {
  background: #0b0b0b;
}
/* =========================================================
   HIGHLIGHT TOP 5 — LEADERBOARD
   ========================================================= */

/* Base commune Top 5 */
.leaderboard tr:nth-child(-n+5) td {
  font-weight: 600;
}

/* #1 — rouge vif */
.leaderboard tr:nth-child(1) {
  color: #ffffff;
}
.leaderboard tr:nth-child(1) .rank {
  color: #ff5a5a;
}
.leaderboard tr:nth-child(1) td {
  border-bottom: 1px solid rgba(255, 90, 90, 0.45);
}

/* #2 */
.leaderboard tr:nth-child(2) .rank {
  color: #ff6f6f;
}

/* #3 */
.leaderboard tr:nth-child(3) .rank {
  color: #ff8a8a;
}

/* #4 */
.leaderboard tr:nth-child(4) .rank {
  color: #d66;
}

/* #5 */
.leaderboard tr:nth-child(5) .rank {
  color: #b55;
}
/* =========================================================
   LEADERBOARD — ESPACEMENT RANG / NOM
   ========================================================= */

.leaderboard .rank {
  width: 48px;
  text-align: right;
  padding-right: 12px;
}

.leaderboard .name {
  padding-left: 8px;     /* respiration avant le nom */
}
.weekly-slot::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 12px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.08),
    transparent
  );
}
.weekly-slot h2 {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ddd;
  margin-bottom: 10px;
}
.weekly-slot:first-child h2 {
  color: #ff5a5a;
}
/* =========================================================
   SAURON EYE — CENTER HOME
   ========================================================= */

.sauron-eye-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px 0 20px 0;
  pointer-events: none; /* pure déco */
}

.sauron-eye {
  width: 160px;
  max-width: 40vw;
  opacity: 0.85;

  filter:
    drop-shadow(0 0 25px rgba(255, 60, 60, 0.45))
    drop-shadow(0 0 60px rgba(255, 0, 0, 0.25));

  animation: sauron-blink 8s infinite ease-in-out;
  transform-origin: center;
}

/* =========================================================
   BLINK ANIMATION
   ========================================================= */

@keyframes sauron-blink {
  0%,
  45%,
  48%,
  100% {
    transform: scaleY(1);
  }

  46%,
  47% {
    transform: scaleY(0.08);
  }
}
/* =========================================================
   LEADERBOARD — HERO BACKGROUND
   ========================================================= */

.leaderboard-page {
  min-height: 100%;
  background-image: url("/static/img/hero-lords-sauron.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  position: relative;
}

/* Overlay sombre pour lisibilité */
.leaderboard-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 0;
}

/* Tout le contenu au-dessus */
.leaderboard-page > * {
  position: relative;
  z-index: 1;
}
/* =========================================================
   MODAL LOGIN
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.modal-box {
  position: relative;
  max-width: 360px;
  margin: 10vh auto;
  padding: 1.5rem;
  background: #0B0B0B;
  border: 1px solid #1F1F1F;
  border-radius: 8px;
}

.modal-box h2 {
  margin-bottom: 1rem;
}

.modal-box input {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
  background: #111;
  border: 1px solid #222;
  color: #E0E0E0;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
