/* ===== Mode Tournoi — wizard de configuration ===== */
.trn-page {
  min-height: 100vh;
  padding: 0 1.25rem 4rem;
  position: relative;
  z-index: 1;
}

.trn-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
}
.trn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #fff);
  text-decoration: none;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.trn-back:hover {
  background: rgba(255, 255, 255, 0.12);
}
.trn-header h1 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: #fbbf24;
}

.trn-intro {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 12px;
}
.trn-intro p {
  margin: 0;
  color: var(--text-secondary, rgba(255, 255, 255, 0.85));
  font-size: 0.95rem;
  line-height: 1.5;
}

.trn-section {
  max-width: 720px;
  margin: 0 auto 1.5rem;
}
.trn-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 1rem;
}
.trn-section-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary, #fff);
}
.trn-section-hint {
  margin: 0 0 0.75rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  font-size: 0.85rem;
}

.trn-selected-count {
  font-size: 0.85rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-weight: 600;
  white-space: nowrap;
}

/* Grille de jeux — sélection multiple ordonnée */
.trn-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}
.trn-game-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-primary, #fff);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  font-family: inherit;
  text-align: left;
}
.trn-game-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}
.trn-game-card.selected {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
}
.trn-game-card:active { transform: scale(0.97); }

.trn-game-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.trn-game-info {
  flex: 1;
  min-width: 0;
}
.trn-game-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trn-game-duration {
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
}
.trn-game-order {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  color: transparent;
  transition: all 0.15s;
}
.trn-game-order.active {
  background: #fbbf24;
  color: #1a1a2e;
}

/* Toggle rangées (manches, mode) */
.trn-rounds-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.trn-rounds-btn {
  flex: 1;
  min-width: 100px;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary, #fff);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.trn-rounds-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.trn-rounds-btn.selected {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fbbf24;
}

/* Récap + lancement */
.trn-launch-section {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.03));
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 16px;
  padding: 1.25rem;
}
.trn-recap {
  margin-bottom: 1rem;
}
.trn-recap-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.trn-recap-key {
  font-weight: 700;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  min-width: 110px;
}
.trn-recap-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}
.trn-launch-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a2e;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.trn-launch-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}
.trn-launch-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.trn-launch-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
}
.trn-launch-status {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  min-height: 1.2em;
}
.trn-launch-status.success { color: #4ade80; }
.trn-launch-status.error { color: #f87171; }

/* Bannière dans le hub menu */
.hub-tournament-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  margin: 0 1.25rem 16px;
  max-width: none;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.04));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 14px;
  color: var(--text-primary, #fff);
  text-decoration: none;
  transition: all 0.2s;
}
.hub-tournament-banner:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.08));
  transform: translateY(-2px);
}
.hub-tournament-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.hub-tournament-banner-text {
  flex: 1;
  min-width: 0;
}
.hub-tournament-banner-text strong {
  color: #fbbf24;
  display: block;
  font-size: 1rem;
  margin-bottom: 0.1rem;
}
.hub-tournament-banner-text span {
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  font-size: 0.85rem;
}
.hub-tournament-banner-arrow {
  font-size: 1.4rem;
  color: #fbbf24;
}

@media (min-width: 640px) {
  .hub-tournament-banner { margin: 0 2rem 16px; }
}

@media (min-width: 1024px) {
  .hub-tournament-banner { max-width: 960px; margin: 0 auto 16px; }
}

@media (max-width: 480px) {
  .trn-page { padding: 0 0.85rem 3rem; }
  .trn-section { margin-bottom: 1.25rem; }
  .trn-games-grid { grid-template-columns: 1fr; }
  .trn-rounds-btn { min-width: 0; font-size: 0.85rem; padding: 0.6rem 0.5rem; }
  .trn-recap-key { min-width: auto; }
  .hub-tournament-banner { padding: 0.75rem 0.85rem; }
}

/* ===== Tournament en jeu — bandeau + podium final ===== */

