/* ============================================================
   Padel Ladder — designsysteem afgeleid van het logo:
   navy #0a3d7e (basis), balgeel #f6d00b (accent), wit.
   Font: Outfit (geometrisch, past bij de ronde logovormen).
   Kleuren altijd hex (#rrggbb / #rrggbbaa) — nooit rgba().
   ============================================================ */
:root {
  --c-primary: #0a3d7e;        /* logo-navy */
  --c-primary-hover: #0c4a99;
  --c-primary-deep: #062a58;   /* donkere navy voor footers/verlopen */
  --c-primary-tint: #e7eefb;   /* lichte navy-tint voor vlakken */
  --c-accent: #f6d00b;         /* logo-geel (padelbal) */
  --c-accent-tint: #fdf3c2;    /* lichte geel-tint voor highlights */
  --c-accent-ink: #6e5c00;     /* leesbaar donkergeel op geel-tint */
  --c-bg: #eef2f8;             /* koel blauwgrijs */
  --c-surface: #ffffff;
  --c-border: #dde5f0;
  --c-text: #16233c;           /* navy-inkt */
  --c-danger: #cf3b30;
  --c-success: #1e8a4f;
  --c-warning: #c99700;        /* okergeel, leesbaar op wit ("Houd je klaar!") */
  --c-muted: #64748d;          /* blauwgrijs */
  --shadow-sm: 0 1px 3px #0a3d7e14;
  --shadow-md: 0 2px 10px #0a3d7e1f;
  --shadow-lg: 0 6px 24px #0a3d7e2e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--c-bg); color: var(--c-text); padding: 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.015em; font-weight: 700; }
button {
  cursor: pointer; padding: 0.5rem 1rem; border: 1px solid #ccd6e6; border-radius: 8px;
  background: white; font-size: 0.95rem; font-family: inherit; font-weight: 500;
  color: var(--c-text);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
button:hover { border-color: #a9bbd6; }
button.primary { background: var(--c-primary); color: white; border-color: var(--c-primary); }
button.primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); }
button.danger { background: var(--c-danger); color: white; border-color: var(--c-danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  padding: 0.5rem; border: 1px solid #c3cfe2; border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; background: white; color: var(--c-text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px #0a3d7e26;
}
form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
form input, form select { flex: 1; min-width: 100px; }

.login-form {
  max-width: 360px; margin: 4rem auto; padding: 2rem;
  background: white; border-radius: 16px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
}
.login-form input,
.login-form select { display: block; width: 100%; padding: 0.6rem; margin: 0.5rem 0; box-sizing: border-box; }
.login-form button { width: 100%; padding: 0.7rem; }
.login-divider {
  text-align: center; margin: 1.2rem 0 0.8rem; position: relative; color: var(--c-muted); font-size: 0.85rem;
}
.login-divider::before, .login-divider::after {
  content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--c-border);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.login-divider span { background: white; padding: 0 0.6rem; }

/* === Create team form === */
.create-team-form { max-width: 420px; }
.create-team-form .player-block { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #e9eef7; }
.create-team-form .player-block:last-of-type { border-bottom: none; }
.create-team-form label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 0.3rem; }
.create-team-form .player-search-results {
  list-style: none; padding: 0; margin: 0 0 0.5rem 0;
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--c-border); border-radius: 8px;
}
.create-team-form .player-search-results:empty { display: none; }
.create-team-form .player-search-results li {
  padding: 0.5rem 0.7rem; cursor: pointer; font-size: 0.9rem;
  border-bottom: 1px solid #eef2f8;
}
.create-team-form .player-search-results li:hover { background: var(--c-primary-tint); }
.create-team-form .player-search-results li:last-child { border-bottom: none; }
.create-team-form .player-search-results li.muted { cursor: default; color: var(--c-muted); padding: 0.8rem; text-align: center; }
.create-team-form .player-selected {
  background: var(--c-primary-tint); padding: 0.7rem; border-radius: 8px; font-size: 0.95rem;
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.create-team-form .player-selected a { font-size: 0.8rem; color: var(--c-muted); }
.create-team-form .manual-link {
  display: inline-block; font-size: 0.8rem; color: var(--c-muted); text-decoration: underline; margin-top: 0.3rem;
}
.create-team-form .manual-form { margin-top: 0.5rem; padding: 0.7rem; background: #f4f7fc; border-radius: 8px; }
.create-team-form .manual-form input { margin: 0.3rem 0; }
.create-team-form .manual-form button { background: var(--c-muted); color: white; border-color: var(--c-muted); margin-top: 0.4rem; }
.create-team-form .team-name-block { margin: 1rem 0; }
.create-team-form .create-error { color: var(--c-danger); font-size: 0.9rem; margin: 0.5rem 0; }
.create-team-form .create-buttons { display: flex; gap: 0.5rem; }
.create-team-form .create-buttons button { flex: 1; }

/* === Ranking tab (team-page) — tabel-stijl === */
.ranking-list {
  list-style: none; padding: 0; margin: 0.5rem 0;
  background: white; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.ranking-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 55px;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #eef2f8;
  font-size: 1rem;
}
.ranking-list li:last-child { border-bottom: none; }
.ranking-list .ranking-header {
  background: #f3f6fb;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600; color: var(--c-muted); padding: 0.4rem 0.7rem;
}
.ranking-list .pos { font-weight: 600; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.ranking-list .pname { overflow: hidden; text-overflow: ellipsis; }
.ranking-list .rating { text-align: right; font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.ranking-list .custom-name { font-style: italic; color: var(--c-muted); }
.ranking-list .ranking-row.me { background: var(--c-accent-tint); font-weight: 600; }
.ranking-list.pre-event .ranking-row { color: #4a5468; }
.ranking-subhead {
  margin: 1rem 0 0.3rem; padding: 0; font-size: 0.85rem; color: var(--c-muted); font-style: italic;
}

/* === Mexicano ranglijst (speler / admin) === */
.mex-ranking {
  list-style: none; padding: 0; margin: 0.5rem 0;
  background: white; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.mex-row {
  display: grid;
  grid-template-columns: 30px 38px minmax(0, 1fr) 55px 48px 32px;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #eef2f8;
  font-size: 1rem;
}
.mex-row:last-child { border-bottom: none; }
.mex-row.mex-header {
  background: #f3f6fb;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600; color: var(--c-muted); padding: 0.4rem 0.6rem;
}
.mex-row .pos { font-weight: 600; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.mex-row .dir { font-size: 0.8rem; text-align: center; }
.mex-row .dir.up { color: var(--c-success); }
.mex-row .dir.down { color: var(--c-danger); }
.mex-row .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mex-row .custom-name { font-style: italic; color: var(--c-muted); }
.mex-row .rating { text-align: right; font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.mex-row .gain { text-align: right; font-size: 0.8rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.mex-row .played { text-align: right; font-size: 0.8rem; color: #9aa7bd; font-variant-numeric: tabular-nums; }
.mex-row.me { background: var(--c-accent-tint); font-weight: 600; }
/* Admin-variant: extra actie-kolom (inchecken/pauze/verwijder) achteraan, zoals de team-ladder.
   Vaste kolombreedte + vaste knopmaat zodat de knoppen in elke rij netjes uitlijnen,
   ongeacht of een rij 0, 1 of 2 knoppen heeft. Compacte rijen + multi-kolom: de lijst vloeit
   automatisch in 2 of 3 kolommen naargelang de (versleepbare) breedte van het ranglijst-paneel. */
/* Max 2 kolommen (shorthand: count + min-breedte); verticale scheidingslijn ertussen. */
.mex-ranking--admin { columns: 2 340px; column-gap: 1.5rem; column-rule: 1px solid var(--c-border); }
.mex-ranking--admin .mex-row {
  grid-template-columns: 26px 30px minmax(0, 1fr) 46px 40px 26px 62px;
  break-inside: avoid;
  padding: 0.2rem 0.5rem;
}
.mex-actions { display: flex; gap: 0.25rem; justify-content: flex-end; }
.mex-actions button {
  width: 28px; height: 24px; padding: 0;
  font-size: 0.8rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Spelersregister-overzicht op de admin-eventlijst (intern + Δ t.o.v. padelstats-baseline).
   Klik op een rij klapt de historiek uit (per event de gespeelde matchen + delta's). */
.mex-row.register-row {
  grid-template-columns: 34px minmax(0, 1fr) 70px 56px 76px 110px;
}
.register-row { cursor: pointer; }
.register-row.mex-header { cursor: default; }
.register-row .diff, .register-row .mx { text-align: right; font-variant-numeric: tabular-nums; }
.register-row .last { text-align: right; }
.register-expand-row {
  list-style: none; padding: 0.4rem 0.8rem 0.6rem 2.2rem;
  background: #f7f9fc; border-bottom: 1px solid #eef2f8;
  font-size: 0.85rem;
}
.register-expand-row summary { cursor: pointer; padding: 0.2rem 0; }
.register-matches { list-style: none; padding: 0.15rem 0 0.3rem 1.2rem; }
.register-matches li { padding: 0.1rem 0; }

.mex-toggle { display: flex; gap: 0.5rem; margin: 0.8rem 0 0.3rem; }
.mex-toggle button {
  flex: 1; padding: 0.4rem; font-size: 0.85rem;
  background: #e9eef7; border: 1px solid var(--c-border); border-radius: 8px; cursor: pointer;
}
.mex-toggle button.active { background: var(--c-primary); color: white; border-color: var(--c-primary); }
.mex-score-strip { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.5rem; flex-wrap: wrap; }
.mex-score-strip button {
  min-width: 2.4rem; padding: 0.5rem 0; font-size: 1rem; font-weight: 700;
  background: white; border: 2px solid var(--c-primary); border-radius: 8px; color: var(--c-primary); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.mex-score-strip button:hover { background: var(--c-primary); color: white; }

/* === Admin: 🆕 badge + pre-event aanmeldingen === */
.fresh-signup-badge { font-size: 0.85em; margin-left: 0.3rem; }
.custom-name-inline { font-style: italic; }
.ladder-divider {
  margin-top: 0.8rem; padding: 0.5rem 0.7rem; background: #e9eef7;
  border-radius: 6px; color: #4a5468; font-size: 0.9rem; grid-column: 1 / -1;
}
li.no-position .pos { color: #9aa7bd; font-style: italic; }

.admin-page #app { padding: 1rem 2rem; max-width: none; }
.team-page #app { padding: 1rem; max-width: 720px; margin: 0 auto; }
.admin-page section { background: white; padding: 1rem; border-radius: 12px; margin: 1rem 0; border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); }
.admin-page h1 { margin-bottom: 1rem; }
.admin-page h2 { margin-bottom: 0.5rem; color: var(--c-primary); }
.admin-page details { margin: 0.5rem 0; }
.admin-page details summary { cursor: pointer; padding: 0.5rem 0; font-weight: bold; }
.admin-page ul, .admin-page ol { padding-left: 1.5rem; }
.admin-page ul li, .admin-page ol li { margin: 0.25rem 0; }

.qr-block { text-align: center; }
.qr-block #qr { display: inline-block; padding: 1rem; background: white; }
.qr-block .url { display: block; margin-top: 0.5rem; font-family: monospace; font-size: 0.9rem; color: var(--c-muted); }

.qr-block-fixed {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: white;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  text-align: center;
  z-index: 100;
  max-width: 180px;
}

/* Admin live view: ladder left (smaller), banen+queue right (wider) */
.live-cols { display: grid; grid-template-columns: var(--left-w, 40%) 10px 1fr; gap: 0.5rem; }
.col-resizer { cursor: col-resize; align-self: stretch; position: relative; touch-action: none; }
.col-resizer::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%); background: #c3cfe2; border-radius: 1px;
}
.col-resizer:hover::before, .col-resizer.dragging::before { background: var(--c-primary); width: 3px; }
@media (max-width: 800px) { .live-cols { grid-template-columns: 1fr; } .col-resizer { display: none; } }
.live-left section, .live-right section { margin: 0 0 1rem; }

/* Rechtermarge zodat de queue-inhoud (o.a. de wachtminuten) links van de vaste QR-barcode
   in de rechteronderhoek blijft en er dus nooit achter verdwijnt. Op smal scherm weer 0. */
.queue-watermark-wrap { position: relative; padding-right: 170px; }
@media (max-width: 800px) { .queue-watermark-wrap { padding-right: 0; } }
.queue-watermark-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: url('https://padelpeer.be/wp-content/uploads/2026/05/padelpeer-5fb8b0.png') no-repeat center bottom;
  background-size: 35% auto;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
.queue-watermark-wrap > * { position: relative; z-index: 1; }

.admin-topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  margin-bottom: 0.5rem;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}
.admin-topbar a { color: var(--c-muted); text-decoration: none; }
/* Matchmaker-status (heartbeat) + start/pauze-knop als één gecombineerd segment in de topbar,
   plus alarmbanner bij stilstand/offline. Pil = toestand, knop = actie. */
.mm-combo { display: inline-flex; align-items: stretch; }
.mm-combo .mm-status { border-radius: 999px 0 0 999px; display: inline-flex; align-items: center; }
.mm-combo button {
  border-radius: 0 999px 999px 0; border-left: none;
  padding: 0.15rem 0.6rem; font-size: 0.8rem; line-height: 1;
}
.mm-status {
  font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem;
  border-radius: 999px; white-space: nowrap; cursor: default;
}
.mm-status.ok { background: #d3efdf; color: #135c36; }
.mm-status.other { background: #d5e4f9; color: var(--c-primary); }
.mm-status.paused { background: #e4e8f0; color: #454f63; }
.mm-status.bad { background: #fadddd; color: #872520; animation: mm-bad-pulse 1.2s ease-in-out infinite; }
@keyframes mm-bad-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.mmlog summary { cursor: pointer; font-size: 0.85rem; padding: 0.3rem 0; }
.mmlog-list { list-style: none; padding: 0.2rem 0 0; max-height: 260px; overflow-y: auto; }
.mmlog-list li { font-size: 0.8rem; padding: 0.15rem 0; border-bottom: 1px solid #eef2f8; }
.mmlog-list li .muted { font-variant-numeric: tabular-nums; margin-right: 0.4rem; }
.mm-alert-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  background: var(--c-danger); color: white; text-align: center;
  padding: 0.55rem 1rem; font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 2px 10px #cf3b3059;
}
.admin-topbar a:hover { color: var(--c-primary); }
.admin-topbar strong { white-space: nowrap; color: var(--c-text); }
.admin-topbar button { padding: 0.3rem 0.7rem; font-size: 0.85rem; line-height: 1.2; }
.admin-topbar .voice-picker-wrap { position: relative; display: inline-block; }
.admin-topbar .voice-picker-wrap select {
  position: absolute; top: 100%; right: 0; margin-top: 0.25rem;
  font-size: 0.85rem; z-index: 20; background: #fff; border: 1px solid #a9bbd6;
}

/* Ladder: tabel-style 7-koloms grid (pos | name | rating | matches | status | action | remove) */
#ladder {
  list-style: none;
  padding: 0;
}
#ladder li {
  display: grid;
  grid-template-columns: 30px 28px minmax(0, 1fr) 45px 35px 80px 28px 28px;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.25rem;
  font-size: 1.05rem;
  border-bottom: 1px solid #eef2f8;
  min-height: 2.1rem;
}
#ladder li .dir { font-size: 0.85rem; line-height: 1; text-align: center; }
#ladder li .dir.up   { color: var(--c-success); }
#ladder li .dir.down { color: var(--c-danger); }
#ladder li .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ladder li .rating, #ladder li .played { font-size: 0.85rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#ladder li .tag { font-size: 0.75rem; text-align: center; }
#ladder li button { font-size: 0.85rem; padding: 0.2rem 0; width: 100%; }
#ladder li .action, #ladder li .remove { text-align: center; }
.ladder-header {
  display: grid;
  grid-template-columns: 30px 28px minmax(0, 1fr) 45px 35px 80px 28px 28px;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
  border-bottom: 2px solid #d3ddec;
  font-weight: 600;
}
.ladder-header .rating, .ladder-header .played { text-align: right; }
.ladder-header .tag-col { text-align: center; }
.qr-block-fixed strong { display: block; font-size: 0.85rem; margin-bottom: 0.25rem; }
.qr-block-fixed #qr { display: inline-block; }
.qr-block-fixed .url { display: block; margin-top: 0.25rem; font-family: monospace; font-size: 0.7rem; color: var(--c-muted); word-break: break-all; }

.error { color: var(--c-danger); margin-top: 1rem; }
.muted { color: var(--c-muted); }
.tag { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.85rem; background: #e9eef7; font-weight: 500; }
.tag.present { background: #d3efdf; color: #135c36; }
.tag.playing { background: #d5e4f9; color: var(--c-primary); }
.tag.waiting { background: var(--c-accent-tint); color: var(--c-accent-ink); }
.tag.awaiting_winner { background: #fadddd; color: #872520; }
.tag.paused { background: #e4e8f0; color: #454f63; }
.tag.removed { background: #dcdfe7; color: #454f63; text-decoration: line-through; }

.courts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
@media (max-width: 1100px) { .courts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.court {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.court.free { background: #f4f7fc; color: var(--c-muted); align-items: center; justify-content: center; min-height: 100px; }
.court.active { background: #e7eefb; border-color: #c3d4ef; }
.court.active.awaiting { background: #fdf3c2; border-color: #ecd77a; }
.court.paused { background: #f0ebeb; opacity: 0.85; }
.court.paused.free { background: #e8e2e2; }
.court-num { font-weight: 700; color: var(--c-primary); font-size: 1rem; text-align: center; display: flex; justify-content: center; align-items: center; gap: 0.5rem; }
.court-pause-btn { font-size: 0.7rem; color: var(--c-muted); cursor: pointer; user-select: none; padding: 0 0.2rem; line-height: 1; }
.court-pause-btn:hover { color: var(--c-danger); }
.court-paused-label { text-align: center; color: var(--c-danger); font-size: 0.8rem; font-weight: bold; }
.court-status { font-size: 1.2rem; }
/* Namen op hun eigen regel, de "wint"-knop als slanke balk eronder — zo knijpt de knop
   de (soms lange) spelersnamen niet samen en blijft het plein-kaartje overzichtelijk. */
.court-team-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  padding: 0.15rem 0;
  font-size: 1.05rem;
}
.court-team-row button {
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  background: var(--c-success);
  color: white;
  border: none;
  border-radius: 6px;
  align-self: stretch;
}
.court-vs { color: var(--c-muted); font-size: 0.75rem; text-align: center; padding: 0.1rem 0; }
.court { position: relative; }
.court-elapsed-corner {
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  font-size: 0.7rem;
  color: var(--c-muted);
  background: #ffffffb3;
  padding: 0 0.25rem;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.court.fresh {
  border: 3px solid var(--c-accent);
  background: #fdf9e3;
  animation: court-fresh 1s ease-in-out infinite alternate;
}
@keyframes court-fresh {
  from { box-shadow: 0 0 0 3px #e8b40059; }
  to { box-shadow: 0 0 20px 9px #e8b400f2; }
}
.court-await { background: var(--c-accent); color: #4a3e00; padding: 0.2rem 0.4rem; border-radius: 6px; font-size: 0.85rem; text-align: center; font-weight: 600; }
.court-pending { background: var(--c-accent-tint); padding: 0.4rem; border-radius: 8px; margin-bottom: 0.4rem; border: 1px dashed var(--c-accent); }
.court-pending-label { font-size: 0.8rem; color: var(--c-accent-ink); margin-bottom: 0.25rem; text-align: center; }
.court-mid-btn { margin-top: 0.25rem; font-size: 0.8rem; padding: 0.3rem 0.4rem; width: 100%; }

/* Queue rows */
.queue-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid #eef2f8;
  font-size: 1.05rem;
}
.queue-row.paired {
  background: linear-gradient(90deg, #fdf3c2, #fbe88f);
  border: 2px solid var(--c-accent);
  border-radius: 10px;
  padding: 0.6rem 0.5rem;
  margin: 0.3rem 0;
  font-weight: bold;
  font-size: 1.15rem;
  box-shadow: 0 1px 4px #f6d00b33;
}
.queue-row.paired .queue-pair { color: #574a00; }
.queue-row.paired .queue-pair em { color: #8a7a1e; }
#queueReady li:not(.muted) {
  animation: ready-pulse 2s ease-in-out infinite;
}
@keyframes ready-pulse {
  0%, 100% { box-shadow: 0 1px 4px #f6d00b33; }
  50% { box-shadow: 0 2px 12px #f6d00b80; }
}
.queue-rank { font-weight: bold; font-variant-numeric: tabular-nums; }
/* Annuleer-knopje (✕) rechts op een "Houd je klaar!"-rij */
.queue-row.paired > button { font-size: 0.8rem; padding: 0.15rem 0.5rem; justify-self: end; }
.queue-pair { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-pair em { color: var(--c-muted); font-style: normal; font-size: 0.85rem; padding: 0 0.25rem; }
.queue-time { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.queue-row.me { background: var(--c-accent-tint); font-weight: bold; }
.queue-row.paired.me { box-shadow: 0 2px 12px #f6d00b99; border-color: #d9b400; }
.queue-pair-stack { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.queue-pair-stack > div { white-space: normal; word-break: break-word; }
.queue-pair-stack .pair-vs { color: var(--c-muted); font-size: 0.85rem; font-weight: normal; padding: 0.05rem 0; }
.team-page .queue-pair { white-space: normal; word-break: break-word; }
.team-page .queue-row { align-items: start; }
/* On team page, only highlight a paired row if it's the player's own team */
.team-page .queue-row.paired:not(.me) {
  background: transparent;
  border: 1px solid #eef2f8;
  border-radius: 0;
  font-weight: normal;
  font-size: 1.05rem;
  padding: 0.3rem 0;
  margin: 0;
  box-shadow: none;
}
@media (min-width: 600px) {
  .queue-pair-stack { flex-direction: row; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
  .queue-pair-stack .pair-vs { padding: 0; font-style: italic; }
}

.match-format-header {
  text-align: center; padding: 0.5rem 2.6rem; /* zij-padding = ruimte voor het logo links */
  background: linear-gradient(90deg, var(--c-primary-deep), var(--c-primary));
  color: white;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  position: relative;
}
/* Logo links in de kopbalk van de spelerspagina: transparante variant (navy weggefilterd),
   dus hij versmelt met élke navy achtergrond, ook het gradient. Volledige balkhoogte. */
.match-format-header .header-logo {
  position: absolute; left: 0.3rem; top: 0;
  height: 100%; width: auto;
}
.match-format-pill {
  display: inline-block;
  background: var(--c-primary); color: white;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: normal;
  margin-left: 0.6rem;
  vertical-align: middle;
  letter-spacing: 0.01em;
}
.match-history { list-style: none; padding: 0; }
.match-history .match-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eef2f8;
  font-size: 1.05rem;
}
.result-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.result-dot.won  { background: var(--c-success); }
.result-dot.lost { background: var(--c-danger); }
.match-delta { margin-left: auto; font-size: 0.85rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.match-delta.up { color: var(--c-success); }
.match-delta.down { color: var(--c-danger); }
.team-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center; gap: 1rem;
  padding: 0.5rem; color: white; font-size: 0.9rem;
  background: linear-gradient(90deg, var(--c-primary-deep), var(--c-primary));
  z-index: 50;
}
.team-footer #footerTeamName { font-weight: bold; }
.team-footer a { color: white; text-decoration: underline; font-size: 0.85rem; }
.team-footer #footerPushBtn {
  background: #ffffff2e; color: white; border: 1px solid #ffffff66;
  border-radius: 8px; padding: 0.25rem 0.6rem; font-size: 0.85rem; cursor: pointer;
}
.team-footer #footerPushBtn:hover { background: #ffffff47; }
.team-page { padding-bottom: 3rem; }

/* Team page banners */
.banner { padding: 2rem; border-radius: 16px; text-align: center; margin: 1rem 0; }
.banner h2 { font-size: 2rem; margin-bottom: 1rem; }
.banner.ingechekt { background: #e4e8f0; }
.banner.ingechekt .ingechekt-cta {
  font-size: 1.4rem; font-weight: 600; color: #135c36;
  margin: 1.5rem 0 0.8rem; line-height: 1.35;
}
.banner.ingechekt .big-cta {
  font-size: 1.4rem; font-weight: 700; padding: 1.1rem 1.5rem;
  width: 100%; border-radius: 12px;
  box-shadow: 0 4px 12px #1e8a4f59;
  animation: pulse-cta 2s ease-in-out infinite;
}
@keyframes pulse-cta {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px #1e8a4f59; }
  50% { transform: scale(1.03); box-shadow: 0 6px 18px #1e8a4f80; }
}
.banner.wacht { background: var(--c-accent-tint); }
.banner.volgende { background: #d5e4f9; }
.banner.speelt { background: #d3efdf; }
.banner.score-nodig { background: #fadddd; }
.banner.pauze { background: #e4e8f0; }
.winner-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; margin-top: 1rem; }
.winner-buttons button { padding: 1rem; font-size: 1rem; }
@keyframes pulse { 0%, 100% { background: #d3efdf; } 50% { background: #b9e4cd; } }

/* Tabs */
.tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--c-primary); color: white; border-color: var(--c-primary); }

/* ===== BOARD ===== */
.board-page { padding: 0; }
.board-page #board {
  display: grid;
  grid-template-columns: 40fr 30fr 30fr;
  gap: 1rem;
  padding: 1rem;
  height: calc(100vh - 60px);
  box-sizing: border-box;
}
.board-page #board section {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  overflow-y: auto;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.board-page #board h2 {
  color: var(--c-primary);
  margin-bottom: 0.75rem;
  border-bottom: 3px solid var(--c-accent);
  padding-bottom: 0.25rem;
  font-size: 1.5rem;
}
.board-page .court {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
}
.board-page .court.free {
  background: #f4f7fc;
  color: var(--c-muted);
}
.board-page .court.active {
  background: #e7eefb;
  border-left: 4px solid var(--c-primary);
}
.board-page .court-num {
  font-weight: 700;
  color: var(--c-primary);
  font-size: 1.3rem;
}
.board-page .court .timer {
  font-size: 0.9rem;
  color: var(--c-muted);
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}
.board-page #ladderList li,
.board-page #queueList li {
  padding: 0.4rem 0;
  font-size: 1.1rem;
  border-bottom: 1px solid #e9eef7;
  list-style: none;
}
.board-page #ladderList li.band-a { background: linear-gradient(90deg, #ffd700 0%, transparent 80%); padding-left: 0.5rem; }
.board-page #ladderList li.band-b { background: linear-gradient(90deg, #c0c0c0 0%, transparent 80%); padding-left: 0.5rem; }
.board-page #ladderList li.band-c { background: linear-gradient(90deg, #cd7f32 0%, transparent 80%); padding-left: 0.5rem; }
.board-page #qrCorner {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: white;
  padding: 0.5rem;
  border-radius: 8px;
  z-index: 100;
}
.board-page #qrCorner img,
.board-page #qrCorner canvas { display: block; }
.board-page .board-hb {
  position: fixed;
  bottom: 60px;
  right: 1rem;
  font-size: 0.8rem;
  color: var(--c-muted);
  background: #ffffffe6;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
}

/* Boot-loader: staat statisch in de HTML zodat hij meteen zichtbaar is, nog vóór JS/Firebase
   geladen zijn. De eerste echte render (app.innerHTML = ...) vervangt hem vanzelf. */
.boot-loader {
  min-height: 70vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.1rem;
}
.boot-loader img {
  width: 110px; height: 110px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}
.boot-loader p { color: var(--c-muted); margin: 0; }
.boot-spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 4px solid #d3ddec;
  border-top-color: var(--c-accent);
  animation: boot-spin 0.9s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

/* Logo links in de board-topbar = link naar het eventoverzicht. De datum + format-tag staan
   links naast het logo; de margin-left:auto op het eerste knoppen-element duwt de rest naar
   rechts (mm-combo bij een lopend event, de 🏁-tag bij een afgesloten event). */
.topbar-home { display: inline-flex; }
.topbar-logo {
  width: 34px; height: 34px;
  border-radius: 8px;
}
/* Linkergroep = logo, datum, tags én matchmaker-pil+knop; vanaf de sprekerknop naar rechts. */
.admin-topbar #speakerToggle { margin-left: auto; }

/* === App-logo op login/inschrijfschermen === */
.app-logo {
  display: block;
  width: 130px; height: 130px;
  margin: 0 auto 1rem;
  border-radius: 26px;
  box-shadow: 0 6px 20px #0a3d7e40;
}

/* Link naar de WhatsApp-groep onderaan de inschrijfschermen */
.wa-group-line { text-align: center; margin-top: 1.1rem; font-size: 0.85rem; }
.wa-group-line a { color: var(--c-muted); text-decoration: none; }
.wa-group-line a:hover { color: var(--c-primary); }

/* Naam + wisselicoon als één groepje in de spelers-footer */
.footer-name-wrap { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.footer-name-wrap #footerTeamName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Ander team / andere speler"-wisselicoon in de spelers-footer */
.footer-icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.25rem 0.45rem;
  background: #ffffff2e; border: 1px solid #ffffff66; border-radius: 8px;
  text-decoration: none;
}
.footer-icon-link:hover { background: #ffffff47; }
.footer-icon-link svg { width: 18px; height: 18px; display: block; }

/* WhatsApp-groeplink in de spelers-footer (wit logo + "Events" rechts ervan) */
.wa-footer-link { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.wa-footer-link svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* === Inline info-tooltip (ⓘ) === */
.tip { position: relative; cursor: help; color: var(--c-primary); font-weight: normal; }
.tip-pop {
  display: none; position: absolute; left: 50%; bottom: 145%; transform: translateX(-50%);
  width: 230px; background: var(--c-primary-deep); color: #ffffff; padding: 0.5rem 0.65rem;
  border-radius: 8px; font-size: 0.75rem; font-weight: normal; line-height: 1.35;
  text-align: left; white-space: normal; z-index: 60; box-shadow: 0 2px 8px #0a3d7e33;
}
.tip-pop::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--c-primary-deep);
}
.tip:hover .tip-pop, .tip.show .tip-pop { display: block; }
