/* ---------- CourtLive : habillage du site (accueil, en-tête, listes) ---------- */
:root { --brand: #F2611D; --ink-strong: #16181D; }
body { padding-bottom: env(safe-area-inset-bottom); }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--ink-strong); color: #fff; }
.topbar .in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
.brand svg { width: 34px; height: 34px; display: block; }
.brand b { font: 700 1.7rem/1 var(--cond); letter-spacing: .01em; }
.topnav { margin-left: auto; display: flex; gap: 14px; }
.topnav a { color: #D6DBE0; text-decoration: none; font-size: .88rem; font-weight: 500; }
.topnav a:hover { color: #fff; }
.topbar .tagline { margin-left: auto; font-size: .78rem; color: #AEB6BF; text-align: right; line-height: 1.2; max-width: 46%; }

.search { display: block; margin: 16px 0 4px; position: relative; }
.search input { width: 100%; font: 400 1rem var(--text); padding: 12px 14px 12px 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-2); }

.sec { margin-top: 22px; }
.sec h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 700 1.45rem/1.1 var(--cond); }
.sec h2 .count { font: 600 .9rem var(--text); color: var(--ink-2); }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: var(--live); animation: beat 1.6s ease-in-out infinite; }

/* Carte d'un match en direct */
.cards { display: grid; gap: 10px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { display: block; text-decoration: none; color: inherit; background: var(--paper); border-radius: 8px; padding: 12px 14px 10px; box-shadow: 0 1px 0 var(--line); position: relative; overflow: hidden; }
.card:active { transform: scale(.99); }
.card .row { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 3px 0; }
.card .chip { width: 6px; height: 26px; border-radius: 2px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(127,127,127,.4); }
.card .tn { font: 600 1.12rem/1.15 var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .ts { font: 700 1.9rem/1 var(--cond); font-variant-numeric: tabular-nums; }
.card .row.lead .ts, .card .row.lead .tn { color: var(--ink); }
.card .row.trail .ts { color: var(--ink-2); }
.card .meta2 { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--ink-2); }
.card .meta2 span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .when { color: var(--live); font-weight: 600; white-space: nowrap; }
.card.soon .when { color: var(--ink-2); }

/* Liste des résultats */
.results { background: var(--paper); border-radius: 8px; overflow: hidden; }
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.res:last-child { border-bottom: 0; }
.res .t { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .95rem; }
.res .t i { width: 4px; height: 16px; border-radius: 2px; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(127,127,127,.4); }
.res .t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res .s { font: 600 1.05rem var(--cond); text-align: right; font-variant-numeric: tabular-nums; }
.res .win { font-weight: 600; }
.res .win + .s, .res .s.win { color: var(--ink); }
.res .sub { grid-column: 1 / -1; font-size: .76rem; color: var(--ink-2); }

.empty-live { background: var(--paper); border-radius: 8px; padding: 26px 18px; text-align: center; }
.empty-live svg { width: 64px; height: 64px; opacity: .9; }
.empty-live h3 { margin: 10px 0 4px; font: 700 1.3rem var(--cond); }
.empty-live p { margin: 0 auto; color: var(--ink-2); max-width: 36ch; font-size: .92rem; }
.none-found { color: var(--ink-2); padding: 6px 2px; margin: 0; }

.foot2 { margin: 32px 0 0; font-size: .75rem; color: var(--ink-2); text-align: center; line-height: 1.5; }

/* Page match */
.matchbar { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 0; }
.btn-l { display: inline-flex; align-items: center; gap: 6px; font: 600 .95rem var(--text); color: var(--ink); text-decoration: none; background: none; border: 0; padding: 8px 0; cursor: pointer; }
.btn-l svg { width: 18px; height: 18px; }
[hidden] { display: none !important; }
.dot-live.off { background: var(--ink-2); animation: none; }

.full-panel { margin-top: 14px; background: var(--paper); border-radius: 8px; padding: 18px; border-left: 5px solid var(--brand); }
.full-panel h2 { margin: 0 0 6px; font: 700 1.4rem var(--cond); }
.full-panel p { margin: 0 0 10px; color: var(--ink-2); }
.full-panel:not([hidden]) ~ .meta, .full-panel:not([hidden]) ~ .board, .full-panel:not([hidden]) ~ .court, .full-panel:not([hidden]) ~ .tally, .full-panel:not([hidden]) ~ .oncourt, .full-panel:not([hidden]) ~ .tabs, .full-panel:not([hidden]) ~ .panel { display: none; }

/* Page du match ouverte dans l'application mobile : l'application affiche déjà sa propre barre */
.in-app .topbar, .in-app .matchbar { display: none !important; }
.in-app body { padding-top: 0; }