/* Bandeau fixed en haut quand un tournoi est actif (toujours visible) */
.gp-tournament-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.5rem 1rem 0.6rem;
  background: linear-gradient(135deg, rgba(35, 28, 12, 0.97), rgba(28, 22, 10, 0.97));
  border-bottom: 2px solid rgba(251, 191, 36, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Décalage du contenu pour ne pas être caché derrière le bandeau fixed.
   On utilise un spacer invisible injecté par CSS via ::before pour
   contourner les overrides existants sur body/.game-page-container. */
body.has-tournament-banner .game-page-container::before {
  content: "";
  display: block;
  height: var(--tournament-banner-h, 110px);
  width: 100%;
  flex-shrink: 0;
}
/* Fallback si .game-page-container::before n'est pas rendable, on tente body::before */
body.has-tournament-banner > .gp-app::before {
  content: "";
  display: block;
  height: var(--tournament-banner-h, 110px);
  width: 100%;
  flex-shrink: 0;
}
.gp-tournament-banner-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.gp-tournament-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.gp-tournament-banner-text {
  flex: 1;
  min-width: 0;
}
.gp-tournament-banner-text strong {
  display: block;
  color: #fbbf24;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-tournament-banner-text span {
  display: block;
  color: var(--text-secondary, rgba(255, 255, 255, 0.75));
  font-size: 0.8rem;
  margin-top: 0.1rem;
}
.gp-tournament-next-btn {
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a2e;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  animation: tournamentNextPulse 1.5s ease-in-out infinite;
}
.gp-tournament-next-btn:hover { filter: brightness(1.1); }
.gp-tournament-next-btn:active { transform: scale(0.97); }
.gp-tournament-next-btn.is-next-game {
  background: linear-gradient(135deg, #67e8f9, #22c55e);
}
@keyframes tournamentNextPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
}

body.has-tournament-round-ended #palmierRestartRow,
body.has-tournament-round-ended #auctionsRestartRow,
body.has-tournament-round-ended #mostlikelyRestart,
body.has-tournament-round-ended #llRestart,
body.has-tournament-round-ended #bombRestart,
body.has-tournament-round-ended #cnRestart,
body.has-tournament-round-ended #pictRestart,
body.has-tournament-round-ended #unanRestartBtn,
body.has-tournament-round-ended #ctrRestartBtn,
body.has-tournament-round-ended #tlRestartBtn,
body.has-tournament-round-ended #hrRestartBtn,
body.has-tournament-round-ended #bjRestartBtn,
body.has-tournament-round-ended #restartGameRow,
body.has-tournament-round-ended #blindtestRestart,
body.has-tournament-round-ended #cqRestartBtn,
body.has-tournament-round-ended #cqRestartBtn2,
body.has-tournament-round-ended #vdtRestart,
body.has-tournament-round-ended #vdtRestart2,
body.has-tournament-round-ended [data-bang-action="restart"],
body.has-tournament-round-ended [data-bj-action="restart"],
body.has-tournament-round-ended [data-ctr-action="restart"],
body.has-tournament-round-ended [data-hr-action="restart"],
body.has-tournament-round-ended [data-jug-action="restart"],
body.has-tournament-round-ended [data-lg-action="restart"],
body.has-tournament-round-ended [data-orc-action="restart"],
body.has-tournament-round-ended [data-pm-action="restart"],
body.has-tournament-round-ended [data-quiz-action="restart"],
body.has-tournament-round-ended [data-tl-action="restart"],
body.has-tournament-round-ended [data-tof-action="restart"],
body.has-tournament-round-ended [data-unan-action="restart"] {
  display: none !important;
}

/* Progress dans le sheet tournoi */
.gp-tournament-progress {
  text-align: center;
  margin: 0.5rem 0 1rem;
  padding: 0.6rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Podium final overlay */
.gp-tournament-final-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1rem;
  animation: tournamentOverlayIn 0.3s ease-out;
}
@keyframes tournamentOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.gp-tournament-final-card {
  max-width: 460px;
  width: 100%;
  background: linear-gradient(135deg, rgba(30, 25, 15, 0.98), rgba(20, 18, 10, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 22px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(251, 191, 36, 0.25);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  animation: tournamentCardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tournamentCardIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.gp-tournament-final-trophy {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 16px rgba(251, 191, 36, 0.5));
  animation: tournamentTrophy 1.5s ease-in-out infinite alternate;
}
@keyframes tournamentTrophy {
  from { transform: rotate(-3deg) scale(1); }
  to { transform: rotate(3deg) scale(1.05); }
}
.gp-tournament-final-title {
  font-size: 1.6rem;
  margin: 0.3rem 0;
  color: #fbbf24;
  font-weight: 700;
}
.gp-tournament-final-sub {
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}
.gp-tournament-final-podium {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.gp-tournament-final-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-align: left;
}
.gp-tournament-final-row.rank-1 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.06));
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}
.gp-tournament-final-row.rank-2 {
  background: rgba(192, 192, 192, 0.1);
  border-color: rgba(192, 192, 192, 0.3);
}
.gp-tournament-final-row.rank-3 {
  background: rgba(205, 127, 50, 0.1);
  border-color: rgba(205, 127, 50, 0.3);
}
.gp-tournament-final-medal {
  font-size: 1.6rem;
  width: 36px;
  text-align: center;
}
.gp-tournament-final-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-tournament-final-stats {
  font-size: 0.85rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gp-tournament-final-details {
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 1rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  font-size: 0.8rem;
  line-height: 1.4;
}
.gp-tournament-final-close {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a2e;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  font-family: inherit;
}
.gp-tournament-final-close:hover { filter: brightness(1.1); }
.gp-tournament-final-close:active { transform: scale(0.98); }

@media (max-width: 480px) {
  .gp-tournament-banner { padding: 0.55rem 0.75rem; }
  .gp-tournament-banner-text strong { font-size: 0.85rem; }
  .gp-tournament-banner-text span { font-size: 0.72rem; }
  .gp-tournament-next-btn { padding: 0.45rem 0.7rem; font-size: 0.78rem; }
  .gp-tournament-final-card { padding: 1.25rem 1rem; }
  .gp-tournament-final-title { font-size: 1.3rem; }
}

/* ===== Bandeau enrichi : top row + stepper ===== */
.gp-tournament-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.gp-tournament-banner-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Bouton "Terminer" — discret, à gauche du "Manche suivante" */
.gp-tournament-end-btn {
  padding: 0.45rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary, rgba(255, 255, 255, 0.85));
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.gp-tournament-end-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary, #fff);
}
.gp-tournament-end-btn:active { transform: scale(0.95); }

