/* ANk esport — feuille de style principale */

:root {
  --bg: #070a11;
  --bg-soft: #0d1220;
  --surface: #121a2a;
  --surface-2: #172135;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eaeff8;
  --muted: #8d99b0;
  --accent: #ff4655;
  --accent-2: #ffb03a;
  --accent-soft: rgba(255, 70, 85, 0.14);
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Rajdhani', 'Inter', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(255, 70, 85, 0.16), transparent 60%),
    radial-gradient(900px 500px at 105% 5%, rgba(64, 120, 255, 0.14), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin: 0 0 12px;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 12px; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.nowrap { white-space: nowrap; }

/* ---------- Barre supérieure ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 10, 17, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(255, 70, 85, 0.22), rgba(255, 176, 58, 0.12));
  border: 1px solid var(--line-strong);
  flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 1.1rem; }
.brand-text small { color: var(--muted); font-size: 0.72rem; }

.nav { display: none; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav a.is-active { color: #fff; background: var(--accent-soft); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 8px 12px; font-size: 0.86rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(120deg, #ff4655, #ff7a3d);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 70, 85, 0.28);
}
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-danger { background: rgba(255, 70, 85, 0.12); border-color: rgba(255, 70, 85, 0.5); color: #ffd8dc; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Avatar ---------- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  flex: 0 0 auto;
}
.avatar-xs { width: 24px; height: 24px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: #fff; background: linear-gradient(140deg, #ff4655, #ff7a3d); }
.avatar-lg { width: 84px; height: 84px; }

/* ---------- Page & sections ---------- */
.page { display: block; }

.section { padding: 26px 0; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; }
.section-head .eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--accent);
}

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.34;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 17, 0.55), rgba(7, 10, 17, 0.96));
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding: 40px 16px 34px;
  max-width: 1200px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2.15rem;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.hero h1 span { color: var(--accent); }
.hero p.lead { color: #c9d3e6; max-width: 620px; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ---------- Cartes ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card-elevated { box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title h3 { margin: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.badge-accent { background: var(--accent-soft); border-color: rgba(255, 70, 85, 0.45); color: #ffc9ce; }
.badge-new { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.45); color: #b6f0c8; }
.badge-warn { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.45); color: #fadfa6; }
.badge-live { background: rgba(255, 70, 85, 0.2); border-color: rgba(255, 70, 85, 0.6); color: #ffd6da; }
.badge-finished { background: rgba(255, 255, 255, 0.06); }
.badge-pending { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.4); color: #fadfa6; }
.badge-validated { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.4); color: #b6f0c8; }
.badge-rejected { background: rgba(255, 70, 85, 0.14); border-color: rgba(255, 70, 85, 0.4); color: #ffc9ce; }

/* ---------- Grilles ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-2, .grid-3, .grid-4 { display: grid; grid-template-columns: 1fr; gap: 14px; }

.stat-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.stat {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.stat strong { font-family: var(--font-display); font-size: 1.7rem; display: block; }
.stat span { color: var(--muted); font-size: 0.82rem; }

/* ---------- Tournois ---------- */
.tour-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.tour-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.tour-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}
.tour-cover img { width: 100%; height: 100%; object-fit: cover; }
.tour-cover .badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tour-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tour-body h3 { margin: 0; font-size: 1.12rem; }
.tour-info { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 0.84rem; }
.tour-info span { display: inline-flex; align-items: center; gap: 6px; }
.tour-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  width: 100%;
}
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #ff4655, #ffb03a); }

/* ---------- Joueurs ---------- */
.player-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.player-card .meta { min-width: 0; flex: 1; }
.player-card h3 { margin: 0 0 2px; font-size: 1.02rem; }
.player-card .sub { color: var(--muted); font-size: 0.8rem; }
.player-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.player-stats b { color: var(--text); font-weight: 600; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }
.rank-row .pos { font-family: var(--font-display); font-size: 1.1rem; width: 30px; color: var(--muted); }
.rank-row.top1 .pos { color: var(--accent-2); }
.rank-row .who { flex: 1; min-width: 0; }
.rank-row .who strong { display: block; }
.rank-row .pts { font-family: var(--font-display); font-size: 1.15rem; }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}
.input:focus { outline: 2px solid rgba(255, 70, 85, 0.45); outline-offset: 1px; }
select.input option { background: #101728; color: #fff; }
textarea.input { min-height: 96px; resize: vertical; }
.form-note { font-size: 0.82rem; color: var(--muted); }

.auth-wrap { max-width: 460px; margin: 0 auto; padding: 26px 0 40px; }
.auth-card { padding: 22px; }
.auth-switch { margin-top: 14px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.auth-switch a { color: var(--accent); font-weight: 600; }

/* ---------- Filtres / onglets ---------- */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
}
.chip.is-active { color: #fff; background: var(--accent-soft); border-color: rgba(255, 70, 85, 0.5); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; min-width: 560px; }
table.table th, table.table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
table.table th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; }
table.table tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cards-list { display: grid; gap: 12px; }

/* ---------- Détail ---------- */
.detail-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.detail-hero img { width: 100%; height: 210px; object-fit: cover; opacity: 0.55; }
.detail-hero .overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; background: linear-gradient(180deg, rgba(7, 10, 17, 0.2), rgba(7, 10, 17, 0.95)); }

