/* DeVeDo Stats — stijl. Zelfstandig (geen externe afhankelijkheden). */
:root {
  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #1a1d21;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --line: #e3e6ea;
  --line-strong: #cdd2d9;
  --brand: #61A60E;
  --brand-strong: #4f8a0b;
  --brand-soft: #eef6e0;
  --brand-ink: #34590a;
  --opp: #c2521f;
  --opp-soft: #fbe9df;
  --opp-ink: #8a3812;
  --made: #1d9e75;
  --made-soft: #e1f5ee;
  --miss: #e24b4a;
  --miss-soft: #fceaea;
  --warn: #b87514;
  --warn-soft: #fbeeda;
  --radius-md: 10px;
  --radius-lg: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #0e1116; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overflow: hidden; }
button { font-family: inherit; }

.screen { display: none; width: 100vw; height: 100vh; overflow: auto; }
.screen.active { display: block; }
#screen-live.active { display: flex; flex-direction: column; overflow: hidden; }

/* ---------- Algemene schermen (home/setup/newmatch) ---------- */
.page { max-width: 920px; margin: 0 auto; padding: 22px 20px 40px; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 44px; height: 44px; border-radius: 11px; }
.brand h1 { font-size: 20px; margin: 0; font-weight: 800; }
.brand p { margin: 0; font-size: 13px; color: var(--muted); }
.page, .page * { color: var(--ink); }
.screen:not(#screen-live) { background: var(--bg); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.btn-primary { background: var(--brand-strong); color: #fff; border: 0; border-radius: 12px; padding: 14px 20px; font-size: 16px; font-weight: 800; cursor: pointer; }
.btn-primary[disabled] { opacity: .4; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 18px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-ghost { background: transparent; border: 0; color: var(--muted); font-weight: 700; cursor: pointer; font-size: 14px; padding: 8px 10px; }
.btn-danger { background: var(--miss-soft); color: #a32d2d; border: 1px solid #f0baba; border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; font-size: 13px; }

label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=date], input[type=number], select {
  width: 100%; padding: 12px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 16px; background: var(--surface); color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; font-weight: 700; color: var(--muted); cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--brand-strong); color: #fff; }

/* match-lijst */
.match-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px; border-top: 1px solid var(--line); }
.match-item:first-child { border-top: 0; }
.match-item .when { font-size: 13px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag.live { background: var(--made-soft); color: #0d6b4f; }

/* roster / lineup keuze */
.plist { display: flex; flex-direction: column; gap: 8px; }
.pitem { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pitem .nr { font-weight: 800; min-width: 42px; }
.pitem .nm { flex: 1; }
.pitem .kl { font-size: 13px; color: var(--muted); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick .chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 9px 13px; font-weight: 800; cursor: pointer; font-size: 14px; }
.pick .chip.on { background: var(--brand-strong); color: #fff; border-color: var(--brand-strong); }
.hint { font-size: 13px; color: var(--muted); }

/* ============ LIVE-SCHERM ============ */
.gamebar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 16px; background: var(--brand-strong); color: #fff; gap: 18px; }
.teamblock { display: flex; align-items: center; gap: 18px; }
.teamblock.opp { justify-content: flex-end; }
.teamname { font-size: 17px; font-weight: 800; }
.teamname .tg { font-size: 11px; font-weight: 600; opacity: .7; margin-left: 5px; }
.meter { display: flex; align-items: center; gap: 7px; }
.meter .ml { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .72; }
.meter .mv { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.bonus { font-size: 10px; font-weight: 800; background: #f5c518; color: #5a4500; padding: 2px 6px; border-radius: 6px; margin-left: 4px; }
.bonus.off { display: none; }
.pips { display: flex; align-items: center; gap: 5px; }
.pip { width: 11px; height: 11px; border-radius: 50%; background: #fff; box-sizing: border-box; }
.pip.used { background: transparent; border: 1.5px solid rgba(255,255,255,.45); }
.pip-gap { width: 10px; }
.scorecenter { display: flex; align-items: center; gap: 16px; }
.score-num { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; min-width: 46px; text-align: center; }
.qrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16); border-radius: 999px; padding: 3px 6px; }
.qrow button { background: rgba(255,255,255,.2); border: 0; color: #fff; width: 26px; height: 26px; border-radius: 50%; font-size: 17px; cursor: pointer; line-height: 1; }
.qrow .qlabel { font-size: 13px; font-weight: 700; min-width: 30px; text-align: center; }
.gamebar .exit { background: rgba(255,255,255,.16); border: 0; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }

.stage { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 16px; min-height: 0; }
.courtcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 6px; display: flex; flex-direction: row; gap: 8px; min-height: 0; }
.courtcard.dv { border-top: 4px solid var(--brand); }
.courtcard.op { border-top: 4px solid var(--opp); }
.sidepanel { width: 134px; flex: none; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.panel-roster { display: flex; flex-direction: column; gap: 5px; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.prow .pn { font-weight: 800; font-size: 15px; }
.prow.out { background: var(--miss-soft); border-color: #eeb9b9; }
.prow.out .pn { color: #a32d2d; }
.foul-dots { display: flex; gap: 3px; }
.fd { width: 6px; height: 6px; border-radius: 50%; background: #d7dbe1; }
.fd.on { background: #8a929c; }
.fd.warn { background: #c2851a; }
.out-tag { font-size: 10px; font-weight: 800; color: #a32d2d; background: #f6d3d3; padding: 2px 7px; border-radius: 6px; }
.panel-bench { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.panel-bench .bl { font-size: 10px; color: var(--faint); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; width: 100%; margin-bottom: 1px; }
.mininum { font-size: 12px; font-weight: 700; color: var(--faint); border: 1px dashed var(--line-strong); border-radius: 8px; padding: 3px 7px; }
.panel-foot { display: flex; flex-direction: column; gap: 7px; margin-top: auto; }
.wissel { border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand-ink); border-radius: 12px; padding: 13px 10px; font-size: 15px; font-weight: 800; cursor: pointer; width: 100%; text-align: center; }
.wissel.op { border-color: var(--opp); background: var(--opp-soft); color: var(--opp-ink); }
.toggle-shots { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 12px; padding: 13px 10px; font-size: 15px; font-weight: 800; cursor: pointer; width: 100%; text-align: center; }
.toggle-shots.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.klasschip { font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 10px; text-align: center; }
.klasschip.ok { background: var(--made-soft); color: #0d6b4f; }
.klasschip.warn { background: var(--warn-soft); color: var(--warn); }
.klasschip.none { background: var(--surface-2); color: var(--faint); font-weight: 600; }
.courtwrap { flex: 1; min-height: 0; display: flex; }
.courtwrap svg { width: 100%; height: 100%; cursor: pointer; }

.actionbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 16px 10px; }
.actionbar .btn { height: 66px; font-size: 19px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; cursor: pointer; }
.actionbar .btn.ghost { color: var(--muted); }
.actionbar .btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- Modals ---------- */
.overlay { position: fixed; inset: 0; background: rgba(14,17,22,.55); display: none; align-items: center; justify-content: center; z-index: 20; }
.overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 16px; width: min(580px, 92%); max-height: 92%; overflow: auto; padding: 18px 20px; }
.modal h3 { margin: 0; font-size: 19px; }
.modal .sub { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.sec-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); margin: 14px 0 8px; }
.pgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.pbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 800; cursor: pointer; min-width: 52px; text-align: center; color: var(--ink); }
.pbtn.bank { color: var(--muted); border-style: dashed; font-size: 14px; padding: 9px 12px; }
.pbtn.sel { background: var(--brand-strong); color: #fff; border-color: var(--brand-strong); }
.outcome { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.obtn { border: 2px solid transparent; border-radius: 12px; padding: 16px; font-size: 18px; font-weight: 800; cursor: pointer; }
.obtn.miss { background: var(--miss-soft); color: #a32d2d; }
.obtn.made { background: var(--made-soft); color: #0d6b4f; }
.obtn.sel, .obtn.sel-tab { border-color: currentColor; }
.points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.ptbtn { border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 800; cursor: pointer; text-align: center; }
.ptbtn.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.ftypes { display: flex; flex-wrap: wrap; gap: 8px; }
.tbtn { border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; font-size: 13px; font-weight: 800; cursor: pointer; color: var(--ink); background: var(--surface); }
.tbtn.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.mbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 20px; font-size: 15px; font-weight: 800; cursor: pointer; }
.mbtn.primary { background: var(--brand-strong); color: #fff; border-color: var(--brand-strong); }
.mbtn.primary[disabled] { opacity: .4; cursor: not-allowed; }
.mbtn.ghost { color: var(--muted); }
.swap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.swap h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.swap .collist { display: flex; flex-direction: column; gap: 7px; }
.swap .pbtn { display: flex; justify-content: space-between; align-items: center; min-width: 0; }
.swap .pbtn .kl { font-size: 12px; font-weight: 700; opacity: .7; }
.klassline { margin-top: 16px; padding: 11px 14px; border-radius: 10px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; background: var(--made-soft); color: #0d6b4f; }
.klassline.warn { background: var(--warn-soft); color: var(--warn); }
.ftslot { display: grid; grid-template-columns: 72px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.ftslot .lbl { font-weight: 800; color: var(--muted); font-size: 13px; }
.ftslot .sbtn { border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-weight: 800; cursor: pointer; font-size: 14px; background: var(--surface); color: var(--ink); }
.ftslot .sbtn.raak.sel { background: var(--made-soft); color: #0d6b4f; border-color: #0d6b4f; }
.ftslot .sbtn.mis.sel { background: var(--miss-soft); color: #a32d2d; border-color: #a32d2d; }