/* Stepper — bulles connectées montrant la progression */
.gp-tournament-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(251, 191, 36, 0.18);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gp-tournament-stepper::-webkit-scrollbar { display: none; }
.gp-tournament-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.2s;
}
.gp-tournament-step.step-past {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.6);
  color: #4ade80;
  font-weight: 700;
}
.gp-tournament-step.step-current {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.5), 0 0 0 3px rgba(251, 191, 36, 0.15);
  animation: stepperCurrentPulse 1.6s ease-in-out infinite;
}
@keyframes stepperCurrentPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(251, 191, 36, 0.5), 0 0 0 3px rgba(251, 191, 36, 0.15); }
  50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.7), 0 0 0 6px rgba(251, 191, 36, 0.1); }
}
.gp-tournament-step-link {
  flex-shrink: 0;
  width: 14px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
}
.gp-tournament-step-link.step-link-past {
  background: rgba(34, 197, 94, 0.5);
}

/* ===== Sheet : liste des jeux du parcours ===== */
.gp-tournament-games-title,
.gp-tournament-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}
.gp-tournament-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.gp-tournament-game-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  font-size: 0.9rem;
}
.gp-tournament-game-current {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2);
}
.gp-tournament-game-done {
  opacity: 0.65;
}
.gp-tournament-game-status { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }
.gp-tournament-game-icon { font-size: 1.1rem; flex-shrink: 0; }
.gp-tournament-game-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-tournament-game-current .gp-tournament-game-name { color: #fbbf24; }
.gp-tournament-game-detail {
  font-size: 0.78rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  white-space: nowrap;
  flex-shrink: 0;
}
.gp-tournament-game-current .gp-tournament-game-detail { color: rgba(251, 191, 36, 0.85); }

@media (max-width: 480px) {
  .gp-tournament-banner-actions { gap: 0.3rem; width: 100%; justify-content: flex-end; }
  .gp-tournament-end-btn { font-size: 0.72rem; padding: 0.35rem 0.55rem; }
  .gp-tournament-step { width: 18px; height: 18px; font-size: 0.6rem; }
  .gp-tournament-step.step-current { width: 26px; height: 26px; font-size: 0.85rem; }
  .gp-tournament-step-link { width: 8px; }
  .gp-tournament-game-item { padding: 0.45rem 0.6rem; font-size: 0.85rem; }
  .gp-tournament-game-detail { font-size: 0.7rem; }
}

/* ===== Onglets Créer / Rejoindre ===== */
.trn-tabs {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.3rem;
}
.trn-tab {
  flex: 1;
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.trn-tab:hover { color: var(--text-primary, #fff); }
.trn-tab.selected {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
}

/* ===== Rejoindre par code ===== */
.trn-join-row {
  display: flex;
  gap: 0.5rem;
}
.trn-join-input {
  flex: 1;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text-primary, #fff);
  font-size: 1.1rem;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.15s;
}
.trn-join-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(251, 191, 36, 0.5);
}
.trn-join-btn {
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a2e;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  font-family: inherit;
  white-space: nowrap;
}
.trn-join-btn:hover { filter: brightness(1.1); }
.trn-join-btn:active { transform: scale(0.97); }
.trn-join-status {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  min-height: 1.2em;
  text-align: center;
}
.trn-join-status.success { color: #4ade80; }
.trn-join-status.error { color: #f87171; }

/* ===== Listing des tournois publics ===== */
.trn-refresh-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-primary, #fff);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.15s;
}
.trn-refresh-btn:hover { background: rgba(255, 255, 255, 0.12); transform: rotate(90deg); }

.trn-lobbies-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}
.trn-lobby-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-primary, #fff);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: left;
}
.trn-lobby-card:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-2px);
}
.trn-lobby-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}
.trn-lobby-code {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fbbf24;
}
.trn-lobby-players {
  font-size: 0.85rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}
