:root {
  --bg-main: #050505;
  --bg-secondary: #0f0f0f;
  --bg-tertiary: #1a1a1a;
  --accent-purple: #a238ff;
  --accent-purple-dim: #601f99;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --glass: rgba(5, 5, 5, 0.85);
  --font-heading: "Playfair Display", serif;
  --font-body: "Inter", sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: radial-gradient(
    circle at 50% 0%,
    #150525 0%,
    var(--bg-main) 60%
  );
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}
ul {
  list-style: none;
}

/* --- BOUTONS --- */
.btn-primary {
  background: var(--accent-purple);
  color: #fff;
  padding: 1rem 2.5rem; /* Plus grand (était 0.8rem 2rem) */
  border-radius: 2px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1rem; /* Plus grand (était 0.85) */
  letter-spacing: 1px;
  border: 1px solid var(--accent-purple);
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(162, 56, 255, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  padding: 1rem 2.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.btn-primary.small,
.btn-secondary.small {
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
}

/* --- HERO SECTION --- */
main {
  padding-top: 90px;
}

.hero {
  max-width: 1300px;
  margin: 0 auto;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  position: relative;
}

.hero-content {
  flex: 1;
  max-width: 650px;
  z-index: 2;
}

.subtitle {
  color: var(--accent-purple);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 1rem; /* Plus grand (était 0.8) */
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: block;
  opacity: 0.9;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 4.8rem; /* Plus grand (était 4) */
  line-height: 1.1;
  margin-bottom: 1.8rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--text-secondary);
  font-weight: 300;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.25rem; /* Plus grand (était 1.1) */
  margin-bottom: 3rem;
  max-width: 550px;
  font-weight: 300;
}

.cta-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-visual {
  position: absolute;
  right: 0;
  top: 5%;
  width: 600px; /* Plus grand (était 500) */
  height: 600px;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatPiece 6s ease-in-out infinite;
}

.hero-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(162, 56, 255, 0.15));
}

@keyframes floatPiece {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

@media (max-width: 900px) {
  .hero-visual {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    right: auto;
    top: auto;
    opacity: 0.6;
  }
}

/* --- PERSONAL STATS BAR --- */
.personal-stats {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 3rem 0;
  background: var(--bg-secondary);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-loading {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1rem;
}

.stats-content {
  display: flex;
  justify-content: center;
  gap: 8rem;
  width: 100%;
}

.stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-item .value {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.8rem; /* Plus grand (était 2) */
  color: var(--accent-purple);
  line-height: 1.2;
  margin-top: 0.3rem;
}

.stat-item .label {
  font-size: 0.9rem; /* Plus grand (était 0.75) */
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

/* --- HISTORIQUE DES PARTIES --- */
.history-section {
  max-width: 1100px;
  margin: 5rem auto;
  padding: 0 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 3rem; /* Plus grand (était 2.5) */
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.15rem; /* Plus grand (était 1) */
  font-weight: 300;
  margin-bottom: 2rem;
}

.separator {
  width: 70px;
  height: 4px;
  background: var(--accent-purple);
  margin: 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(162, 56, 255, 0.3);
}

.history-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  min-height: 250px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.state-message {
  padding: 5rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.table-responsive {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.history-table th {
  text-align: left;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem; /* Plus grand (était 0.75) */
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.history-table td {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
  font-size: 1.05rem; /* Taille de base augmentée */
}

.history-table tr:last-child td {
  border-bottom: none;
}

.history-table tr:hover {
  background: var(--bg-tertiary);
}

/* --- ÉLÉMENTS DU TABLEAU --- */
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px; /* Plus grand */
  border-radius: 4px;
  font-size: 0.85rem; /* Plus grand */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 140px; /* Plus large */
}

.result-badge.win {
  background: rgba(162, 56, 255, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(162, 56, 255, 0.3);
}

.result-badge.loss {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.result-badge.draw {
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  border: 1px solid var(--border-subtle);
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 15px;
}

.avatar-circle {
  width: 46px; /* Plus grand (était 38) */
  height: 46px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem; /* Plus grand */
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.player-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.player-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem; /* Plus grand */
}

.player-rating {
  font-size: 0.9rem; /* Plus grand */
  color: var(--text-secondary);
}

.game-type {
  color: var(--accent-purple);
  font-size: 1rem;
  font-weight: 500;
}

.accuracy-score {
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 1rem;
}
.accuracy-score.high {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
}
.accuracy-score.med {
  color: #f1c40f;
  background: rgba(241, 196, 15, 0.1);
}
.accuracy-score.low {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.date-text {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.95rem;
}

.btn-table-action {
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}

.btn-table-action:hover {
  color: var(--accent-purple);
  border-bottom: 1px solid var(--accent-purple);
}

/* --- FOOTER --- */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 5rem 2rem;
  background: var(--bg-main);
  margin-top: 5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 3rem;
}

.footer-brand {
  max-width: 350px;
}

.footer-brand h4 {
  font-family: var(--font-heading);
  font-size: 1.8rem; /* Plus grand */
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.footer-brand .dot {
  color: var(--accent-purple);
}
.footer-brand p {
  color: var(--text-secondary);
  font-size: 1rem;
  font-style: italic;
}

.footer-nav-group {
  display: flex;
  gap: 5rem;
}

.footer-col h5 {
  color: var(--accent-purple);
  font-family: var(--font-body);
  font-size: 0.9rem; /* Plus grand */
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.2s ease;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--text-primary);
  transform: translateX(5px);
}

.footer-copy {
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  margin-top: 2rem;
  color: #555;
  font-size: 0.9rem;
  text-align: center;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
  .hero h1 {
    font-size: 3.5rem;
  }
  .stats-content {
    flex-direction: column;
    gap: 3rem;
  }
  .cta-group {
    justify-content: center;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3rem;
  }
  .footer-nav-group {
    flex-direction: column;
    gap: 2.5rem;
    width: 100%;
  }
  .footer-col a:hover {
    transform: none;
  }
}
