:root {
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Light theme */
  --color-bg: #f5f5f7;
  --color-bg-elevated: #ffffff;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  /* >>> ICI : nouvelle couleur accent orange */
  --color-accent: #f97316; /* orange */
  --color-accent-soft: rgba(249, 115, 22, 0.12);
}

html[data-theme="dark"] {
  --color-bg: #050816;
  --color-bg-elevated: #0b1220;
  --color-text: #e5e7eb;
  --color-muted: #9ca3af;
  --color-border: #1f2937;
  /* >>> ICI aussi en orange, un peu plus chaud */
  --color-accent: #fb923c;
  --color-accent-soft: rgba(251, 146, 60, 0.18);
}


/* RESET SIMPLE */

*,
*::before,
*::after {
  box-sizing: border-box;
}


/* score à droite de chaque joueur */
.match-score {
  min-width: 1.4rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text);
  opacity: 0.9;
}


body {
  margin: 0;
  font-family: var(--font-family);
  /* Light par défaut : fond uni propre */
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] body {
    background:
    radial-gradient(circle at top left, #33281f 0, transparent 40%),
    radial-gradient(circle at bottom right, #111827 0, transparent 45%),
    var(--color-bg);
}



/* HEADER */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.92),
    rgba(15, 23, 42, 0.72)
  );
}

html[data-theme="light"] .app-header {
  background: rgba(245, 245, 247, 0.92);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.bracket-match {
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--color-bg-elevated, rgba(15, 23, 42, 0.85));
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bracket-match-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: 0.2rem;
}

.bracket-player {
  padding: 0.15rem 0.35rem;
  justify-content: space-between;
  display: flex;
  border-radius: 0.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  font-size: 0.8rem;
}

/* =======================
   ADMIN PANEL
   ======================= */

#view-admin {
  padding: 3rem 6vw;
}

#view-admin h2 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

#view-admin .tournament-subtitle {
  margin-bottom: 1.5rem;
}

/* conteneur */
.admin-tournaments {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* carte */
.admin-card {
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.98),
      rgba(15, 23, 42, 0.93)
    );
  border-radius: 1rem;
  padding: 1.3rem 1.5rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* header de carte */
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-card-header h3 {
  font-size: 1.1rem;
}

.admin-status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  text-transform: lowercase;
}

/* grille des champs */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.3rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.admin-field span {
  color: rgba(156, 163, 175, 0.9);
}

.admin-field input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 0.9rem;
  outline: none;
}

.admin-field input:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.5);
}

/* actions */
.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.admin-card-actions button {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease, color 0.12s ease;
}

/* bouton principal (Create / Enregistrer) */
.admin-btn-save,
.admin-btn-create {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(251, 146, 60, 0.45);
}

.admin-btn-save:hover,
.admin-btn-create:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(251, 146, 60, 0.6);
}

/* reset = neutre */
.admin-btn-reset {
  background: rgba(30, 64, 175, 0.15);
  color: #e5e7eb;
  border: 1px solid rgba(129, 140, 248, 0.6);
}

.admin-btn-reset:hover {
  background: rgba(79, 70, 229, 0.25);
}

/* delete = danger */
.admin-btn-delete {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.8);
}

.admin-btn-delete:hover {
  background: rgba(248, 113, 113, 0.28);
}

/* bloc "Créer un nouveau tournoi" un peu plus mis en avant */
.admin-card:first-child {
  border-style: dashed;
  border-color: rgba(251, 146, 60, 0.7);
}


/* Cliquable + hover */
.bracket-player.clickable {
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.bracket-player.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Gagnant / perdant */
:root {
  --color-success: #22c55e;
  --color-danger: #ef4444;
}

.bracket-player.winner {
  border-color: var(--color-success);
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.08);
}

.bracket-player.loser {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.06);
  opacity: 0.9;
}



.logo-mark {
  width: 80px;      /* ajuste la taille comme tu veux */
  height: 80px;
 
  display: block;
}

.logo-text {
  margin-left: -3%;
  margin-top: -4%;
  font-weight: 600;
  font-size: 1.2rem;
}


.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 0.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-status {
  font-size: 0.8rem;
  color: var(--color-muted);
  min-width: 80px;
}

/* THEME TOGGLE */

