* {
  box-sizing: border-box;
}

:root {
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-light: #fff7ed;
  --navy: #1e3560;
  --navy-light: #2a4a80;
  --bg: #eef0f5;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 10px;
  --radius-lg: 14px;

  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.5;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('images/leeuw02.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: -1;
}

/* ── Navigation bar ── */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  padding-top: 22px;
}

.site-nav {
  background: var(--navy);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  position: relative;
  overflow: visible;
}

.nav-leeuw {
  position: absolute;
  top: 0;
  left: 230px;
  height: 115px;
  pointer-events: none;
  z-index: 201;
}

.site-nav-brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav-brand span {
  color: var(--orange);
}

.nav-brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.site-nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-links a {
  display: block;
  padding: 6px 12px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.site-nav-links a:hover,
.site-nav-links a.actief {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.site-nav-links a.nav-uitgelicht {
  color: var(--orange);
  font-weight: 700;
}

.site-nav-links a.nav-uitgelicht:hover,
.site-nav-links a.nav-uitgelicht.actief {
  color: var(--orange);
}

/* ── Page shell ── */
.page-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ── Header ── */
.site-header {
  margin-top: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
}

h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.intro {
  max-width: 700px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}

/* ── Forms & inputs ── */
input[type="text"],
input[type="email"],
input[type="password"] {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
  color: var(--text);
  width: 100%;
}

input[type="number"] {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 4px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
  color: var(--text);
  text-align: center;
}

input:focus {
  border-color: var(--orange);
}

button,
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

/* Primary orange button */
.inline-form button,
.auth-form button[type="submit"],
.auth-form button[type="button"] {
  background: var(--orange);
  color: #fff;
  width: 100%;
  margin-top: auto;
}

.inline-form button:hover,
.auth-form button[type="submit"]:hover,
.auth-form button[type="button"]:hover {
  background: var(--orange-dark);
}

button.secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}

button.secondary:hover {
  border-color: var(--navy);
}

.section-header {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.inline-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 16px;
}

.inline-form label { display: none; }

.participant-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-forms {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  margin-bottom: 16px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.auth-form label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: -4px;
}

.auth-message {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 0.88rem;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.auth-message:empty {
  display: none;
}

.auth-message.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.auth-message.success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Online-teller (alleen beheerder) — rechts in de groene "Ingelogd als"-balk */
.online-teller {
  font-size: 0.78rem;
  color: #166534;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.online-teller::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.hidden { display: none !important; }

/* ── Leaderboard + kampioen grid ── */
.lb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}
.lb-grid .card {
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .lb-grid { grid-template-columns: 1fr; }
}

#leaderboard-card { display: flex; flex-direction: column; }
#kampioen-stat-card { display: flex; flex-direction: column; padding-bottom: 24px; }
#kampioen-stat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kamp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
}
.kamp-row:last-child { margin-bottom: 0; }
/* Bij gelijkmatige verdeling vangt space-between de tussenruimte op */
#kampioen-stat-body .kamp-row { margin-bottom: 0; }
/* Op mobiel staan de kaartjes niet uitgerekt, dus space-between heeft geen
   ruimte → herstel handmatig extra ruimte boven elke landrij */
@media (max-width: 640px) {
  #kampioen-stat-body { gap: 18px; }
  /* Bodemruimte op mobiel ongewijzigd laten (alleen desktop verdubbeld) */
  #kampioen-stat-card { padding-bottom: 18px; }
}
.kamp-land {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  grid-column: 1;
}
.kamp-bar-wrap {
  grid-column: 1;
  background: #e8eaf0;
  border-radius: 99px;
  height: 7px;
  overflow: hidden;
}
.kamp-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 99px;
  min-width: 4px;
  transition: width 0.4s ease;
}
.kamp-pct {
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--orange);
  text-align: right;
  white-space: nowrap;
  align-self: center;
}

/* ── Nieuws lijst ── */
.nieuws-content {
  display: flex;
  flex-direction: column;
}
.nieuws-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.nieuws-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.nieuws-item:first-child { padding-top: 0; }
.nieuws-item:last-child  { border-bottom: none; padding-bottom: 0; }
.nieuws-bron {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--orange);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Mobiel houdt de oude (goede) badge-maat */
@media (max-width: 640px) {
  .nieuws-bron {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 4px;
  }
}
.nieuws-titel {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  line-height: 1.4;
}
.nieuws-titel:hover { text-decoration: underline; color: var(--orange); }
.nieuws-tijd {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── Match cards ── */
.match-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: #fafafa;
  transition: border-color 0.15s;
}

