/* Résultats Tirages — feuille de style
   Après modification : incrémenter ASSET_VERSION dans inc/bootstrap.php (cache OVH). */

:root {
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #475569;
  --line: #E2E8F0;
  --line-2: #F1F5F9;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --link: #1D4ED8;
  --c: #1D4ED8;            /* couleur du jeu, redéfinie par style="--c:…" */
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #F59E0B; outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- En-tête ---------- */
.top { background: var(--ink); color: #fff; }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo-ball { width: 32px; height: 32px; border-radius: 50%; background: #FACC15; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { color: #CBD5E1; font-weight: 600; padding: 11px 13px; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: #fff; background: #1E293B; text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; background: var(--c, #1E293B); }
.nav a[aria-current="page"]:not([style]) { background: #1E293B; }

/* ---------- Mise en page ---------- */
.main { padding-top: 32px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 28px; }
.intro h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.intro p { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.intro p strong { color: var(--ink); }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: -18px; }

/* ---------- Prochains tirages ---------- */
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.next-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); border-top: 4px solid var(--c); }
.next-item:hover { text-decoration: none; border-color: var(--c); }
.next-game { font-weight: 700; color: var(--c); }
.next-date { color: var(--muted); font-size: 15px; }
.next-jackpot { font-size: 22px; font-weight: 800; }

/* ---------- Cartes de résultats ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-wide { grid-column: 1 / -1; }
.card-head { background: var(--c); color: #fff; padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; }
.card-head h2 { margin: 0; font-size: 21px; font-weight: 800; }
.card-head h2 a { color: #fff; }
.card-head span { font-weight: 500; font-size: 15px; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.more { margin-top: auto; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.empty { color: var(--muted); margin: 0; }

.second { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.second-label { font-size: 14px; color: var(--muted); min-width: 90px; }

.extras { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; font-size: 15px; color: var(--ink-2); }
.extras div { display: flex; gap: 6px; }
.extras dt::after { content: " :"; }
.extras dd { margin: 0; font-weight: 700; color: var(--ink); }

/* ---------- Boules ---------- */
.balls { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.ball { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; background: #fff; border: 2px solid #CBD5E1; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }
.ball-sm { width: 32px; height: 32px; font-size: 13px; }
.ball-lg { width: 50px; height: 50px; font-size: 19px; }
.ball-bonus { color: #fff; }
.ball-chance { background: #DC2626; border-color: #DC2626; }
.ball-star   { background: #FACC15; border-color: #FACC15; color: var(--ink); }
.ball-dream, .ball-letter { background: var(--c); border-color: var(--c); }
.ball-legend { font-size: 13px; color: var(--muted); margin-left: 2px; }

/* ---------- Page jeu ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { background: var(--c); color: #fff; padding: 16px 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.panel-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.panel-head-light { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); align-items: flex-end; }
.panel-body { padding: 22px; }
.pager-mini { display: flex; gap: 8px; }
.pager-mini a, .pager-mini span { color: #fff; font-weight: 600; padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 8px; }
.pager-mini a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.pager-mini span { opacity: .55; }
.panel-body:has(.draw-ranks) { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 32px; }
.draw-main, .draw-ranks { display: flex; flex-direction: column; gap: 12px; }
.label { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- Tableaux ---------- */
.table-box { overflow-x: auto; }
.draw-ranks .table-box { border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-size: 15px; vertical-align: middle; }
.draws td { white-space: nowrap; }
.draws .balls { flex-wrap: nowrap; gap: 5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #F8FAFC; }

/* ---------- Formulaires ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters div { display: flex; flex-direction: column; gap: 4px; }
label { font-size: 13px; font-weight: 600; color: var(--muted); }
select, input[type="date"], input[type="text"], input[type="password"] {
  font: inherit; font-size: 15px; min-height: 44px; padding: 0 12px; border: 1px solid #CBD5E1; border-radius: 8px; background: #fff; color: var(--ink);
}
button { font: inherit; font-size: 15px; font-weight: 700; min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--link); color: #fff; cursor: pointer; }
button:hover { background: #1E40AF; }
button:disabled { background: #94A3B8; cursor: not-allowed; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid #CBD5E1; }
.btn-light:hover { background: var(--line-2); }

.pagination { padding: 16px 22px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination a { min-width: 44px; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #CBD5E1; border-radius: 8px; font-weight: 600; }
.pagination a[aria-current="page"] { background: var(--link); border-color: var(--link); color: #fff; }

/* ---------- Texte de présentation ---------- */
.about { max-width: 760px; }
.about h2 { margin: 0 0 6px; font-size: 20px; }
.about p { margin: 0; color: var(--ink-2); }

/* ---------- Pied de page ---------- */
.foot { background: #fff; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot .wrap { padding-top: 22px; padding-bottom: 22px; }
.foot p { margin: 0 0 8px; }
.foot strong { color: var(--ink); }

/* ---------- Admin ---------- */
.admin-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.admin-top h1 { margin: 0; }
.admin-top div { display: flex; gap: 16px; align-items: center; }
.login { max-width: 420px; }
.login h1 { margin-top: 0; }
.flash { padding: 12px 16px; border-radius: 8px; margin: 0; }
.flash-ok { background: #DCFCE7; color: #14532D; }
.flash-err { background: #FEE2E2; color: #7F1D1D; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.tag-ok { background: #DCFCE7; color: #14532D; }
.tag-erreur { background: #FEE2E2; color: #7F1D1D; }
.tag-warn { background: #FEF3C7; color: #78350F; }
.actions form { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { font-size: 13px; min-height: 36px; padding: 0 10px; }
.links { width: 100%; font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; padding: 8px; border: 1px solid #CBD5E1; border-radius: 8px; }

@media (max-width: 640px) {
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
  .ball { width: 40px; height: 40px; font-size: 16px; }
  .ball-lg { width: 44px; height: 44px; }
  .ball-sm { width: 30px; height: 30px; }
  .panel-body, .card-body { padding: 16px; }
  th, td { padding: 9px 10px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
