/* Page Arène — d'après la maquette validée (kit de design du 15/10/2026). Polices OFL servies localement. */
@font-face { font-family: "Unbounded"; src: url(/static/fonts/Unbounded-wght.ttf) format("truetype"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url(/static/fonts/Manrope-wght.ttf) format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/static/fonts/JetBrainsMono-wght.ttf) format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #05070C; --panel: #0A0E1A; --panel2: #0E1322; --border: #1A2030; --line: #131826; --line2: #151A26;
  --track: #151B29; --text: #E8ECF4; --muted: #9AA3B5; --dim: #6B7488; --soft: #C9D0DD;
  --gain: #34D399; --loss: #F87171; --amber: #FBBF24;
  --mono: "JetBrains Mono", ui-monospace, monospace; --title: "Unbounded", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "Manrope", system-ui, sans-serif; overflow-x: hidden; }
a { color: var(--text); } a:hover { color: #fff; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); } .muted { color: var(--muted); } .dim { color: var(--dim); }
.up { color: var(--gain); } .down { color: var(--loss); } .flat { color: var(--muted); }

/* En-tête */
header.top { border-bottom: 1px solid var(--line2); }
.top-in { padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.right { gap: 16px; }
.logo { font-family: var(--title); font-weight: 800; font-size: 16px; letter-spacing: .05em; }
.live { display: inline-flex; align-items: center; gap: 8px; font: 700 12px var(--mono); color: #FCA5A5; border: 1px solid #4A1D24;
        background: #1A0B0E; padding: 5px 10px; border-radius: 999px; letter-spacing: .1em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #F87171; animation: pulse 1.8s infinite; }
.live.wait { color: #93C5FD; border-color: #1D2E4A; background: #0B1220; } .live.wait i { background: #60A5FA; animation: none; }
.live.done { color: #FCD34D; border-color: #4A3A12; background: #1A1405; } .live.done i { background: var(--amber); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(248,113,113,.6); } 70% { box-shadow: 0 0 0 9px rgba(248,113,113,0); } 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); } }
.season { font: 12px var(--mono); color: var(--muted); }
.count { font: 12px var(--mono); color: var(--muted); }
.count b { color: var(--text); font-size: 14px; }
.sim { font: 700 11px var(--mono); color: var(--bg); background: var(--amber); padding: 4px 9px; border-radius: 999px; letter-spacing: .08em; }

/* Mise en page */
main.wrap { padding-top: 16px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }   /* chaque panneau à la hauteur de son contenu */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 20px; min-width: 0;
         display: flex; flex-direction: column; gap: 10px; }
.wide { flex: 999 1 640px; min-width: 0; }
.side { flex: 1 1 340px; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
h1 { margin: 0; font-family: var(--title); font-weight: 800; font-size: 26px; letter-spacing: -.01em; line-height: 1.25; }
h1 span { color: var(--muted); }
.ttl { font: 700 13px var(--mono); letter-spacing: .16em; }
.sub { font: 12px var(--mono); color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 14px 0; }
.av { display: block; border-radius: 50%; flex: none; }

/* Graphique */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.ctag { position: absolute; transform: translateY(-50%); display: flex; align-items: center; gap: 5px; text-decoration: none;
        background: var(--bg); border: 1px solid; border-radius: 999px; padding: 2px 8px 2px 2px; white-space: nowrap;
        font: 700 11px var(--mono); color: var(--text); }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
               padding: 0 12%; color: var(--muted); font-size: 14px; }

/* Classement */
.leader { border: 1px solid; border-radius: 18px; padding: 12px 14px 12px 12px; display: flex; align-items: center; gap: 12px; background: var(--panel2); }
.leader .who { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.leader .lbl { display: inline-flex; align-items: center; gap: 6px; font: 11px var(--mono); color: var(--muted); letter-spacing: .12em; }
.leader .nm { font-family: var(--title); font-weight: 800; font-size: 20px; }
.num { text-align: right; font-family: var(--mono); }
.num b { display: block; font-weight: 700; }
.brow { display: grid; grid-template-columns: 18px 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px;
        border-bottom: 1px solid var(--line); text-decoration: none; }
.brow:last-child { border-bottom: 0; }
.brow .rk { font: 12px var(--mono); color: var(--dim); }
.brow .nm { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.brow .nm b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; border-radius: 2px; background: var(--track); position: relative; overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }

/* Flux */
.slot-title { font: 700 13px var(--mono); letter-spacing: .16em; margin: 6px 0 2px; }
.slot-title.old { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); }
.drow { display: grid; grid-template-columns: 32px 74px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.drow .who { display: flex; flex-direction: column; gap: 2px; font: 700 13px var(--mono); }
.drow .act { font: 700 11px var(--mono); }
.drow .what { font: 13px var(--mono); }
.drow .why { font-size: 14px; color: var(--muted); line-height: 1.45; }
.drow details summary { cursor: pointer; color: var(--dim); font: 12px var(--mono); margin-top: 4px; list-style: none; }
.drow details summary::-webkit-details-marker { display: none; }
.drow details summary::before { content: "▸ "; } .drow details[open] summary::before { content: "▾ "; }
.drow details div { font-size: 13px; color: var(--muted); margin-top: 4px; }
.drow details b { font-family: var(--mono); color: var(--soft); }

/* Textes des IA : punchlines, clashs, duel, question */
.ai-tag { display: inline-block; font: 700 11px/1 var(--mono); letter-spacing: .1em; padding: 4px 7px; border-radius: 6px; border: 1px solid; vertical-align: 1px; }
.mention { font: 11px var(--mono); color: var(--dim); }
.mention a { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 700 12px var(--mono); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; }
.punch { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 16px; background: var(--panel2);
         border: 1px solid var(--border); border-left: 3px solid; margin: 6px 0; }
.punch .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.punch .line { font-weight: 700; font-size: 16px; line-height: 1.4; }
.clash { border: 1px solid var(--border); border-radius: 16px; background: var(--panel2); padding: 12px; margin: 6px 0;
         display: flex; flex-direction: column; gap: 10px; }
.clash .ch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.clash .ch b { font-family: var(--title); font-weight: 800; font-size: 14px; letter-spacing: .04em; }
.say { display: flex; gap: 10px; align-items: flex-start; }
.say.r { flex-direction: row-reverse; }
.bubble { background: var(--bg); border: 1px solid; border-radius: 16px; padding: 9px 12px; max-width: 82%; min-width: 0; }
.say.r .bubble { text-align: right; }
.bubble .line { font-weight: 700; font-size: 15px; line-height: 1.4; }
.bubble .st { font: 11px var(--mono); color: var(--muted); margin-top: 3px; }
.vs { font-family: var(--title); font-weight: 800; color: var(--muted); }

.duel .fighters { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.duel .f { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.duel .f b { font-family: var(--title); font-weight: 800; font-size: 15px; }
.duel .f span { font-size: 12px; color: var(--muted); }
.duel .score { font: 800 40px/1 var(--mono); }
.duel .score small { display: block; font: 600 11px "Manrope", sans-serif; color: var(--muted); margin-top: 6px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.days span { font: 700 11px var(--mono); border: 1px solid; border-radius: 8px; padding: 3px 7px; }
.talk { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }

.question h2 { margin: 0; font-family: var(--title); font-weight: 800; font-size: 20px; line-height: 1.3; }
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.answer { background: var(--bg); border: 1px solid var(--border); border-top: 3px solid; border-radius: 16px; padding: 12px;
          display: flex; flex-direction: column; gap: 8px; }
.answer .h { display: flex; align-items: center; gap: 10px; }
.answer .h b { font-weight: 800; }
.answer .line { font-weight: 700; line-height: 1.45; }

/* Exposition */
.erow { display: flex; flex-direction: column; gap: 6px; }
.erow .l { display: flex; justify-content: space-between; font-size: 13px; }
.erow .l b { font-weight: 700; }
.erow .bar { height: 8px; border-radius: 4px; }
.erow .bar > span { border-radius: 4px; }

/* Combattants */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.fighter { background: var(--bg); border: 1px solid var(--border); border-top: 3px solid; border-radius: 18px; padding: 18px 14px;
           display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; }
.fighter .nm { font-family: var(--title); font-weight: 800; font-size: 18px; }
.fighter .nk { font-size: 14px; font-weight: 700; }
.fighter .ds { font-size: 13px; color: var(--muted); line-height: 1.45; }
.fighter .rf { font: 11px var(--mono); color: var(--dim); }

.more { align-self: center; margin-top: 8px; background: var(--panel2); color: var(--soft); border: 1px solid var(--border); border-radius: 999px;
        padding: 8px 16px; font: 12px var(--mono); cursor: pointer; }
.more:hover { border-color: #2A3348; }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 8px 4px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* Avant-saison */
.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px 8px 30px; text-align: center; }
.hero-lbl { font: 700 12px var(--mono); letter-spacing: .2em; color: var(--muted); }
.hero-count { font-family: var(--title); font-weight: 800; font-size: 64px; line-height: 1; letter-spacing: -.01em; }
.hero-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 22px; margin-top: 14px; }
.hero-f { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; }
.hero-title { font-family: var(--title); font-weight: 800; font-size: 28px; margin-top: 10px; }
.hero-title span { color: var(--muted); }
.prog { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prog b { font-size: 12px; color: var(--amber); }
.prog span { font-size: 14px; }

/* Égalités, étiquette IA, partage */
.exq { font: 600 11px var(--mono); color: var(--muted); }
.tagline { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.ia { font: 700 11px/1 var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; }
.share { font: 600 11px var(--mono); color: var(--soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
         text-decoration: none; background: var(--bg); }
.share:hover { border-color: #2A3348; color: #fff; }

/* Duel : J1 à J7 */
.jrow { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.jcell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.jcell span { font: 11px var(--mono); color: var(--dim); }
.jd { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--border); background: var(--panel2);
      display: flex; align-items: center; justify-content: center; }
.jd.todo { border: 2px dashed #3A4256; background: transparent; }
.jd.eq { border-color: var(--muted); color: var(--muted); font: 800 16px var(--mono); }

/* Conférence repliée */
details.replay { display: block; }
details.replay summary { cursor: pointer; font: 700 13px var(--mono); letter-spacing: .1em; color: var(--muted); list-style: none; }
details.replay summary::-webkit-details-marker { display: none; }
details.replay summary::before { content: "▸ "; } details.replay[open] summary::before { content: "▾ "; }
details.replay[open] summary { margin-bottom: 12px; }
footer #handle a { color: var(--soft); }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top-in { padding: 12px 16px; }
  .panel { padding: 16px; border-radius: 18px; }
  h1 { font-size: 20px; }
  .drow { grid-template-columns: 32px minmax(0, 1fr); }
  .drow .who { grid-column: 2; } .drow .txt { grid-column: 2; }
  .bubble { max-width: 88%; }
  .duel .score { font-size: 32px; }
  .m-title { margin: 0; font-size: 20px; }
  #chart-head h1 { display: none; }
  body:not(.pre) .board-col { order: -1; }           /* titre et classement avant le graphique */
  .hero-count { font-size: 40px; } .hero-title { font-size: 21px; }
  .answers.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .answers.carousel > .answer { flex: 0 0 84%; scroll-snap-align: start; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fighter { padding: 14px 10px; }
  .fighter img { width: 88px; height: 88px; }
  .fighter .nm { font-size: 15px; } .fighter .nk { font-size: 13px; } .fighter .ds { font-size: 12px; }
}

@media (min-width: 641px) { .m-title { display: none !important; } }
