/* De kleuren van de game (app/src/ui/thema.ts): zwart met pastelgoud. Op een licht systeem dezelfde sfeer op warm wit. */
:root {
  color-scheme: dark;
  --achtergrond: #0e0d0b;
  --paneel: #1a1814;
  --paneel-licht: #2a2620;
  --rand: rgba(233, 213, 161, 0.18);
  --tekst: #f5ead0;
  --tekst-zacht: rgba(233, 213, 161, 0.68);
  --accent: #e9d5a1;
  --op-accent: #2a2112;
  --accent-zacht: rgba(233, 213, 161, 0.14);
  --goed: #6fcf97;
  --let-op: #eda100;
  --fout: #ff7b72;
  --fout-zacht: rgba(255, 123, 114, 0.14);
  --reeks-1: #3987e5;
  --reeks-2: #d95926;
  --raster: rgba(233, 213, 161, 0.12);
  /* Spelerskaart: één warme kleur, van weinig (dof) naar veel (fel) spelers */
  --heet-1: #7a5a2a;
  --heet-2: #a8742c;
  --heet-3: #d6922f;
  --heet-4: #f2b54a;
  --heet-5: #ffe29a;
  --land: #24211b;
  --land-rand: rgba(233, 213, 161, 0.22);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --achtergrond: #f6f3ea;
    --paneel: #fffdf7;
    --paneel-licht: #efe9da;
    --rand: rgba(70, 55, 20, 0.16);
    --tekst: #231d10;
    --tekst-zacht: rgba(55, 44, 20, 0.72);
    --accent: #6d5413;
    --op-accent: #fffdf7;
    --accent-zacht: rgba(109, 84, 19, 0.1);
    --goed: #17733f;
    --let-op: #8a5a00;
    --fout: #b3261e;
    --fout-zacht: rgba(179, 38, 30, 0.09);
    --reeks-1: #2a78d6;
    --reeks-2: #eb6834;
    --raster: rgba(70, 55, 20, 0.12);
    --heet-1: #e8c98a;
    --heet-2: #d9a24a;
    --heet-3: #bf7a1f;
    --heet-4: #9a5512;
    --heet-5: #6b360a;
    --land: #ece5d3;
    --land-rand: rgba(70, 55, 20, 0.28);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--achtergrond);
  color: var(--tekst);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Schil */
