:root {
  --line-color: #d4af37;
  --grid-line-color: rgba(255, 215, 0, 0.15);
  --event-bg: #1a1a1a;
  --event-border: #d4af37;
  --text-color: #fcf6ff;
  --point-bg: #0e0e0e;
  --timeline-padding: 50px;
  --site-title: "RSLX";
}

@font-face {
  font-family: 'American Captain';
  src: url('/style/American Captain.otf') format('opentype');
}

body {
  position: relative;
  background: url('/style/img/TITAN BACKGROUND.webp') top center no-repeat;
  background-size: cover;
  background-attachment: fixed;
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  overflow-x: hidden;
  padding-top: 70px; /* Compense la hauteur de la barre */
  z-index: -2;
  padding-bottom: 100px; /* hauteur de la bannière (60px) + marge de sécurité */
}

/* Overlay sombre */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: -1;
}

#page-title {
  font-family: 'American Captain', Impact, sans-serif;
  letter-spacing: 2px;
  font-size: 42px;
  color: var(--text-color);
  text-shadow: 0 0 12px rgba(212,175,55,0.25);
}

header,
.timeline-container,
.summary-box {
  position: relative;
  z-index: 1;
}

header {
  display: inline-block;
  text-align: center;
  font-family: 'American Captain', sans-serif;
  font-size: 48px;
  letter-spacing: 2px;
  margin: 10px 0;
  background: linear-gradient(to bottom, #feeec1, #e09f40);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(1px 1px 1px rgba(255, 255, 255, 0.2))
          drop-shadow(-1px -1px 1px rgba(0, 0, 0, 0.5));
}

.header-wrapper {
  text-align: center;
}

/* Timeline globale */
.timeline-container {
  overflow-x: hidden;
  padding: 0 50px;
}

.timeline {
  position: relative;
  display: flex;
  width: max-content;
  height: auto;
}

.date-column {
  flex: none;
  text-align: center;
  position: relative;
  padding: 0 2px;
  box-sizing: border-box;
  border-radius: 4px;
  overflow: hidden; /* nécessaire pour que le ::after ne déborde pas */
}

.date-column::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    #00ffdd00 0%,
    rgba(0,201,255,0.15) 20%,
    rgba(0,201,255,0.15) 80%,
    rgba(0,201,255,0) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}

.date-column.date-selected::after {
  opacity: 1;
}

.date-column .day,
.date-column .date {
  position: relative;
  z-index: 1;
}

.date-column .day {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.date-column .date {
  font-size: 13px;
}

/* Lignes de la timeline */
.date-column .grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--grid-line-color);
}

.timeline-line {
  position: absolute;
  top: 55px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--line-color);
}

/* Événements */
.event-block {
  position: absolute;
  background: var(--event-bg);
  border: 2px solid var(--event-border);
  padding: 4px;
  min-width: 50px;
  border-radius: 14px;
  text-align: center;
  box-sizing: border-box;

  /* 🔹 Ajout pour transition fluide */
  transition: background 0.5s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 0 0 rgba(0,201,255,0);
}

  .event-block.event-highlight {
    background: linear-gradient(
        90deg,
        rgba(0,201,255,0.15) 0%,
        rgba(0,201,255,0.05) 100%
    );
    box-shadow: 0 0 10px rgba(0,201,255,0.4);
    border-color: #00c9ff; /* léger bleu néon pour rappeler le highlight */
    }

.event-name {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 6px;
}

/* Points */
.points-container {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.point-box {
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, filter 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--point-bg);
  border: 2px solid var(--event-border);
  border-radius: 8px;
  flex: 1 1 40px;
  max-width: 40px;
  min-width: 18px;
  padding: 2px;
  width: 40px;
  box-shadow: inset 0 0 6px rgba(255, 215, 0, 0.25);
}

.point-box:hover {
  transform: scale(1.05);
}

.point-box:active {
  transform: scale(0.85);
}

.point-box img {
  width: 28px;
  height: 28px;
  flex: 1 1 28px;
  max-width: 28px;
  min-width: 18px;
  max-height: 28px;
  min-height: 18px;
  object-fit: contain;
}

.point-box span {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--line-color);
}

/* États des points */
.point-box.state-upcoming {
  border: 2px solid #e0e0e0;
  box-shadow: inset 0 0 6px rgba(212,175,55,0.25);
}

.point-box.state-upcoming img {
  filter: grayscale(100%);
}

.point-box.state-upcoming span {
  color: #e0e0e0;
}

.point-box.state-ongoing {
  border: 2px solid orange;
  box-shadow: inset 0 0 6px rgba(255,165,0,0.25);
}

