/* ---------------------- */
/* Base générale          */
/* ---------------------- */

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #182642 0, #050816 45%, #02030a 100%);
  color: #e5e7eb;
  margin: 0;
}

/* Header & footer */

header,
footer {
  background: radial-gradient(circle at top, #111827 0, #020617 60%);
  padding: 16px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

footer {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  border-bottom: none;
}

/* Contenu principal */

section {
  max-width: 1200px;
  margin: 0 auto 3rem auto;
  padding: 20px 20px 40px;
}

/* Titres */

h1,
h2 {
  color: #f9fafb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
}

/* Sous-titre de la home (hors header) */

.site-subtitle-center {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  margin: 1.5rem 0 2.5rem;
  color: #e5f3ff;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.7);
}

/* Liens */

a {
  color: #e5f3ff;
  text-decoration: none;
}

a:hover {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

/* ---------------------- */
/* Header avec logos      */
/* ---------------------- */

.site-header {
  width: 100%;
  padding: 1.5rem 1.5rem 1rem;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), transparent);
}

.site-header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* équilibre parfait */
  align-items: center;
  max-width: 1140px;
  margin: 0 auto;
}

/* Logo boutique : aligné à gauche dans la colonne de gauche */
.header-left {
  justify-self: start;
}

/* Logo Riftbound : centré mathématiquement dans la page */
.header-center {
  justify-self: center;
}

/* colonne droite volontairement vide pour équilibrer */
.header-right {
}

/* Logos */
.site-logo {
  height: 90px;
  width: auto;
  object-fit: contain;
}

.shop-logo {
  max-height: 70px;
  opacity: 0.95;
}

.league-logo {
  max-height: 110px;
}

/* Responsive header */

@media (max-width: 768px) {
  .site-header-grid {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
    text-align: center;
  }

  .header-left,
  .header-center {
    justify-self: center;
  }

  .site-logo {
    height: 60px;
  }

  .shop-logo {
    max-height: 50px;
  }

  .league-logo {
    max-height: 70px;
  }
}

/* ---------------------- */
/* Tables = cartes        */
/* ---------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 65%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.85),
    0 0 0 1px rgba(148, 163, 184, 0.12);
}

th,
td {
  padding: 10px 12px;
  text-align: center;
}

th {
  background: linear-gradient(to right, #111827, #020617);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

td {
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
}

tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.75);
}

tbody tr:nth-child(odd) {
  background-color: rgba(3, 7, 18, 0.8);
}

tbody tr:hover {
  background: linear-gradient(
    to right,
    rgba(34, 197, 235, 0.14),
    rgba(56, 189, 248, 0.06)
  );
}

/* ---------------------- */
/* Boutons                */
/* ---------------------- */

