/* Lobby des tournois en ligne. Préfixe tn- : .board, .chip et .me existent déjà.
   Style volontairement plat : une liste dense, des aplats, l'or réservé au prochain départ et à l'action. */
:root { color-scheme: dark;
  --bg: #0B1322; --surface: #111C30; --surface-2: #17243C; --line: #22304A;
  --ink: #F2EEE4; --muted: #93A0B8; --gold: #F4B740; --gold-deep: #B9861F; --gold-fg: #241500;
  --ok: #5BD69A; --red: #E0504B;
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --body: 'Manrope', system-ui, sans-serif; }
* { box-sizing: border-box; }
.tn [hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden; }
body { font: 500 16px/1.45 var(--body); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tn { --tn-row: #17243C; --tn-row-h: #1C2B47;
  max-width: 1040px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 6px; }

/* Bandeau : une image, un titre, une ligne */
.tn-hero { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 200px; padding: 16px 20px 18px; border-radius: 16px 16px 0 0; overflow: hidden;
  background: linear-gradient(90deg, #0A0E21 50%, rgba(10,14,33,0) 72%), #0A0E21 url(/jouer/tn-hero.webp) right center / auto 100% no-repeat; }
.tn-back { position: absolute; top: 14px; left: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: rgba(11,19,34,.6); color: var(--ink); text-decoration: none; }
.tn-back svg { width: 22px; height: 22px; }
.tn-back:hover { color: var(--gold); }
.tn h1 { margin: 0; font: 900 64px/.9 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.tn-lead { margin: 6px 0 0; color: #B9C4D8; font-size: 14px; }

/* En-têtes de colonnes collés sous le bandeau */
.tn-cols, .tn-row { display: grid; grid-template-columns: minmax(130px, 1.3fr) minmax(0, 1fr) 90px 90px 80px; column-gap: 12px; align-items: center; }
.tn-cols { margin-top: -6px; padding: 10px 16px; border-radius: 0 0 16px 16px; background: #0F1A2D; color: var(--muted); font: 700 13px/1 var(--body); }
.tn-cols span:nth-child(n+3), .tn-num { text-align: right; }

/* Lignes : un aplat, deux lignes, toute la ligne mène à la fiche */
.tn-board { display: flex; flex-direction: column; gap: 6px; }
.tn-row { position: relative; grid-template-areas: "name name name name name" "start mid n1 n2 n3"; row-gap: 4px; padding: 12px 16px; border-radius: 12px; background: var(--tn-row); transition: background .12s; }
.tn-row:hover { background: var(--tn-row-h); }
.tn-name { grid-area: name; font: 800 19px/1.2 var(--body); text-decoration: none; overflow-wrap: anywhere; }
.tn-name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tn-row.hot .tn-name { color: var(--gold); }
.tn-row.past .tn-name { color: #C3CCDB; }
.tn-start { grid-area: start; color: #C9D2E2; font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tn-start small { font-size: 14px; color: var(--muted); }
.tn-live { color: var(--ok); font-weight: 800; }
.tn-mid { grid-area: mid; min-width: 0; }
.tn-num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tn-num small { color: var(--muted); font-size: 13px; }
.tn-row .tn-num:nth-of-type(3) { grid-area: n1; } .tn-row .tn-num:nth-of-type(4) { grid-area: n2; } .tn-row .tn-num:nth-of-type(5) { grid-area: n3; }
.tn-tag { font-size: 13px; font-weight: 700; color: var(--muted); }
.tn-tag.on { color: var(--ok); }
.tn-tag.win { color: var(--gold); }
.tn-tag.win::before { content: "Vainqueur "; color: var(--muted); font-weight: 600; }
.tn-sit { position: relative; z-index: 1; min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--gold); color: var(--gold-fg); font: 800 13px/1 var(--body); cursor: pointer; }

.tn-sec { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.tn h2 { margin: 0 0 2px; font: 700 14px/1 var(--body); color: var(--muted); }
.tn-note, .tn-err, .tn-empty { margin: 8px 0; }
.tn-err { color: var(--red); font-weight: 700; }
.tn-empty, .tn-note { color: var(--muted); }
.tn-guest { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0; padding: 12px 16px; border-radius: 12px; background: var(--surface); }
.tn-guest p { margin: 0; flex: 1 1 220px; color: var(--muted); font-size: 14px; }
.tn-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 0; border-radius: 999px; padding: 10px 20px; background: var(--gold); color: var(--gold-fg); font-weight: 800; cursor: pointer; text-decoration: none; text-align: center; box-shadow: 0 4px 0 var(--gold-deep); }
.tn-btn.ghost { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.tn-btn:disabled { opacity: .55; cursor: default; }

@media (max-width: 700px) {
  .tn-hero { min-height: 168px; padding: 62px 16px 14px; background: linear-gradient(90deg, #0A0E21 35%, rgba(10,14,33,.2) 90%), #0A0E21 url(/jouer/tn-hero-m.webp) right -70px center / auto 100% no-repeat; }
  .tn h1 { font-size: 50px; }
  .tn-lead { font-size: 13px; }
  .tn-cols, .tn-row { grid-template-columns: minmax(0, 1fr) auto 58px 54px 48px; column-gap: 8px; }
  .tn-cols { padding: 10px 12px; font-size: 12px; }
  .tn-row { padding: 10px 12px; }
  .tn-name { font-size: 17px; }
  .tn-start, .tn-start small { font-size: 13px; }
  .tn-num { font-size: 14px; } .tn-num small { font-size: 11px; }
  .tn-tag { font-size: 12px; }
  .tn-tag.win::before { content: none; }
}
@media (max-width: 860px) { .tn { padding-bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .tn-row { transition: none; } }
/* iPhone : la zone de l'heure et de la batterie reste opaque quand on fait défiler */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--bg); }

/* Passage d'une page à l'autre : fondu court, la barre d'onglets ne bouge pas (navigateurs récents ; ailleurs, rien ne change) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
