/* ============ De Pronostiek - avondmatch thema ============ */
:root {
  --pitch: #0C2A1D;
  --pitch-deep: #092217;
  --surface: rgba(244, 247, 242, 0.05);
  --surface-hi: rgba(244, 247, 242, 0.09);
  --chalk: #F4F7F2;
  --chalk-dim: #9DBFA9;
  --chalk-faint: rgba(244, 247, 242, 0.22);
  --amber: #FFC53D;
  --green: #6FD98F;
  --live: #FF5A48;
  --font-head: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --font-num: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--pitch-deep); }
body { font-family: var(--font-body); color: var(--chalk); }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
button:disabled { cursor: default; }

.app-shell {
  max-width: 448px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--pitch);
  position: relative;
  overflow: hidden;
}

.center-circle {
  position: absolute;
  top: -140px; left: 50%;
  transform: translateX(-50%);
  width: 280px; height: 280px;
  border-radius: 50%;
  border: 2px dashed var(--chalk-faint);
  pointer-events: none;
}

.app-header { padding: 32px 20px 8px; position: relative; }
.eyebrow { font-family: var(--font-num); font-size: 11px; letter-spacing: 3px; color: var(--chalk-dim); }
.wordmark {
  font-family: var(--font-head);
  font-weight: 800; font-size: 44px; line-height: 0.95;
  text-transform: uppercase; margin: 6px 0 0;
}
.subtitle { margin-top: 6px; font-size: 13px; color: var(--chalk-dim); }

.tabs { padding: 12px 20px 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; position: relative; align-items: center; }
.tab {
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--surface); color: var(--chalk-dim);
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  transition: background 0.15s;
}
.tab.active { background: var(--chalk); color: var(--pitch); }

/* ---- speleravatar (overal herbruikt: menu, klassement, detail, seizoen) ---- */
.player-avatar {
  border-radius: 50%; object-fit: cover; display: block; flex-shrink: 0;
}
.player-avatar-sm { width: 28px; height: 28px; }
.player-avatar-md { width: 40px; height: 40px; }
.player-avatar-lg { width: 72px; height: 72px; }
.player-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--amber); color: var(--pitch-deep);
  font-family: var(--font-head); font-weight: 800;
}
.player-avatar-fallback.player-avatar-sm { font-size: 13px; }
.player-avatar-fallback.player-avatar-md { font-size: 17px; }
.player-avatar-fallback.player-avatar-lg { font-size: 30px; }

/* ---- profielmenu (avatar-knop + dropdown) ---- */
.profile-menu { position: absolute; top: 32px; right: 20px; z-index: 20; }
.profile-avatar-btn { border-radius: 50%; line-height: 0; }
.profile-dropdown-overlay { position: fixed; inset: 0; z-index: 20; }
.profile-dropdown {
  position: absolute; top: 48px; right: 0; z-index: 21;
  width: 190px; background: var(--pitch);
  border: 1px solid var(--chalk-faint); border-radius: 12px;
  padding: 10px; box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}
.profile-dropdown-name {
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  text-transform: uppercase; padding: 4px 8px 10px;
}
.profile-dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 8px; border-radius: 8px;
  font-size: 14px; color: var(--chalk); text-decoration: none;
}
.profile-dropdown-item:hover { background: var(--surface-hi); }
.profile-dropdown-danger { color: var(--live); }

/* ---- profielpagina ---- */
.page-title {
  font-family: var(--font-head); font-weight: 800; font-size: 28px;
  text-transform: uppercase; margin: 0;
}
.section-title {
  font-family: var(--font-head); font-weight: 700; font-size: 18px;
  text-transform: uppercase; margin-bottom: 12px;
}
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-upload input[type="file"] { color: var(--chalk-dim); font-size: 13px; }

.app-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; position: relative; padding-bottom: 48px; }

/* ---- generiek ---- */
.mono { font-family: var(--font-num); }
.small { font-size: 12px; }
.tiny { font-size: 10px; letter-spacing: 1px; }
.muted { color: var(--chalk-dim); }
.faint { color: var(--chalk-faint); }
.amber { color: var(--amber); }
.green { color: var(--green); }
.chalk { color: var(--chalk); }
.center { text-align: center; }

.chalk-line { border-top: 2px dashed var(--chalk-faint); margin: 0 4px; }

.info-bar {
  background: var(--surface-hi);
  border-radius: 12px; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}