button {
  padding: 6px 14px;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  font-weight: bold;
  background: linear-gradient(135deg, #22c55e, #22d3ee);
  color: #020617;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 30px rgba(34, 211, 238, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.8);
  filter: brightness(1.05);
}

.btn-delete {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: white;
}

.btn-delete:hover {
  background: linear-gradient(135deg, #ea580c, #dc2626);
}

.btn-delete-all {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  color: white;
}

/* Messages */

.message {
  margin-top: 15px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* ---------------------- */
/* Légendes : icônes      */
/* ---------------------- */

table td:first-child {
  text-align: left;   /* aligne verticalement image + texte */
}

.legend-icon {
  width: 56px;
  height: 56px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 10px;
  border-radius: 8px;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.legend-table table {
  width: 100%;
  border-collapse: collapse;
}

/* Wrapper top/bottom légendes sur la home */

.legends-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.legend-table {
  flex: 1 1 auto;
}

/* Responsive légendes */

@media (max-width: 800px) {
  .legends-wrapper {
    flex-direction: column;
  }

  .legend-icon {
    width: 42px;
    height: 42px;
  }

  .legend-table .legend-icon {
    width: 52px;
    height: 52px;
  }
}

/* ---------------------- */
/* Layout : légende       */
/* ---------------------- */

.legend-title {
  text-align: center;
  font-size: 2rem;
  margin: 1.5rem 0 2rem 0;
}

.legend-layout {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin: 2rem auto;
  max-width: 1200px;
  padding: 0 1rem;
}

.legend-side-image {
  flex: 0 0 260px;
}

.legend-side-image img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: cover;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(148, 163, 184, 0.25);
}

.legend-content {
  flex: 1 1 auto;
}

/* Responsive légende */

@media (max-width: 900px) {
  .legend-layout {
    flex-direction: column;
    align-items: center;
  }

  .legend-side-image {
    max-width: 260px;
  }

  .legend-content {
    width: 100%;
  }
}

/* ---------------------- */
/* Layout : joueur        */
/* ---------------------- */

.player-title {
  text-align: center;
  font-size: 2rem;
  margin: 1.5rem 0 2rem 0;
  width: 100%;
}

.player-layout {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin: 2rem auto;
  max-width: 1200px;
  padding: 0 1rem;
}

.player-side-image {
  flex: 0 0 260px;
  text-align: center;
}

.player-side-image img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: 0.5rem;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(148, 163, 184, 0.25);
}

.best-legend-caption {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #e5e7eb;
}

.player-content {
  flex: 1 1 auto;
}

/* Responsive joueur */

@media (max-width: 900px) {
  .player-layout {
    flex-direction: column;
    align-items: center;
  }

  .player-content {
    width: 100%;
  }

  .player-side-image {
    max-width: 260px;
  }
}

/* Couleurs pour les winrates */
.winrate-bad {
  color: #f97373;      /* rouge clair */
  font-weight: 600;
}

.winrate-avg {
  color: #facc15;      /* jaune/or */
  font-weight: 600;
}

.winrate-good {
  color: #4ade80;      /* vert vif */
  font-weight: 600;
}

/* Optionnel : léger glow sur les bons WR */
.winrate-good {
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.legend-meta {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.legend-top-player {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.legend-top-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.legend-top-name a {
  font-size: 1.1rem;
  font-weight: 600;
}

.legend-top-stats {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.legend-top-winrate {
  font-size: 1.4rem;
}

.player-meta {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.main-nav {
  text-align: center;
  margin-top: 0.75rem;
}

.main-nav a {
  display: inline-block;
  margin: 0 0.9rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
  text-decoration: none;
  position: relative;
}

/* petit underline animé au hover */
.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #22c55e, #22d3ee);
  transform: translateX(-50%);
  transition: width 0.18s ease-out;
}

.main-nav a:hover {
  color: #e5f3ff;
}

.main-nav a:hover::after {
  width: 70%;
}

/* Responsive : un peu plus d’espace */
@media (max-width: 768px) {
  .main-nav a {
    margin: 0 0.5rem;
    font-size: 0.8rem;
  }
}

/* Bloc Top 3 sur la home */

.overview-section {
  max-width: 1200px;
  margin: 0 auto 2.5rem auto;
  padding: 0 20px;
}

.overview-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.overview-card {
  flex: 1 1 280px;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(148, 163, 184, 0.3);
}

.overview-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.overview-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.overview-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  line-height: 3.4; 
}

.overview-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.overview-name {
  font-weight: 600;
}

.overview-meta {
  font-size: 0.85rem;
  color: #cbd5f5;
}

/* Responsive */
@media (max-width: 800px) {
  .overview-grid {
    flex-direction: column;
  }
}

/* Lignes de tableau cliquables */
.clickable-row {
  cursor: pointer;
}

/* On renforce un peu le hover pour les lignes cliquables */
.clickable-row:hover {
  background: linear-gradient(
    to right,
    rgba(34, 197, 235, 0.22),
    rgba(56, 189, 248, 0.1)
  );
}

.overview-list li:not(:last-child) {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

    .tournament-title {
  text-align: center;
  font-size: 2rem;
  margin: 1.5rem 0 2rem 0;
}

/* Résumé global */
.tournament-meta {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #cbd5f5;
}

/* Carte Top 3 joueurs du tournoi */
.tournament-top-card {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(148, 163, 184, 0.35);
}

.tournament-top-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.tournament-top-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tournament-top-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.tournament-top-list li:last-child {
  border-bottom: none;
}

.tournament-top-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tournament-top-rank {
  font-weight: 700;
  font-size: 1rem;
  color: #e5f3ff;
  width: 2rem;
}

.tournament-top-info {
  display: flex;
  flex-direction: column;
}

.tournament-top-name {
  font-weight: 600;
}

.tournament-top-meta {
  font-size: 0.85rem;
  color: #cbd5f5;
}

.overview-card {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.overview-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 22px 55px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(56, 189, 248, 0.35);
}

.tournament-top-card {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.tournament-top-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 22px 55px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(250, 204, 21, 0.35);
}

/* Animation d'apparition douce au scroll */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.winrate-pulse {
  display: inline-block;
  animation: pulse-soft 1.6s ease-in-out infinite;
  will-change: transform, filter;
}

@keyframes pulse-soft {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.6));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 18px rgba(74, 222, 128, 1));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.6));
  }
}

.tournament-results th:nth-child(2),
.tournament-results td:nth-child(2) {
  text-align: left;
}