.theme-toggle {
  border: none;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* HAMBURGER */

/* HAMBURGER */

.hamburger-btn {
  display: none; /* visible seulement en mobile via @media */
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.hamburger-btn span {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-text);
  transform: translateX(-50%);
  transition: transform 0.18s ease-out, opacity 0.18s ease-out, top 0.18s ease-out;
}

/* position des 3 barres */
.hamburger-btn span:nth-child(1) {
  top: 10px;
}

.hamburger-btn span:nth-child(2) {
  top: 16px;
}

.hamburger-btn span:nth-child(3) {
  top: 22px;
}

/* état “ouvert” -> croix */
.hamburger-btn.open span:nth-child(1) {
  top: 16px;
  transform: translateX(-50%) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  top: 16px;
  transform: translateX(-50%) rotate(-45deg);
}



/* NAVIGATION MOBILE */

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
  z-index: 24;
}

.mobile-nav-backdrop.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 260px;
  max-width: 80%;
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-border);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  z-index: 25;
  display: flex;
  flex-direction: column;
  padding: 0.9rem 0.9rem 1.2rem;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.mobile-nav-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.mobile-nav-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-muted);
}

.mobile-nav-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-size: 0.9rem;
}

.mobile-nav-section {
  padding-top: 0.3rem;
  border-top: 1px solid var(--color-border);
}

.mobile-nav-section:first-of-type {
  border-top: none;
}

.mobile-nav-link {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.45rem 0.2rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text);
}

.mobile-nav-link.primary {
  background: linear-gradient(135deg, var(--color-accent), #ea580c);
  color: white;
  margin-top: 0.35rem;
}

.mobile-nav-link.danger {
  color: #f97373;
  margin-top: 0.35rem;
}

.mobile-nav-link:hover {
  background: var(--color-accent-soft);
}

.mobile-nav-user {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 0.3rem;
}


/* LAYOUT GENERAL */

.app-main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding:  0.2rem 3rem;
}

/* VUES (SPA light) */

.view {
  display: none;
}

.view.active {
  display: block;
}

/* HERO */

.hero {
  padding: 2rem 0 1.5rem;
}

.hero-text {
  max-width: 650px;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.hero p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* BOUTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn.primary {
background: linear-gradient(135deg, var(--color-accent), #ea580c);  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.btn.ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn.small {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
}

.btn.full {
  width: 100%;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

/* LIEN TEXTE */

.link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--color-accent);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

/* SECTIONS */

.section {
  margin-top: 0.1rem;
  padding: 1.3rem 1rem 1rem;
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.6)
  );
  border-radius: 1.25rem;
  border: 1px solid var(--color-border);
}

html[data-theme="light"] .section {
  background: var(--color-bg-elevated);
}

.section-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}

.section-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* CARDS */

.cards-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 1rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--color-border);
}

html[data-theme="light"] .card {
  background: var(--color-bg);
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.card-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.card-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}

.card-body {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.card-body p {
  margin: 0 0 0.4rem;
}

.card-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
}

.card-list li + li {
  margin-top: 0.1rem;
}

.card-footer {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

/* TABLEAU CLASSEMENT */

.table-wrapper {
  margin-top: 1.25rem;
  overflow-x: auto;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ranking-table th,
.ranking-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.ranking-table thead {
  background: rgba(15, 23, 42, 0.9);
}

html[data-theme="light"] .ranking-table thead {
  background: var(--color-bg);
}

.ranking-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.65);
}

html[data-theme="light"] .ranking-table tbody tr:hover {
  background: rgba(243, 244, 246, 1);
}

/* MODALES */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 30;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-bg-elevated);
  border-radius: 1rem;
  padding: 1rem 1.2rem 1rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-muted);
}

.modal-footer {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--color-muted);
}

/* FORMULAIRES */

.form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.form-field span {
  color: var(--color-muted);
}

.form-field input {
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  background: var(--color-bg);
  color: var(--color-text);
}

.form-field input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* FOOTER */