.point-box.state-validated {
  border: 2px solid #4caf50;
  box-shadow: inset 0 0 6px rgba(76,175,80,0.25);
}

.point-box.state-validated span {
  color: #4caf50;
}

.point-box.state-passed {
  border: 2px solid red;
  box-shadow: inset 0 0 6px rgba(100,100,100,0.25);
}

.point-box.state-passed span {
  color: red;
}

.point-box.state-passed img {
  filter: grayscale(100%) sepia(100%) hue-rotate(-50deg) saturate(500%) brightness(80%);
}

/* Summary box */
.summary-box {
  position: relative;
  margin: 0 auto;
  max-width: 280px;
  text-align: center;
  background: #1a1a1a;
  border: 2px solid #d4af37;
  padding: 8px;
  border-radius: 14px;
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  display: block;
}

.summary-box div {
  margin-bottom: 6px;
}

/* Colonne du jour actuel */
.date-column.today {
  background: linear-gradient(
    to bottom,
    rgba(212,175,55,0) 0%,
    rgba(212,175,55,0.15) 20%,
    rgba(212,175,55,0.15) 80%,
    rgba(212,175,55,0) 100%
  );
}

/* Légende */
.legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 2px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.skipped { background-color: red; }
.legend-dot.in-progress { background-color: orange; }
.legend-dot.done { background-color: #4caf50; }
.legend-dot.not-started { background-color: #e0e0e0; }

/* Barre principale fixée */
.menu-bar {
  background: #1a1a1a;
  padding: 15px 0;
  display: flex;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10000000000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.menu-links {
  list-style: none;
  display: flex;
  gap: 40px;
  padding: 0;
  margin: 0;
}

.menu-links li {
  position: relative;
}

.dropdown-toggle {
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 10px 20px;
  transition: background 0.2s;
}

.dropdown-toggle:hover {
  background: #333;
  border-radius: 5px;
}

/* Dropdown niveau 1 */
.dropdown-content {
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  display: none;
  flex-direction: column;
  min-width: 180px;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  z-index: 10000000000;
}

.dropdown-content li a {
  color: white;
  padding: 10px;
  display: block;
  text-decoration: none;
  transition: background 0.2s;
}

.dropdown-content li a:hover {
  background: #444;
}

.dropdown:hover .dropdown-content {
  display: flex;
}

/* Sous-dropdown niveau 2 */
.dropdown-sub {
  position: relative;
}

.dropdown-sub-toggle {
  color: white;
  padding: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.dropdown-sub-toggle:hover {
  background: #444;
  border-radius: 5px;
}

.arrow {
  margin-left: 8px;
  font-size: 12px;
  transform: rotate(0deg);
  transition: transform 0.2s;
}

.dropdown-sub:hover .arrow {
  transform: rotate(90deg);
}

.dropdown-sub-content {
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 0;
  left: 100%;
  background: #222;
  display: none;
  flex-direction: column;
  min-width: 180px;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  z-index: 10000000001;
}

.dropdown-sub-content li a {
  padding: 10px;
  color: white;
  text-decoration: none;
  display: block;
}

.dropdown-sub-content li a:hover {
  background: #444;
}

.dropdown-sub:hover .dropdown-sub-content {
  display: flex;
}

/* Calculator */
.dropdown-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 300px;
  position: relative;
  z-index: 10000;
  margin: 0 auto;
}

select {
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  background-color: #2a2a2a;
  color: white;
  outline: none;
}

.hidden {
  display: none;
}

/* Tableau points */
#points-table-container {
  margin: 30px auto;
  max-width: 700px;
  overflow-x: auto;
  position: relative;
  z-index: 10000;
}

#points-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
}

#points-table th,
#points-table td {
  border: 1px solid var(--event-border);
  padding: 8px;
  background-color: var(--event-bg);
}

#points-table th {
  background: linear-gradient(to bottom, #feeec1, #e09f40);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#points-table td:first-child {
  text-align: left;
  font-weight: 600;
}

/* Bouton toggle */
.toggle-btn {
  background: linear-gradient(145deg, #1a1a1a, #2b2b2b);
  border: 2px solid #d4af37;
  color: #fcf6ff;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 10px 0;
}

#toggle-btn {
  display: none;
}

/* Résultat du calcul */
#calculation-result {
  width: 100%;
  text-align: center;
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  position: relative;
  z-index: 10000;
  margin-top: 15px;
  font-size: 15px;
  font-style: italic;
}

/* Inputs */
.points-inputs {
  display: flex;
  flex-direction: column;
  align-items: center;   /* centre le contenu horizontalement */
  justify-content: center;
  position: relative;
  z-index: 10000;
  gap: 10px;
  margin: 20px auto;     /* centre le bloc sur la page */
  flex-wrap: wrap;
  text-align: center;
  width: fit-content;    /* 👈 le bloc s’adapte à son contenu */
  max-width: 100%;       /* sécurité pour petits écrans */
}

