:root {
  --navy: #0f2a45;
  --navy-2: #163a5c;
  --green: #1a7a3a;
  --green-2: #22964a;
  --live: #d6302b;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #e9edf2;
  --text: #121a24;
  --muted: #5d6877;
  --border: #dce3ea;
  --shadow: 0 1px 2px rgba(15, 42, 69, .06), 0 4px 14px rgba(15, 42, 69, .06);
  --radius: 14px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1520;
  --surface: #13202e;
  --surface-2: #1b2b3c;
  --text: #e8eef4;
  --muted: #94a3b4;
  --border: #22364a;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --green-2: #39b863;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px; outline: none; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: var(--navy); color: #fff;
}
.brand-logo { height: 24px; width: auto; }
.topbar-actions { display: flex; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 0; color: inherit;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn.small { width: 32px; height: 32px; font-size: 14px; }

/* Category chips */
.chips {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 60px); z-index: 15;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px; background: var(--navy-2);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  background: rgba(255,255,255,.1); color: #dbe6f0; border: 0;
}
.chip.active { background: var(--green); color: #fff; }

/* Section titles */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  margin: 26px 0 12px; color: var(--text);
}
.section-title::before { content: ""; width: 4px; height: 16px; background: var(--green); border-radius: 2px; transform: skewX(-12deg); }
.page-title { font-size: 28px; font-weight: 900; font-style: italic; margin: 22px 0 4px; letter-spacing: -.01em; }
.page-sub { color: var(--muted); margin: 0 0 12px; }

/* Hero */
.hero {
  position: relative; display: block; margin-top: 16px;
  border-radius: var(--radius); overflow: hidden; background: var(--navy);
  aspect-ratio: 16 / 10; box-shadow: var(--shadow);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,20,33,.92) 0%, rgba(8,20,33,.35) 55%, transparent 80%); }
