:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e3e6ea;
  --ink: #16191d;
  --muted: #6b7280;
  --home: #2563eb;
  --draw: #9ca3af;
  --away: #dc2626;
  --accent: #047857;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1215;
    --panel: #171b20;
    --line: #262c33;
    --ink: #e8eaed;
    --muted: #939ba5;
    --home: #60a5fa;
    --draw: #8b939d;
    --away: #f87171;
    --accent: #34d399;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
/* Het logo is tegelijk de home-knop: het speelveld van bovenaf met de pijl
   die de goede kant op wijst. */
.logoknop {
  border: 0; background: none; padding: 4px; margin: -4px; cursor: pointer;
  border-radius: 8px; line-height: 0; flex: none;
}
.logoknop:hover { background: var(--bg); }
.logoknop:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 44px sluit aan op de hoogte van de titel plus de regel eronder. */
svg.logo { width: 44px; height: 44px; display: block; }
.logoknop:hover svg.logo path[stroke*="accent"] { stroke-width: 3.4; }
h1 { margin: 0; font-size: 19px; letter-spacing: -.2px; }
.sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.controls { display: flex; gap: 10px; align-items: center; }

.segmented { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.segmented button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: 13.5px;
}
.segmented button.active { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13.5px;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: progress; }

.tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.tab {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 11px 4px; margin-right: 20px; font: inherit; font-size: 14px;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

main { max-width: 980px; margin: 0 auto; padding: 20px; }
.view { display: none; }
.view.active { display: block; }

.daygroup { margin-bottom: 22px; }
.dayhead {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 8px 2px; font-weight: 600;
}

.match {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 8px; box-shadow: var(--shadow); overflow: hidden;
}
.match > summary {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px;
  align-items: center; padding: 12px 14px; cursor: pointer; list-style: none;
}
.match > summary > * { min-width: 0; }

.match > summary::-webkit-details-marker { display: none; }
.match[open] > summary { border-bottom: 1px solid var(--line); }

.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.teams { font-weight: 550; }
.teams .vs { color: var(--muted); font-weight: 400; margin: 0 6px; }
.verdict { text-align: right; font-size: 13px; }
.verdict b { font-variant-numeric: tabular-nums; }
.verdict .label { color: var(--muted); display: block; font-size: 11.5px; }

.bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; margin-top: 8px; background: var(--line); }
.bar i { display: block; height: 100%; }
.bar .h { background: var(--home); }
.bar .d { background: var(--draw); }
.bar .a { background: var(--away); }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  border-radius: 2px; margin-right: 5px; vertical-align: baseline;
}
.legend .h::before { background: var(--home); }
.legend .d::before { background: var(--draw); }
.legend .a::before { background: var(--away); }

.detail { padding: 14px; display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .detail { grid-template-columns: 1fr; } }

.detail h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.panel h3 { margin: 0 0 4px; font-size: 15px; }
.panel .note { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--bg); border: 1px solid var(--line);
}
.pill.good { color: var(--accent); border-color: currentColor; }
.pill.warn { color: var(--away); border-color: currentColor; }

.empty { color: var(--muted); text-align: center; padding: 40px 20px; }

.scorebar { display: flex; align-items: center; gap: 8px; }
.scorebar i { display: block; height: 6px; background: var(--home); border-radius: 3px; min-width: 2px; }

footer {
  max-width: 980px; margin: 0 auto; padding: 8px 20px 40px;
  color: var(--muted); font-size: 12.5px;
}
footer p { margin: 0; }

/* Op een telefoon past de conclusie niet naast de balk; die gaat eronder. */
@media (max-width: 620px) {
  .match > summary {
    grid-template-columns: 52px minmax(0, 1fr);
    row-gap: 6px;
  }
  .verdict { grid-column: 2; text-align: left; }
  .verdict .label { display: inline; margin-left: 6px; }
}


/* --- landen- en competitiekiezer --- */

/* Land boven, competitie eronder. Naast elkaar leest het als een rij knoppen
   waarin niet te zien is welke keuze bij welke laag hoort. */