.trn-lobby-card-mid {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}
.trn-lobby-card-bottom {
  font-size: 0.78rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
}
.trn-lobbies-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

@media (max-width: 480px) {
  .trn-lobbies-list { grid-template-columns: 1fr; }
  .trn-tab { font-size: 0.85rem; padding: 0.55rem 0.5rem; }
}

/* ===== Tournament builder refresh ===== */
.trn-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

.trn-header {
  max-width: none;
  margin: 0 auto 0.75rem;
  padding: 1.15rem 0 0.75rem;
  position: relative;
  top: auto;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.trn-header-copy {
  min-width: 0;
}

.trn-kicker,
.trn-eyebrow,
.trn-step,
.trn-option-label {
  display: inline-flex;
  align-items: center;
  color: #67e8f9;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.trn-header h1 {
  margin-top: 0.1rem;
  color: #fff7d6;
  font-size: 1.55rem;
}

.trn-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: stretch;
  margin: 0 auto 1rem;
  padding: 1.25rem;
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(20, 184, 166, 0.09)),
    rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.trn-hero-copy h2 {
  margin: 0.35rem 0 0.45rem;
  max-width: 760px;
  color: var(--text-primary, #fff);
  font-size: 1.7rem;
  line-height: 1.08;
}

.trn-hero-copy p {
  margin: 0;
  max-width: 760px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.78));
  line-height: 1.5;
}

.trn-hero-scorecard {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.6rem;
  min-width: 260px;
}

.trn-recap-kpis div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 78px;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.trn-hero-scorecard div {
  display: flex;
  flex-direction: column;
  min-width: 58px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.trn-hero-scorecard span,
.trn-recap-kpis strong {
  color: #fbbf24;
  font-size: 1.3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.trn-hero-scorecard span {
  font-size: 1.45rem;
  line-height: 1;
}

.trn-hero-scorecard small,
.trn-recap-kpis span {
  color: var(--text-muted, rgba(255, 255, 255, 0.58));
  font-size: 0.78rem;
}

.trn-tabs {
  max-width: none;
  width: min(440px, 100%);
  margin: 0 0 1rem;
  border-radius: 10px;
}

.trn-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  align-items: start;
}

.trn-builder-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trn-section {
  max-width: none;
  margin: 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
}

.trn-section-header {
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.trn-section-title {
  margin-top: 0.15rem;
  font-size: 1.15rem;
}

.trn-section-hint {
  max-width: 760px;
  line-height: 1.45;
}

.trn-selected-count {
  border-radius: 8px;
}

.trn-preset-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.9rem;
}

.trn-preset-btn {
  min-height: 38px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-secondary, rgba(255, 255, 255, 0.78));
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.trn-preset-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.trn-preset-btn.selected {
  color: #102024;
  background: linear-gradient(135deg, #fbbf24, #67e8f9);
  border-color: transparent;
}

.trn-games-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
}

.trn-game-card {
  min-height: 76px;
  display: grid;
  grid-template-columns: 30px 38px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
}

.trn-game-card.selected {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(45, 212, 191, 0.08));
}

.trn-game-icon {
  font-size: 1.55rem;
  text-align: center;
}

.trn-game-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.trn-game-name,
.trn-game-duration {
  display: block;
}

.trn-game-name {
  white-space: normal;
  line-height: 1.18;
}

.trn-game-duration {
  color: rgba(255, 255, 255, 0.57);
}

.trn-game-order,
.trn-game-order.active {
  border-radius: 8px;
}

.trn-selected-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.trn-route-empty {
  padding: 1rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.58));
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  text-align: center;
}

.trn-route-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
  background: rgba(7, 12, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.trn-route-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #102024;
  background: #fbbf24;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.trn-route-main {
  min-width: 0;
}

.trn-route-title {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
}

.trn-route-title strong,
.trn-route-title span {
  display: block;
}

