/* Voetbal Trainer – styles.css
   Mobile-first, licht/donker via prefers-color-scheme. */

:root {
  color-scheme: light dark;
  --bg: #f3f6f4;
  --bg-top: #e6f1ea;
  --surface: #ffffff;
  --surface-2: #eef3f0;
  --surface-3: #e3eae6;
  --text: #0f1813;
  --muted: #5d6b63;
  --border: #e1e8e3;
  --accent: #128a4a;
  --accent-2: #0f6f3b;
  --accent-strong: #0b5a30;
  --accent-soft: #e0f3e8;
  --accent-soft-2: #c9e9d6;
  --on-accent: #ffffff;
  --danger: #c62828;
  --danger-soft: #fdecea;
  --warn: #e0a100;
  --late: #9a5b00;
  --late-soft: #fdf1dc;
  --late-soft-2: #f6dfae;
  --late-fill: #f3a21a;
  --on-late: #2a1a00;
  --board: linear-gradient(160deg, #0f3d26 0%, #144d31 55%, #0d3320 100%);
  --board-text: #f1fff6;
  --board-btn: #3ddc84;
  --board-btn-text: #06301a;
  --sync-off: rgba(255, 255, 255, 0.55);
  --sync-ok: #c8ffde;
  --sync-pending: #ffd54a;
  --sync-error: #ffb3ad;
  --sync-busy: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 24, 0.05), 0 1px 3px rgba(16, 32, 24, 0.04);
  --shadow: 0 1px 2px rgba(16, 32, 24, 0.04), 0 14px 32px -16px rgba(16, 32, 24, 0.22);
  --shadow-lg: 0 18px 40px -18px rgba(16, 32, 24, 0.35);
  --nav-bg: rgba(255, 255, 255, 0.86);
  --topbar: linear-gradient(120deg, #0c6636 0%, #128a4a 55%, #17a35a 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b100d;
    --bg-top: #0f1a13;
    --surface: #151c17;
    --surface-2: #1c2620;
    --surface-3: #243029;
    --text: #e8efe9;
    --muted: #98a99e;
    --border: #253029;
    --accent: #35c777;
    --accent-2: #2fb56b;
    --accent-strong: #7be8ab;
    --accent-soft: #173a27;
    --accent-soft-2: #1e4a32;
    --on-accent: #05150c;
    --danger: #ff8078;
    --danger-soft: #3b1b18;
    --late: #ffc96b;
    --late-soft: #3a2a10;
    --late-soft-2: #4d3814;
    --board: linear-gradient(160deg, #0d2c1c 0%, #123a26 55%, #0a2418 100%);
    --sync-off: rgba(255, 255, 255, 0.45);
    --sync-ok: #9df5c2;
    --sync-pending: #ffd54a;
    --sync-error: #ff9a93;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    --shadow-lg: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    --nav-bg: rgba(19, 26, 21, 0.9);
    --topbar: linear-gradient(120deg, #0b3f22 0%, #0f5a33 60%, #12673a 100%);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 320px);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); }
h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0.35rem 0; }
code { font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 6px; }
svg.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; }
h2 > svg.ic, h3 > svg.ic { color: var(--accent); width: 1.2em; height: 1.2em; margin-right: 0.2em; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1rem;
  padding-top: max(0.55rem, env(safe-area-inset-top));
  background: var(--topbar);
  color: #fff;
  box-shadow: 0 6px 24px -12px rgba(0, 0, 0, 0.45);
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, 0.16); }
.brand__icon svg { width: 22px; height: 22px; }
.tabs { display: flex; gap: 0.2rem; flex-shrink: 0; }
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  opacity: 0.86;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.tabs__icon { display: inline-grid; place-items: center; }
.tabs__icon svg { width: 20px; height: 20px; }
.tabs a:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.tabs a.is-active { opacity: 1; background: rgba(255, 255, 255, 0.2); }

.sync {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--sync-off);
  text-decoration: none;
  flex-shrink: 0;
}
.sync svg { width: 24px; height: 24px; }
.sync[data-state="ok"] { color: var(--sync-ok); }
.sync[data-state="pending"] { color: var(--sync-pending); }
.sync[data-state="error"] { color: var(--sync-error); }
.sync[data-state="busy"] { color: var(--sync-busy); animation: sync-pulse 0.9s infinite alternate; }
@keyframes sync-pulse { from { opacity: 0.35; } to { opacity: 1; } }
.sync-status { display: flex; align-items: flex-start; gap: 0.5rem; font-weight: 600; }
.sync-dot { width: 12px; height: 12px; margin-top: 0.4em; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.sync-status[data-state="ok"] .sync-dot { background: var(--accent); }
.sync-status[data-state="pending"] .sync-dot { background: var(--warn); }
.sync-status[data-state="error"] .sync-dot { background: var(--danger); }
.sync-status[data-state="busy"] .sync-dot { background: var(--accent); animation: sync-pulse 0.9s infinite alternate; }

/* Layout */
.container { max-width: 720px; margin: 0 auto; padding: 1rem; padding-bottom: 5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0.1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.toolbar .actions { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); }
.empty {
  color: var(--muted);
  padding: 0.9rem 1rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; font-weight: 700; color: var(--accent-strong); margin: 0 0 0.25rem; }
.back { display: inline-flex; align-items: center; gap: 0.2rem; margin-bottom: 0.4rem; text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--muted); }
.back:hover { color: var(--accent-strong); }
.count {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.5em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
.badge {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.training-head h2 { font-size: 1.45rem; }
.training-head .badge { font-size: 0.75rem; vertical-align: 0.3em; }

/* Formulieren */
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field > span { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="url"], input[type="search"], input[type="date"], input[type="time"], input[type="password"], textarea, select {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
select { width: auto; padding-right: 2rem; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d6b63' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn:focus-visible, .icon:focus-visible, .thumb-btn:focus-visible, .chip:focus-visible, .slot:focus-visible, .scoreboard__btn:focus-visible, .att-btn:focus-visible, .segmented button:focus-visible, .tabs a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
input[type="search"] { margin: 0.5rem 0 0.75rem; }
textarea { resize: vertical; }
.field--inline { flex-direction: row; align-items: center; gap: 0.5rem; }
.field--inline > span { white-space: nowrap; }
.subhead { margin: 1rem 0 0.5rem; font-size: 0.92rem; font-weight: 700; }
.details summary { cursor: pointer; color: var(--muted); font-weight: 600; margin: 0.75rem 0 0.5rem; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  flex-shrink: 0;
}

/* Knoppen */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--surface-3); background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn--primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); border-color: transparent; color: var(--on-accent); box-shadow: 0 6px 16px -8px rgba(18, 138, 74, 0.7); }
.btn--primary:hover { background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-strong) 100%); border-color: transparent; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.btn--sm { min-height: 38px; padding: 0.35rem 0.8rem; font-size: 0.9rem; border-radius: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.icon svg { width: 18px; height: 18px; }
.icon:hover { background: var(--surface-2); }
.icon:disabled { opacity: 0.3; cursor: not-allowed; }
.icon--danger { color: var(--danger); }
.icon--danger:hover { background: var(--danger-soft); border-color: transparent; }

.segmented {
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  margin: 0.5rem 0;
}
.segmented a, .segmented button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented a[aria-selected="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented--full { display: flex; margin: 0 0 0.9rem; }

/* Lijsten */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.list-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem 0.7rem;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.list-item.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.list-item__row { display: flex; align-items: center; gap: 0.7rem; }
.list-item .actions { margin-top: 0.5rem; gap: 0.35rem; }
.list-item .btn { min-height: 36px; padding: 0.3rem 0.75rem; font-size: 0.88rem; border-radius: 10px; }
.list-item .btn--ghost { padding-inline: 0.55rem; }
.btn--pick { min-width: 6.4rem; }
.list-item strong { display: block; overflow-wrap: break-word; }
.mini-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.thumb-wrap { position: relative; flex-shrink: 0; line-height: 0; }
.thumb-wrap .num {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  box-shadow: 0 0 0 2px var(--surface);
}
.thumb {
  width: 54px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 10px;
  background: #0b0f0d;
  flex-shrink: 0;
}
.thumb-btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; line-height: 0; flex-shrink: 0; }
/* Tekst- en foto-oefeningen: tegel met icoon, of een eigen (liggende) thumbnail */
.thumb--tile { display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.thumb--tile svg.ic { width: 24px; height: 24px; }
.thumb--photo { width: 72px; aspect-ratio: 4 / 3; background: var(--surface-2); }
.thumb-btn--peek { position: relative; }
.thumb-play {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--surface);
}
.thumb-play svg.ic { width: 12px; height: 12px; }
.num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.list-item.is-selected .tag { background: var(--surface); }

/* Trainingen- en wedstrijdoverzicht */
.session { display: flex; gap: 0.85rem; padding: 0.85rem 0; border-top: 1px solid var(--border); }
.session:first-of-type { border-top: 0; padding-top: 0.25rem; }
.session__body { flex: 1 1 auto; min-width: 0; }
.session__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.session h3 { margin-bottom: 0.15rem; }
.session h3 a { text-decoration: none; color: inherit; }
.session h3 a:hover { text-decoration: underline; }
.session .actions { margin-top: 0.55rem; }
.date-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
  line-height: 1;
}
.date-tile__day { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.date-tile__mon { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }
.date-tile--past { background: var(--surface-2); color: var(--muted); }

/* Afspeellijst */
.playlist { list-style: none; margin: 0; padding: 0; }
.play-item__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.play-item__head h3 { margin: 0; }
.ext { text-align: center; margin: 0.6rem 0 0; font-size: 0.9rem; }

.player {
  position: relative;
  width: min(100%, 360px, calc(78vh * 9 / 16));
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.player img, .player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.player__play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 45%);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.player__play svg {
  width: 78px;
  height: 78px;
  padding: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease;
}
.player__play:hover svg, .player__play:focus-visible svg { transform: scale(1.06); }
.preview-player { margin: 0.75rem 0 0.25rem; }
.preview { display: flex; gap: 0.75rem; align-items: center; }
.preview-body { margin: 0.75rem 0 0.25rem; }

/* Tekst en foto's van oefeningen */
.ex-text { line-height: 1.55; overflow-wrap: anywhere; }
.ex-text + .ext, .ex-image + .ex-text { margin-top: 0.75rem; }
.player + .ex-text { margin-top: 0.9rem; }
.ex-image { margin: 0; }
.ex-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 14px;
  background: var(--surface-2);
  cursor: zoom-in;
}
.ex-image--loading img { filter: blur(5px); opacity: 0.7; cursor: default; }
.image-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.image-pick__preview img { display: block; max-width: 180px; max-height: 180px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.image-pick__preview p { margin: 0.3rem 0 0; }
.image-pick__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.file-btn { cursor: pointer; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 6, 0.94);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lightbox__close svg.ic { width: 22px; height: 22px; }

/* Chips (wissels, aanwezigheid, gasten) */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { background: var(--surface-3); }
.chip.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip--check input { margin: 0; width: 18px; height: 18px; accent-color: var(--accent); }
.chip.is-off { opacity: 0.55; text-decoration: line-through; }
.chip--static { cursor: default; padding-right: 0.3rem; }
.chip__x { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; background: transparent; color: var(--danger); font: inherit; cursor: pointer; padding: 0; border-radius: 999px; }
.chip__x svg { width: 16px; height: 16px; }
.chip__x:hover { background: var(--danger-soft); }

/* Aanwezigheid bij trainingen en opkomst */
.att-item { transition: background 0.15s ease, border-color 0.15s ease; }
.att-item.is-present { border-color: var(--accent-soft-2); background: var(--accent-soft); }
.att-item.is-late { border-color: var(--late-soft-2); background: var(--late-soft); }
.att-item.is-absent { background: var(--surface-2); }
.att-item.is-absent strong { color: var(--muted); text-decoration: line-through; }
.att-state { font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.att-item.is-present .att-state { color: var(--accent-strong); }
.att-item.is-late .att-state { color: var(--late); }
.att-item.is-absent .att-state { color: var(--danger); }
.att-toggle { display: flex; gap: 0.4rem; flex-shrink: 0; }
.att-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.att-btn svg { width: 22px; height: 22px; }
.att-btn:hover { background: var(--surface-2); }
.att-btn:active { transform: scale(0.94); }
.att-btn--present.is-on { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 6px 16px -8px rgba(18, 138, 74, 0.7); }
.att-btn--late.is-on { background: var(--late-fill); border-color: transparent; color: var(--on-late); box-shadow: 0 6px 16px -8px rgba(243, 162, 26, 0.7); }
.att-btn--absent.is-on { background: var(--danger); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(198, 40, 40, 0.6); }
.late { color: var(--late); font-weight: 700; }
.th-ic { display: inline-block; margin-right: 0.3rem; vertical-align: -3px; }
.th-ic svg { width: 15px; height: 15px; }
.pct { display: inline-flex; align-items: center; justify-content: flex-end; gap: 0.45rem; }
.bar { display: inline-block; width: 52px; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* Veld en opstelling */
.pitch {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0.75rem auto 0.5rem;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: repeating-linear-gradient(180deg, #2e9c5c 0 12.5%, #2a905a 12.5% 25%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.78), var(--shadow);
}
.pitch__mid { position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255, 255, 255, 0.78); }
.pitch__circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
}
.pitch__box { position: absolute; left: 24%; right: 24%; height: 13%; border: 2px solid rgba(255, 255, 255, 0.78); }
.pitch__box--top { top: -2px; border-top: 0; }
.pitch__box--bottom { bottom: -2px; border-bottom: 0; }
.slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 19%;
  min-width: 58px;
  max-width: 84px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.slot__shirt { width: 44px; height: 41px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); transition: transform 0.12s ease; }
.slot__shirt path { fill: #ff6a2b; stroke: rgba(255, 255, 255, 0.92); stroke-width: 2; stroke-linejoin: round; }
.slot--keeper .slot__shirt path { fill: #ffc51a; }
.slot--empty .slot__shirt path { fill: rgba(255, 255, 255, 0.2); stroke-dasharray: 4 3; }
.slot.is-selected .slot__shirt { transform: scale(1.1); filter: drop-shadow(0 0 8px #ffe066) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
.slot.is-selected .slot__shirt path { stroke: #fff; stroke-width: 4; }
.slot__name {
  max-width: 100%;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(6, 30, 16, 0.55);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot--empty .slot__name { opacity: 0.85; font-weight: 600; background: rgba(6, 30, 16, 0.35); }
.hint { min-height: 1.2em; }

/* Scorebord, doelpunten en ranglijst */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  padding: 1rem 0.75rem;
  border-radius: 16px;
  background: var(--board);
  color: var(--board-text);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.scoreboard__side { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; min-width: 0; }
.scoreboard__name { max-width: 100%; font-weight: 700; font-size: 0.76rem; line-height: 1.2; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.9; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.scoreboard__center { display: flex; flex-direction: column; align-items: center; }
.scoreboard__score { font-size: 2.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; padding: 0 0.4rem; font-variant-numeric: tabular-nums; }
.scoreboard__label { margin-top: 0.35rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; }
.scoreboard__btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  background: var(--board-btn);
  color: var(--board-btn-text);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(61, 220, 132, 0.9);
  transition: transform 0.08s ease;
}
.scoreboard__btn:active { transform: scale(0.94); }
.btn--big { min-height: 56px; min-width: 88px; font-size: 1.35rem; padding: 0.5rem 1.4rem; }
.events__edit { display: block; }
.badge--score { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.events .badge--score { font-size: 0.78rem; }
.events { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.events li { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 12px; }
.num--small { width: 28px; height: 28px; font-size: 0.85rem; background: var(--surface-2); color: var(--text); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 0.55rem 0.45rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.table th:not(:nth-child(2)), .table td:not(:nth-child(2)) { text-align: right; }
.table td:nth-child(2) { width: 100%; font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.rank--1 { background: #ffe08a; color: #6b4d00; }
.rank--2 { background: #e6e9ec; color: #4a545c; }
.rank--3 { background: #f2c9a8; color: #6b3a12; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 480px);
  padding: 0.75rem 1.15rem;
  border-radius: 14px;
  background: rgba(15, 24, 19, 0.92);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  z-index: 20;
}

/* Installeren als app */
.install-banner { display: flex; align-items: center; gap: 0.75rem; }
.install-banner .btn { flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Mobiel: tabs als bottom-nav, makkelijker met de duim op het veld */
@media (max-width: 600px) {
  .topbar { justify-content: center; }
  .sync { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    gap: 0.25rem;
    padding: 0.4rem 0.5rem;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabs a {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    text-align: center;
    padding: 0.25rem 0.2rem;
    border-radius: 12px;
    color: var(--muted);
    opacity: 1;
    font-size: 0.68rem;
    font-weight: 600;
  }
  .tabs a:hover { background: transparent; }
  .tabs__icon { width: 56px; height: 30px; border-radius: 999px; transition: background 0.15s ease; }
  .tabs__icon svg { width: 22px; height: 22px; }
  .tabs a.is-active { color: var(--accent-strong); background: transparent; }
  .tabs a.is-active .tabs__icon { background: var(--accent-soft); }
  .container { padding-bottom: 6.5rem; }
  .toast { bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .segmented { display: flex; }
  .segmented a, .segmented button { padding: 0.45rem 0.4rem; font-size: 0.86rem; }
  .att-state { display: none; }
  /* Drie knoppen (aanwezig, te laat, afwezig) naast de naam: iets kleiner zodat de naam ruimte houdt */
  .att-toggle { gap: 0.3rem; }
  .att-btn { width: 40px; height: 40px; }
  .att-btn svg { width: 20px; height: 20px; }
  /* Lijsten: kleinere miniaturen en knopjes, zodat titels niet midden in een woord afbreken */
  .list-item .thumb { width: 48px; }
  .list-item .thumb--photo { width: 64px; }
  .list-item__row { gap: 0.55rem; }
  .mini-actions { gap: 0.15rem; }
  .mini-actions .icon { width: 34px; height: 34px; }
  /* Smalle kaarten: badge onder de titel, compacte knoppen zonder icoon in de tekstknoppen */
  .session__head { flex-wrap: wrap; }
  .session__head > .grow { flex: 1 1 170px; }
  .session .actions .btn--sm { min-height: 36px; padding: 0.3rem 0.6rem; font-size: 0.84rem; }
  .session .actions .btn--text .ic { display: none; }
  /* Tabellen (ranglijst, opkomst) moeten zonder scrollen in beeld passen: compactere koppen en
     cellen, en een lange naam breekt af in plaats van de tabel breder te maken */
  .table { font-size: 0.92rem; }
  .table th, .table td { padding: 0.5rem 0.25rem; }
  .table th { font-size: 0.6rem; letter-spacing: 0.02em; }
  /* Opkomst: alleen het icoon in de kop, het woord blijft voor schermlezers */
  .th-ic { margin-right: 0; }
  .th-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
  .rank { width: 24px; height: 24px; font-size: 0.75rem; }
  .bar { display: none; }
}
