/* App (beheer, publieke pagina's, print): huisstijl via CSS-variabelen, standaard Toernooibord (navy/blauw/amber, Sora + Inter) */
/* Lettertypes zelf gehost (geen verbinding met Google: AVG en snelheid). Variabele fonts, subsets latin + latin-ext;
   bron Google Fonts, licentie SIL Open Font License 1.1 (zie ../fonts/LICENSE.txt). */
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 100 800; font-display: swap; src: url(../fonts/sora-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 100 800; font-display: swap; src: url(../fonts/sora-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 700; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 700; font-display: swap; src: url(../fonts/bricolage-grotesque-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/plus-jakarta-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Standaardhuisstijl Toernooibord. Per account instelbaar (Beheer → Account): server/thema.js zet dan dezelfde
   variabelen in de kop van de pagina (o.a. de Tevoko-stijl: groen/limoen, zand, Bricolage Grotesque + Plus Jakarta Sans).
   Namen uit de eerste versie: --green = hoofdkleur (koppen, knoppen), --lime = accent, --ink = donkere vlakken. */
:root {
  --ink: #0e1a2b;
  --ink-2: #1b2c45;
  --green: #1d5bd8;
  --green-dark: #1647ab;
  --green-soft: #e9f0fd;
  --lime: #ffb020;
  --lime-dark: #1d5bd8;
  --lime-soft: #fff4dc;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #13213a;
  --muted: #5d6779;
  --line: #e2e6ee;
  --ok: #10866f;
  --ok-soft: #e2f5f0;
  --warn: #c27b09;
  --warn-text: #8f5a05; /* oranje als tekst: --warn haalt op wit maar 3,4:1 */
  --warn-soft: #fdf4e6;
  --err: #cb3439;
  --err-soft: #fdecec;
  --heren: #2566ac;
  --dames: #cb3439;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(14, 26, 43, .08);
  --header-grad: linear-gradient(90deg, #0e1a2b 0%, #1b3358 100%);
  --tap: 48px;
  --font-head: "Sora", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .6em; }
h1 { color: var(--green); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--lime-dark); }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }

/* Hoog contrast (instelling van het apparaat, handig in fel zonlicht): geen grijze tekst, duidelijkere lijnen */
@media (prefers-contrast: more) {
  :root { --muted: var(--text); --line: #8a93a3; }
  a { text-decoration-thickness: 2px; }
  .btn-ghost, .chip { border-color: var(--text) !important; }
}

/* Topbalk */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--header-grad); color: #fff;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { height: 40px; width: auto; display: block; }
/* logo laadt niet: de alt-tekst netjes op één regel binnen de hoogte van het logo, niet over de titel heen */
.brand img { max-width: 40vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 .8rem/40px var(--font); color: rgba(255,255,255,.9); }
.brand-name { font-family: var(--font-head); font-size: 1.15rem; line-height: 1.1; color: inherit; } /* account zonder logo */
.brand-text { font-family: var(--font-head); color: #fff; font-size: 1.1rem; line-height: 1.1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.brand-text small { display: block; font-family: var(--font); color: rgba(255,255,255,.9); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 8px; color: #fff; }
.menu summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 24px; height: 3px; background: #fff; border-radius: 2px; position: relative; content: ""; }
.burger::before { position: absolute; top: -8px; }
.burger::after { position: absolute; top: 8px; }
.menu-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.menu nav {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--ink); border: 1px solid #444; border-radius: var(--radius);
  min-width: 240px; padding: 8px; display: flex; flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.menu nav a { color: #fff; text-decoration: none; padding: 12px; border-radius: 999px; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.nav-group { display: flex; flex-direction: column; }
.nav-group + .nav-group { border-top: 1px solid #ffffff22; margin-top: 6px; padding-top: 6px; }
.nav-kop { color: #ffffffa0; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px 4px; }
/* telefoon/tablet: navigatielade over de volle hoogte (Material navigation drawer); tik ernaast sluit hem */
@media (max-width: 1279px) {
  .menu summary { position: relative; z-index: 1; }
  .menu[open] summary::before { content: ""; position: fixed; inset: 0; background: rgba(14, 26, 43, .45); cursor: default; }
  .menu nav { position: fixed; top: 0; right: 0; bottom: 0; z-index: 2; width: min(320px, 86vw); overflow-y: auto; border-radius: var(--radius) 0 0 var(--radius); border: 0; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); flex-wrap: nowrap; }
}
.menu nav a:hover, .menu nav a[aria-current] { background: var(--ink-2); color: var(--lime); }
.menu .logout { border-top: 1px solid #444; margin-top: 6px; padding: 10px 4px 2px; display: flex; flex-direction: column; gap: 8px; }
.menu .who { color: #bbb; font-size: .85rem; padding: 0 8px; }

@media (min-width: 1280px) {
  .menu summary { display: none; }
  .menu nav { position: static; display: flex; flex-direction: row; align-items: center; background: none; border: 0; box-shadow: none; padding: 0; min-width: 0; gap: 2px; }
  .menu:not([open]) nav { display: flex; }
  .menu .logout { flex-direction: row; align-items: center; border: 0; margin: 0 0 0 12px; padding: 0; }
  .nav-group { display: contents; }
  .nav-kop { display: none; }
  .menu nav a { min-height: 40px; padding: 8px 12px; }
}

/* Inhoud */
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.page-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

/* Meldingen */
.flash, .note { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border-left: 5px solid; }
.flash-ok, .note-ok { background: var(--ok-soft); border-color: var(--ok); }
.flash-warn, .note-warn { background: var(--warn-soft); border-color: var(--warn); }
.flash-err, .note-err { background: var(--err-soft); border-color: var(--err); }
.note ul { margin: .3em 0 0; padding-left: 1.2em; }

/* Knoppen */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--green); color: #fff;
}
.btn:hover { filter: brightness(.95); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--heren); outline-offset: 2px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--green); border: 1px solid var(--line); }
.btn-danger { background: var(--err); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn-big { min-height: 64px; font-size: 1.15rem; padding: 0 28px; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }

/* Formulieren */
label { display: block; font-weight: 600; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input:not([type]), input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], input[type=color], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
  font: 1rem var(--font);
}
input[type=color] { padding: 4px; width: 64px; }
textarea { min-height: 200px; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.checkbox { display: flex; gap: 10px; align-items: center; font-weight: 400; min-height: var(--tap); }
.checkbox input { width: 22px; height: 22px; }

.check-list { max-height: 260px; overflow-y: auto; border: 2px solid var(--line); border-radius: 8px; padding: 4px 12px; margin-top: 8px; background: #fff; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); column-gap: 24px; align-content: start; }
.check-list .checkbox { min-height: 40px; }

/* Tabellen */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { border-collapse: collapse; width: 100%; background: var(--card); }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafaf7; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data input, table.data select { min-height: 40px; padding: 6px 8px; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--line); color: var(--text); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn-text); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-H { background: var(--heren); color: #fff; }
.badge-D { background: var(--dames); color: #fff; }

/* Tegels op overzicht */
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); border-top: 5px solid var(--lime); min-height: 120px; }
.tile:hover { border-color: var(--lime-dark); }
.tile h2 { margin-bottom: .3em; }
.tile.soon { opacity: .6; border-top-color: var(--line); pointer-events: none; }
/* telefoon: tegels als compacte lijstregels (titel + één regel uitleg + pijltje) */
@media (max-width: 600px) {
  .grid:has(> .tile) { gap: 8px; }
  .tile { min-height: 0; padding: 12px 40px 12px 16px; border-top-width: 1px; border-left: 5px solid var(--lime); position: relative; }
  .tile::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border: solid var(--muted); border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); }
  .tile h2 { font-size: 1.05rem; margin: 0; }
  .tile p { margin: 2px 0 0; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* speeldag: lopende ronde en voortgang bovenaan het overzicht */
.live-card { border-left: 6px solid var(--ok); }
.live-kop { font-size: 1.05rem; }
.live-stand { margin: 6px 0; }
.live-stand strong { font-family: var(--font-head); font-size: 1.6rem; }
.live-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 14px; }
.live-bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.live-card .btn-big { width: 100%; max-width: 420px; }

/* Inlogscherm */
.auth { max-width: 460px; margin: 24px auto; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.tabs a { text-align: center; padding: 12px; border-radius: 8px; background: var(--card); border: 2px solid var(--line); text-decoration: none; color: var(--text); font-weight: 700; }
.tabs a[aria-current] { border-color: var(--lime-dark); background: var(--lime-soft); }
.code-input { font-size: 1.6rem !important; letter-spacing: .15em; text-transform: uppercase; text-align: center; font-family: ui-monospace, Consolas, monospace !important; }
.code-show { font: 700 2.2rem ui-monospace, Consolas, monospace; letter-spacing: .12em; background: var(--ink); color: var(--lime); padding: 16px 24px; border-radius: var(--radius); display: inline-block; }

/* Schema-overzicht */
.sched { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sched th, .sched td { border: 1px solid var(--line); padding: 6px 10px; text-align: center; background: var(--card); }
.sched th { background: #fafaf7; font-size: .8rem; }
.sched td.hl { background: var(--lime-soft); font-weight: 700; }
.ovl td.o0 { background: #fff; }
.ovl td.o1 { background: #e8f5e9; }
.ovl td.o2 { background: #fff8e1; }
.ovl td.o3 { background: #ffe0b2; }
.ovl td.o4 { background: #ffccbc; }
.ovl td.self { background: var(--ink); color: var(--ink); }

/* Indelingsbord */
.board { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); margin-bottom: 20px; }
.poule { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; scroll-margin-top: 90px; }
.poule header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; color: #fff; background: var(--ink); }
.poule .pname { font-family: var(--font-head); font-size: 1.1rem; }
.poule .pcount { font-family: var(--font); font-size: .7rem; background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
.poule .pfield { font-size: .8rem; opacity: .9; text-align: right; }
.poule ol { list-style: none; margin: 0; padding: 4px 0; }
.poule li form { margin: 0; }
.slot {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 4px 12px;
  border: 0; background: none; color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer;
  border-top: 1px solid #f0f0ea;
}
a.slot:hover { background: var(--lime-soft); }
.slot .nr { font-family: var(--font-head); width: 1.4em; color: var(--muted); text-align: right; flex: none; }
.slot .tn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.slot .tn em { font-weight: 400; color: var(--muted); }
.slot .cls { font-size: .75rem; color: var(--muted); flex: none; }
.slot .act { flex: none; font-weight: 700; }
.slot.empty { cursor: default; }
.is-sel .slot { background: var(--ink) !important; color: #fff; }
.is-sel .slot .nr, .is-sel .slot .cls { color: var(--lime); }
.target.t-ok { background: #edf7ee; }
.target.t-warn { background: var(--warn-soft); }
.target.t-err { background: var(--err-soft); }
.target:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
.tgt-key { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: .75rem; color: var(--text); margin-left: 4px; }
.tgt-key.t-ok { background: #edf7ee; } .tgt-key.t-warn { background: var(--warn-soft); } .tgt-key.t-err { background: var(--err-soft); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot-err { background: var(--err); } .dot-warn { background: #e0a800; }
.poule.reserve header { background: var(--muted); }
.selbar {
  position: sticky; top: 70px; z-index: 10; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.selbar .btn-ghost { color: #fff; }
.selbar details summary { cursor: pointer; color: var(--lime); margin-top: 4px; }

/* Slepen */
.grip { cursor: grab; touch-action: none; color: var(--muted); font-size: 1.15rem; line-height: 1; padding: 6px 2px; margin-left: -6px; flex: none; user-select: none; }
.grip-inline { color: var(--muted); }
[data-dnd] [data-drag] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dnd-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: .92; background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.dnd-ghost.pchip { width: auto !important; }
.dnd-src { opacity: .35; }
body.dnd-active, body.dnd-active * { cursor: grabbing !important; }
body.dnd-active .poule li[data-drop], body.dnd-active .poule.reserve { transition: background .1s; }
.dnd-active li.dt-ok .slot, .selecting li.dt-ok .slot { background: #edf7ee; }
.dnd-active li.dt-warn .slot, .selecting li.dt-warn .slot { background: var(--warn-soft); }
.dnd-active li.dt-err .slot, .selecting li.dt-err .slot { background: var(--err-soft); }
.selecting li[data-drop] .slot, .selecting section.reserve { cursor: pointer; }
li.dnd-over .slot, section.dnd-over { outline: 3px solid var(--ink); outline-offset: -3px; }
section.poule.reserve.dnd-over { background: var(--lime-soft); }
body.dnd-saving { opacity: .6; pointer-events: none; }

/* Veldenbord */
.fieldboard { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); margin-bottom: 20px; }
.frow { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 60px; scroll-margin-top: 90px; }
.frow .fhead { display: flex; align-items: center; gap: 10px; width: 48%; padding: 8px 12px; border-right: 1px dashed var(--line); }
.frow .fnr { font-family: var(--font-head); font-size: 1.4rem; min-width: 1.6em; text-align: right; }
.frow .fname { font-size: .9rem; line-height: 1.2; }
.frow .fslot { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; }
.frow.unassigned { grid-column: 1 / -1; background: #fafaf7; border-style: dashed; }
.frow.double { border-color: var(--err); }
.frow.dnd-over { outline: 3px solid var(--ink); outline-offset: -3px; background: var(--lime-soft); }
.pchip { display: inline-flex; align-items: center; gap: 6px; color: #fff; border-radius: 8px; padding: 6px 12px 6px 8px; font-family: var(--font-head); font-size: 1rem; cursor: grab; min-height: 44px; }
.pchip .grip { color: rgba(255,255,255,.8); margin-left: 0; }
.pchip small { font-family: var(--font); font-size: .7rem; background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 6px; }

@media (max-width: 600px) {
  .btn { white-space: normal; text-align: center; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; }
  .selbar { top: 64px; padding: 10px 12px; }
  .wrap { padding-top: 12px; }
  h1 { font-size: 1.35rem; }
}

@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}

/* Uitslagen invoeren */
.veld-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.veld { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-height: 130px; padding: 10px 8px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
.veld:hover { border-color: var(--ink); }
.veld-nr { font-family: var(--font-head); font-size: 2.6rem; line-height: 1; }
.veld-sponsor { font-size: .7rem; font-weight: 700; color: var(--ink); background: var(--lime-soft); border-radius: 4px; padding: 0 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.veld-poule { font-size: .75rem; font-weight: 700; color: var(--muted); }
.veld-teams { font-size: .78rem; line-height: 1.25; }
.veld-res { margin-top: auto; font-size: .8rem; color: var(--muted); }
.veld-res strong { font-family: var(--font-head); font-size: 1.1rem; color: var(--ok); }
.veld.done { background: var(--ok-soft); border-color: #b9dcbb; }
.veld.open .veld-res { color: var(--warn-text); font-weight: 700; }
.veld.last { border: 4px solid var(--ink); animation: veldflash 1.2s ease-out 2; }
@keyframes veldflash { 0% { box-shadow: 0 0 0 0 rgba(176, 203, 31, .9); } 100% { box-shadow: 0 0 0 14px rgba(176, 203, 31, 0); } }
/* minmax(0, …): anders rekt een lange sponsornaam (nowrap) de kolom op en loopt het raster buiten beeld */
.veld { min-width: 0; }
@media (max-width: 600px) { .veld-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .veld { min-height: 110px; padding: 6px 4px; } .veld-nr { font-size: 2rem; } .veld-teams { display: none; } }
/* na opslaan: knop naar het volgende open veld, blijft onderin staan (ook als de pagina naar het laatste veld springt) */
.next-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: center; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }
.next-bar .btn { box-shadow: var(--shadow), 0 4px 12px rgba(14, 26, 43, .18); }
.rnd-day { margin-top: 16px; }
.rnd-day > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: var(--tap); margin-bottom: 8px; }
.rnd-day > summary::-webkit-details-marker { display: none; }
.rnd-day > summary h2 { margin: 0; }
.rnd-day > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rnd-day[open] > summary::after { transform: rotate(-135deg); }
.rnd-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(110px, 100%), 1fr)); }
.rnd { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 88px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
.rnd-nr { font-family: var(--font-head); font-size: 1.4rem; }
.rnd-time { font-weight: 700; }
.rnd-count { font-size: .8rem; color: var(--muted); }
.rnd.done { background: var(--ok-soft); border-color: #b9dcbb; }
.rnd.part { background: var(--warn-soft); border-color: #eed48a; }
.rnd.current { border: 4px solid var(--ink); }
.mlist { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; min-height: 72px; padding: 10px 14px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.mrow:hover { border-color: var(--ink); }
.mrow.done { background: #f6fbf6; }
.m-field { display: flex; flex-direction: column; }
.m-field strong { font-family: var(--font-head); font-size: 1.6rem; line-height: 1; }
.m-field small { color: var(--muted); font-size: .75rem; }
.m-teams { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-weight: 700; font-size: 1.05rem; }
.m-teams .vs { color: var(--muted); }
.m-teams small { flex-basis: 100%; font-weight: 400; font-size: .8rem; }
.m-status { text-align: right; display: flex; flex-direction: column; }
.m-status strong { font-family: var(--font-head); font-size: 1.4rem; }
.m-status small { color: var(--muted); }

.entry { max-width: 720px; margin: 0 auto; }
.e-head { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; }
.e-field { color: var(--lime); font-weight: 700; font-size: .95rem; }
.e-teams { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.2; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.e-teams .vs { color: var(--lime); }
.e-head .muted { color: #ccc; }
.e-sets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.e-set { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-align: center; }
.e-set.win-a, .e-set.win-b { border-color: var(--ok); }
.e-set.draw { border-color: var(--warn); }
.e-set-title { font-weight: 700; color: var(--muted); }
.e-scores { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; }
.e-box input { width: 88px; height: 76px; font: 700 2.4rem var(--font); text-align: center; border: 3px solid var(--line); border-radius: 10px; background: #fff; caret-color: transparent; cursor: pointer; }
.e-box.active input { border-color: var(--ink); background: var(--lime-soft); box-shadow: 0 0 0 3px var(--lime); }
.e-dash { font-size: 2rem; color: var(--muted); }
.e-set-result { min-height: 1.4em; font-weight: 700; }
.e-set.win-a .e-set-result, .e-set.win-b .e-set-result { color: var(--ok); }
.e-set.draw .e-set-result { color: var(--warn-text); }
.e-wo-set { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.e-result { text-align: center; margin: 12px 0; min-height: 3.4em; }
.e-score { font-family: var(--font-head); font-size: 2.4rem; line-height: 1; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.keypad button { min-height: 68px; font: 700 1.8rem var(--font); border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.keypad button:active { background: var(--lime-soft); }
.keypad .k-clear { font-size: 1.1rem; background: #f6f6f1; }
.keypad .k-next { font-size: 1.1rem; background: var(--ink); color: #fff; border-color: var(--ink); }
.e-actions { display: grid; grid-template-columns: 3fr 1fr; gap: 10px; }
.e-actions .btn-big { min-height: 72px; font-size: 1.2rem; }
.e-more { margin-top: 16px; }
.e-more summary { cursor: pointer; font-weight: 600; }
@media (min-width: 900px) and (orientation: landscape) {
  .entry { max-width: 1100px; display: grid; grid-template-columns: 1fr 360px; gap: 0 20px; }
  .entry > .row, .entry > .e-head, .entry > .note, .entry > p { grid-column: 1 / -1; }
  #entry-form { display: contents; }
  .e-sets, .e-result, .e-warn, .e-more { grid-column: 1; }
  .e-pad { grid-column: 2; grid-row: span 4; align-self: start; }
  .e-pad .keypad { margin-top: 0; }
}
@media (max-width: 600px) {
  .mrow { grid-template-columns: 60px 1fr; }
  .m-status { grid-column: 2; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
  .entry > .row { margin-bottom: 4px !important; }
  .e-head { padding: 8px 12px; margin-bottom: 8px; }
  .e-field { font-size: .8rem; }
  .e-teams { font-size: 1.1rem; margin: 2px 0; }
  /* sets onder elkaar, per set één rij: "Set 1  [21] – [18]  15–0 / 0–15"; de teamnamen staan al in de kop */
  .e-sets { grid-template-columns: 1fr; gap: 6px; }
  .e-set { display: grid; grid-template-columns: 3.4em auto 1fr; grid-template-areas: "title scores wo" "res res res"; align-items: center; gap: 0 8px; padding: 6px 10px; text-align: left; }
  .e-set-title { grid-area: title; font-size: .85rem; line-height: 1.2; }
  .e-scores { grid-area: scores; gap: 4px; margin: 0; }
  .e-wo-set { grid-area: wo; justify-content: flex-end; margin: 0; }
  .e-set-result { grid-area: res; font-size: .78rem; min-height: 0; }
  .e-set-result:empty { display: none; }
  .e-set:has(.e-box.active) { border-color: var(--ink); }
  .e-box input { width: 56px; height: 52px; font-size: 1.7rem; border-width: 2px; }
  .e-dash { font-size: 1.3rem; }
  .e-wo-set .btn-sm { min-height: 36px; padding: 0 8px; font-size: .78rem; }
  .e-result { margin: 6px 0; min-height: 2.6em; }
  .e-score { font-size: 1.8rem; }
  /* toetsenblok + Opslaan samen vast onderin: er valt nooit een knop onder een andere */
  .e-pad { position: sticky; bottom: 0; z-index: 5; background: var(--bg); margin: 0 -16px; padding: 6px 16px max(8px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 16px rgba(14, 26, 43, .08); }
  .keypad { gap: 6px; margin: 0 0 6px; }
  .keypad button { min-height: 52px; font-size: 1.5rem; }
  .e-actions .btn-big { min-height: 56px; font-size: 1.05rem; }
  .entry .wrap, main.wrap:has(.entry) { padding-bottom: 16px; }
}
.team-note { font-size: .8rem; color: var(--text); background: var(--warn-soft); border-radius: 6px; padding: 2px 6px; margin-top: 4px; max-width: 520px; }
.home-sec { margin: 28px 0 12px; font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 10px; align-items: center; }
.home-sec .badge { text-transform: none; letter-spacing: 0; }
.pub-links .row { gap: 8px; }
/* Snackbars (app.js verplaatst de meldingen hierheen) */
.snackbars { position: fixed; left: 12px; right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
body:has(.next-bar) .snackbars { bottom: 104px; }
.flash.snackbar { pointer-events: auto; margin: 0; width: 100%; max-width: 600px; display: flex; align-items: flex-start; gap: 12px; background: var(--ink); color: #fff; border-left-width: 6px; box-shadow: 0 8px 24px rgba(14, 26, 43, .3); animation: snack-in .25s ease-out; transition: opacity .35s, transform .35s; }
.flash.snackbar a { color: var(--lime); }
.flash-ok.snackbar { border-color: #5fd3a5; }
.flash-warn.snackbar { border-color: var(--lime); }
.flash-err.snackbar { border-color: #ff8a8e; }
.snack-x { margin-left: auto; flex: none; background: none; border: 0; color: #fff; font-size: 1rem; min-width: 32px; min-height: 32px; cursor: pointer; border-radius: 50%; }
.snack-x:hover { background: #ffffff22; }
.snack-weg { opacity: 0; transform: translateY(12px); }
@keyframes snack-in { from { opacity: 0; transform: translateY(12px); } }
/* Wachtrij voor uitslagen zonder verbinding (app.js): vaste banner bovenin, onder de kopbalk (onderin staan toetsenblok en knoppen) */
.wachtrij { position: fixed; left: 12px; right: 12px; top: calc(68px + env(safe-area-inset-top)); z-index: 50; background: var(--warn-soft); border: 2px solid var(--warn); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); font-size: .95rem; }
.wachtrij p { margin: 4px 0; }
.wachtrij-lijst { display: block; color: var(--muted); margin-top: 2px; }
.wachtrij-fout { color: var(--err); font-weight: 600; }
.wachtrij .linkbtn, .linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }
#entry-form.busy { opacity: .6; pointer-events: none; }

/* Snel naar een onderdeel van een lange pagina (toernooi-instellingen) */
.jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px -16px 16px; padding: 0 16px 2px; }
.jump a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.jump a:hover { border-color: var(--green); }
.card[id] { scroll-margin-top: 80px; }
/* vaste Opslaan-balk onderin; "Nog niet opgeslagen" verschijnt na een wijziging (app.js) */
.save-bar { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: 10px 0 max(10px, env(safe-area-inset-bottom)); border-top: 1px solid transparent; }
.save-note { display: none; color: var(--warn-text); font-weight: 700; }
form.dirty .save-bar { border-top-color: var(--line); box-shadow: 0 -6px 16px rgba(14, 26, 43, .08); }
form.dirty .save-note { display: inline; }
.jump.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.jump.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px); mask-image: linear-gradient(90deg, transparent, #000 40px); }
.jump.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