.trn-route-title strong {
  color: var(--text-primary, #fff);
  line-height: 1.2;
}

.trn-route-title span:not(.trn-route-icon) {
  margin-top: 0.12rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.58));
  font-size: 0.82rem;
}

.trn-route-icon {
  width: 30px;
  text-align: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.trn-route-config {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.7rem;
}

.trn-round-stepper,
.trn-route-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.trn-round-stepper span,
.trn-route-select span,
.trn-route-note {
  padding: 0 0.3rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.75));
  font-size: 0.78rem;
  font-weight: 800;
}

.trn-round-stepper button,
.trn-route-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #fff);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.trn-round-stepper button:hover:not(:disabled),
.trn-route-actions button:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.17);
  border-color: rgba(251, 191, 36, 0.38);
}

.trn-round-stepper button:disabled,
.trn-route-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.trn-round-stepper input {
  width: 44px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #fbbf24;
  text-align: center;
  font: inherit;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.trn-route-select select {
  min-height: 30px;
  max-width: 150px;
  border: 0;
  border-radius: 8px;
  padding: 0 0.55rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary, #fff);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
}

.trn-route-actions {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  gap: 0.35rem;
}

.trn-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.trn-option-card {
  padding: 0.85rem;
  background: rgba(7, 12, 18, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
}

.trn-option-label {
  margin-bottom: 0.55rem;
}

.trn-rounds-btn {
  border-radius: 8px;
  min-height: 42px;
}

.trn-recap-card {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(251, 191, 36, 0.12), rgba(45, 212, 191, 0.055)),
    rgba(9, 13, 20, 0.82);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
}

.trn-recap-top h2 {
  margin: 0.15rem 0 0;
  color: var(--text-primary, #fff);
  font-size: 1.2rem;
}

.trn-recap-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.trn-recap-kpis div {
  min-height: 70px;
  padding: 0.65rem;
}

.trn-recap-line {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
}

.trn-recap-key {
  min-width: 0;
  color: #67e8f9;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.trn-recap-route {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.74));
}

.trn-recap-pill {
  display: block;
  margin: 0;
  border-radius: 8px;
  line-height: 1.25;
}

.trn-launch-btn {
  border-radius: 8px;
  letter-spacing: 0;
}

.trn-join-row {
  align-items: stretch;
}

.trn-join-input,
.trn-join-btn,
.trn-lobby-card,
.trn-lobbies-empty {
  border-radius: 8px;
}

/* ===== Final tournament results refresh ===== */
.gp-tournament-final-card {
  max-width: 680px;
  border-radius: 14px;
}

.gp-tournament-final-podium {
  gap: 0.65rem;
}

.gp-tournament-final-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  border-radius: 8px;
}

.gp-tournament-final-row.rank-1 {
  transform: translateY(-1px);
}

.gp-tournament-final-stats {
  display: inline-flex;
  gap: 0.55rem;
}

.gp-tournament-final-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
  background: transparent;
}

.gp-tournament-final-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.gp-tournament-final-kpis span {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary, #fff);
  font-weight: 900;
}

.gp-tournament-final-kpis small {
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  font-size: 0.72rem;
  font-weight: 700;
}

.gp-tournament-final-history {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gp-tournament-final-history-title {
  color: #67e8f9;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gp-tournament-final-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.75));
}

.gp-tournament-final-history-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary, #fff);
}

.gp-tournament-final-close {
  border-radius: 8px;
}

@media (max-width: 900px) {
  .trn-hero,
  .trn-builder {
    grid-template-columns: 1fr;
  }

  .trn-hero-scorecard {
    min-width: 0;
    justify-content: flex-start;
  }

  .trn-recap-card {
    position: static;
  }
}

@media (max-width: 620px) {
  .trn-page {
    padding-inline: 0.85rem;
  }

  .trn-hero {
    padding: 1rem;
  }

  .trn-hero-copy h2 {
    font-size: 1.35rem;
  }

  .trn-option-grid,
  .trn-recap-kpis,
  .gp-tournament-final-kpis {
    grid-template-columns: 1fr;
  }

  .trn-hero-scorecard {
    width: 100%;
    justify-content: space-between;
    gap: 0.9rem;
  }

  .trn-route-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .trn-route-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
  }

  .trn-route-config {
    align-items: stretch;
  }

  .trn-round-stepper,
  .trn-route-select {
    width: 100%;
    justify-content: space-between;
  }

  .trn-route-select select {
    flex: 1;
    max-width: none;
  }

  .gp-tournament-final-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .gp-tournament-final-stats {
    grid-column: 2;
    flex-wrap: wrap;
    white-space: normal;
  }
}