/* ---- ronde-navigatie ---- */
.round-nav {
  background: var(--surface-hi);
  border-radius: 12px; padding: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.round-nav-beker { background: rgba(255, 197, 61, 0.12); border: 1px solid rgba(255, 197, 61, 0.35); }
.nav-arrow { width: 40px; height: 40px; border-radius: 8px; font-size: 18px; color: var(--chalk); }
.nav-arrow:disabled { color: var(--chalk-faint); }
.round-name { font-family: var(--font-head); font-weight: 800; font-size: 22px; text-transform: uppercase; }

/* ---- matchkaart ---- */
.match-card { background: var(--surface); border-radius: 12px; padding: 16px 12px; cursor: pointer; }
.match-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.match-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.team {
  /* clamp laat de naam meeschalen met de schermbreedte in plaats van vast te staan;
     bij een grotere systeemlettergrootte valt de tekst zo niet buiten de kaart. */
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(13px, 3.8vw, 19px);
  line-height: 1.05; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
  min-width: 0; overflow: hidden;
}
/* Logo en naam zitten samen in team-inner, zodat ze aan elkaar blijven plakken ook als
   de naam over twee regels valt. Zonder dit duwt een lange naam het logo naar de rand. */
.team-inner {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; max-width: 100%;
}
/* Enkel op spaties afbreken. Afbreken binnen een woord maakt namen onleesbaar
   ("ANDERLE / CHT"); een lange naam op een regel mag liever verkleinen. */
.team-name { min-width: 0; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.team-home { flex: 1 1 0; justify-content: flex-end; }
.team-home .team-name { text-align: right; }
.team-away { flex: 1 1 0; justify-content: flex-start; }
.team-away .team-name { text-align: left; }

/* ---- clublogo's ---- */
.team-logo { object-fit: contain; flex-shrink: 0; display: block; }
.team-logo-xs { width: 18px; height: 18px; }
.team-logo-sm { width: 24px; height: 24px; }
.team-logo-md { width: 30px; height: 30px; }
.team-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-hi); color: var(--chalk-dim);
  font-family: var(--font-num); font-weight: 600;
}
.team-logo-fallback.team-logo-xs { font-size: 8px; }
.team-logo-fallback.team-logo-sm { font-size: 10px; }
.team-logo-fallback.team-logo-md { font-size: 11px; }
.result { font-size: 28px; font-weight: 600; padding: 0 10px; }
.result-sm { font-size: 24px; font-weight: 600; }
.my-pred { margin-top: 8px; text-align: center; font-size: 12px; }