.app-footer {
  margin-top: auto;
  padding: 1rem 1.5rem 1.6rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.pill-countdown {
  border-color: var(--color-accent);
  color: var(--color-accent);
}


.admin-tournaments {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-card-title {
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.admin-card-sub {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.admin-card-actions {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn.admin-small {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
}

.admin-input-row {

    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;

}

.admin-input {

  padding: 0.25rem 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: 0.8rem;

}

html[data-theme="dark"] .admin-input {
  background: rgba(15, 23, 42, 0.95);
}


/* UTILITAIRES */

/* Bouton logout (desktop) */
.logout-icon {
  background: transparent;
  border: none;
  padding: 0;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logout-icon i {
  color: #f97373;         /* rouge doux */
  font-size: 0.95rem;
}

.logout-icon:hover i {
  color: #fb5151;         /* un peu plus vif au survol */
}

.logout-icon:focus-visible {
  outline: 2px solid #fb5151;
  outline-offset: 2px;
}


.hidden {
  display: none !important;
}

.detail-header-top {
display: flex;
  justify-content: space-between;
  margin-bottom: 10px;

}

/* RESPONSIVE */

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }

  .card-badge {
  font-size: 0.6rem;
}

  .app-header {
    padding: 0.5rem 0.9rem;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    z-index: 30;
  }

  .logo-text {
    font-size: 0.95rem;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: auto;
  }

  .auth-status {
    display: none; /* on ne l'affiche que dans le panneau mobile */
  }

  /* On cache les boutons Connexion / Inscription dans le header
     sur mobile : ils seront dans le panneau slide */
  .header-right .btn.small {
    display: none;
  }

  /* Le hamburger devient visible sur mobile */
  .hamburger-btn {
    display: flex;
  }

  .theme-toggle {
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  }

  .app-main {
    padding-inline: 1rem;
  }

  .section {
    padding-inline: 0.9rem;
  }

  .app-footer {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }

  .tournament-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Panneau mobile commence sous le header */
  .mobile-nav {
    top: 93px;                /* hauteur approximative du header */
    height: calc(100% - 56px);
  }

  .mobile-nav-backdrop {
    top: 40px;
    height: calc(100% - 56px);
  }
}







/* DÉTAIL TOURNOI */

.tournament-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.1rem;
}

.tournament-subtitle {
  margin: 0.25rem 0 0.6rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.tournament-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-muted);
}

.badge-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  white-space: nowrap;
}

.divider {
  margin: 1rem 0 0.8rem;
  border: 0;
  border-top: 1px solid var(--color-border);
  opacity: 0.9;
}

.subsection-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}


/* BRACKET V2 : arbre avec podium au centre */

.bracket-layout {
  margin: 0.8rem 0;
  display: flex;
  padding: 0 1rem 0 1rem;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;      /* centre tout le bloc */
  max-width: 100%;            /* évite le gros vide sur les côtés */
}


.bracket-side {
  flex: 0 0 auto;               /* largeur minimale, ne s’étire plus */
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}


.bracket-side-right {
  justify-content: flex-start;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 115px;
  max-width: 180px;
  
}

.bracket-round-title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.match-card {
  position: relative;
  border-radius: 0.7rem;
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.55rem;
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.78rem;
}

html[data-theme="light"] .match-card {
  background: var(--color-bg);
}

.match-label {
  font-size: 0.7rem;
  color: var(--color-muted);
  margin-bottom: 0.18rem;
}

.match-player {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
}

.match-player + .match-player {
  margin-top: 0.22rem;
  border-top: 1px dashed var(--color-border);
  padding-top: 0.22rem;
}

/* placeholders : "Vainqueur R1M1", "Perdant demi-finale" */
.match-player.placeholder span {
  color: var(--color-muted);
  font-style: italic;
}


.country-select {
  position: relative;
}

.country-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  cursor: pointer;
  font-size: 0.9rem;
}

html[data-theme="light"] .country-select-trigger {
  background: var(--color-bg);
}

.country-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.country-label {
  flex: 1;
  text-align: left;
  font-size: 0.9rem;
}

.country-arrow {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Menu */
.country-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 0.6rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
  padding: 0.25rem 0;
  display: none;
}

html[data-theme="light"] .country-select-menu {
  background: var(--color-bg);
}

.country-select-menu.open {
  display: block;
}


