/* ============================================================
   SPKTR PRONOS 2026 — charte SPKTR
   Noir #1f1f1f · Orange #ff7500
   Display : Big Shoulders · Texte : Saira
   ============================================================ */

:root {
  --bg: #1f1f1f;
  --bg-2: #171717;
  --surface: #282828;
  --surface-2: #303030;
  --line: rgba(255, 255, 255, 0.08);
  --chalk: rgba(255, 255, 255, 0.16);
  --text: #f2efeb;
  --text-dim: #a39e98;
  --volt: #ff7500;
  --volt-dark: #d96300;
  --volt-ink: #1f1f1f;
  --gold: #ffa64d;
  --red: #ff6157;
  --blue: #6cb8ff;
  --r: 14px;
  --font-display: "Big Shoulders", "Arial Narrow", sans-serif;
  --font-body: "Saira", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 117, 0, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.45;
}

/* lignes de pelouse en fond */
.pitch-lines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 120px,
    rgba(255, 255, 255, 0.012) 120px 240px
  );
}
.pitch-lines::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.app { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 14px calc(90px + env(safe-area-inset-bottom)); }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- header ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px 10px;
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand .kicker {
  font-family: var(--font-display); font-weight: 500; letter-spacing: 0.32em;
  font-size: 11px; color: var(--volt); text-transform: uppercase;
}
.brand h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 34px;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.brand h1 .slash { color: var(--volt); }
.whoami { text-align: right; font-size: 13px; color: var(--text-dim); }
.whoami b { color: var(--text); display: block; font-size: 15px; }
.whoami button {
  background: none; border: none; color: var(--text-dim); font-size: 12px;
  text-decoration: underline; padding: 2px 0 0;
}
.whoami button:hover { color: var(--volt); }

/* bandeau compte à rebours */
.next-up {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(100deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 14px; margin-bottom: 14px;
  animation: rise 0.5s ease both;
}
.next-up .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--volt);
  box-shadow: 0 0 12px var(--volt); flex: none;
  animation: pulse 1.6s infinite;
}
.next-up .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.next-up .teams { font-weight: 600; font-size: 14px; }
.next-up .countdown {
  margin-left: auto; font-family: var(--font-display); font-weight: 700;
  font-size: 24px; color: var(--volt); letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- onglets ---------- */

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; gap: 4px;
  background: rgba(10, 15, 11, 0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.tabs button {
  flex: 1; max-width: 160px;
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 6px; border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.tabs button .ico { display: block; font-size: 18px; margin-bottom: 2px; }
.tabs button.active { color: var(--volt-ink); background: var(--volt); }

/* ---------- auth ---------- */

.auth {
  max-width: 400px; margin: 8vh auto 0; text-align: center;
  animation: rise 0.6s ease both;
}
.auth .ball { font-size: 52px; display: block; margin-bottom: 8px; }
.auth h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 52px;
  text-transform: uppercase; line-height: 0.95;
}
.auth h1 em { font-style: normal; color: var(--volt); }
.auth .sub { color: var(--text-dim); margin: 10px 0 26px; font-size: 14px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 20px; text-align: left;
}
.auth-card .switch { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-card .switch button {
  flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--line);
  background: none; color: var(--text-dim);
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.auth-card .switch button.active { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-dim); margin-bottom: 6px;
}
.field input, .field select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--chalk); background: var(--bg-2); color: var(--text);
  font-size: 16px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--volt); outline-offset: -1px; border-color: transparent; }
.btn-primary {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: var(--volt); color: var(--volt-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  text-transform: uppercase; letter-spacing: 0.08em;
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(255, 117, 0, 0.35); }
.btn-primary:active { transform: scale(0.98); }
.auth .err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }
.auth .hint { color: var(--text-dim); font-size: 12px; margin-top: 16px; }

/* ---------- filtres matchs ---------- */

.filters {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none; padding: 7px 14px; border-radius: 99px;
  border: 1px solid var(--chalk); background: none; color: var(--text-dim);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: all 0.15s;
}
.filters button.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.day-head {
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
  margin: 22px 2px 10px; display: flex; align-items: center; gap: 12px;
}
.day-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- carte match (style ticket) ---------- */

.match {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: 12px; overflow: hidden;
  animation: rise 0.45s ease both;
}
.match:nth-child(2n) { animation-delay: 0.05s; }
.match::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--chalk);
}
.match.is-open::before { background: var(--volt); box-shadow: 0 0 10px rgba(182,255,59,0.5); }
.match.is-finished::before { background: var(--gold); }
.match.is-live::before { background: var(--red); box-shadow: 0 0 10px rgba(255,97,87,0.6); }

.match-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px 0; font-size: 12px; color: var(--text-dim);
}
.badge {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--chalk); border-radius: 6px; padding: 2px 7px;
}
.badge.live { color: var(--red); border-color: var(--red); animation: pulse 1.4s infinite; }
.badge.done { color: var(--gold); border-color: rgba(255, 166, 77, 0.5); }
.match-meta .when { margin-left: auto; font-variant-numeric: tabular-nums; }