.steppers { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.stepper { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* De knoppen zijn minstens 44px hoog: onder die maat wordt aantikken op een telefoon
   onnauwkeurig. touch-action voorkomt dat een dubbele tik als zoomgebaar wordt opgevat,
   wat bij snel achter elkaar tikken storend is. */
.stepper button {
  width: clamp(34px, 10vw, 44px);
  height: 44px;
  border-radius: 8px;
  background: var(--surface-hi);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.stepper button:active { background: var(--amber); color: var(--pitch-deep); }
.score-cell {
  /* min-width in plaats van een vaste breedte: bij twee cijfers groeit het vakje mee. */
  min-width: clamp(34px, 9vw, 44px); height: 44px; padding: 0 4px;
  border-radius: 8px;
  background: var(--pitch-deep); border: 1px solid var(--chalk-faint);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-size: 22px; font-weight: 600; color: var(--amber);
}

.pts-chip {
  font-family: var(--font-num); font-size: 11px;
  background: var(--surface-hi);
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}

.btn-primary {
  width: 100%; padding: 16px; border-radius: 12px;
  font-family: var(--font-head); font-weight: 800; font-size: 20px;
  text-transform: uppercase; letter-spacing: 1px;
  background: var(--amber); color: var(--pitch-deep);
  transition: background 0.15s;
}
.btn-primary:disabled { background: var(--surface-hi); color: var(--chalk-dim); }

/* ---- overlay / sheet ---- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 448px; max-height: 80vh; overflow-y: auto;
  background: var(--pitch);
  border-top: 2px dashed var(--chalk-faint);
  border-radius: 16px 16px 0 0;
  padding: 20px 20px 32px;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-title { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.close { font-size: 20px; color: var(--chalk-dim); }

.pred-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.pred-name { flex: 1; font-family: var(--font-head); font-weight: 700; font-size: 18px; text-transform: uppercase; }
.you-chip {
  font-family: var(--font-num); font-size: 9px; letter-spacing: 1px;
  background: var(--amber); color: var(--pitch-deep);
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}

/* ---- stand ---- */
.standing-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.rank {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-hi);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-weight: 600; font-size: 15px;
}
.rank-first { background: var(--amber); color: var(--pitch-deep); }
.standing-name { flex: 1; }
.standing-pts { font-size: 22px; font-weight: 600; }

/* ---- seizoen ---- */
.lock-note { margin-bottom: 12px; }
.my-pick {
  width: 100%; background: var(--pitch-deep);
  border: 1px dashed var(--chalk-faint); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
  text-align: left;
}
.my-pick:disabled { border-color: transparent; }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team-option {
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  text-transform: uppercase; text-align: left;
  background: var(--surface-hi); border-radius: 12px; padding: 12px;
  display: flex; align-items: center; gap: 10px;
}

/* ---- kalender (volledig seizoensoverzicht) ---- */
.calendar-round-header {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 800; font-size: 16px;
  text-transform: uppercase; color: var(--chalk-dim);
  padding: 14px 4px 6px;
}
.calendar-round-header.amber { color: var(--amber); }
.calendar-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 8px; background: var(--surface);
  margin-bottom: 4px;
}
.calendar-teams {
  font-size: clamp(11px, 3vw, 13px);
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 5px;
}
/* Beide ploegnamen krijgen evenveel ruimte, zodat er niet één volledig wegvalt terwijl de
   andere alle plaats inneemt. */
.calendar-team-name {
  flex: 1 1 0; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-result { font-size: clamp(11px, 3vw, 13px); width: clamp(74px, 20vw, 90px); text-align: center; flex-shrink: 0; }
.calendar-mine { font-size: clamp(11px, 3vw, 13px); width: clamp(36px, 10vw, 46px); text-align: right; flex-shrink: 0; }

/* ---- prijzen (vrije-tekst seizoensprono's) ---- */
.award-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.award-edit-actions { display: flex; gap: 8px; }

/* ---- icoonset (zelfgetekende monoline SVG's) ---- */
.icon { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; }
.icon-md { width: 21px; height: 21px; }
.icon-lg { width: 30px; height: 30px; }
.round-name-icon { display: inline-flex; align-items: center; gap: 8px; }
.lock-note { display: flex; align-items: center; gap: 6px; }
.streak { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: var(--amber); }
.match-meta > span { display: inline-flex; align-items: center; gap: 5px; }

/* ---- competitiestand ---- */
.table-head, .table-row {
  display: flex; align-items: center; gap: 6px; padding: 9px 2px;
}
.table-head {
  font-family: var(--font-num); font-size: 10px; letter-spacing: 1px;
  color: var(--chalk-dim); text-transform: uppercase;
  border-bottom: 2px dashed var(--chalk-faint);
}
.table-pos { width: 20px; text-align: center; flex-shrink: 0; font-size: clamp(11px, 3vw, 13px); }
.table-team { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: clamp(11px, 3vw, 13px); }
.table-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-num { width: clamp(22px, 6vw, 30px); text-align: center; flex-shrink: 0; font-size: clamp(11px, 3vw, 13px); }
.table-row-leader .table-pos { color: var(--amber); font-weight: 600; }

/* De W/G/V-kolommen pas verbergen wanneer er echt geen ruimte is. Eerder stond deze
   grens op 420px, waardoor ze ook wegvielen op ruime telefoonschermen. */
@media (max-width: 340px) {
  .hide-narrow { display: none; }
}

/* ---- live-indicator ---- */
.live-bar { border: 1px solid rgba(255, 90, 72, 0.4); gap: 10px; justify-content: flex-start; }
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--live); flex-shrink: 0;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---- rat van de week ---- */
.rat-mark {
  display: inline-flex; align-items: center;
  margin-left: 8px; color: var(--live);
  vertical-align: middle;
}

.round-mark { display: inline-flex; align-items: center; margin-left: 6px; vertical-align: middle; }
.round-summary .small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---- badgekaart: wie verdiende hem, en hoe vaak ---- */
.badge-earners { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.badge-earner { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.badge-earner-name { color: var(--chalk); }
.badge-count { color: var(--amber); font-size: 11px; }

/* ---- voortgangsbalk ---- */
.progress-track {
  height: 8px; border-radius: 999px; background: var(--pitch-deep);
  border: 1px solid var(--chalk-faint); overflow: hidden; margin: 12px 0 8px;
}
.progress-fill {
  height: 100%; background: var(--amber);
  transition: width 0.4s ease;
}

/* ---- beheer ---- */
.beheer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.beheer-season { margin: 16px 0 12px; }
.beheer-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; }
.beheer-actions .tab { font-size: 13px; padding: 6px 12px; }

/* ---- badges ---- */
.badge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.badge-card { background: var(--surface-hi); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.badge-locked { background: var(--surface); opacity: 0.45; }
.badge-icon { color: var(--amber); line-height: 0; }
.badge-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; text-transform: uppercase; line-height: 1.1; }

/* ---- login ---- */
.login-card {
  background: var(--surface); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.login-label { display: block; font-size: 12px; color: var(--chalk-dim); margin-top: 8px; }
.login-input {
  display: block; width: 100%; box-sizing: border-box;
  background: var(--pitch-deep); border: 1px solid var(--chalk-faint);
  border-radius: 10px; padding: 12px; color: var(--chalk);
  font-family: var(--font-body); font-size: 16px;
}
.login-input:focus { outline: 2px solid var(--amber); border-color: transparent; }
.login-error {
  background: rgba(255, 90, 72, 0.15); border: 1px solid rgba(255, 90, 72, 0.4);
  color: var(--live); border-radius: 10px; padding: 10px 14px; font-size: 13px;
}
.login-shell .app-main { padding-top: 32px; }
.login-card .btn-primary { margin-top: 16px; }

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