.match-card:hover {
  border-color: #d1d5db;
}

.match-card.ingevuld {
  background: #f0fdf4;
  border-color: #86efac;
}

.match-card.ingevuld:hover {
  border-color: #4ade80;
}

.voorspelling-blok {
  border-radius: var(--radius);
  padding: 12px;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}

.voorspelling-blok.ingevuld {
  background: #f0fdf4;
  border-color: #86efac;
}

.match-headline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.match-headline .groep-badge {
  background: var(--navy);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 52px 18px 52px 1fr;
  gap: 6px;
  align-items: center;
}

.match-grid label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}

.match-grid .rt { text-align: right; }
.match-grid .ra { text-align: left; }
.match-grid .nl { color: var(--orange); }

.vlag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
  flex-shrink: 0;
}
.match-grid .rt .vlag { margin-left: 5px; }
.match-grid .ra .vlag { margin-right: 5px; }

.match-sep {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.match-score-display {
  grid-column: 2 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--navy);
}
.match-score-display .msd-dash {
  font-size: 1.1rem;
  font-weight: 400;
  color: #bbb;
}
.match-pred-row {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 4px 0 0;
  padding: 6px 0 0;
  border-top: 1px solid var(--border);
}

.match-grid input {
  text-align: center;
  padding: 7px 4px;
  font-size: 1rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 8px;
}

.match-grid input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
}

/* ── Nederland styling ── */
.nederland {
  color: var(--orange);
}

/* ── Scorer dropdown ── */
.scorer-row {
  display: grid;
  gap: 4px;
}

.scorer-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.scorer-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.scorer-select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: default;
}


/* ── Leaderboard table ── */
.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.leaderboard th {
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
}

.leaderboard td {
  padding: 9px 12px;
  border-bottom: 1px solid #f3f4f6;
}

.lb-row {
  cursor: pointer;
  user-select: none;
}

.lb-row:hover { background: #fafafa; }

.lb-self td:nth-child(2) { font-weight: 700; }

.lb-jij {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
}

.lb-chevron {
  color: var(--muted);
  font-size: 1.4rem;
  margin-left: 4px;
  line-height: 1;
  vertical-align: middle;
}

/* Puntenkolom rechts uitlijnen zodat de trend-driehoekjes netjes op één lijn staan */
.leaderboard th:nth-child(3),
.leaderboard td:nth-child(3) { text-align: right; }

.lb-trend {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.7rem;
  line-height: 1;
  vertical-align: middle;
}
.lb-trend-up   { color: #22a559; }
.lb-trend-down { color: #d83b3b; }
.lb-trend-flat { color: var(--muted); }

.lb-detail { display: none; }
.lb-detail.lb-detail-open { display: table-row; }

.lb-detail td { padding: 0 12px 10px; border-bottom: 1px solid #f3f4f6; }

.lb-detail-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 16px;
  background: var(--orange-light);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.82rem;
}

.lb-detail-inner span:nth-child(odd) {
  color: var(--muted);
  font-weight: 600;
}

.lb-muted { color: var(--muted); }

/* ── Account status ── */
.account-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.account-status p {
  margin: 0;
  font-size: 0.88rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  /* iOS zoomt in op velden met font-size < 16px (en zoomt niet terug). 16px voorkomt dat. */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"] {
    font-size: 16px;
  }
  .nav-shell { padding-top: 0; }
  .nav-leeuw { display: none; }
  .site-nav {
    height: auto;
    padding: 0 12px;
    flex-wrap: wrap;
    gap: 0;
  }

  .site-nav-brand {
    padding: 10px 0;
  }

  .nav-brand-logo {
    height: 34px;
  }

  .site-nav-links {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding: 4px 0 8px;
    gap: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav-links::-webkit-scrollbar { display: none; }

  .site-nav-links a {
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 5px 8px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .match-grid {
    grid-template-columns: 1fr 44px 16px 44px 1fr;
    gap: 4px;
  }
}
