/* Opzet: clubbord. Groene balk met speelveldlijnen bovenaan, daaronder een agenda per speeldag met één kaart per beurt. */
:root {
  --bg: #eef2ee;
  --surface: #ffffff;
  --ink: #14231b;
  --muted: #55665c;
  --line: #d3ddd5;
  --band: #17503a;
  --accent: #1f6b47;
  --accent-ink: #ffffff;
  --fluiten: #2457c5;
  --fruit: #b65608;
  --toog: #8b3a86;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --bad: #a3271f;
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1713; --surface: #16241d; --ink: #e6efe9; --muted: #9aaca1; --line: #2a3b31;
    --band: #0b2a1e; --accent: #3fa776; --accent-ink: #06150e;
    --fluiten: #86a8f5; --fruit: #f1a460; --toog: #d98fd3;
    --warn: #f1cf86; --warn-bg: #3a2f14; --bad: #ff8a80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1713; --surface: #16241d; --ink: #e6efe9; --muted: #9aaca1; --line: #2a3b31;
  --band: #0b2a1e; --accent: #3fa776; --accent-ink: #06150e;
  --fluiten: #86a8f5; --fruit: #f1a460; --toog: #d98fd3;
  --warn: #f1cf86; --warn-bg: #3a2f14; --bad: #ff8a80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.field input[type="file"] { padding: 8px 0; max-width: 100%; }
.wrap {
  max-width: 980px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Balk */
.band { background: var(--band); color: #fff; position: relative; overflow: hidden; }
.band::before { content: ""; position: absolute; right: -70px; top: 50%; width: 280px; height: 280px; border: 2px solid rgba(255,255,255,.16); border-radius: 50%; transform: translateY(-50%); }
.band::after { content: ""; position: absolute; right: 70px; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.16); }
.band .wrap { position: relative; z-index: 1; padding-block: 22px 0; }
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.brand h1 { margin: 0; font: 700 clamp(44px, 9vw, 64px)/0.95 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.brand p { margin: 0; font-size: 15px; opacity: .88; max-width: 34ch; }
.nav { display: flex; gap: 4px; margin-top: 18px; }
.nav button { background: transparent; border: 0; color: rgba(255,255,255,.78); padding: 11px 16px; font: 600 15px var(--font-body); border-radius: 8px 8px 0 0; min-height: 44px; }
.nav button[aria-current="page"] { background: var(--bg); color: var(--ink); }

main { padding-block: 22px 56px; }
.view[hidden] { display: none; }

/* Wie ben jij */
.who { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }
.who.attention { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field .lab { font: 600 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field select, .field input[type="text"], .field input[type="url"], .field input[type="date"], .field textarea {
  min-height: 44px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; max-width: 100%;
}
.field textarea { min-height: 76px; resize: vertical; }
.who .field.grow { flex: 1 1 240px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.seg label { text-transform: none; letter-spacing: 0; font: 500 15px var(--font-body); color: var(--ink); padding: 0 16px; min-height: 42px; display: flex; align-items: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { font-weight: 600; }
.seg label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }
.hint { color: var(--muted); font-size: 14px; }

.banner { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.banner.bad { color: var(--bad); }

/* Overzicht */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 2px 0 2px 14px; border-left: 3px solid var(--accent); }
.stat b { display: block; font: 700 34px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; min-height: 40px; font-weight: 500; font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.toolbar .spacer { flex: 1; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); min-height: 40px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Agenda */
.day { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding-block: 18px; border-top: 1px solid var(--line); }
.date { text-align: left; }
.date .n { font: 700 46px/0.95 var(--font-display); font-variant-numeric: tabular-nums; }
.date .m { font: 600 13px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.date .w { font-size: 14px; color: var(--muted); }
.date .today { display: inline-block; margin-top: 4px; font: 600 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 999px; }
.beurten { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.beurt { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.beurt .top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.tag { --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--font-body); color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); padding: 4px 11px 4px 8px; border-radius: 999px; }
.tag svg { width: 17px; height: 17px; }
.tag.fluiten { --c: var(--fluiten); } .tag.fruit { --c: var(--fruit); } .tag.toog { --c: var(--toog); }
.time { font: 600 15px var(--font-body); font-variant-numeric: tabular-nums; }
.cat { color: var(--muted); font-size: 14px; }
.match { margin: 0 0 12px; font: 600 19px/1.25 var(--font-body); overflow-wrap: anywhere; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); max-width: 100%; }
.slot .nm { overflow-wrap: anywhere; font-weight: 500; }
.slot.mine { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); }
.slot .act { background: none; border: 0; padding: 4px 2px; color: var(--muted); text-decoration: underline; font-size: 14px; min-height: 32px; }
.slot.free { --c: var(--accent); border: 1.5px dashed var(--c); background: transparent; color: var(--c); font-weight: 600; padding: 6px 18px; }
.beurt.fluiten .slot.free { --c: var(--fluiten); } .beurt.fruit .slot.free { --c: var(--fruit); } .beurt.toog .slot.free { --c: var(--toog); }
.slot.free:hover { background: color-mix(in srgb, var(--c) 10%, transparent); }
.busy .slot, .busy .chip, .busy .act { pointer-events: none; opacity: .6; }
.empty { padding: 36px 8px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.empty b { display: block; color: var(--ink); font: 700 24px var(--font-display); margin-bottom: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 26px; }
.panel h2 { margin: 0 0 4px; font: 700 24px var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.panel p { margin: 0 0 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 0 18px; min-height: 44px; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn[disabled] { opacity: .55; cursor: default; }
textarea.share { width: 100%; min-height: 150px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }

/* Media */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.media { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.media .frame { aspect-ratio: 16 / 10; background: color-mix(in srgb, var(--ink) 8%, var(--surface)); display: grid; place-items: center; width: 100%; max-width: 100%; border: 0; overflow: hidden; padding: 0; }
.media .frame img, .media .frame iframe { width: 100%; height: 100%; border: 0; object-fit: cover; display: block; }
.media button.frame { cursor: zoom-in; }
.media .linkframe { text-decoration: none; color: var(--fluiten); font-weight: 600; padding: 14px; text-align: center; overflow-wrap: anywhere; }
.media .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.media h3 { margin: 0; font: 600 16px/1.3 var(--font-body); overflow-wrap: anywhere; }
.media p { margin: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.meta { font-size: 13px; color: var(--muted); }
.kind { font: 600 11px var(--font-body); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
dialog#lb { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog#lb::backdrop { background: rgba(0,0,0,.82); }
dialog#lb img { max-width: 96vw; max-height: 92vh; display: block; border-radius: 8px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 8px; max-width: min(92vw, 520px); font-size: 15px; z-index: 20; }
.toast[hidden] { display: none; }

@media (max-width: 560px) {
  .day { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
  .date .n { font-size: 38px; }
  .date .w { font-size: 13px; }
  .date .today { font-size: 10px; letter-spacing: .02em; padding: 2px 6px; }
  .brand p { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .slot, .chip, .btn { transition: background-color .15s, border-color .15s; }
}

.who[hidden] { display: none; }
.nav { flex-wrap: wrap; }

/* Beheer */
.stack { display: flex; flex-direction: column; gap: 14px; }
.panel .stack { margin-top: 12px; }
.panel h3 { margin: 18px 0 6px; font: 600 16px var(--font-body); }
.callout { border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-radius: 8px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.callout code { font: 600 18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; background: var(--surface); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); user-select: all; }
.callout.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font: 600 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
table.t tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; font: 600 11px var(--font-body); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--accent); text-decoration: underline; min-height: 32px; font-size: 14px; }
.link-btn.bad { color: var(--bad); }
.radios { display: flex; flex-direction: column; gap: 8px; }
.radios label { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.radios input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--accent); }
.radios small { display: block; color: var(--muted); }
.who .field select { min-width: 0; }
.field input[type="password"], .field input[type="email"], .field input[type="number"] { min-height: 44px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
details.plain { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
details.plain summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.beurt .beheerbalk { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--muted); }
.beurt .beheerbalk select { min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 2px 8px; }
.media video { width: 100%; height: 100%; background: #000; display: block; object-fit: contain; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; width: 160px; display: inline-block; vertical-align: middle; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; }