.hero-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 18px; color: #fff; }
.hero h2 { margin: 8px 0 6px; font-size: clamp(20px, 5.4vw, 28px); line-height: 1.15; font-weight: 800; }
.hero .meta { color: #c7d3df; }

.tag {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  background: var(--green); color: #fff;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.meta { font-size: 13px; color: var(--muted); }

/* Horizontal carousel */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail .card-v { flex: 0 0 72%; max-width: 280px; scroll-snap-align: start; }

/* Cards */
.card-v { display: block; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-v .thumb { aspect-ratio: 16/10; background: var(--surface-2); }
.card-v .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-v .body { padding: 12px; }
.card-v h3 { margin: 6px 0; font-size: 16px; line-height: 1.25; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.list { display: flex; flex-direction: column; gap: 10px; }
.card-h {
  display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start;
  background: var(--surface); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow);
}
.card-h .thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.card-h .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-h h3 { margin: 4px 0 6px; font-size: 15.5px; line-height: 1.28; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-h .cat { font-size: 11px; font-weight: 800; color: var(--green-2); text-transform: uppercase; letter-spacing: .06em; }

/* Numbered most-read */
.ranked { counter-reset: r; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.ranked a { counter-increment: r; display: grid; grid-template-columns: 38px 1fr; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; line-height: 1.3; }
.ranked a:last-child { border-bottom: 0; }
.ranked a::before { content: counter(r); font-size: 26px; font-weight: 900; font-style: italic; color: var(--green-2); line-height: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 0;
  background: var(--green); color: #fff; font-weight: 700; font-size: 15px;
}
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.block { width: 100%; margin: 16px 0; }
.btn:disabled { opacity: .6; }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--radius); }
@keyframes sh { to { background-position: -200% 0; } }
.skel-hero { aspect-ratio: 16/10; margin-top: 16px; }
.skel-row { height: 130px; margin-top: 10px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .big { font-size: 42px; margin-bottom: 8px; }

/* Publicité */
.ad { grid-column: 1 / -1; margin: 6px 0; min-height: 100px; text-align: center; overflow: hidden; }
.content .ad { margin: 1.4em 0; }
.ad-label { display: block; font-family: var(--font); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-preview { display: grid; place-items: center; height: 250px; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-family: var(--font); font-size: 14px; }

/* Article */
.article { padding-top: 8px; }
.article-cover { margin: 12px -16px 0; aspect-ratio: 16/9; background: var(--surface-2); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article h1 { font-size: clamp(24px, 6.4vw, 34px); line-height: 1.12; font-weight: 900; margin: 18px 0 10px; letter-spacing: -.01em; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: 13.5px; }
.article-actions { display: flex; gap: 8px; margin: 16px 0 4px; }
.article-actions .btn { flex: 1; padding: 10px; font-size: 14px; }
.article-actions .btn.saved { background: var(--navy); }
.content { font-family: var(--serif); font-size: 18.5px; line-height: 1.65; }
.content p { margin: 0 0 1.05em; }
.content h2, .content h3 { font-family: var(--font); line-height: 1.2; margin: 1.6em 0 .6em; }
.content h2 { font-size: 23px; }
.content h3 { font-size: 19px; }
.content a { color: var(--green-2); text-decoration: underline; text-underline-offset: 2px; }
.content img { height: auto; border-radius: 10px; margin: 0 auto; }
.content figure { margin: 1.4em 0; max-width: 100% !important; width: auto !important; }
.content figcaption, .content .wp-caption-text { font-family: var(--font); font-size: 13px; color: var(--muted); margin-top: 6px; }
.content blockquote { margin: 1.2em 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--green); font-style: italic; }
.content ul, .content ol { padding-left: 1.3em; }
.content table { width: 100%; border-collapse: collapse; font-family: var(--font); font-size: 14px; display: block; overflow-x: auto; }
.content td, .content th { border: 1px solid var(--border); padding: 6px 8px; }
.content iframe { max-width: 100%; }
.source-link { display: block; text-align: center; color: var(--muted); font-size: 14px; margin: 18px 0; text-decoration: underline; }

/* Rubriques grid */
.cat-group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 0; margin-bottom: 14px; }
.cat-group h2 { margin: 0; padding: 12px 16px 8px; font-size: 18px; font-weight: 800; font-style: italic; display: flex; justify-content: space-between; align-items: center; }
.cat-group h2 a { font-size: 13px; font-style: normal; color: var(--green-2); font-weight: 700; }
.cat-group .sub { display: flex; justify-content: space-between; padding: 11px 16px; border-top: 1px solid var(--border); font-weight: 600; }
.cat-group .sub span { color: var(--muted); font-weight: 400; font-size: 14px; }

/* Search */
.search-box { position: relative; margin-top: 18px; }
.search-box input {
  width: 100%; padding: 14px 16px 14px 46px; border-radius: 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); outline: none;
}
.search-box input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,122,58,.2); }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* Scores */
.seg { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin: 12px 0; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 4px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.datebar .date-label { font-weight: 800; text-transform: capitalize; }
.datebar .icon-btn { background: var(--surface); box-shadow: var(--shadow); }
.league { margin-top: 16px; }
.league-head { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.league-head img { width: 22px; height: 22px; object-fit: contain; }
.matches { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.match { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--border); }
.match:first-child { border-top: 0; }
.match .status { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: center; }
.match .status.live { color: var(--live); font-weight: 800; }
.match .status.live::before { content: ""; display: block; width: 7px; height: 7px; margin: 0 auto 3px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.team { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.7; min-width: 0; }
.team img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.win { font-weight: 800; }
.score { display: flex; flex-direction: column; text-align: right; font-weight: 800; font-size: 15px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 6px; animation: pulse 1.4s infinite; }
.updated { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0; }

/* Plus page */
.menu-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.menu-list a, .menu-list button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 16px; border: 0; border-top: 1px solid var(--border); background: none; text-align: left; font-weight: 600; font-size: 15.5px; }
.menu-list > :first-child { border-top: 0; }
.menu-list .chev { color: var(--muted); }
.about-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; margin-top: 18px; }
.about-card img { height: 22px; width: auto; margin-bottom: 12px; }
.about-card p { margin: 0; color: #c7d3df; line-height: 1.5; }
.footer-note { text-align: center; color: var(--muted); font-size: 12.5px; margin: 24px 0; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15,42,69,.06);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--green-2); }

/* Install banner + toast */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.18);
  max-width: 520px; margin: 0 auto;
}
.install-banner img { border-radius: 10px; }
.install-banner div { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.install-banner span { color: var(--muted); font-size: 12.5px; }
.install-banner .btn { padding: 8px 14px; font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-h { grid-template-columns: 150px 1fr; }
  .article-cover { margin: 12px 0 0; border-radius: var(--radius); overflow: hidden; }
}
