/* ── Badges statut ─────────────────────────────────────────── */
.trn-badge {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.trn-badge-draft    { background: #3a3b40; color: #aaa; }
.trn-badge-open     { background: #1a3a2a; color: #57f287; }
.trn-badge-active   { background: #3a3010; color: #fee75c; }
.trn-badge-finished { background: #1a2a3a; color: #5865f2; }

/* ── Liste page /tournaments ───────────────────────────────── */
.trn-section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted, #aaa);
  margin: 2rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

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

.trn-card {
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: border-color .15s, transform .15s;
}
.trn-card:hover { border-color: #5865f2; transform: translateY(-2px); }
.trn-card-open   { border-color: #57f28740; }
.trn-card-active { border-color: #fee75c40; }

.trn-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.trn-card-desc {
  font-size: .85rem;
  color: var(--text-muted, #aaa);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trn-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .8rem;
  font-size: .8rem;
  color: var(--text-muted, #aaa);
  margin-top: auto;
}
.trn-card-date {
  font-size: .78rem;
  color: var(--text-muted, #aaa);
}

/* ── Liste historique ──────────────────────────────────────── */
.trn-list { display: flex; flex-direction: column; gap: .5rem; }

.trn-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 8px;
  padding: .75rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.trn-list-item:hover { background: #25262a; }
.trn-list-left  { display: flex; align-items: center; gap: .75rem; }
.trn-list-name  { font-weight: 600; }
.trn-list-right { display: flex; gap: 1.5rem; font-size: .85rem; color: var(--text-muted, #aaa); }

.trn-empty {
  text-align: center;
  color: var(--text-muted, #aaa);
  padding: 3rem 0;
  font-size: 1rem;
}

/* ── Hero page détail ──────────────────────────────────────── */
.trn-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.trn-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-start;
  justify-content: flex-end;
}
.trn-meta-chip {
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 8px;
  padding: .5rem .9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.trn-meta-label { font-size: .72rem; color: var(--text-muted, #aaa); text-transform: uppercase; letter-spacing: .05em; }
.trn-meta-val   { font-size: 1rem; font-weight: 700; }

.trn-cta {
  margin-top: 1.25rem;
  background: #1a2a3a;
  border: 1px solid #3a5a7a;
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .9rem;
  color: #8ab4e0;
}
.trn-cta code {
  background: #0d1a25;
  padding: .1rem .4rem;
  border-radius: 4px;
  font-family: monospace;
  color: #57f287;
}
.trn-cta-registered {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: #57f287;
  font-weight: 600;
}
.trn-unreg-btn {
  font-size: .82rem;
  padding: .35rem .85rem;
}

/* ── Flash message ──────────────────────────────────────────── */
.trn-flash {
  margin-top: 1rem;
  padding: .6rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
}
.trn-flash-success { background: #1a3a2a; border: 1px solid #57f28760; color: #57f287; }
.trn-flash-error   { background: #3a1a1a; border: 1px solid #ed444460; color: #ed4444; }

/* ── Tableau classement ─────────────────────────────────────── */
.trn-table-wrap { overflow-x: auto; }

.trn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.trn-table th, .trn-table td {
  padding: .65rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--border, #2e2f33);
}
.trn-table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted, #aaa);
  font-weight: 600;
}
.trn-table tbody tr:hover { background: #25262a; }
.trn-row-top { background: #1a1f30; }

.trn-rank    { width: 48px; text-align: center; font-size: 1.1rem; }
.trn-points  { color: #fee75c; }

.trn-player-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
}
.trn-player-link:hover { color: #5865f2; }
.trn-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Matchs du tournoi ──────────────────────────────────────── */
.trn-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.trn-match-card {
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 10px;
  padding: 1rem;
}
.trn-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
  gap: .5rem;
}
.trn-match-round { font-weight: 700; font-size: .85rem; color: #5865f2; }
.trn-match-link  { font-size: .8rem; color: #aaa; text-decoration: none; }
.trn-match-link:hover { color: #5865f2; }
.trn-match-date  { font-size: .75rem; color: #888; }

.trn-match-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.trn-match-player {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
}
.trn-winner .trn-match-name { font-weight: 700; color: #fee75c; }
.trn-match-pos  { width: 22px; color: #888; font-size: .78rem; }
.trn-match-pts  { margin-left: auto; color: #57f287; font-size: .78rem; }
.trn-match-more { font-size: .78rem; color: #888; padding-left: 22px; }

/* ── Inscrits ───────────────────────────────────────────────── */
.trn-reg-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.trn-reg-player {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .85rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s;
}
.trn-reg-player:hover { border-color: #5865f2; }
.trn-reg-mmr { font-size: .75rem; color: #aaa; }

/* ── Prize pool ──────────────────────────────────────── */
.trn-prize-chip { border-color: rgba(245,158,11,.35) !important; }
.trn-prize-link {
  color: #fbbf24;
  font-weight: 600;
  text-decoration: none;
  font-size: .8rem;
}
.trn-prize-link:hover { text-decoration: underline; }
.trn-card-prize {
  font-size: .72rem;
  font-weight: 600;
  color: #fbbf24;
  margin-top: .35rem;
}
.trn-card-checkin {
  font-size: .72rem;
  font-weight: 600;
  color: #fb923c;
  margin-top: .25rem;
}

/* ── Badges type de tournoi ─────────────────────────────────── */
.trn-type-badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.trn-type-points_swiss { background: #1e2a4a; color: #818cf8; border: 1px solid #3730a3; }
.trn-type-cup          { background: #2a1e3a; color: #c084fc; border: 1px solid #7e22ce; }
.trn-type-hyper_roll   { background: #1e3a2a; color: #34d399; border: 1px solid #065f46; }
.trn-type-round_robin  { background: #2a2a1e; color: #fbbf24; border: 1px solid #92400e; }
.trn-type-custom       { background: #2a1e1e; color: #f87171; border: 1px solid #7f1d1d; }

/* ── Barème de points ───────────────────────────────────────── */
.trn-scoring-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: 1rem;
}
.trn-scoring-label {
  font-size: .78rem;
  color: var(--text-muted, #aaa);
  margin-right: .25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.trn-scoring-chip {
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 6px;
  padding: .2rem .55rem;
  font-size: .75rem;
  color: #e0e0e0;
}
.trn-scoring-chip strong { color: #fee75c; }
.trn-scoring-zero { opacity: .45; }

/* ── Check-in banner ────────────────────────────────────────── */
.trn-checkin-banner {
  margin-top: 1rem;
  background: #2a1e0e;
  border: 1px solid #fb923c60;
  border-radius: 10px;
  padding: .85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .9rem;
  color: #fb923c;
}
.trn-checkin-ok { color: #57f287; font-weight: 700; }

/* ── Waitlist ────────────────────────────────────────────────── */
.trn-waitlist { display: flex; flex-direction: column; gap: .4rem; }
.trn-waitlist-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 8px;
  padding: .55rem .9rem;
  font-size: .88rem;
}
.trn-waitlist-pos {
  font-weight: 700;
  font-size: .8rem;
  color: #fee75c;
  min-width: 28px;
}

/* ── Inscrits : check-in dot ─────────────────────────────────── */
.trn-reg-checkin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.trn-ci-ok      { background: #57f287; }
.trn-ci-pending { background: #fb923c; }
.trn-reg-checked { border-color: #57f28740; }

/* ── Lobbies directs ─────────────────────────────────────────── */
.trn-round-section { margin-bottom: 2rem; }
.trn-round-title {
  font-size: 1rem;
  font-weight: 700;
  color: #5865f2;
  margin: 0 0 .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.trn-lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.trn-lobby-card {
  background: var(--card-bg, #1e1f22);
  border: 1px solid var(--border, #2e2f33);
  border-radius: 10px;
  padding: 1rem;
}
.trn-lobby-finished { border-color: #57f28730; }
.trn-lobby-active   { border-color: #fee75c30; }

.trn-lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
  gap: .5rem;
}
.trn-lobby-num {
  font-weight: 700;
  font-size: .9rem;
  color: #5865f2;
}
.trn-lobby-status-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.trn-lstatus-finished { background: #1a3a2a; color: #57f287; }
.trn-lstatus-active   { background: #3a3010; color: #fee75c; }
.trn-lstatus-pending  { background: #2a2a2a; color: #aaa; }

.trn-lobby-players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.trn-lobby-player {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .83rem;
}
.trn-lobby-winner .trn-lobby-name { font-weight: 700; color: #fee75c; }
.trn-lobby-pos  { width: 24px; color: #888; font-size: .76rem; flex-shrink: 0; }
.trn-lobby-name { flex: 1; text-decoration: none; color: inherit; }
.trn-lobby-name:hover { color: #5865f2; }
.trn-lobby-pts  { color: #57f287; font-size: .75rem; margin-left: auto; white-space: nowrap; }
.trn-lobby-empty { font-size: .8rem; color: #666; margin: 0; }
