:root {
  --bg: #0a0c16; --bg2: #121528; --card: #161a31; --line: #262b4d;
  --pink: #ff2e88; --pink2: #ff6fb1; --gold: #e2c27a; --cyan: #34e1ff;
  --txt: #eef0ff; --mute: #8f95bd; --ok: #3ee08f; --ko: #ff5470;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--txt);
  font: 15px/1.45 Inter, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background:
  radial-gradient(900px 500px at 10% -10%, #ff2e8833, transparent 60%),
  radial-gradient(800px 600px at 110% 0%, #34e1ff22, transparent 60%), var(--bg); min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
[hidden] { display: none !important; }

/* ---------- en-tête ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: #0a0c16e6; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.brand span { font-family: Bungee, sans-serif; font-size: 24px; color: var(--pink);
  text-shadow: 0 0 6px #ff2e88aa, 0 0 18px #ff2e8855; }
.brand small { color: var(--gold); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
nav a { text-decoration: none; color: var(--mute); padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 14px; }
nav a.on, nav a:hover { color: var(--txt); background: var(--bg2); }
nav a.out { color: var(--mute); }

.layout { display: grid; grid-template-columns: 1fr; max-width: 1400px; margin: 0 auto; }
main { padding: 14px 14px 90px; min-width: 0; }
@media (min-width: 980px) {
  .layout { grid-template-columns: 1fr 340px; gap: 0; }
  main { padding: 18px 22px 40px; }
}

/* ---------- sections ---------- */
.sec { font-family: Bungee, sans-serif; font-weight: 400; font-size: 20px; color: var(--gold); margin: 22px 0 10px;
  letter-spacing: .02em; }
.sec small { display: block; font: 600 12px Inter, sans-serif; color: var(--mute); letter-spacing: 0; margin-top: 2px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.votes-left { background: var(--bg2); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; font-size: 14px; }
.votes-left b { color: var(--pink); font-size: 16px; }
.filters { display: flex; gap: 6px; }
.chip { background: transparent; border: 1px solid var(--line); color: var(--mute); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip.on { border-color: var(--pink); color: var(--txt); background: #ff2e8822; }

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

/* ---------- carte combat ---------- */
.match { background: linear-gradient(180deg, var(--card), #12152a); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.match.st-en_cours { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink), 0 0 28px #ff2e8855; }
.match.st-termine { opacity: .85; }
.m-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.tag { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.tag.next { color: var(--bg); background: var(--gold); padding: 2px 8px; border-radius: 6px; }
.tag.live { color: var(--pink); animation: blink 1.2s infinite; }
.tag.done { color: var(--mute); }
@keyframes blink { 50% { opacity: .35; } }
.pot { color: var(--mute); }

.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px; }
.f { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.f img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 4px 10px #0008); transition: transform .2s; }
.match:hover .f img { transform: rotate(-4deg) scale(1.04); }
.match:hover .f:last-child img { transform: rotate(4deg) scale(1.04); }
.f span { font-weight: 800; font-size: 14px; line-height: 1.15; }
.f.win span { color: var(--ok); }
.f.win span::after { content: ' 🏆'; }
.f.lose img { filter: grayscale(1) brightness(.6); }
.vs { font-family: 'Bungee Shade', Bungee, sans-serif; font-size: 26px; color: var(--pink); text-shadow: 0 0 12px #ff2e8888; }

.odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.odd { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 4px;
  display: flex; flex-direction: column; align-items: center; transition: border-color .15s, background .15s; }
.odd small { color: var(--mute); font-weight: 800; font-size: 11px; }
.odd b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--gold); }
.odd:not(:disabled):hover { border-color: var(--gold); }
.odd.sel { background: var(--gold); border-color: var(--gold); }
.odd.sel b, .odd.sel small { color: var(--bg); }
.odd:disabled { cursor: default; opacity: .6; }
.odd.res { opacity: 1; border-color: var(--ok); }
.odd.res b { color: var(--ok); }

.betform { background: var(--bg2); border: 1px dashed var(--gold); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.bet-line { display: flex; align-items: center; gap: 8px; }
.bet-pick { font-weight: 800; flex: 1; }
.bet-line input { width: 74px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; text-align: right; font-size: 16px; }
.quick { display: flex; gap: 6px; }
.quick button { flex: 1; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; color: var(--mute); }
.gain { font-size: 13px; color: var(--mute); }
.gain b { color: var(--txt); }
.go { background: var(--pink); border: 0; border-radius: 10px; padding: 10px; font-weight: 800; letter-spacing: .03em; color: #fff;
  box-shadow: 0 4px 18px #ff2e8866; }
.go:disabled { opacity: .5; }

.mybets { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--mute); }
.mybets li.ok { color: var(--ok); }
.mybets li.ko { color: var(--ko); }

.m-foot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vote { background: transparent; border: 1px solid var(--line); color: var(--txt); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.vote b { margin-left: 4px; color: var(--pink); }
.vote.on { background: #ff2e8826; border-color: var(--pink); }
.vote:disabled { opacity: .5; cursor: default; }
.voters { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- chat ---------- */
.chat { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: none; flex-direction: column; }
.chat.open { display: flex; }
@media (min-width: 980px) {
  .chat { position: sticky; top: 59px; height: calc(100vh - 59px); display: flex; border-left: 1px solid var(--line); background: #0d1020; z-index: 1; }
  .chat-close, .chat-fab { display: none !important; }
}
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-close { background: none; border: 0; font-size: 18px; color: var(--mute); }
.chat-log { list-style: none; margin: 0; padding: 10px 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.chat-log li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.chat-log li img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.chat-log li .ref { width: 32px; text-align: center; font-style: normal; font-size: 22px; }
.chat-log li p { margin: 1px 0 0; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-log li > div { background: var(--bg2); border-radius: 4px 12px 12px 12px; padding: 6px 10px; min-width: 0; }
.chat-log li.mine > div { background: #ff2e8826; }
.chat-log time { color: var(--mute); font-size: 11px; }
.chat-log li.sys { font-size: 12.5px; color: var(--gold); justify-content: space-between; gap: 6px;
  background: #e2c27a14; border-left: 2px solid var(--gold); padding: 5px 8px; border-radius: 4px; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.chat-form input { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 16px; min-width: 0; }
.chat-form button { background: var(--pink); border: 0; border-radius: 10px; padding: 0 14px; font-weight: 800; color: #fff; }
.chat-fab { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; width: 58px; height: 58px;
  border-radius: 50%; border: 0; background: var(--pink); font-size: 26px; box-shadow: 0 6px 24px #ff2e8888; }
.chat-fab span { position: absolute; top: -2px; right: -2px; background: var(--gold); color: var(--bg); font: 800 12px Inter;
  min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 5px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 50; background: var(--ok); color: #04210f;
  padding: 10px 16px; border-radius: 10px; font-weight: 700; box-shadow: 0 8px 30px #0009; max-width: 90vw; }
.toast.bad { background: var(--ko); color: #fff; }

/* ---------- ardoises ---------- */
.board { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: 640px; }
.board li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; }
.board .rk { font-family: Bungee; color: var(--mute); width: 24px; }
.board li:first-child .rk { color: var(--gold); }
.board img { width: 48px; height: 48px; object-fit: contain; }
.who-n { flex: 1; display: flex; flex-direction: column; }
.who-n small { color: var(--mute); font-size: 12px; }
.net { font: 800 20px Inter; font-variant-numeric: tabular-nums; }
.board li.pos .net { color: var(--ok); }
.board li.neg .net { color: var(--ko); }
.note { color: var(--mute); font-size: 13px; }

/* ---------- règles ---------- */
.prose { max-width: 680px; }
.prose h3 { color: var(--pink2); margin: 20px 0 6px; font-size: 16px; }
.prose p { color: #cfd2ee; margin: 0 0 10px; }
.formula { font-family: ui-monospace, monospace; background: var(--bg2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; color: var(--gold) !important; }

/* ---------- arbitre ---------- */
.adm { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm th { text-align: left; color: var(--mute); font-size: 12px; text-transform: uppercase; padding: 6px; border-bottom: 1px solid var(--line); }
.adm td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm tr.st-en_cours { background: #ff2e8818; }
.adm tr.st-termine { opacity: .6; }
.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-f { display: flex; gap: 4px; flex-wrap: wrap; }
.adm-f button { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 13px; }
.adm-f button[value=lancer] { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 700; }
.adm-f .ghost { color: var(--mute); }
@media (max-width: 700px) { .adm th:nth-child(4), .adm td:nth-child(4) { display: none; } }

/* ---------- connexion ---------- */
.login { max-width: 560px; margin: 0 auto; padding: 40px 18px; text-align: center; }
.neon { font-family: Bungee, sans-serif; font-weight: 400; font-size: clamp(44px, 13vw, 76px); margin: 0; color: #fff;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--pink), 0 0 30px var(--pink), 0 0 60px var(--pink); animation: flick 5s infinite; }
@keyframes flick { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: .55; } }
.sub { color: var(--gold); letter-spacing: .1em; text-transform: uppercase; font-size: 12px; margin: 4px 0 26px; }
.pick-hint { color: var(--mute); margin: 0 0 8px; }
.who { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 18px; }
.who-btn { background: transparent; border: 2px solid transparent; border-radius: 12px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.who-btn img { width: 100%; max-width: 76px; aspect-ratio: 1; object-fit: contain; }
.who-btn span { font-size: 11px; font-weight: 700; color: var(--mute); line-height: 1.1; }
.who-btn.sel { border-color: var(--pink); background: #ff2e8820; }
.who-btn.sel span { color: var(--txt); }
.login-form { display: grid; gap: 8px; max-width: 340px; margin: 0 auto; }
.login-form input { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 16px; }
.login-form button { background: var(--pink); border: 0; border-radius: 10px; padding: 12px; font-weight: 800; color: #fff; box-shadow: 0 6px 24px #ff2e8866; }
.err { color: var(--ko); margin: 0; }
@media (max-width: 520px) {
  .top { padding: 8px 10px; }
  .brand span { font-size: 20px; }
  .brand small { display: none; }
  nav { flex-wrap: nowrap; gap: 0; }
  nav a { padding: 6px 7px; font-size: 13px; }
}
.who-btn { justify-content: flex-start; }