.match-body {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.match-player-main {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.match-player-flag {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.6);
}

.match-player-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* placeholders et vainqueur restent comme avant */
.match-player.placeholder .match-player-main {
  opacity: 0.7;
}

.match-player.is-winner {
  border-radius: 0.4rem;
  box-shadow: 0 0 0 1px var(--color-accent);
}


.country-option {
  width: 100%;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
}

.country-option:hover {
  background: rgba(148, 163, 184, 0.15);
}





/* CENTRE : podium + finales */

.bracket-center {
  width: 540px;          /* un peu plus large */
  min-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  align-self: center;    /* se centre verticalement dans le layout */
}


.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.4rem;
}

.podium-item {
  flex: 1; /* base */
  min-width: 0;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.7rem 0.7rem 0.4rem 0.4rem;
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  position: relative;
}

.podium-item.first {
  flex: 1.4;                 /* plus large pour le 1er */
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.podium-item .place {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
}

.podium-item .name {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-muted);
  font-size: 0.75rem;        /* un chouilla plus petit */
}

html[data-theme="light"] .podium-item {
  background: var(--color-bg-elevated);
}

/* 👑 Couronne au-dessus du 1er */
.podium-item.first::before {
  content: "👑";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.75rem;
}

/* bloc finale + match 3e place */

.bracket-finals {
  border-radius: 0.9rem;
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.55rem;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}


.bracket-player-content {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Contenu texte du podium (flag + pseudo) */
.podium-item .name {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

/* wrapper interne (on peut aussi le cibler, mais c'est optionnel) */
.podium-name-content {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Drapeau dans le podium */
.podium-flag {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}


.bracket-flag {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}


html[data-theme="light"] .bracket-finals {
  background: var(--color-bg-elevated);
}

.bracket-finals-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-align: center;
  color: var(--color-muted);
}

/* Même largeur pour toutes les cartes du bracket côté gauche/droit */
.bracket-side .match-card {
  min-width: 180px;   /* ajuste 170 / 190 / 200px selon le rendu que tu veux */
}


/* Responsive bracket */

@media (max-width: 900px) {
  .bracket-layout {
    /* On garde l’alignement horizontal */
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1rem;

    /* On autorise le scroll horizontal */
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
  }

  /* Le centre reste au milieu, pas en premier */
  .bracket-center {
    order: 0;
    margin-top: 25px;
    min-width: 300px;
  }

  .bracket-side,
  .bracket-side-right {
    justify-content: flex-start;
  }
}


/* TOASTS (notifications) */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 40;
  pointer-events: none; /* les clics passent à travers sauf sur le bouton */
}

.toast {
  min-width: 240px;
  max-width: 320px;
  padding: 0.6rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.96);
  color: var(--color-text);
  font-size: 0.85rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  animation: toast-in 0.18s ease-out forwards, toast-out 0.25s ease-in forwards 3s;
  pointer-events: auto;
}

html[data-theme="light"] .toast {
  background: var(--color-bg-elevated);
}

.toast-icon {
  font-size: 1rem;
  margin-top: 0.05rem;
}

.toast-message {
  flex: 1;
}

.toast-close {
  border: none;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

/* variantes */
.toast-success {
  border-color: var(--color-accent);
}

.toast-success .toast-icon {
  color: var(--color-accent);
}

.toast-error {
  border-color: #f97373;
}

.toast-error .toast-icon {
  color: #f97373;
}

.tournament-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

/* bouton désactivé */
.btn[disabled],
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* Animations */
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}

/* position plus centrée sur mobile */
@media (max-width: 820px) {
  .toast-container {
    left: 0;
    right: 0;
    bottom: 1rem;
    align-items: center;
  }

  .toast {
    max-width: min(360px, 90vw);
  }
}




/* RESPONSIVE spécifique détail tournoi */

@media (max-width: 820px) {
  .tournament-header {
    flex-direction: column;
    align-items: flex-start;
  }
}



/* === Bouton icône dans la nav === */
.icon-button {
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 1.2rem;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.icon-button:hover {
  background: rgba(148, 163, 184, 0.16);
  transform: translateY(-1px);
}

/* === PANEL DE CHAT === */

.chat-panel {
  position: fixed;
  top: 0;
  right: 0;                /* si tu le veux à gauche: remplace par left:0 */
  width: 340px;
  max-width: 100%;
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid var(--color-border);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 999;
}

.chat-panel.open {
  transform: translateX(0);
}

html[data-theme="light"] .chat-panel {
  background: var(--color-bg-elevated);
}

/* Header */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.chat-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.chat-close {
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
}

.chat-close:hover {
  background: rgba(148, 163, 184, 0.16);
}

/* Scrollbar custom pour le chat */

/* Firefox */
.chat-messages {
  scrollbar-width: thin; /* "auto" | "thin" */
  scrollbar-color: rgba(148, 163, 184, 0.8) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.8);
  border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(248, 250, 252, 0.9);
}