.schil { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100%; }
#app { min-height: 100%; }
.zijbalk {
  background: var(--paneel);
  border-right: 1px solid var(--rand);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.merk { font-weight: 700; font-size: 15px; padding: 0 10px; color: var(--accent); }
.merk small { display: block; font-weight: 400; font-size: 12px; color: var(--tekst-zacht); }
.menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--tekst);
  text-decoration: none;
}
.menu a:hover { background: var(--accent-zacht); }
.menu a[aria-current="page"] { background: var(--accent-zacht); color: var(--accent); font-weight: 600; }
.teller { background: var(--accent); color: var(--op-accent); border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.wie { padding: 0 10px; color: var(--tekst-zacht); font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inhoud { padding: 24px 28px 64px; min-width: 0; max-width: 1240px; }
.kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.kop .sub { color: var(--tekst-zacht); font-size: 13px; margin: 2px 0 0; }
.terug { display: inline-block; margin-bottom: 8px; font-size: 13px; }

/* Bouwstenen */
.paneel { background: var(--paneel); border: 1px solid var(--rand); border-radius: 10px; padding: 16px; margin-bottom: 16px; min-width: 0; }
.rooster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.rooster.breed { grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); }
.tegels { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.tegel { background: var(--paneel); border: 1px solid var(--rand); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
a.tegel:hover { border-color: var(--accent); }
.tegel .naam { color: var(--tekst-zacht); font-size: 12px; }
.tegel .waarde { font-size: 24px; font-weight: 650; line-height: 1.3; }
.tegel .toelichting { color: var(--tekst-zacht); font-size: 12px; }
.zacht { color: var(--tekst-zacht); }
.klein { font-size: 12px; }
.rij { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uitleg { background: var(--accent-zacht); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; font-size: 13px; }
.leeg { color: var(--tekst-zacht); padding: 18px 4px; text-align: center; }

button, .knop {
  font: inherit;
  color: var(--tekst);
  background: var(--paneel-licht);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
button.hoofd { background: var(--accent); color: var(--op-accent); border-color: var(--accent); font-weight: 600; }
button.gevaar { color: var(--fout); border-color: var(--fout); background: var(--fout-zacht); }
button.tekstknop { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
input, select, textarea {
  font: inherit;
  color: var(--tekst);
  background: var(--achtergrond);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: 5px 9px;
  max-width: 100%;
}
textarea { width: 100%; min-height: 72px; resize: vertical; }
label { display: block; font-size: 13px; }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 3px; }

/* Tabellen */
.tabelvak { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--tekst-zacht); white-space: nowrap; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--rand); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.getal, th.getal { text-align: right; }
tbody tr.klikbaar { cursor: pointer; }
tbody tr.klikbaar:hover { background: var(--accent-zacht); }
.afkap { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paginering { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; color: var(--tekst-zacht); font-size: 13px; }

/* Status: altijd met een teken en een woord, nooit alleen kleur */
.pil { display: inline-flex; align-items: center; gap: 4px; border: 1px solid currentColor; border-radius: 10px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
.pil.goed { color: var(--goed); }
.pil.let-op { color: var(--let-op); }
.pil.fout { color: var(--fout); }
.pil.zacht { color: var(--tekst-zacht); }

/* Gegevens */
.gegevens { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.gegevens dt { color: var(--tekst-zacht); }
.gegevens dd { margin: 0; overflow-wrap: anywhere; }

/* Chat */
.bericht { padding: 8px 10px; border-bottom: 1px solid var(--rand); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.bericht:last-child { border-bottom: 0; }
.bericht .van { font-weight: 600; font-size: 13px; }
.bericht .wanneer { color: var(--tekst-zacht); font-size: 12px; font-weight: 400; margin-left: 6px; }
.bericht .tekst { grid-column: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.bericht .actie { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.bericht.gemeld { background: var(--fout-zacht); border-radius: 6px; }
.bericht.weg .tekst { color: var(--tekst-zacht); font-style: italic; }
.citaat { border-left: 3px solid var(--fout); padding: 6px 12px; background: var(--fout-zacht); border-radius: 0 6px 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; }
.scrolllijst { max-height: 520px; overflow-y: auto; }

/* Dialoog */
dialog { background: var(--paneel); color: var(--tekst); border: 1px solid var(--rand); border-radius: 10px; padding: 18px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog h2 { font-size: 16px; }
dialog form { display: flex; flex-direction: column; gap: 12px; }
.fout { color: var(--fout); }
.knoppen { display: flex; justify-content: flex-end; gap: 8px; }

/* Inloggen */
.inlog { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.inlog form { background: var(--paneel); border: 1px solid var(--rand); border-radius: 12px; padding: 24px; width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; }
.inlog h1 { color: var(--accent); }

/* Melding */
#melding { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--op-accent); padding: 8px 14px; border-radius: 8px; font-weight: 600; max-width: calc(100vw - 32px); z-index: 10; }
#melding.is-fout { background: var(--fout); color: #fff; }

/* Grafieken */
.grafiek { position: relative; }
.grafiek svg { display: block; width: 100%; overflow: visible; }
.grafiek text { fill: var(--tekst-zacht); font-size: 11px; }
.grafiek .rasterlijn { stroke: var(--raster); stroke-width: 1; }
.grafiek .reeks-1 { fill: var(--reeks-1); }
.grafiek .reeks-2 { fill: var(--reeks-2); }
.grafiek .band { fill: transparent; }
.grafiek .band:hover, .grafiek .band.aan { fill: var(--accent-zacht); }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--tekst-zacht); margin-bottom: 6px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legenda i.reeks-1 { background: var(--reeks-1); }
.legenda i.reeks-2 { background: var(--reeks-2); }
.tooltip { position: absolute; pointer-events: none; background: var(--paneel-licht); border: 1px solid var(--rand); border-radius: 6px; padding: 5px 9px; font-size: 12px; white-space: nowrap; z-index: 2; }
.tooltip b { display: block; font-weight: 600; }
.tooltip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.tooltip i.reeks-1 { background: var(--reeks-1); }
.tooltip i.reeks-2 { background: var(--reeks-2); }
details.tabelkeuze { margin-top: 8px; font-size: 13px; }
details.tabelkeuze summary { cursor: pointer; color: var(--tekst-zacht); }
details.tabelkeuze .tabelvak { max-height: 260px; overflow-y: auto; margin-top: 6px; }

/* Spelerskaart op het overzicht */
.kaartkop { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.kaartkop h2 { margin: 0; }
.schakelaar { display: inline-flex; border: 1px solid var(--rand); border-radius: 7px; overflow: hidden; }
.schakelaar button { border: 0; border-radius: 0; background: transparent; padding: 4px 12px; font-size: 13px; }
.schakelaar button + button { border-left: 1px solid var(--rand); }
.schakelaar button[aria-pressed="true"] { background: var(--accent); color: var(--op-accent); font-weight: 600; }
.kaartrooster { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(240px, 1fr); gap: 20px; align-items: start; }
.kaart { position: relative; max-width: 520px; width: 100%; justify-self: center; }
.kaart svg { display: block; width: 100%; height: auto; overflow: visible; }
.kaart .provincies path { fill: var(--land); stroke: var(--land-rand); stroke-width: 4; stroke-linejoin: round; }
.kaart .gloed circle { opacity: 0.4; }
.kaart .stip { stroke: var(--paneel); stroke-width: 6; }
.kaart .stip.grof { fill-opacity: 0.45; stroke: currentColor; stroke-dasharray: 14 10; stroke-width: 5; }
.kaart .stip.aan { stroke: var(--tekst); stroke-width: 9; }
.kaart .raak { fill: transparent; cursor: default; }
.kaart .kaartlabels text { fill: var(--tekst); font-size: 52px; font-weight: 650; paint-order: stroke; stroke: var(--paneel); stroke-width: 14px; stroke-linejoin: round; pointer-events: none; }
.kaartleeg { position: absolute; left: 8%; right: 8%; top: 42%; text-align: center; background: var(--paneel-licht); border: 1px solid var(--rand); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.heet-1 { fill: var(--heet-1); background: var(--heet-1); color: var(--heet-1); }
.heet-2 { fill: var(--heet-2); background: var(--heet-2); color: var(--heet-2); }
.heet-3 { fill: var(--heet-3); background: var(--heet-3); color: var(--heet-3); }
.heet-4 { fill: var(--heet-4); background: var(--heet-4); color: var(--heet-4); }
.heet-5 { fill: var(--heet-5); background: var(--heet-5); color: var(--heet-5); }
.kaartzij h3 { font-size: 13px; font-weight: 650; margin: 16px 0 6px; color: var(--tekst-zacht); }
.kaartcijfers { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.kaartcijfers .waarde { font-size: 22px; font-weight: 650; line-height: 1.2; }
.hotspots { list-style: none; margin: 0; padding: 0; }
.hotspots button { display: grid; grid-template-columns: 10px minmax(0, 1fr) 72px 44px; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-radius: 6px; padding: 5px 6px; text-align: left; }
.hotspots button:hover, .hotspots button:focus-visible { background: var(--accent-zacht); }
.hotspots .blokje { width: 10px; height: 10px; border-radius: 50%; }
.hotspots .plek { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotspots .balk { height: 6px; border-radius: 3px; background: var(--raster); overflow: hidden; }
.hotspots .balk > span { display: block; height: 100%; border-radius: 3px; }
.hotspots .getal { text-align: right; font-weight: 600; }
.schaal { display: flex; align-items: center; gap: 4px; margin-top: 14px; }
.schaal i { width: 22px; height: 8px; border-radius: 2px; }
.schaal i:first-of-type { margin-left: 4px; }
.schaal i:last-of-type { margin-right: 4px; }
.voetnoot { margin: 12px 0 0; }

@media (max-width: 760px) {
  .schil { grid-template-columns: minmax(0, 1fr); }
  .zijbalk { position: static; height: auto; flex-direction: column; gap: 8px; border-right: 0; border-bottom: 1px solid var(--rand); padding: 10px 6px; }
  .menu { flex-direction: row; overflow-x: auto; }
  .menu a { white-space: nowrap; }
  .inhoud { padding: 16px 16px 48px; }
  .rooster, .rooster.breed { grid-template-columns: minmax(0, 1fr); }
  .afkap { max-width: 180px; }
  .kaartrooster { grid-template-columns: minmax(0, 1fr); }
}
