/* =====================================================================
   TOURNADA — gedeelde stijl (landing + beheer)
   ===================================================================== */
:root {
  --indigo: #4f46e5;
  --indigo-d: #3730a3;
  --amber: #f59e0b;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.05);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--indigo); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }

/* ---- Layout helpers ---- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hide { display: none !important; }

/* ---- Topbar ---- */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.brand .logo { width: 30px; height: 30px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  background: var(--indigo); color: #fff; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--indigo); border-color: var(--line); }
.btn.ghost:hover { background: #f1f5f9; filter: none; }
.btn.amber { background: var(--amber); color: #3b2600; }
.btn.danger { background: #fff; color: var(--err); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; filter: none; }
.btn.sm { padding: 6px 11px; font-size: .85rem; border-radius: 8px; }
.btn.xs { padding: 3px 7px; font-size: .9rem; line-height: 1.1; border-radius: 7px; }
/* Subtiel labeltje (bv. Sportrs-herkomst) naast een teamnaam. */
.mini-tag { display: inline-block; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); background: #f1f5f9; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; vertical-align: middle; }

/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Forms ---- */
label { display: block; font-weight: 600; font-size: .88rem; margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--indigo); border-color: var(--indigo); }
/* Ontbrekend verplicht veld + "wat mis je in deze stap"-melding. */
.veld-mist { border-color: var(--err); background: #fef2f2; }
.stap-mist { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin-bottom: 14px; }
/* Sportrs club/team-typeahead (team toevoegen). */
.tm-veld { position: relative; }
.tm-sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  max-height: 240px; overflow: auto; }
.tm-sug-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: .92rem; }
.tm-sug-item:hover { background: #f1f5f9; }
.tm-sug-item img { width: 22px; height: 22px; object-fit: contain; }
.tm-sug-item.nieuw { color: var(--indigo); border-top: 1px solid var(--line); font-weight: 600; }
/* Wedstrijdschema-stap: genummerde secties + poulegrid. */
.ws-nr { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--indigo); color: #fff; font-size: .9rem; margin-right: 8px; vertical-align: middle; }
.ws-poulegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ws-kolijst { list-style: none; padding: 0; margin: 0; }
/* Poule-indeling met slepen. */
.indeel-grid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.indeel-poules { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.indeel-kolom { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 70px; margin-top: 6px; }
.team-chip { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; margin: 6px 0; cursor: grab; font-size: .9rem; }
.team-chip:active { cursor: grabbing; }
.dropzone.over { outline: 2px dashed var(--indigo); outline-offset: 2px; background: #eef2ff; }
/* Knock-out slepen: bron-slots per wedstrijd. */
.ws-ko-matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ko-paar { display: flex; gap: 8px; align-items: center; }
.ko-slot { flex: 1; min-width: 90px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; text-align: center; background: #fff; font-size: .88rem; }
.ko-slot.gevuld { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-style: solid; text-align: left; }
.ws-ko-nieuw { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--indigo); color: var(--indigo); }
@media (max-width: 640px) { .indeel-grid { grid-template-columns: 1fr; } }
.ws-pauzerij td { background: #fff7ed; color: #9a3412; font-size: .85rem; }

/* ---- Programma per speelronde: tijd als balk, teams op 2 regels met logo ---- */
.ws-ronde { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; background: var(--card); }
.ws-ronde-balk { background: var(--indigo); color: #fff; font-weight: 700; padding: 8px 14px; font-size: .95rem; }
.ws-wed { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ws-wed-nr { color: var(--muted); font-size: .8rem; min-width: 1.4em; text-align: right; flex: 0 0 auto; }
.ws-wed-teams { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ws-wed-rij { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ws-wed-rij .team-logo, .ws-wed-rij .team-logo-ph { margin-right: 3px; vertical-align: middle; }
.ws-wed-naam { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-wed-rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.ws-wed-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; text-align: right; }
.ws-wed-acties { display: flex; gap: 4px; }
.ws-pauze-balk { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; border-radius: 8px; padding: 6px 12px; margin-bottom: 14px; font-size: .85rem; }
.ws-editrij { border-top: 1px solid var(--line); background: #f8fafc; padding: 12px 14px; }

/* Ruime bewerk-weergave van een wedstrijd in het programma (label links, invoer rechts). */
.ws-editrij td { background: #f8fafc; }
.ws-edit { max-width: 440px; }
.ws-edit-kop { font-weight: 700; margin-bottom: 6px; }
.ws-edit-rij { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; margin: 6px 0; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
.table-scroll { overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: center; width: 1%; white-space: nowrap; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge.concept { background: #f1f5f9; color: #475569; }
.badge.gepubliceerd { background: #dcfce7; color: #166534; }
.badge.bezig { background: #fef3c7; color: #92400e; }
.badge.afgelopen { background: #e0e7ff; color: #3730a3; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0; overflow-x: auto; }
.tab { padding: 10px 14px; border: none; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }

/* ---- Werkruimte: fase-gestuurde navigatie ---- */
.wr-kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 8px 0 16px; }

/* Fase-balk: waar zit ik in de reis van het toernooi? */
.fasebalk { display: flex; align-items: center; gap: 4px; margin: 0 0 20px; overflow-x: auto; padding-bottom: 2px; }
.fasestap { display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.fasestap .fasenr { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef2ff; color: var(--indigo); font-weight: 800; font-size: .82rem; flex: 0 0 auto; }
.fasestap .fasenaam { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: .82rem; }
.fasestap .fasenaam small { font-weight: 600; font-size: .78rem; color: inherit; opacity: .8; }
.fasestap.gedaan .fasenr { background: #dcfce7; color: var(--ok); }
.fasestap.toekomst { opacity: .55; }
.fasestap.actief { background: #eef2ff; border-color: #c7d2fe; color: var(--indigo-d); }
.fasestap.actief .fasenr { background: var(--indigo); color: #fff; }
.faselijn { flex: 1 1 14px; min-width: 12px; height: 2px; background: var(--line); border-radius: 2px; }

/* Twee kolommen: stappenlijst + inhoud */
.wr-body { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.stappen { position: sticky; top: 16px; max-height: calc(100vh - 28px); overflow: auto; }
/* Verouderd (te herbereken) schema: grijs + niet-interactief tot 'Genereer opnieuw'. */
.ws-verouderd { opacity: .45; pointer-events: none; }
/* Inklapbaar stap-menu links, met chevron-tab op de kolomrand. */
.wr-body { position: relative; }
.stappen-toggle { position: absolute; top: 0; z-index: 5; width: 22px; height: 34px; padding: 0;
  border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer;
  color: var(--indigo); font-size: 1.15rem; line-height: 1; }
.stappen-toggle:hover { background: #eef2ff; }
.wr-body:not(.stappen-dicht) .stappen-toggle { left: 286px; }
.wr-body.stappen-dicht { grid-template-columns: 1fr; }
.wr-body.stappen-dicht .stappen { display: none; }
.wr-body.stappen-dicht .stappen-toggle { left: 0; }
.wr-body.stappen-dicht .stapinhoud { padding-left: 30px; }
.stappen-kop { font-weight: 800; font-size: .95rem; color: var(--ink); }
.stappen-doel { font-size: .84rem; margin: 4px 0 12px; }
.stapitem { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: inherit; border: 1px solid transparent; margin-bottom: 4px; }
.stapitem:hover { background: #f8fafc; }
.stapitem.actief { background: #eef2ff; border-color: #c7d2fe; }
.stapitem .stapnr { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f1f5f9; color: var(--muted); font-weight: 800; font-size: .8rem; flex: 0 0 auto; margin-top: 1px; }
.stapitem.actief .stapnr { background: var(--indigo); color: #fff; }
.stapmid { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.staptitel { font-weight: 700; font-size: .9rem; }
.stapuitleg { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.stapind { font-size: .72rem; font-weight: 700; white-space: nowrap; flex: 0 0 auto; margin-top: 2px; }
.stapind.ok { color: var(--ok); }
.stapind.warn { color: var(--amber); }
.stapind.todo { color: var(--muted); }
.faseactie { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.faseactie.andere { border-top-color: transparent; }
.btn.breed { width: 100%; justify-content: center; }
.mini { font-size: .78rem; margin: 0; }
.klaar-note { font-weight: 700; margin: 0; }
.stapinhoud { min-width: 0; }

/* Keuzeblokken (bv. scheids-modus) */
.keuzeblok { display: flex; flex-direction: column; gap: 8px; }
.keuze { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.keuze input { width: auto; margin: 3px 0 0; flex: 0 0 auto; }
.keuze span { display: flex; flex-direction: column; }
.keuze small { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.keuze:has(input:checked) { border-color: #c7d2fe; background: #eef2ff; }

@media (max-width: 760px) {
  .wr-body { grid-template-columns: 1fr; }
  .stappen { position: static; }
  .stappen-toggle { display: none; }
  .wr-body.stappen-dicht .stapinhoud { padding-left: 0; }
  .fasestap .fasenaam small { display: none; }
}

/* ---- Toast ---- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; animation: pop .2s ease; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--err); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* ---- Landing ---- */
.hero { padding: 80px 0 60px; text-align: center; background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%); }
.hero.hero-foto { background: linear-gradient(rgba(15,23,42,.5), rgba(15,23,42,.66)), var(--hero-foto, none); background-size: cover; background-position: center; color: #fff; padding: 96px 0 84px; }
.hero.hero-foto h1 { color: #fff; }
.hero.hero-foto .lead { color: rgba(255,255,255,.92); }
.hero.hero-foto .pill { background: rgba(255,255,255,.22); color: #fff; }
.hero.hero-foto .btn.ghost { color: #fff; border-color: rgba(255,255,255,.55); background: transparent; }
.hero.hero-foto .btn.ghost:hover { background: rgba(255,255,255,.14); }
.sfeer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sfeer-grid img { width: 100%; height: 190px; object-fit: cover; border-radius: 12px; display: block; }
@media (max-width: 700px) { .sfeer-grid { grid-template-columns: repeat(2, 1fr); } .sfeer-grid img { height: 140px; } }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 14px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.pill { display: inline-block; background: #e0e7ff; color: var(--indigo-d); font-weight: 700; font-size: .8rem; padding: 5px 14px; border-radius: 999px; margin-bottom: 20px; }
.section { padding: 56px 0; }
.section h2 { font-size: 1.8rem; margin: 0 0 8px; }
.feature { padding: 22px; }
.feature .ico { font-size: 1.8rem; }
.feature h3 { margin: 10px 0 6px; font-size: 1.15rem; }
.eco { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.eco .card { border-top: 4px solid var(--indigo); }
.eco .card.sportrs { border-top-color: var(--amber); }
.eco .card.commentada { border-top-color: #0ea5e9; }
footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .9rem; }

/* ---- Publieke toernooipagina ---- */
.t-hero { background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-d) 100%); color: #fff; padding: 40px 0 34px; }
.t-hero.met-foto { background-size: cover; background-position: center; }
.t-hero .badge { background: rgba(255,255,255,.2); color: #fff; margin-bottom: 12px; }
.t-hero h1 { margin: 0; font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.t-meta { margin: 10px 0 0; opacity: .92; font-size: 1.02rem; }
.t-blokken { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.t-blok h2 { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; margin: 0 0 10px; }
.t-blok .t-ico { font-size: 1.5rem; line-height: 1; }
.t-content { color: #334155; }
.t-content h3 { font-size: 1.12rem; margin: 16px 0 6px; }
.t-content h4 { font-size: 1rem; margin: 12px 0 4px; }
.t-content p { margin: 0 0 10px; }
.t-content ul { margin: 0 0 10px; padding-left: 20px; }
.t-content li { margin: 3px 0; }
.t-content a { color: var(--indigo); }
.t-score { text-align: center; font-weight: 700; white-space: nowrap; padding: 10px 14px; }

/* Verslag-foto's (publiek) */
.verslag-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 20px; }
.verslag-fotos figure { margin: 0; }
.verslag-fotos img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; display: block; }
.verslag-fotos figcaption { font-size: .82rem; color: #64748b; margin-top: 5px; }

/* Verslag-foto's (beheer) */
.v-foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 6px 0; }
.v-foto { position: relative; }
.v-foto img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--line); }
.v-foto input { width: 100%; margin-top: 4px; font-size: .8rem; padding: 4px 6px; }
.v-foto-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(15,23,42,.72); color: #fff; cursor: pointer; line-height: 1; font-size: 15px; }

/* ---- Toernooikaart met banner ---- */
.t-kaart { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.t-banner { height: 130px; background-size: cover; background-position: center; background-color: #eef2ff; }
.t-banner.leeg { background: linear-gradient(135deg, var(--indigo), var(--indigo-d)); display: flex; align-items: center; justify-content: center; }
.t-banner.leeg svg { width: 46px; height: 46px; color: rgba(255,255,255,.55); }
.t-kaart-body { padding: 16px; }
.kosten-badge { display: inline-block; margin-top: 10px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.kosten-badge.gratis { background: #dcfce7; color: #166534; }
.kosten-badge.betaald { background: #fef3c7; color: #92400e; }

/* ---- Teamlogo ---- */
.team-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: -6px; margin-right: 7px; }
.team-logo-groot { width: 34px; height: 34px; object-fit: contain; }
.team-logo-ph { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; vertical-align: -6px; margin-right: 7px; color: #cbd5e1; }
.team-logo-ph svg { width: 16px; height: 16px; }

/* ---- Wedstrijd-events (logger) ---- */
.ev-klok { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 10px; background: var(--paper, #f7f7fb); border: 1px solid var(--line); border-radius: 10px; }
.ev-klok-tijd { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.4rem; letter-spacing: .5px; min-width: 62px; }
.ev-klok-hint { font-size: .78rem; flex: 1 1 160px; }
.ev-lijst { list-style: none; padding: 0; margin: 0 0 12px; }
.ev-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: .92rem; border-bottom: 1px solid var(--line); }
.ev-item:last-child { border-bottom: none; }
.ev-leeg { list-style: none; padding: 6px 4px; }
.ev-ico { flex: 0 0 auto; font-size: 1.15rem; line-height: 1; width: 22px; text-align: center; }
.ev-min { flex: 0 0 auto; width: 34px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); text-align: right; }
.ev-team { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ev-speler { flex: 1 1 auto; color: var(--muted); }
.ev-del { flex: 0 0 auto; margin-left: auto; border: none; background: none; color: var(--err); cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 0 4px; }
.ev-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ev-form select, .ev-form input { padding: 6px 8px; }
.ev-type { display: inline-flex; gap: 4px; }
.ev-type-btn { border: 1px solid var(--line); background: var(--card, #fff); border-radius: 8px; padding: 4px 8px; font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: .5; transition: opacity .12s, box-shadow .12s; }
.ev-type-btn.actief { opacity: 1; border-color: var(--indigo); box-shadow: 0 0 0 2px color-mix(in srgb, var(--indigo) 30%, transparent); }

/* ---- Toernooidag: wedstrijd-cel met vaste kolommen ---- */
.td-wed { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 22px minmax(0, 1fr); align-items: center; column-gap: 8px; }
.td-wed-logo { display: inline-flex; align-items: center; justify-content: center; }
.td-wed-naam { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-wed-vs { color: var(--muted); text-align: center; padding: 0 2px; }
/* Poule-subkop binnen de poulekaart */
.td-groepkop { margin: 16px 0 6px; font-size: .95rem; }
.td-groepkop:first-child { margin-top: 0; }
/* KO-ronde die nog niet is vrijgegeven */
.card.td-ko-wacht { opacity: .7; border-style: dashed; }
/* Tiebreak-volgorde-instelling */
.tb-lijst { list-style: none; margin: 0; padding: 0; }
.tb-rij { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.tb-rij.uit { opacity: .55; }
.tb-aan { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; cursor: pointer; }
.tb-aan input { width: auto; }
.tb-rij .tb-nr { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 50%; background: var(--indigo); color: #fff; font-size: .75rem; font-weight: 700; }
.tb-rij.uit .tb-nr { background: var(--line); color: var(--muted); }
/* Beslissende tiebreak-regel onder een teamnaam in de stand */
.stand-reden { font-size: .74rem; font-style: italic; }
/* Wedstrijdtabel (toernooidag/eindstand) met vaste kolommen — voorkomt dat het
   wedstrijd-grid dichtklapt en houdt de kolommen uitgelijnd over de rijen. */
.wed-tabel { table-layout: fixed; width: 100%; min-width: 440px; }
.wed-tabel .c-nr { width: 28px; }
.wed-tabel .c-tijd { width: 54px; }
.wed-tabel .c-uit { width: 108px; }
.wed-tabel .c-act { width: 92px; }
.td-uitslag { text-align: center; }
.td-score-in { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; justify-content: center; }
.td-score-in input { width: 40px; text-align: center; padding: 5px 4px; }
.td-score-multi { display: inline-flex; flex-direction: column; gap: 3px; align-items: center; }
.td-beslis-in { display: block; margin-top: 5px; white-space: nowrap; font-size: .8rem; }
.td-beslis-in input { width: 32px; text-align: center; padding: 3px; }

/* Openbare Uitslagen: selector-chips per poule / knock-outronde */
.pub-groep-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.pub-groep-chip { border: 1px solid var(--line); background: var(--card, #fff); color: var(--ink); border-radius: 999px; padding: 8px 15px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.pub-groep-chip:hover { border-color: var(--indigo); }
.pub-groep-chip.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.pub-pauze { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; font-size: .9rem; font-weight: 600; }
/* Toernooi-info (Info-tab) als nette regels */
.t-info-lijst { display: flex; flex-direction: column; gap: 9px; }
.t-info-rij { display: flex; align-items: center; gap: 9px; }
.t-info-rij svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--muted); }

/* Openbare wedstrijden als scorebord-kaartjes (klik = details) */
.pub-matches { margin-top: 4px; }
.pub-match { border-top: 1px solid var(--line); padding: 10px 4px; }
.pub-match:first-child { border-top: none; }
.pub-match.klikbaar { cursor: pointer; }
.pub-match-kop { display: flex; align-items: center; gap: 12px; }
.pub-match-teams { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pub-match-rij { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pub-match-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.pub-match-team > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-badge { flex: 0 0 auto; min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.pub-badge.win { background: var(--ok, #16a34a); }
.pub-badge.lose { background: #ef4444; }
.pub-badge.draw { background: #94a3b8; }
/* Beslissende score (strafschoppen e.d.) naast de reguliere score. */
.pub-badge-pen { flex: 0 0 auto; min-width: 22px; height: 30px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 700; font-size: .82rem; color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pub-match-tijd { flex: 0 0 auto; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.pub-match-detail { display: none; padding: 10px 2px 2px; font-size: .88rem; color: var(--muted); }
.pub-match.open .pub-match-detail { display: block; }
.pub-match-info svg { width: 15px; height: 15px; vertical-align: -2px; }
.pub-match-sub { margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Poulestand met vaste kolommen: lijnt uit over meerdere poules, onafhankelijk van de teamnaam */
.stand-tabel { table-layout: fixed; width: 100%; }
.stand-tabel .c-pos { width: 30px; }
.stand-tabel .c-num { width: 38px; }
.stand-tabel td, .stand-tabel th { overflow-wrap: anywhere; }
/* Afgerond toernooi: alles read-only tot 'heropenen' */
.afgerond-balk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--amber, #f59e0b) 14%, transparent); border: 1px solid color-mix(in srgb, var(--amber, #f59e0b) 40%, transparent); font-size: .9rem; }
.afgerond-balk span { flex: 1 1 auto; }
.wr-afgerond input, .wr-afgerond select, .wr-afgerond textarea,
.wr-afgerond button, .wr-afgerond a.btn,
.wr-afgerond [draggable="true"], .wr-afgerond .dropzone,
.wr-afgerond [contenteditable] { pointer-events: none !important; }
.wr-afgerond input, .wr-afgerond select, .wr-afgerond textarea, .wr-afgerond button, .wr-afgerond a.btn { opacity: .55; }

/* Openbare poulestand-tabel (vaste kolommen, lijnt uit over meerdere poules) */
.pub-stand { table-layout: fixed; width: 100%; }
.pub-stand .c-pos { width: 30px; }
.pub-stand .c-num { width: 36px; }
.pub-stand-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Eindklassering (podium) in de eindstand */
.podium-tabel td { vertical-align: middle; }
.podium-pos { white-space: nowrap; font-weight: 800; font-size: 1.05rem; width: 1%; }
.podium-tabel tr:first-child .podium-pos { color: var(--amber, #f59e0b); }

/* ---- Sponsoren ---- */
.sponsor-band { margin: 34px 0; }
.sponsor-band h2 { margin: 0 0 16px; }
.sponsor-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; align-items: center; }
.sponsor { display: inline-flex; align-items: center; }
.sponsor img { max-height: 56px; max-width: 160px; object-fit: contain; }
.sponsor span { font-weight: 700; color: var(--muted); }

/* ---- WYSIWYG-editor ---- */
.wysiwyg { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wy-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.wy-bar button { border: 1px solid transparent; background: none; padding: 5px 9px; border-radius: 6px; cursor: pointer; font-size: .85rem; color: var(--ink); }
.wy-bar button:hover { background: #e2e8f0; }
.wy-edit { padding: 12px 14px; min-height: 120px; outline: none; line-height: 1.55; }
.wy-edit:focus { background: #fff; }
.wy-edit h3 { font-size: 1.1rem; margin: 10px 0 4px; }
.wy-edit ul { padding-left: 20px; }
.wy-edit a { color: var(--indigo); }

/* ---- Blok-iconen (strakke SVG) ---- */
.t-blok .t-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: #eef2ff; color: var(--indigo); flex: 0 0 auto; }
.blok-ico { display: inline-flex; align-items: center; color: var(--indigo); }
.feature .ico svg { width: 30px; height: 30px; color: var(--indigo); }
.eco-ico { color: var(--indigo); }
.eco-ico svg { width: 22px; height: 22px; vertical-align: -4px; }
.t-meta .meta-ico { width: 17px; height: 17px; vertical-align: -3px; opacity: .95; }
.meta-sep { opacity: .55; }

/* ---- Cookiebalk ---- */
.cookiebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--ink); color: #fff; padding: 14px 20px; display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; box-shadow: 0 -4px 20px rgba(15,23,42,.15); }
.cookiebar a { color: #c7d2fe; }
.cookiebar .cb-btns { display: flex; gap: 8px; }
.cb-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.cb-btn.cb-ja { background: var(--indigo); color: #fff; }
.cb-btn.cb-nee { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }

@media (max-width: 640px) {
  .field-row { flex-direction: column; }
  .hero { padding: 56px 0 40px; }

  /* Meer breedte op mobiel: minder zijmarge en kaartpadding */
  .wrap { padding: 0 12px; }
  .card { padding: 15px; }
  .section { padding: 40px 0; }

  /* Compacte header: secundaire link weg, kleinere brand/knoppen/taalkiezer */
  .topbar .wrap { height: 54px; gap: 8px; }
  .topbar .brand { font-size: 1.02rem; gap: 7px; }
  .topbar .brand .logo { width: 26px; height: 26px; }
  .topbar .wrap .row { gap: 8px; }
  .nav-deelnemers { display: none; }
  .topbar .btn { padding: 8px 12px; font-size: .85rem; }
  #lang-switch { padding: 6px 6px; font-size: .85rem; }

  /* Publieke standtabel op mobiel: compact + alleen #, team, G, saldo, punten */
  .pub-stand { table-layout: auto; }
  .pub-stand th, .pub-stand td { padding: 9px 6px; font-size: .9rem; }
  .pub-col-extra { display: none; }                 /* W / GL / V verbergen op mobiel */
  .pub-stand-team { white-space: normal; overflow: visible; }
}