/* Liste de messages */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.chat-message {
  padding: 0.35rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

html[data-theme="light"] .chat-message {
  background: var(--color-bg);
}

/* header de chaque message */

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.12rem;
}

/* petit drapeau dans le chat (si tu l'utilises) */
.chat-flag {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7);
}

/* Pseudo cliquable : on garde le nom .chat-nickname */
.chat-nickname {
  background: transparent;          /* enlève le fond blanc du <button> */
  border: none;                     /* enlève la bordure par défaut */
  padding: 0;                       /* pas de padding bouton */
  margin: 0;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.78rem;
}

.chat-nickname-admin {
  color: #bb0707;              /* tu peux mettre #f97316 si tu veux plus orange */
}

/* Modérateur = bleu */
.chat-nickname-mod {
  color: #1078f7;
}

.chat-nickname:hover {
  color: var(--color-accent);
}

.chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.chat-badge-admin {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.5);
  color: #bb0707;
}

.chat-badge-mod {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.5);
  color: #1078f7;
}

/* ==== MINI MODAL CHAT USER ==== */

.chat-user-modal {
  width: min(360px, 90vw);
  padding: 1rem 1.1rem 0.9rem;
}

.chat-user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.chat-user-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-user-flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7);
}

.chat-user-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.chat-user-nickname {
  font-weight: 600;
  font-size: 0.9rem;
}

.chat-user-badge {
  font-size: 0.7rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-start;
}

/* couleur du badge suivant le rôle */
.chat-user-badge-admin {
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.chat-user-badge-mod {
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.5);
  color: #bfdbfe;
}

.chat-user-badge-member {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
}

.chat-user-meta {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-bottom: 0.8rem;
}

.chat-user-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.user-action-btn {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.9);
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}

.user-action-btn:hover {
  border-color: var(--color-accent);
}

.user-action-btn.warn {
  border-color: rgba(234, 179, 8, 0.8);
  color: #fbbf24;
}

.user-action-btn.danger {
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}



/* badge de rôle à côté du pseudo dans le chat */
.chat-role-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* variantes de couleur pour les rôles */
.chat-role-badge.admin {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.6);
}

.chat-role-badge.moderator {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.6);
}

.chat-role-badge.staff {
  background: rgba(52, 211, 153, 0.18);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.6);
}

/* timestamp à droite */

.chat-time {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--color-muted);
}

/* texte du message */

.chat-text {
  font-size: 0.78rem;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Formulaire */

.chat-form {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.4rem;
}

.chat-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

html[data-theme="light"] .chat-input {
  background: var(--color-bg);
}

.chat-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* === OVERLAY DU MINI-MODAL CHAT === */

.chat-user-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65); /* voile sombre */
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
}

.chat-user-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* === CARD DU MINI-MODAL === */

.chat-user-modal-card {
  width: 280px;
  max-width: 92vw;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 0.9rem;
  border: 1px solid var(--color-border);
  padding: 0.8rem 0.9rem 0.85rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  font-size: 0.8rem;
}

html[data-theme="light"] .chat-user-modal-card {
  background: var(--color-bg-elevated);
}

/* Header */

.chat-user-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.chat-user-id {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-user-flag {
  width: 16px;
  height: 11px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.chat-user-name {
  font-weight: 600;
  font-size: 0.82rem;
}

/* badge principal dans le mini-modal */
.chat-user-main-badge {
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-user-main-badge.admin {
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.6);
}

.chat-user-main-badge.mod {
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.7);
}

.chat-user-main-badge.member {
  background: rgba(148, 163, 184, 0.18);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.chat-user-modal-close {
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
}

.chat-user-modal-close:hover {
  background: rgba(148, 163, 184, 0.18);
}

/* Ligne infos */

.chat-user-modal-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
}

.chat-user-label {
  color: var(--color-muted);
}

/* Actions admin/modo */

.chat-user-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-user-action-btn {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
  text-align: center;
  background: rgba(15, 23, 42, 0.95);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.chat-user-action-btn.warn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #f9fafb;
  border-color: transparent;
}

.chat-user-action-btn.danger {
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.7);
}

