/* ==========================================================================
   BESCLan toernooisysteem — designsysteem in de huisstijl van de
   Belgian Streamers Community (zwart, Belgisch rood/geel, Bebas Neue + Montserrat)
   ========================================================================== */
@font-face { font-family: "Bebas Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/bebas-neue-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: "Bebas Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/bebas-neue-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: "Montserrat"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/montserrat-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: "Montserrat"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/montserrat-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; }

:root {
  --bg: #050505;
  --bg-2: #0b0b0b;
  --card: #121212;
  --card-2: #1a1a1a;
  --card-3: #242424;
  --line: #262626;
  --line-2: #363636;
  --text: #f6f6f6;
  --muted: #a6a6a6;
  --dim: #6f6f6f;
  --accent: #d4131b;                                              /* BESC-rood, instelbaar */
  --accent-ink: #ffffff;                                          /* tekst op accent (app.js kiest zwart/wit) */
  --accent-text: color-mix(in srgb, var(--accent) 62%, #fff);     /* leesbare accentkleur op zwart */
  --be-red: #d4131b;
  --be-dark: #990000;
  --be-yellow: #f6c700;
  --green: #22c55e;
  --red: #ff4d4d;
  --orange: #f59e0b;
  --blue: #3b82f6;
  --purple: #a855f7;
  --gray: #737373;
  --gold: var(--be-yellow);
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --stripes: linear-gradient(150deg, transparent 0 14%, var(--be-red) 14% 16.5%, transparent 16.5% 27%, var(--be-yellow) 27% 33%, transparent 33% 47%, var(--be-red) 47% 49%, var(--be-yellow) 49% 50.5%, transparent 50.5% 66%, var(--be-yellow) 66% 71%, transparent 71% 80%, var(--be-red) 80% 85%, transparent 85% 93%, var(--be-yellow) 93% 94.5%, transparent 94.5%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .02em; line-height: 1.05; }
h1 { font-size: 2.6rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
:focus-visible { outline: 2px solid var(--be-yellow); outline-offset: 2px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.container.wide { max-width: 1600px; }
main { padding: 24px 0 64px; min-height: calc(100vh - 140px); overflow-x: clip; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.auto-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-s { margin-top: 8px; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(0, 0, 0, .92); backdrop-filter: blur(12px); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #2a2a2a 0 33.33%, var(--be-yellow) 33.33% 66.66%, var(--be-red) 66.66%); }
.topbar .container { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-size: 1.65rem; letter-spacing: .03em; color: var(--text); white-space: nowrap; line-height: 1; }
.brand:hover { text-decoration: none; }
/* Belgische driekleur als beeldmerk */
.brand-mark { width: 24px; height: 30px; flex: none; display: inline-block; transform: skewX(-14deg); border-radius: 2px; background: linear-gradient(90deg, #2a2a2a 0 33.33%, var(--be-yellow) 33.33% 66.66%, var(--be-red) 66.66%); box-shadow: 0 0 0 1px #3a3a3a; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #e0e0e0; padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 500; white-space: nowrap; }
.nav a:hover { color: #fff; background: var(--card); text-decoration: none; }
.nav a.active { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.btn.nav-toggle { display: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); display: inline-block; box-shadow: 0 0 0 0 color-mix(in srgb, var(--purple) 60%, transparent); animation: pulse 1.6s infinite; vertical-align: middle; }
.sync { font-size: .78rem; color: var(--dim); white-space: nowrap; }
.sync.off { color: var(--red); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--purple) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidenav { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.sidenav a { color: var(--muted); padding: 9px 12px; border-radius: var(--radius-sm); display: flex; gap: 10px; align-items: center; font-weight: 550; }
.sidenav a:hover { background: var(--card-2); color: var(--text); text-decoration: none; }
.sidenav a.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidenav .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.sidenav .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 6px 12px 2px; }
.ico { width: 18px; text-align: center; opacity: .9; }

footer.site { border-top: 1px solid var(--line); background: #000; color: var(--dim); font-size: .85rem; padding: 18px 0; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: #fff; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flat { background: var(--card); }
.card.tight { padding: 12px 14px; }
.card.click { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.click:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-family: var(--display); font-size: 2.4rem; font-weight: 400; letter-spacing: .02em; line-height: 1; }
.stat .l { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.stat.c-green .v { color: var(--green); } .stat.c-red .v { color: var(--red); } .stat.c-orange .v { color: var(--orange); }
.stat.c-blue .v { color: var(--blue); } .stat.c-purple .v { color: var(--purple); } .stat.c-gray .v { color: var(--muted); }

/* ---------- hero ---------- */
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 680px; }
/* Banner met diagonale rood/gele strepen, zoals op belgianstreamerscommunity.be */
.hero.banner { position: relative; overflow: hidden; margin: -24px calc(50% - 50vw) 28px; padding: clamp(40px, 8vw, 84px) 16px; text-align: center; background: var(--stripes), #0a0a0a; border-bottom: 1px solid var(--line); }
.hero.banner::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), transparent 70%); }
.hero.banner > * { position: relative; }
.hero.banner h1 { display: inline-block; background: #000; padding: .12em .45em .02em; margin: 0; font-size: clamp(2.4rem, 7vw, 4.4rem); }
.hero.banner p { display: table; margin: 12px auto 0; background: #000; color: #e8e8e8; padding: 6px 14px; max-width: min(680px, 100%); }
.event-banner { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.event-banner h1 { margin: 0 0 4px; }
.event-logo { width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; background: var(--card-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; font-family: var(--display); font-size: 2.1rem; color: var(--be-yellow); }
.event-logo.sm { width: 44px; height: 44px; font-size: 1.35rem; }
.meta-list { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .9rem; }
.meta-list span::before { content: attr(data-i); margin-right: 6px; opacity: .8; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); padding: 9px 15px; border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; text-decoration: none; }
.btn:hover { background: var(--card-3); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 82%, white); }
.btn.outline { background: transparent; border-color: #fff; color: #fff; }
.btn.outline:hover { background: #fff; color: #000; }
.btn.danger { background: color-mix(in srgb, var(--red) 16%, var(--card-2)); border-color: color-mix(in srgb, var(--red) 50%, var(--line)); color: #fecaca; }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 26%, var(--card-2)); }
.btn.success { background: color-mix(in srgb, var(--green) 18%, var(--card-2)); border-color: color-mix(in srgb, var(--green) 50%, var(--line)); color: #bbf7d0; }
.btn.warn { background: color-mix(in srgb, var(--orange) 16%, var(--card-2)); border-color: color-mix(in srgb, var(--orange) 50%, var(--line)); color: #fde68a; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: .85rem; border-radius: var(--radius-sm); }
.btn.lg { padding: 12px 20px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; white-space: nowrap; border: 1px solid transparent; letter-spacing: .01em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-green { color: #86efac; background: color-mix(in srgb, var(--green) 14%, transparent); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.b-red { color: #fca5a5; background: color-mix(in srgb, var(--red) 14%, transparent); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.b-orange { color: #fcd34d; background: color-mix(in srgb, var(--orange) 14%, transparent); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.b-blue { color: #93c5fd; background: color-mix(in srgb, var(--blue) 14%, transparent); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.b-purple { color: #d8b4fe; background: color-mix(in srgb, var(--purple) 16%, transparent); border-color: color-mix(in srgb, var(--purple) 32%, transparent); }
.b-gray { color: #cbd5e1; background: color-mix(in srgb, var(--gray) 16%, transparent); border-color: color-mix(in srgb, var(--gray) 30%, transparent); }
.b-accent { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.b-gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.b-purple.pulse::before { animation: pulse 1.6s infinite; }

/* ---------- alerts ---------- */
.alert { border: 1px solid var(--line-2); background: var(--card-2); border-radius: var(--radius); padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert.danger { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); background: color-mix(in srgb, var(--red) 9%, var(--card)); }
.alert.warning { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); background: color-mix(in srgb, var(--orange) 8%, var(--card)); }
.alert.success { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: color-mix(in srgb, var(--green) 8%, var(--card)); }
.alert.info { border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); background: color-mix(in srgb, var(--blue) 7%, var(--card)); }
.alert .grow p:last-child { margin: 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { background: none; border: 0; color: var(--muted); padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .active { color: var(--text); border-bottom-color: var(--accent); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; border-radius: 999px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.pills button.active { background: color-mix(in srgb, var(--accent) 18%, var(--card)); color: #fff; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 650; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--card-2) 60%, transparent); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .pos { font-weight: 800; width: 44px; font-variant-numeric: tabular-nums; }
.table tr.qualify td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.table tr.out td { color: var(--dim); }
.table tr.leader td .name { color: var(--gold); }
.table.compact td, .table.compact th { padding: 7px 10px; }
.form-dots { display: inline-flex; gap: 3px; }
.form-dots i { width: 16px; height: 16px; border-radius: 4px; display: inline-grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800; color: #0b1220; }
.form-dots .W { background: var(--green); } .form-dots .L { background: var(--red); } .form-dots .D { background: var(--gray); color: #fff; } .form-dots .B { background: var(--blue); }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-text { font-weight: 600; font-size: .88rem; color: #d6d6d6; }
.field .hint { color: var(--dim); font-size: .8rem; }
.field .err { color: #fca5a5; font-size: .82rem; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--red); }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:-webkit-autofill, input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset; -webkit-text-fill-color: var(--text); caret-color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea { min-height: 90px; resize: vertical; }
input[type=number] { font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; font-size: .92rem; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; min-width: 0; }
legend { padding: 0 8px; font-weight: 700; color: var(--text); }
.form-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.form-section > h3 { display: flex; align-items: center; gap: 8px; }
.form-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; z-index: 5; }
.member-row { display: grid; grid-template-columns: 1.4fr 1fr .7fr .9fr auto; gap: 8px; align-items: center; }
.sortable li { list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; }
.sortable { padding: 0; margin: 0; }

/* ---------- match cards ---------- */
.match { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.match.s-live, .match.s-paused { border-color: color-mix(in srgb, var(--purple) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--purple) 25%, transparent), 0 8px 30px color-mix(in srgb, var(--purple) 12%, transparent); }
.match.s-disputed { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.match.s-waiting { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.match-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.match-top .where { display: flex; gap: 10px; flex-wrap: wrap; }
.side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.side .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.side .who .nm { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .seat { font-size: .74rem; color: var(--dim); font-family: var(--mono); white-space: nowrap; }
.side .sc { font-family: var(--display); font-size: 2.1rem; font-weight: 400; line-height: 1; min-width: 32px; text-align: right; }
.side.win .nm { color: #bbf7d0; } .side.win .sc { color: var(--green); }
.side.lose .nm, .side.lose .sc { color: var(--dim); }
.side.tbd .nm { color: var(--dim); font-style: italic; font-weight: 500; }
.avatar { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--card-3); display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--muted); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.match-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.match .reason { font-size: .8rem; color: #fca5a5; }
.match .games { font-size: .78rem; color: var(--muted); font-family: var(--mono); }
.flash { animation: flash 1.4s ease; }
@keyframes flash { 0% { color: var(--be-yellow); transform: scale(1.35); text-shadow: 0 0 18px var(--be-yellow); } 100% { transform: scale(1); } }
.vs { color: var(--dim); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

.match-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.match-row:last-child { border-bottom: 0; }
.match-row .t { font-variant-numeric: tabular-nums; font-weight: 700; }
.match-row .b-side { text-align: right; }
.match-row .score { font-family: var(--display); font-size: 1.5rem; line-height: 1; padding: 0 6px; white-space: nowrap; }
.list-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* ---------- bracket ---------- */
.bracket-wrap { overflow-x: auto; padding-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.bracket { position: relative; display: flex; gap: 56px; padding: 22px; min-width: max-content; }
.bracket svg.lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.b-col { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; width: 230px; flex: none; position: relative; z-index: 1; }
.b-col-title { font-family: var(--display); font-size: 1.15rem; letter-spacing: .06em; color: var(--muted); text-align: center; margin-bottom: 4px; }
.b-col-body { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; flex: 1; }
.b-match { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; font-size: .87rem; position: relative; }
.b-match .b-meta { display: flex; justify-content: space-between; font-size: .7rem; color: var(--dim); padding: 4px 9px; background: var(--bg-2); border-bottom: 1px solid var(--line); gap: 6px; }
.b-slot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 6px 9px; align-items: center; }
.b-slot + .b-slot { border-top: 1px solid var(--line); }
.b-slot .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.b-slot .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.b-slot.win { background: color-mix(in srgb, var(--green) 12%, transparent); }
.b-slot.win .nm, .b-slot.win .sc { color: #bbf7d0; }
.b-slot.lose .nm, .b-slot.lose .sc { color: var(--dim); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 70%, transparent); }
.b-slot.tbd .nm { color: var(--dim); font-style: italic; font-weight: 500; font-size: .8rem; }
.b-slot.noshow .nm::after { content: " · no-show"; color: var(--red); font-size: .72rem; font-weight: 700; }
.b-match.s-live, .b-match.s-paused { border-color: var(--purple); box-shadow: 0 0 0 2px color-mix(in srgb, var(--purple) 30%, transparent); }
.b-match.s-walkover { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.b-match.s-disputed { border-color: var(--red); }
.b-match.s-cancelled { opacity: .45; }
.b-match.is-bye { opacity: .55; }
.b-drop { font-size: .68rem; color: var(--orange); padding: 3px 9px; border-top: 1px dashed var(--line-2); background: color-mix(in srgb, var(--orange) 6%, transparent); }
.bracket-section { margin-bottom: 22px; }
.bracket-section > h3 { display: flex; gap: 10px; align-items: center; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- swiss rounds & matrix ---------- */
.round-block { margin-bottom: 18px; }
.matrix td, .matrix th { text-align: center; padding: 6px 8px; font-size: .8rem; }
.matrix td.self { background: var(--bg-2); }
.matrix td.w { color: var(--green); font-weight: 700; } .matrix td.l { color: var(--red); font-weight: 700; } .matrix td.d { color: var(--muted); font-weight: 700; } .matrix td.p { color: var(--blue); }
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 110px; font-size: .74rem; text-transform: none; letter-spacing: 0; }

/* ---------- modals & toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .78); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 200; padding: 16px; animation: fadeIn .15s ease; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); animation: pop .18s ease; }
.modal.lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.6rem; letter-spacing: .02em; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--card); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 300; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--card-2); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 11px 14px; box-shadow: var(--shadow); animation: pop .2s ease; font-size: .92rem; }
.toast.error { border-left-color: var(--red); } .toast.success { border-left-color: var(--green); } .toast.warning { border-left-color: var(--orange); }

/* ---------- states ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); background: color-mix(in srgb, var(--card) 50%, transparent); }
.empty .big { font-size: 2rem; margin-bottom: 6px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 48px 0; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }
.progress { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.qr { background: #fff; padding: 12px; border-radius: 12px; width: 200px; height: 200px; }
.qr svg { width: 100%; height: 100%; display: block; }
.code-box { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .14em; background: var(--bg-2); border: 1px dashed var(--line-2); padding: 8px 14px; border-radius: 10px; display: inline-block; }
.copy-line { display: flex; gap: 8px; }
.copy-line input { font-family: var(--mono); font-size: .82rem; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; display: flex; flex-direction: column; gap: 12px; }
.timeline .ti { position: relative; font-size: .88rem; }
.timeline .ti::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); border: 2px solid var(--bg); }
.timeline .ti.auto::before { background: var(--orange); }
pre.json { background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: .75rem; max-height: 160px; overflow: auto; margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.score-input { display: grid; grid-template-columns: minmax(0, 1fr) 96px 30px 96px minmax(0, 1fr); gap: 10px; align-items: center; }
.score-input input { text-align: center; font-size: 1.8rem; font-weight: 800; padding: 8px; }
.score-input .nmA { text-align: right; font-weight: 700; } .score-input .nmB { font-weight: 700; }
.games-grid { display: grid; grid-template-columns: auto 80px 80px; gap: 8px; align-items: center; max-width: 320px; }
.games-grid input { text-align: center; }
.chip { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--card-3); font-size: .78rem; color: var(--muted); }
.hide { display: none !important; }

/* ---------- TV-weergave ---------- */
body.tv { background: #000; font-size: 20px; overflow: hidden; }
body.tv .topbar, body.tv footer.site { display: none; }
body.tv main { padding: 0; }
.tv-screen { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 2.2vh 2.5vw; gap: 2vh; }
.tv-head { display: flex; justify-content: space-between; align-items: center; gap: 2vw; }
.tv-head { border-bottom: .5vh solid; border-image: linear-gradient(90deg, #2a2a2a 0 33.33%, var(--be-yellow) 33.33% 66.66%, var(--be-red) 66.66%) 1; padding-bottom: 1.6vh; }
.tv-head h1 { font-size: 6.4vh; margin: 0; }
.tv-head .brand-mark { width: 4.4vh; height: 5.6vh; margin-right: .6vw; }
.tv-clock { font-family: var(--display); font-size: 7.5vh; line-height: 1; color: var(--be-yellow); }
.tv-panel { overflow: hidden; min-height: 0; }
.tv-panel h2 { font-size: 4.4vh; color: #fff; letter-spacing: .06em; margin-bottom: 2vh; display: flex; align-items: center; gap: 1vw; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36vw, 1fr)); gap: 2vh 1.5vw; }
.tv .match { padding: 2vh 1.4vw; border-radius: var(--radius); }
.tv .side .nm { font-size: 3.1vh; }
.tv .side .sc { font-size: 6.4vh; }
.tv .match-top { font-size: 2vh; }
.tv .match-foot { font-size: 2vh; }
.tv .avatar { width: 4.4vh; height: 4.4vh; font-size: 1.8vh; }
.tv .table { font-size: 2.4vh; }
.tv .table th { font-size: 1.6vh; }
.tv .table td { padding: 1.1vh 1vw; }
.tv-foot { display: flex; justify-content: space-between; color: var(--dim); font-size: 1.8vh; }
.tv-dots { display: flex; gap: 8px; }
.tv-dots i { width: 34px; height: 5px; border-radius: 3px; background: var(--line-2); }
.tv-dots i.on { background: var(--accent); }
.tv-upcoming .match-row { font-size: 2.6vh; padding: 1.4vh 1vw; grid-template-columns: 9vw minmax(0, 1fr) auto minmax(0, 1fr) 14vw; }
.tv .bracket-wrap { border: 0; background: transparent; overflow: hidden; }
.tv .b-col { width: 15vw; }
.tv .b-match { font-size: 1.6vh; }
.tv-exit { position: fixed; top: 10px; right: 10px; opacity: 0; transition: opacity .2s; z-index: 10; }
.tv-screen:hover .tv-exit { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .sidenav .sep, .sidenav .label { display: none; }
  .sidenav a { white-space: nowrap; }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar .container { height: 56px; gap: 10px; }
  .nav { position: fixed; top: 56px; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; display: none; }
  .nav.open { display: flex; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--accent); }
  .btn.nav-toggle { display: inline-flex; margin-left: auto; }
  .sync { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .match-row .b-side { grid-column: 2; text-align: left; }
  .match-row .score { grid-row: 1 / span 2; grid-column: 3; }
  .match-row .extra { grid-column: 1 / -1; }
  .member-row { grid-template-columns: 1fr 1fr; }
  .score-input { grid-template-columns: 1fr 70px 16px 70px 1fr; }
  .score-input input { font-size: 1.3rem; }
  .hero h1 { font-size: 2.2rem; }
  h1 { font-size: 2.1rem; }
  .brand { font-size: 1.4rem; }
  .card { padding: 14px; }
  .form-actions { flex-wrap: wrap; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, footer.site, .no-print, .sidenav, .toasts { display: none !important; }
  main { padding: 0; }
  .admin-layout { display: block; }
  .card, .table-wrap, .list-card { border: 0; background: none; }
  .table th { background: #eee; color: #000; position: static; }
  .table td, .table th { border-bottom: 1px solid #bbb; color: #000; }
  a { color: #000; }
  .badge { border: 1px solid #999; color: #000 !important; background: none !important; }
}