.picker {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
/* De landenrij blijft één regel, met Advies er netjes achteraan. Wrappen zou
   die knop op een eigen regel zetten en dat leest als iets anders.
   Let op: geen overflow op normale schermbreedte. Een scroll-gebied laat de
   rechter binnenmarge van de balk vervallen, waardoor de laatste knop - Advies -
   met zijn actieve kader buiten de rand uitstak. */
.picker .segmented.countries {
  flex-wrap: nowrap;
  max-width: 100%;
}
.picker .segmented.countries button { white-space: nowrap; flex: none; }
.picker .segmented.leagues { flex-wrap: wrap; }

/* Alleen als het echt niet past mag de rij schuiven, en dan zorgt een afstandje
   aan het eind dat de laatste knop ook daar niet tegen de rand plakt. */
@media (max-width: 760px) {
  .picker .segmented.countries { overflow-x: auto; scrollbar-width: thin; }
  .picker .segmented.countries::after { content: ''; flex: none; width: 2px; }
}

/* Advies krijgt precies hetzelfde kader als de landen. Let op de klassenaam:
   .advies is het grote uitkomstblok in het adviesscherm, en die regels (met
   margin-top en align-items: baseline) landden eerder per ongeluk op deze knop -
   waardoor hij kleiner werd en uit de lijn zakte. Vandaar .adviesknop. */
.segmented button.adviesknop { font-weight: 600; }
.countries button { display: inline-flex; align-items: center; gap: 6px; }
.flag { font-size: 15px; line-height: 1; }
.leagues button { font-size: 13px; }

/* --- versheid --- */

.freshness {
  font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.freshness::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); flex: none;
}
.freshness.live::before { background: var(--away); animation: pulse 1.6s ease-in-out infinite; }
.freshness.today::before { background: var(--accent); }
.freshness.working::before { background: var(--home); animation: pulse .9s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) {
  .freshness::before { animation: none !important; }
}

.match.live { border-color: var(--away); }
.match.live .time { color: var(--away); font-weight: 600; }
.match.live .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--away); margin-right: 5px; animation: pulse 1.6s ease-in-out infinite;
}

@media (max-width: 620px) {
  .picker { padding: 8px 12px; gap: 8px; }
  .countries button { padding: 5px 8px; font-size: 12.5px; }
  .freshness { display: none; }
}

/* --- stand in de wedstrijdkaart --- */