.match-main {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 8px; padding: 12px 14px 14px;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.team .flag { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.team .name { font-weight: 600; font-size: 13.5px; }

.score-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 132px; }

.stepper-row { display: flex; align-items: center; gap: 6px; }
.stepper { display: flex; flex-direction: column; align-items: center; }
.stepper input {
  width: 46px; height: 48px; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 28px;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--chalk); border-radius: 10px;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus { outline: 2px solid var(--volt); outline-offset: -1px; }
.score-zone .vs { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--text-dim); }
.stepper .btns { display: flex; gap: 4px; margin-top: 4px; }
.stepper .btns button {
  width: 21px; height: 21px; border-radius: 6px; border: 1px solid var(--chalk);
  background: none; color: var(--text-dim); font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.stepper .btns button:hover { color: var(--volt); border-color: var(--volt); }

.final-score {
  font-family: var(--font-display); font-weight: 800; font-size: 40px;
  letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
}
.final-score .sep { color: var(--text-dim); font-size: 28px; padding: 0 2px; }

.save-bet {
  border: none; border-radius: 8px; padding: 7px 16px;
  background: var(--volt); color: var(--volt-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.1em;
  transition: transform 0.1s, opacity 0.2s;
}
.save-bet:disabled { opacity: 0.35; cursor: default; }
.save-bet:active { transform: scale(0.95); }
.save-bet.saved { background: transparent; color: var(--volt); border: 1px solid var(--volt); }

.my-points {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
}
.my-points.p3 { background: rgba(255, 117, 0, 0.15); color: var(--volt); }
.my-points.p1 { background: rgba(108, 184, 255, 0.15); color: var(--blue); }
.my-points.p0 { background: rgba(255, 97, 87, 0.12); color: var(--red); }
.my-points.none { background: rgba(255,255,255,0.06); color: var(--text-dim); }

/* pronos des autres, après coup d'envoi */
.match-bets { border-top: 1px dashed var(--chalk); padding: 10px 14px; }
.match-bets summary {
  cursor: pointer; font-size: 12.5px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.1em; list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.match-bets summary::after { content: "▾"; margin-left: auto; transition: transform 0.2s; }
.match-bets[open] summary::after { transform: rotate(180deg); }
.bets-grid { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.bet-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font-size: 13px;
}
.bet-chip .sc { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.bet-chip .pts { font-size: 11px; font-weight: 700; }
.bet-chip .pts.p3 { color: var(--volt); }
.bet-chip .pts.p1 { color: var(--blue); }
.bet-chip .pts.p0 { color: var(--text-dim); }

.empty {
  text-align: center; color: var(--text-dim); padding: 50px 20px; font-size: 14px;
}

/* ---------- classement ---------- */

.podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end;
  margin: 26px 0 18px; min-height: 170px;
}
.podium .spot {
  text-align: center; border-radius: var(--r) var(--r) 0 0; padding: 14px 6px 10px;
  background: var(--surface); border: 1px solid var(--line); border-bottom: none;
  animation: rise 0.5s ease both;
}
.podium .spot .medal { font-size: 26px; }
.podium .spot .nm { font-weight: 600; font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .spot .pt {
  font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--volt);
}
.podium .spot .pt small { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.podium .p1 { order: 2; padding-top: 22px; border-color: rgba(255, 166, 77, 0.45); background: linear-gradient(180deg, rgba(255, 166, 77, 0.10), var(--surface)); }
.podium .p1 .pt { color: var(--gold); font-size: 38px; }
.podium .p2 { order: 1; height: 78%; animation-delay: 0.08s; }
.podium .p3 { order: 3; height: 64%; animation-delay: 0.16s; }

.lb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb-table th {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim);
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--chalk);
}
.lb-table th.num, .lb-table td.num { text-align: center; }
.lb-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.lb-table tr.me td { background: rgba(255, 117, 0, 0.06); }
.lb-table td.rank { font-family: var(--font-display); font-weight: 800; font-size: 18px; width: 40px; text-align: center; }
.lb-table tr:nth-child(1) td.rank { color: var(--gold); }
.lb-table td.pts { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--volt); text-align: center; }
.lb-note { color: var(--text-dim); font-size: 12px; text-align: center; margin-top: 14px; }

.prize {
  margin-top: 22px; text-align: center;
  border: 1px dashed rgba(255, 166, 77, 0.5); border-radius: var(--r);
  padding: 16px; background: rgba(255, 166, 77, 0.05);
}
.prize .t { font-family: var(--font-display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); }
.prize .d { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ---------- règles ---------- */

.rules { display: grid; gap: 10px; margin-top: 16px; }
.rule {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px;
}
.rule .pts-big {
  font-family: var(--font-display); font-weight: 800; font-size: 34px;
  min-width: 64px; text-align: center;
}
.rule.r3 .pts-big { color: var(--volt); }
.rule.r1 .pts-big { color: var(--blue); }
.rule.r0 .pts-big { color: var(--text-dim); }
.rule b { display: block; font-size: 15px; }
.rule span { font-size: 13px; color: var(--text-dim); }

/* ---------- admin ---------- */

.admin-section { margin-top: 24px; }
.admin-section > h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
  color: var(--volt);
}
.admin-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; margin-bottom: 10px;
}
.admin-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-row .title { font-weight: 600; font-size: 14px; flex: 1; min-width: 180px; }
.admin-row .sub { font-size: 12px; color: var(--text-dim); display: block; }
.mini-input {
  width: 52px; padding: 8px; text-align: center; border-radius: 8px;
  border: 1px solid var(--chalk); background: var(--bg-2); color: var(--text);
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.btn-sm {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--chalk);
  background: none; color: var(--text); font-size: 13px; font-weight: 600;
}
.btn-sm:hover { border-color: var(--volt); color: var(--volt); }
.btn-sm.danger:hover { border-color: var(--red); color: var(--red); }
.btn-sm.solid { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- divers ---------- */

.toast {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 10px 20px; border-radius: 99px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 100;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); color: #fff; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 460px) {
  .brand h1 { font-size: 27px; }
  .next-up .countdown { font-size: 19px; }
  .team .flag { font-size: 28px; }
  .stepper input { width: 42px; height: 44px; font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
}