.chat-user-action-btn:hover {
  filter: brightness(1.05);
}

/* Mobile */

@media (max-width: 640px) {
  .chat-user-modal-card {
    width: 92vw;
    padding: 0.75rem 0.8rem;
  }
}


.chat-send {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white;
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.06);
  white-space: nowrap;
}

.chat-send:hover {
  filter: brightness(1.05);
}

/* Petit ajustement mobile */
@media (max-width: 640px) {
  .chat-panel {
    width: 100%;
  }
}


/* ==========================
   MODAL PROFIL UTILISATEUR
   ========================== */

/* Overlay plein écran */
#user-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;                 /* masqué par défaut */
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
}

/* visible quand on ajoute .open et qu’on retire .hidden */
#user-profile-modal.open {
  display: flex;
}

#user-profile-modal.hidden {
  display: none;
}

/* Carte centrale */
.user-profile-modal {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  width: 380px;
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

html[data-theme="light"] .user-profile-modal {
  background: var(--color-bg-elevated);
}

/* Header du modal */

.user-profile-modal .modal-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#user-profile-title {
  font-size: 0.95rem;
  font-weight: 600;
}

#user-profile-close {
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.4rem;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
  cursor: pointer;
}

#user-profile-close:hover {
  background: rgba(148, 163, 184, 0.15);
}

/* Bloc principal : avatar + infos */

.user-profile-main {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem 0.75rem;
}

.user-profile-avatar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* DRAPEAU */
.user-profile-flag {
  width: 38px;
  height: 26px;
  border-radius: 0.4rem;       /* léger arrondi, plus de cercle bizarre */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

/* Infos texte */

.user-profile-info {
  flex: 1;
  min-width: 0;
}

.user-profile-topline {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

/* PSEUDO — PAS de fond blanc */
.user-profile-nickname {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0;                  /* au cas où un ancien style mettait du padding/fond */
  background: transparent;
  border-radius: 0;
}

.user-profile-country {
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* Rôle principal (admin / modo / membre) */

.user-profile-role-line {
  margin-bottom: 0.2rem;
}

.user-profile-main-role {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* variations selon le rôle interne */
.user-profile-main-role.admin {
  border-color: #fb923c;
  color: #fed7aa;
  background: rgba(234, 88, 12, 0.15);
}

.user-profile-main-role.mod {
  border-color: #38bdf8;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.15);
}

.user-profile-main-role.member {
  border-color: rgba(148, 163, 184, 0.5);
}

/* Meta (date d’inscription) */

.user-profile-meta {
  font-size: 0.78rem;
  color: var(--color-muted);
}

/* Tags custom (rôles perso) */

.user-profile-tags {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.user-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

/* Sections (Tournois / Actions) */

.user-profile-section {
  padding: 0.65rem 1.25rem 0.9rem;
  border-top: 1px solid var(--color-border);
}

.user-profile-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}

/* Tournois */

.user-profile-tournaments {
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-profile-tournament {
  padding: 0.15rem 0;
}

.user-profile-tournaments-empty {
  font-size: 0.78rem;
  color: var(--color-muted);
}

/* Scrollbar des tournois (optionnel) */
.user-profile-tournaments {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.8) transparent;
}
.user-profile-tournaments::-webkit-scrollbar {
  width: 6px;
}
.user-profile-tournaments::-webkit-scrollbar-track {
  background: transparent;
}
.user-profile-tournaments::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.8);
  border-radius: 999px;
}

/* Actions admin / modo */

.user-profile-section.hidden {
  display: none;
}

.user-profile-actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.user-profile-role-label {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.user-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.user-action-btn {
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.95);
  color: var(--color-text);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.user-action-btn.warn {
  border-color: #fbbf24;
  color: #facc15;
}

.user-action-btn.danger {
  border-color: #f97373;
  color: #fecaca;
}

.user-action-btn:hover {
  filter: brightness(1.06);
}

/* Responsive mobile */

@media (max-width: 640px) {
  #user-profile-modal {
    padding: 0.75rem;
  }

  .user-profile-modal {
    width: 100%;
    max-height: 85vh;
  }
}









