/* Variables de couleur - alignées avec l'app */
:root {
  --bg: #f4efe6;
  --bg-soft: #fff8ee;
  --ink: #1f2a24;
  --blue: #1558c0;
  --light-blue: #8fb0e0;
  --orange: #d68c45;
  --light-grey: #d6c8b8;
  --danger: #9b2226;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  background: white;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue);
  text-decoration: none;
  
  @media screen and (max-width: 768px) {
    text-decoration: underline;
  }
}

/* Layout principal */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* En-tête */
.site-header {
  background: var(--blue);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.site-version {
  position: absolute;
  top: 8px;
  right: 10px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.9;
}

.header-content {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 14px;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 2.2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.header-logo img {
  width: 80px;
  height: 80px;
  display: block;
}

.header-logo:hover {
  color: #8fb0e0;
}

/* Menu toggle button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.menu-toggle svg {
  width: 40px;
  height: 40px;
  display: block;
}

/* Navigation */
.site-nav {
  font-size: 14px;
  display: flex;
  gap: 4px;
  padding-right: 2px;
  width: min(1000px, 100%);
  margin: 0 0 -14px 0;
  background: white;
}

.site-nav a {
  padding: 10px 0;
  text-decoration: none;
  color: var(--blue);
  background-color: white;
  font-weight: 600;
  transition: all 0.3s ease;
  flex: 1;
  text-align: center;
  border: 1px solid var(--light-grey);
  border-bottom: none;
}

.site-nav a:hover {
  color: var(--blue);
  background: var(--light-blue);
}

.site-nav a.active {
  background: white;
  color: var(--blue);
}

@media (min-width: 768px) {
  .site-nav {
    background-color: transparent;
  }

  .site-nav a {
    color: white;
    background-color: var(--blue);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }
}

/* Contenu principal */
.site-main {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 16px;
}

/* Pied de page */
.site-footer {
  color: white;
  background: var(--ink);
  border-top: 2px solid var(--light-grey);
  padding: 24px 16px;
  text-align: center;
  font-size: 0.9rem;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
}

/* Contenu des pages */
.page-content {
  background: var(--bg-soft);
  border: 1px solid var(--light-grey);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.page-content h1 {
  margin-top: 0;
  color: var(--blue);
  font-size: 2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-content h1 svg {
  width: 36px;
  height: 36px;
  color: var(--blue);
}

.page-content h2 {
  color: var(--blue);
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--light-grey);
}

.page-content p {
  line-height: 1.6;
  margin: 12px 0;
}

.page-content ul,
.page-content ol {
  line-height: 1.8;
  margin: 16px 0;
  padding-left: 24px;
}

/* Cartes d'explication */
.explanation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 24px 0;
  min-width: 0;
}

.explanation-card {
  background: #fff;
  border: 1px solid var(--light-grey);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.explanation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.explanation-card p {
  margin: 0;
  font-size: 0.95rem;
}

.explanation-card p:last-child {
  margin-top: auto;
  text-align: right;
}

.explanation-card .feature-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.explanation-card h3 {
  margin-top: 0;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 16px;
}

.explanation-card svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* Table de codes */
.codes-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.codes-table th {
  color: #000;
  background-color: var(--light-blue);
  padding: 6px 12px;
  text-align: left;
  font-weight: 500;
  border-bottom: 3px solid var(--blue);
}

.codes-table td {
  padding: 12px;
  border-bottom: 1px solid var(--light-grey);
}

.codes-table tbody tr:nth-child(odd) {
  background: #e6e6e6;
}

.codes-table tbody tr:nth-child(even) {
  background: #f0f0f0;
}

.codes-table tr:hover {
  background: #f9f6f1;
}

.code-badge {
  display: inline-block;
  font-weight: bold;
}

/* Milestones/Timeline */
.milestones {
  display: flex;
  gap: 24px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
  position: relative;
}

@keyframes shake {
  0%, 100% { transform: translateY(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateY(-3px); }
  20%, 40%, 60%, 80% { transform: translateY(3px); }
}

.milestone-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  background: white;
  border: 10px solid var(--blue);
  color: var(--blue);
  border-radius: 50%;
  font-weight: 700;
  font-size: 2rem;
  flex-shrink: 0;
  cursor: pointer;
}

.milestone-number:hover {
  animation: shake 1.3s ease-in-out;
}

.milestone-content {
  text-align: center;
  font-weight: 600;
}

.milestone-arrow {
  position: absolute;
  right: -36px;
  top: -40px;
  font-size: 4rem;
}

.milestone:last-child .milestone-arrow {
  display: none;
}

/* Responsive design */
@media (max-width: 768px) {
  .milestones {
    flex-direction: column;
    gap: 48px;
  }

  .milestone {
    position: relative;
  }

  .milestone-arrow {
    position: absolute;
    right: auto;
    top: 100px;
    transform: translateX(0) rotate(90deg);
    font-size: 2rem;
    font-weight: bold;
  }

  .milestone:last-child .milestone-arrow {
    display: block;
  }

  .header-content {
    flex-direction: row;
    padding: 14px;
  }

  .menu-toggle {
    display: block;
  }

  .site-header {
    flex-direction: row;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 4px;
    right: 4px;
    flex-direction: column;
    border-bottom: 2px solid var(--light-grey);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 8px 0;
    gap: 0;
    width: auto;
  }

  .site-nav.active {
    display: flex;
  }

  .site-nav a {
    padding: 12px 16px;
    border-bottom: none;
    border-left: 3px solid transparent;
    flex: auto;
    text-align: left;
  }

  .site-nav a.active {
    border-bottom: none;
    background: white;
    color: var(--blue);
  }

  .site-main {
    padding: 20px 12px;
  }

  .page-content {
    padding: 20px;
  }

  .page-content h1 {
    font-size: 1.6rem;
  }

  .explanation-grid {
    grid-template-columns: 1fr;
  }
}

.points-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-width: 0;
}

/* Grille pour la section résumé des statistiques */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 24px 0;
}

.summary-grid .avg-by-game {
  grid-column: span 2;
}

.summary-grid .global-avg {
  grid-column: span 1;
}

@media (max-width: 768px) {
  .points-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-grid .avg-by-game,
  .summary-grid .global-avg {
    grid-column: span 1;
  }
}