.kv { display: grid; gap: 10px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv div:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--muted); font-size: 0.86rem; }
.kv .v { font-weight: 600; text-align: right; }

.match-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.match-row:last-child { border-bottom: 0; }
.match-score { font-family: var(--font-display); font-size: 1.05rem; white-space: nowrap; }

.announce { border-left: 3px solid var(--accent); padding: 12px 14px; background: rgba(255, 255, 255, 0.03); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.announce h3 { margin: 0 0 6px; font-size: 1rem; }
.announce time { color: var(--muted); font-size: 0.78rem; }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.12), rgba(255,255,255,0.05)); border-radius: 10px; height: 90px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

.chart-box { position: relative; height: 260px; }
.chart-box canvas { width: 100% !important; }

/* ---------- Administration ---------- */
.admin-view { display: block; }
.admin-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-block { margin-bottom: 22px; }

/* ---------- Pied de page ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 22px 0 30px;
  background: rgba(255, 255, 255, 0.02);
}
.footer-inner { display: grid; gap: 16px; }
.footer-brand strong { font-family: var(--font-display); font-size: 1.1rem; }
.footer-brand p { color: var(--muted); font-size: 0.88rem; margin: 6px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer-links a { color: var(--muted); font-size: 0.88rem; }
.footer-links a:hover { color: var(--text); }
.footer-meta p { color: var(--muted); font-size: 0.8rem; margin: 0; }
.site-footer-admin .footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.site-footer-admin .footer-note { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* ---------- Barre de navigation basse ---------- */
.botnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(9, 12, 20, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.botnav a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
}
.botnav a.is-active { color: #fff; background: var(--accent-soft); }
.botnav svg { display: block; }

/* ---------- Notifications ---------- */
.toasts {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: #16203a;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.toast.ok { border-color: rgba(34, 197, 94, 0.5); }
.toast.err { border-color: rgba(255, 70, 85, 0.55); }

/* ---------- Modale d'installation ---------- */
.install-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 6, 11, 0.72);
}
.install-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.install-steps { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.install-steps li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 0.88rem; }
.install-steps svg { flex: 0 0 auto; color: var(--accent); }

/* ---------- Écran mot de passe admin ---------- */
.gate {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 20px 0;
}
.gate .card { max-width: 420px; width: 100%; }

/* ---------- Aides ---------- */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hide-mobile { display: none; }

/* =========================================================
   Tablette / bureau
   ========================================================= */
@media (min-width: 700px) {
  h1 { font-size: 2.4rem; }
  .hero-inner { padding: 62px 16px 54px; }
  .hero h1 { font-size: 3rem; }
  .section { padding: 34px 0; }
  .section-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-inner { grid-template-columns: 1.2fr 1fr 1fr; }
  .hide-mobile { display: block; }
  .cards-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  body { padding-bottom: 30px; }
  .nav { display: flex; }
  .botnav { display: none; }
  .toasts { left: auto; right: 20px; width: 360px; bottom: 20px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .install-btn { order: 0; }
}

@media (max-width: 699px) {
  .install-label { display: none; }
  .install-btn { padding: 8px 10px; }
  .topbar-actions .btn-sm { padding: 8px 10px; }
}