.points-inputs label {
  font-size: 0.9rem;
  color: #fcf6ff;
  font-weight: 600;
}

.points-inputs input {
  background-color: #1a1a1a;
  color: #fcf6ff;
  border: none;
  border-radius: 6px;
  padding: 1rem;
  padding-right: 2.5rem;
  width: 100%;
  max-width: 200px;
  box-sizing: border-box;
}

/* Suppression des flèches sur les inputs numériques */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

/* Texte sous inputs */
.points-inputs span {
  font-size: 0.9rem;
  color: #fcf6ff;
}

#points-remaining {
  font-weight: bold;
  font-size: 16px;
}

/* === Harmonisation du lien "Home" === */
.menu-links > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0px 20px;
  color: white;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.menu-links > li > a:hover {
  background: #333;
  border-radius: 5px;
}

/* Empêche les couleurs par défaut du navigateur */
.menu-links > li > a:visited,
.menu-links > li > a:active {
  color: white;
}

/* --- Bannière Adsterra fixe en bas de page --- */
.adsense-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height:60px;
  background: #0e0e0e;
  border-top: 1px solid #d4af37;
  box-shadow: 0 -2px 10px rgba(212, 175, 55, 0.25);
  padding: 10px 0;
  z-index: 9998;
  display: flex;
  justify-content: center;
  align-items: center;
}

.adsense-footer iframe {
  border: none;
}

/* Masque la bannière sur mobile */
@media (max-width: 768px) {
  .adsense-footer {
    display: none;
  }
}

/* --- Événements terminés (finie avant aujourd'hui) --- */
.event-block.event-ended {
  background: repeating-linear-gradient(
    135deg,
    rgba(245, 37, 37, 0.1) 0px,
    rgba(245, 37, 37, 0.1) 4px,
    rgba(75, 75, 75, 0.1) 4px,
    rgba(75, 75, 75, 0.1) 8px
  );
  filter: grayscale(0);
  opacity: 1;
  border: 2px solid rgba(255, 9, 9, 0.25);
  box-shadow: none;
}

/* le titre grisé */
.event-block.event-ended .event-name {
  color: rgb(163, 1, 1);
}

/* les points restent lumineux */
.event-block.event-ended .point-box img {
  filter: none;
  opacity: 1;
}

/* --- Event terminé mais complètement validé --- */
.event-block.event-ended.validated {
  background: linear-gradient(135deg, rgba(0, 201, 100, 0.1), rgba(0, 201, 100, 0.05));
    background: repeating-linear-gradient(
    135deg,
    rgba(37, 245, 37, 0.1) 0px,
    rgba(37, 245, 37, 0.1) 4px,
    rgba(75, 75, 75, 0.1) 4px,
    rgba(75, 75, 75, 0.1) 8px
  );
  border: 2px solid rgba(0, 201, 27, 0.4);
  box-shadow: 0 0 10px rgba(0, 201, 27, 0.2);
  filter: none;
  opacity: 1;
}

.event-block.event-ended.validated .event-name {
  color: rgba(5, 136, 1, 0.85);
  text-shadow: 0 0 8px rgba(0, 255, 150, 0.4);
}

/* --- Event terminé partiellement complété --- */
.event-block.event-ended.partial {
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 165, 0, 0.08) 0px,
    rgba(255, 165, 0, 0.08) 4px,
    rgba(75, 75, 75, 0.08) 4px,
    rgba(75, 75, 75, 0.08) 8px
  );
  border: 2px solid rgba(255, 165, 0, 0.5);
  box-shadow: 0 0 8px rgba(255, 165, 0, 0.25);
  opacity: 1;
}

.event-block.event-ended.partial .event-name {
  color: rgba(255, 180, 0, 0.8);
  text-shadow: 0 0 6px rgba(255, 180, 0, 0.3);
}

/* Bouton reset individuel (événement) */
.event-reset {
  position: absolute;
  top: 4px;
  right: 6px;
  background: transparent;
  color: #d4af37;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 5;
}

.event-reset:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Bouton reset global (summary box) */
.global-reset {
  position: absolute;
  bottom: 6px;
  right: 10px;
  background: #1a1a1a;
  border: 1px solid #d4af37;
  color: #fcf6ff;
  font-size: 13px;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  transition: 0.2s;
}

.global-reset:hover {
  background: #d4af37;
  color: #1a1a1a;
}

/* Assure que la summary box soit en position relative */
.summary-box {
  position: relative;
}