.score {
  display: inline-block; margin: 0 8px; padding: 1px 8px;
  border-radius: 5px; background: var(--bg); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px;
}
.score.live { background: var(--away); border-color: var(--away); color: #fff; }
.match.played { opacity: .92; }
.match.played .time { font-size: 12px; }

.verdict b.ok { color: var(--accent); }
.verdict b.nok { color: var(--away); }

/* --- gokjes --- */

.betrow { display: flex; flex-wrap: wrap; gap: 6px; }
.betbtn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 5px 11px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px;
}
.betbtn:hover { border-color: var(--muted); }
.betbtn.chosen { background: var(--home); border-color: var(--home); color: #fff; font-weight: 600; }
.betbtn.clear { color: var(--muted); }
.betbtn:disabled { opacity: .5; cursor: progress; }

.betbadge {
  display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border: 1px solid currentColor;
}
.betbadge.open { color: var(--muted); }
.betbadge.goed { color: var(--accent); }
.betbadge.fout { color: var(--away); }

.tally { display: flex; gap: 8px; flex-wrap: wrap; }
.pill.goed { color: var(--accent); border-color: currentColor; }
.pill.fout { color: var(--away); border-color: currentColor; }
.pill.open { color: var(--muted); }

/* Groen als je gok uitkwam, rood als niet. Een streep links in plaats van een
   volle achtergrond: leesbaar in beide thema's, ook voor wie kleuren slecht
   onderscheidt, want de kolom "stand" vertelt hetzelfde verhaal. */
table.bets tr.bet td:first-child { border-left: 3px solid transparent; padding-left: 10px; }
table.bets tr.goed td:first-child { border-left-color: var(--accent); }
table.bets tr.fout td:first-child { border-left-color: var(--away); }
table.bets tr.goed { background: color-mix(in srgb, var(--accent) 8%, transparent); }
table.bets tr.fout { background: color-mix(in srgb, var(--away) 8%, transparent); }

.betdate { color: var(--muted); font-size: 12px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.betleague { color: var(--muted); font-size: 11.5px; margin-left: 8px; }
.note.tiny { font-size: 12px; margin: 8px 0 0; }
.note.tiny.warn { color: var(--away); }

/* --- zekerheidsfilter --- */

.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.filterbar select {
  font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.filterbar .hint { color: var(--accent); font-weight: 600; }
.filterbar .hint:empty { display: none; }

.hiddencount {
  color: var(--muted); font-size: 13px; text-align: center;
  padding: 14px 20px 0;
}

/* --- extra markten --- */
.markets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.market {
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.market b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .filterbar { padding: 8px 12px; } }
tr.boven td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
tr.boven td:last-child b { color: var(--accent); }

/* --- blessures --- */
.injuries { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.injcol b { display: block; font-size: 13px; margin-bottom: 2px; }
.injcol .injcount { font-size: 11.5px; color: var(--away); font-weight: 600; }
.injcol .none { font-size: 11.5px; color: var(--muted); }
.injcol ul { list-style: none; margin: 6px 0 0; padding: 0; }
.injcol li { font-size: 12px; padding: 1px 0; border-left: 2px solid var(--away); padding-left: 7px; }
.injcol li.twijfel { border-left-color: var(--draw); }
.injcol li.meer { border-left-color: transparent; color: var(--muted); font-style: italic; }
.injcol li span { color: var(--muted); font-size: 11px; }
@media (max-width: 640px) { .injuries { grid-template-columns: 1fr; } }
td.sub, td.num.sub { color: var(--muted); font-size: 12.5px; }

/* --- adviesscherm --- */
.knoppen { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 4px; }
.knop { display: flex; flex-direction: column; gap: 4px; }
.knop label { font-size: 12px; color: var(--muted); }
.knop select {
  font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.advies { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.groot { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.groot.goed { color: var(--accent); }
.groot.matig { color: #d97706; }
.groot.slecht { color: var(--away); }
.keten { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.keten span {
  font-size: 12px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.keten span:hover { border-color: var(--muted); }
.keten span.actief { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
table.sel td, table.sel th { padding: 8px; }
.comp { color: var(--muted); font-size: 11.5px; display: block; }
.note.waarschuw { border-left: 3px solid #d97706; padding-left: 12px; margin-top: 14px; }

/* --- gok verwijderen --- */
.betdel {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 5px;
}
.betdel:hover { color: var(--away); background: var(--bg); }
.betdel:disabled { opacity: .4; cursor: progress; }

/* Het hidden-attribuut verliest van elke expliciete display-regel; zonder dit
   blijven .segmented (flex) en .tabs (flex) zichtbaar in het adviesscherm. */
[hidden] { display: none !important; }

/* Zeven knoppen op één regel krijgen: iets krapper, en de vlagcodes wat kleiner.
   Past het alsnog niet (smal scherm), dan schuift de rij horizontaal. */
.picker .segmented.countries button { padding: 5px 9px; font-size: 13px; }
.picker .segmented.countries .flag { font-size: 13px; opacity: .8; }

/* Wanneer-kolom in de adviesselectie: dag boven, aanvangstijd eronder. */
td.wanneer { white-space: nowrap; width: 1%; }
td.wanneer b { display: block; font-size: 12.5px; }
td.wanneer span {
  color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums;
}
.filterbar .hint.onzeker { color: var(--muted); font-weight: 400; font-style: italic; }
td.marge { color: var(--muted); font-size: 12.5px; }

/* Stand van zaken bij een gokje: komt nog, bezig, of afgelopen. */
.wedstrijdstatus {
  font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--muted);
}
.wedstrijdstatus.live {
  color: var(--away); border-color: currentColor; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wedstrijdstatus.klaar { color: var(--muted); }
.wedstrijdstatus.komt { color: var(--ink); }

/* Geluidsknop in de bovenbalk. */
.geluidknop { padding: 6px 10px; font-size: 15px; line-height: 1; }
.geluidknop.uit { opacity: .45; }

/* Wie is er ingelogd, en de knoppen daarbij. */
.gebruiker { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.gebruiker > span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.klein { padding: 5px 10px; font-size: 12.5px; }
@media (max-width: 700px) { .gebruiker > span { display: none; } }
