:root {
  --bg: #17051f;
  --bg-deep: #12001f;
  --panel: rgba(255, 255, 255, 0.12);
  --panel-strong: rgba(255, 255, 255, 0.16);
  --panel-soft: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-dark: #1f0620;
  --muted: rgba(255, 255, 255, 0.68);
  --muted-dark: rgba(31, 6, 32, 0.78);
  --pink: #ff37b7;
  --yellow: #ffcc33;
  --cyan: #26f0c7;
  --orange: #ff8a00;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 204, 51, 0.72), transparent 25%),
    radial-gradient(circle at 80% 18%, rgba(255, 55, 183, 0.64), transparent 28%),
    radial-gradient(circle at 50% 85%, rgba(38, 240, 199, 0.48), transparent 30%),
    linear-gradient(135deg, #2a0845, var(--bg) 55%, #0b0017);
}

a {
  color: inherit;
  text-decoration: none;
}

.container,
.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.shell {
  padding: 24px 0 110px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 22px;
  margin: 0 0 24px;
  color: var(--text-dark);
  background:
    linear-gradient(135deg, rgba(255, 204, 51, 0.92) 0%, rgba(255, 131, 117, 0.88) 24%, rgba(255, 55, 183, 0.86) 60%, rgba(38, 240, 199, 0.42) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.75;
  z-index: -1;
}

.hero::before {
  width: 260px;
  height: 260px;
  top: -90px;
  right: -70px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
}

.hero::after {
  width: 220px;
  height: 220px;
  left: -75px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
  gap: 22px;
  align-items: center;
  min-height: 0;
}

.hero-copy {
  max-width: 660px;
  padding-top: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  font-size: 14px;
}

.title {
  margin: 12px 0 10px;
  font-size: clamp(36px, 6.2vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 1000;
}

.subtitle {
  margin: 0;
  max-width: 560px;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.22;
  color: var(--muted-dark);
  font-weight: 800;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
}

.hero-panel {
  position: relative;
  padding: 18px;
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.hero-kicker {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 13px;
}

.stat-card {
  padding: 13px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: left;
}

.stat-value {
  display: block;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1;
  font-weight: 1000;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.76);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-note {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.35;
}
.card,
.notice,
.empty {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  color: var(--text);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
  margin: 0 0 18px;
}

.gradient-card {
  background: linear-gradient(135deg, rgba(255, 55, 183, 0.92), rgba(255, 138, 0, 0.88), rgba(255, 204, 51, 0.9));
  color: var(--text-dark);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 18px;
  padding: 15px 20px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.btn {
  background: #fff;
  color: var(--text-dark);
}

.btn.main {
  width: 100%;
  padding: 18px 20px;
  background: linear-gradient(90deg, var(--yellow), var(--pink), var(--cyan));
  color: #18051f;
}

.btn.dark {
  background: rgba(23, 5, 31, 0.92);
  color: #fff;
}

.btn.warn,
button,
input[type="submit"] {
  background: var(--yellow);
  color: var(--text-dark);
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

input::placeholder,
textarea::placeholder { color: rgba(255, 255, 255, 0.45); }
textarea { min-height: 120px; resize: vertical; }

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.rider {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.rider input { width: auto; margin-top: 4px; }

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.error {
  background: rgba(255, 0, 80, 0.22);
  border: 1px solid rgba(255, 0, 80, 0.4);
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 16px;
}

.success {
  background: rgba(38, 240, 199, 0.2);
  border: 1px solid rgba(38, 240, 199, 0.38);
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 16px;
}

.leaderboard { display: grid; gap: 14px; }

.player-card {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
}

.player-summary {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.locked-card .player-summary { cursor: default; }

details[open] .player-summary { background: rgba(255,255,255,0.06); }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

.rank {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  font-size: 20px;
  font-weight: 900;
}

.player-card:first-child .rank {
  background: var(--yellow);
  color: var(--text-dark);
}

.name { display: block; font-size: 20px; font-weight: 900; }
.meta { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.score { text-align: right; }
.score strong { display: block; font-size: 28px; line-height: 1; }
.score span { color: var(--muted); font-size: 12px; font-weight: 700; }

.team { padding: 0 16px 16px; }
.team-grid { display: grid; gap: 8px; margin-top: 8px; }
.rider strong { display: block; font-size: 15px; }
.rider small { display: block; margin-top: 3px; color: var(--muted); }
.rider-points { font-weight: 900; color: var(--yellow); white-space: nowrap; }

.hidden-team {
  margin: 0 16px 16px;
  border-radius: 20px;
  padding: 14px;
  background: rgba(255,216,77,0.16);
  border: 1px solid rgba(255,216,77,0.28);
  color: rgba(255,255,255,0.9);
  font-weight: 800;
}

.nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(860px, calc(100% - 18px));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px;
  background: rgba(23, 5, 31, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  z-index: 100;
}

.nav a {
  color: rgba(255,255,255,0.72);
  text-align: center;
  border-radius: 15px;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 700;
}

.nav a.active {
  background: #fff;
  color: var(--text-dark);
  font-weight: 900;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: auto;
  }

  .hero-copy,
  .hero-panel {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .shell,
  .container {
    width: min(100%, calc(100% - 24px));
  }

  .shell { padding: 16px 0 100px; }

  .hero {
    padding: 18px;
    border-radius: 26px;
  }

  .title {
    font-size: clamp(34px, 11vw, 48px);
  }

  .subtitle {
    font-size: 16px;
  }

  .hero-tags {
    margin-top: 12px;
  }

  .hero-badge {
    padding: 7px 10px;
    font-size: 11px;
  }

  .hero-panel {
    padding: 15px;
  }

  .stat-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .player-summary {
    grid-template-columns: auto 1fr;
  }

  .score {
    grid-column: 2;
    text-align: left;
  }

  .nav {
    width: calc(100% - 12px);
    gap: 4px;
    padding: 6px;
    bottom: 8px;
  }

  .nav a {
    font-size: 11px;
    padding: 10px 4px;
  }
}

/* Foutpagina en admin-formulieren */
.hero-compact {
  min-height: auto;
}

.card form + .muted,
.admin-note {
  margin-top: 12px;
}

/* Algemene uitlijning voor alle pagina's */
h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 7vw, 56px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  font-weight: 1000;
}

h2, h3, p { margin-top: 0; }

.shell > h1,
.container > h1,
.shell > .muted,
.container > .muted {
  max-width: 900px;
}

.shell > .muted,
.container > .muted {
  margin-bottom: 18px;
  font-size: 17px;
  line-height: 1.45;
}

.stat-grid.countdown-clock {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-grid.countdown-clock .stat-card {
  min-width: 0;
}

.stat-card-wide {
  display: block;
}

.explain-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.explain-list li {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.12);
}

.explain-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--yellow);
}

.points-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}

.points-table th,
.points-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  text-align: left;
}

.points-table th {
  color: var(--yellow);
}

.points-table tr:last-child td {
  border-bottom: 0;
}

@media (min-width: 641px) {
  .nav {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 640px) {
  .stat-grid.countdown-clock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.btn.danger,
button.danger {
  background: #ff5c7a;
  color: #fff;
}

.delete-stage-form {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 14px;
}


/* Pagina's met dezelfde hero/card-lay-out */
.hero-compact .hero-copy {
  max-width: 760px;
}

.stage-card .player-summary {
  cursor: default;
}

.stage-card .rank {
  border-radius: 18px;
}

form > .card:last-of-type {
  margin-bottom: 18px;
}

.team-progress {
  min-width: 74px;
  min-height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(255,255,255,0.22);
  color: var(--text-dark);
}

@media (max-width: 640px) {
  .team-progress {
    min-width: 58px;
    min-height: 58px;
    font-size: 28px;
  }
}

/* Admin spelersbeheer */
.btn.soft-danger,
button.soft-danger {
  background: rgba(255, 92, 122, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 92, 122, 0.42);
}

.btn.soft-danger:hover,
button.soft-danger:hover {
  background: rgba(255, 92, 122, 0.28);
}

.admin-player-panel {
  overflow: hidden;
}

.admin-player-list {
  display: grid;
  gap: 10px;
}

.admin-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-player-row.inactive {
  opacity: 0.86;
  background: rgba(0, 0, 0, 0.16);
}

.admin-player-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-player-actions form,
.admin-player-row form {
  margin: 0;
}

@media (max-width: 640px) {
  .admin-player-row {
    grid-template-columns: 1fr;
  }

  .admin-player-actions {
    justify-content: flex-start;
  }

  .admin-player-actions .btn,
  .admin-player-row .btn {
    width: 100%;
  }
}

.small-note {
  margin: 10px 0 0;
  font-size: 13px;
}

.reset-link-card input[readonly] {
  font-family: monospace;
  cursor: copy;
}

/* Team page - groep A t/m E */
.team-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.team-progress {
  min-width: 72px;
  min-height: 72px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  color: var(--text-dark);
  font-size: 34px;
  font-weight: 1000;
}

.group-summary {
  align-items: stretch;
}

.badge-ok {
  background: rgba(38, 240, 199, 0.22);
  border: 1px solid rgba(38, 240, 199, 0.36);
}

.team-form {
  display: grid;
  gap: 0;
}

.team-group-card {
  overflow: hidden;
}

.team-group-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.team-group-heading h2 {
  margin-bottom: 4px;
}

.group-count {
  min-width: 58px;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.14);
  color: var(--yellow);
  font-size: 18px;
  font-weight: 1000;
}

.rider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rider-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  min-height: 76px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255,255,255,0.09);
  cursor: pointer;
}

.rider-option:hover {
  background: rgba(255,255,255,0.13);
}

.rider-option input {
  width: 20px;
  min-height: 20px;
  margin: 3px 0 0;
  accent-color: var(--yellow);
}

.rider-option b {
  display: block;
  margin-bottom: 4px;
  line-height: 1.2;
}

.rider-team {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .team-header,
  .team-group-heading {
    grid-template-columns: 1fr;
  }

  .team-progress,
  .group-count {
    width: fit-content;
  }

  .rider-list {
    grid-template-columns: 1fr;
  }
}

/* Team-pagina herstel */
.team-group-card {
  overflow: hidden;
}

.team-group-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.rider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rider-option {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
}

.rider-option input {
  width: 20px;
  min-height: 20px;
  margin: 3px 0 0;
  flex: none;
}

.rider-option b {
  display: block;
  line-height: 1.2;
}

.rider-team {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.team-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.team-progress {
  font-size: 38px;
  font-weight: 1000;
}

@media (max-width: 760px) {
  .team-group-heading {
    display: grid;
  }

  .rider-list {
    grid-template-columns: 1fr;
  }

  .team-header {
    grid-template-columns: 1fr;
  }
}

/* Strikte teamgroepen */
.team-group-card { overflow: hidden; }
.team-group-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.rider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rider-option {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
}
.rider-option input {
  width: 20px;
  min-height: 20px;
  margin: 3px 0 0;
}
.rider-team {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.team-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.team-progress {
  font-size: 38px;
  font-weight: 1000;
}
@media (max-width: 760px) {
  .team-group-heading { display: grid; }
  .rider-list { grid-template-columns: 1fr; }
  .team-header { grid-template-columns: 1fr; }
}

/* Team-pagina: databasegroepen A-E */
.team-group-card { overflow: hidden; }
.team-group-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.rider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rider-option {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
}
.rider-option input {
  width: 20px;
  min-height: 20px;
  margin: 3px 0 0;
}
.rider-team {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.team-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.team-progress {
  font-size: 38px;
  font-weight: 1000;
}
@media (max-width: 760px) {
  .team-group-heading { display: grid; }
  .rider-list { grid-template-columns: 1fr; }
  .team-header { grid-template-columns: 1fr; }
}
