/* Events Discord — liste des tournois et page d'un tournoi */

/* ------------------------------------------------------------ badges */

.game-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.game-badge.lol { background: rgba(214, 180, 106, 0.16); color: #ecd193; border: 1px solid rgba(214, 180, 106, 0.45); }
.game-badge.valorant { background: rgba(255, 79, 100, 0.14); color: #ff9aa7; border: 1px solid rgba(255, 79, 100, 0.45); }
.status-badge { border: 1px solid var(--line-strong); color: var(--text-muted); }
.status-badge.live { border-color: rgba(79, 232, 204, 0.6); color: var(--neon); }
.status-badge.live::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
  animation: blink 1.4s ease infinite;
}
.status-badge.done { border-color: rgba(255, 211, 107, 0.5); color: var(--gold); }
@keyframes blink { 50% { opacity: 0.3; } }

/* ------------------------------------------------------------ liste */

.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 6, 24, 0.5);
  color: var(--text-muted);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.filter:hover { color: var(--text); border-color: var(--violet-soft); }
.filter.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--violet), var(--sakura-deep)); }

.event-section { margin-bottom: 40px; }
.event-section .section-title { margin-bottom: 16px; }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.event-card {
  --accent: var(--violet-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--panel);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.event-card.lol { --accent: #d6b46a; }
.event-card.valorant { --accent: #ff4f64; }
.event-card:hover { color: var(--text); transform: translateY(-5px); box-shadow: 0 20px 44px rgba(5, 2, 15, 0.6), 0 0 34px -12px var(--accent); }
.event-top { display: flex; gap: 8px; flex-wrap: wrap; }
.event-card h3 { margin: 4px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1; color: var(--ice-1); }
.event-card .meta { margin: 0; color: var(--text-muted); font-size: 15px; }
.event-card .champ-line { font-weight: 700; color: var(--gold); }
.event-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; }
.event-foot .go { font-family: var(--font-label); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.empty-events { max-width: 520px; margin: 0 auto; }

/* ---------------------------------------------------- formulaire tournoi */

.t-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.t-form .span-2 { grid-column: 1 / -1; }
.t-form .check-field { display: flex; align-items: flex-end; padding-bottom: 10px; }
@media (max-width: 600px) { .t-form { grid-template-columns: 1fr; } }
.game-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 6, 24, 0.5);
  cursor: pointer;
  text-align: center;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.game-option input { position: absolute; opacity: 0; pointer-events: none; }
.game-option.lol:has(input:checked) { border-color: #d6b46a; color: #ecd193; box-shadow: 0 0 24px -8px #d6b46a; }
.game-option.valorant:has(input:checked) { border-color: #ff4f64; color: #ff9aa7; box-shadow: 0 0 24px -8px #ff4f64; }
.game-option:has(input:focus-visible) { outline: 2px solid var(--neon); outline-offset: 2px; }

/* ------------------------------------------------------------ tournoi */

.t-head { text-align: center; margin-bottom: 18px; }
.t-head .back { display: inline-block; margin-bottom: 12px; font-family: var(--font-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.t-head .back:hover { color: var(--ice-1); }
.t-badges { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.t-meta { margin: 10px 0 0; color: var(--text-muted); font-size: 17px; }
/* Lecture seule pour un membre qui n'a pas créé le tournoi : petite mention discrète. */
.t-lock { margin: 6px 0 0; color: var(--text-dim); font-size: 14px; }
.t-desc { max-width: 760px; margin: 0 auto 20px; white-space: pre-line; color: var(--text-muted); text-align: center; }

.champion-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 211, 107, 0.55);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 211, 107, 0.22), rgba(10, 6, 24, 0.7));
  box-shadow: 0 0 50px -16px var(--gold);
  text-align: center;
}
.champion-banner .lbl { font-family: var(--font-label); font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.champion-banner .name { font-family: var(--font-display); font-size: 44px; line-height: 1; color: #fff2c9; text-shadow: 0 0 24px rgba(255, 211, 107, 0.6); }
.champion-banner .players { width: 100%; color: var(--text-muted); font-size: 15px; }

.tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0 auto 22px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 6, 24, 0.6);
}
.tab {
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, var(--violet), var(--sakura-deep)); }

.notice-line { text-align: center; margin: 0 0 16px; }
.preview-tag { display: block; text-align: center; margin-bottom: 12px; color: var(--text-dim); font-family: var(--font-label); letter-spacing: 0.18em; text-transform: uppercase; font-size: 14px; }

/* ------------------------------------------------------------ bracket */

.bracket-scroll { overflow-x: auto; padding: 6px 4px 18px; }
.bracket { position: relative; display: flex; gap: 46px; width: max-content; margin: 0 auto; }
.bracket svg.connectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.connectors path { fill: none; stroke: rgba(182, 162, 255, 0.35); stroke-width: 2; }
.connectors path.lit { stroke: var(--sakura); filter: drop-shadow(0 0 4px var(--sakura)); }
.round { display: flex; flex-direction: column; width: 230px; }
.round-name {
  margin-bottom: 12px;
  text-align: center;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--neon);
}
.round-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }

.match {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 10, 36, 0.88);
  color: var(--text);
  text-align: left;
  overflow: hidden;
  font: inherit;
}
button.match { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
button.match:hover { border-color: var(--neon); box-shadow: 0 0 20px -6px var(--neon); transform: translateY(-1px); }
.match.ready { border-color: rgba(79, 232, 204, 0.45); }
.match.bye { opacity: 0.55; border-style: dashed; }
.match .bo {
  position: absolute;
  top: 50%;
  right: -1px;
  transform: translateY(-50%);
  padding: 1px 6px;
  border-radius: 6px 0 0 6px;
  background: var(--night-600);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: none;
}
.slot { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; }
.slot + .slot { border-top: 1px solid var(--line); }
.slot .seed { min-width: 18px; font-family: var(--font-display); font-size: 16px; color: var(--text-dim); text-align: center; }
.slot .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.slot .score { min-width: 24px; text-align: center; font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--text-muted); }
.slot.tbd .tname { color: var(--text-dim); font-weight: 400; font-style: italic; }
.slot.win { background: linear-gradient(90deg, rgba(240, 138, 216, 0.2), transparent); }
.slot.win .tname { color: #fff; }
.slot.win .score { color: var(--sakura); }
.slot.lose .tname,
.slot.lose .score { color: var(--text-dim); }
.slot .ff { font-size: 11px; font-weight: 700; color: var(--bad); letter-spacing: 0.08em; text-transform: uppercase; }

.third-place { margin-top: 26px; display: flex; flex-direction: column; align-items: center; }
.third-place .round { width: 230px; }

/* ------------------------------------------------------- championnat */

.rr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .rr-layout { grid-template-columns: 1fr; } }
.standings .table { min-width: 0; }
.standings td.rank { font-family: var(--font-display); font-size: 22px; color: var(--text-dim); width: 44px; text-align: center; }
.standings tr.first td.rank { color: var(--gold); }
.standings td.num-cell { text-align: center; font-variant-numeric: tabular-nums; }
.journees { display: grid; gap: 14px; }
.journee h3 { margin: 0 0 8px; font-family: var(--font-label); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; font-size: 14px; color: var(--neon); }
.journee .rr-matches { display: grid; gap: 8px; }
.rr-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 10, 36, 0.8);
  color: var(--text);
  font: inherit;
  text-align: left;
}
button.rr-match { cursor: pointer; }
button.rr-match:hover { border-color: var(--neon); }
.rr-match .b { text-align: right; }
.rr-match .mid { font-family: var(--font-display); font-size: 22px; color: var(--text-muted); min-width: 64px; text-align: center; }
.rr-match .w { color: var(--sakura); font-weight: 700; }
.rr-match .l { color: var(--text-dim); }

/* ------------------------------------------------------------ équipes */

.teams-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.team-list { display: grid; gap: 10px; }
.team-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 6, 24, 0.5);
}
.team-row .seed { font-family: var(--font-display); font-size: 26px; color: var(--violet-soft); text-align: center; }
.team-row .tname { font-weight: 700; font-size: 18px; }
.team-row .players { color: var(--text-muted); font-size: 14px; }
.team-row .row-actions { display: flex; gap: 4px; }
.team-row .row-actions .btn-icon { width: 30px; height: 30px; min-height: 30px; font-size: 13px; }
.players-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .players-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------- saisie du score */

.score-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 16px; }
.score-side { display: grid; gap: 8px; justify-items: center; text-align: center; }
.score-side .tname { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.score-side .input { width: 90px; text-align: center; font-family: var(--font-display); font-size: 34px; min-height: 60px; }
.score-vs { font-family: var(--font-display); font-size: 30px; color: var(--sakura); }
.danger-zone { border: 1px solid rgba(255, 95, 132, 0.35); }

/* ------------------------------------------ onglets de la catégorie Events */

/* Tournois | Création de game : mêmes onglets que la page d'un tournoi, mais en liens. */
.events-nav { margin-bottom: 28px; }
.events-nav a.tab { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.events-nav a.tab[aria-current="page"] { color: #fff; background: linear-gradient(135deg, var(--violet), var(--sakura-deep)); }
