/* Het Schema — the reader interface.
   Register: A · Speels (prototype #42). Two accents only, and they are not
   interchangeable: goud is play and Thuis, koraal is Uit and you. Within goud,
   three tiers ramp with how much of the night you play: Heel (filled bright),
   Eerste helft (filled muted), Tweede helft (outlined). */

:root {
  --ink: #17110d;
  --raised: #241a11;
  --row: #1e1610;
  --row-border: #2e2317;
  --row-edge: #3d2e1c;
  --card-border: #3a2c1c;

  --goud: #e8b23a;
  --op-goud: #1b1208;
  --goud-dim: #c9a969;
  --goud-line: #7a5f2c;
  --goud-faint: #4d3c25;

  --koraal: #e4573d;
  --op-koraal: #240b06;

  --display: #fbf3e4;
  --name: #f5ead6;
  --opponent: #e9dcc4;
  --muted-1: #cbb897;
  --muted-2: #8d7b5f;
  --muted-3: #6a5943;

  --sticker: #3a2a15;

  --display-font: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body-font: "Instrument Sans", system-ui, -apple-system, sans-serif;

  --notch: polygon(0 0, 100% 0, calc(100% - 11px) 50%, 100% 100%, 0 100%);
  --notch-sm: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--name);
  font-family: var(--body-font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 40px;
}

/* ---------- header ---------- */

.header {
  padding: calc(26px + env(safe-area-inset-top)) 22px 20px;
  background:
    radial-gradient(120% 90% at 78% -10%, rgba(232, 178, 58, 0.22) 0%, rgba(232, 178, 58, 0) 62%),
    linear-gradient(180deg, var(--raised) 0%, var(--ink) 100%);
}

.brand { display: flex; align-items: center; gap: 11px; }

.mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--goud); position: relative; overflow: hidden; flex: none;
}
.mark i {
  position: absolute; left: 15px; top: 4px; width: 3px; height: 26px;
  background: var(--op-goud); border-radius: 2px;
}
.mark i:nth-child(1) { transform: rotate(42deg); }
.mark i:nth-child(2) { transform: rotate(-42deg); }
.mark b {
  position: absolute; left: 13px; top: 13px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--koraal);
}

.wordmark {
  font-family: var(--display-font); font-weight: 800; font-size: 15px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--goud); background: var(--op-goud);
  padding: 5px 22px 5px 12px; clip-path: var(--notch);
}

.title {
  font-family: var(--display-font); font-weight: 800; font-size: 40px; line-height: 1;
  color: var(--display); margin-top: 16px; text-shadow: 2px 3px 0 var(--sticker);
}

.season-name {
  margin-top: 8px; font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; color: var(--muted-2);
}

.rope {
  height: 6px; margin-top: 12px; border-radius: 3px; opacity: 0.7;
  background-image: repeating-linear-gradient(90deg, var(--muted-3) 0 8px, transparent 8px 14px);
}

/* ---------- identity ---------- */

.hoi-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

.hoi {
  font-size: 15px; font-weight: 600; color: var(--muted-1);
  background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer;
}

.nudge {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
  font-size: 12px; color: var(--muted-2);
  border: 1px dashed #4a3c28; border-radius: 999px; padding: 4px 10px;
  background: none; font-family: inherit; cursor: pointer;
}
.nudge:hover { border-color: var(--goud); color: var(--goud); }
.nudge .x { color: var(--muted-3); padding: 0 2px; }

.who-button {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px;
  background: var(--goud); color: var(--op-goud); border: 0; border-radius: 14px;
  padding: 12px 16px; cursor: pointer; box-shadow: 0 5px 0 -1px var(--sticker);
  font-family: var(--display-font); font-weight: 800; font-size: 18px;
}
.who-button .diamond {
  margin-left: auto; width: 9px; height: 9px;
  background: var(--op-goud); transform: rotate(45deg);
}

.back {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 13px; font-weight: 600; color: var(--muted-1);
  background: none; border: 1px solid var(--card-border); border-radius: 999px;
  padding: 6px 14px; font-family: inherit; cursor: pointer;
}
.back:hover { border-color: var(--goud); color: var(--goud); }

/* ---------- section labels ---------- */

section { padding: 4px 22px 0; }

.eyebrow { display: flex; align-items: center; gap: 8px; padding: 14px 0 10px; }
.eyebrow span {
  font-family: var(--display-font); font-weight: 600; font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--goud-dim);
}
.eyebrow .diamond {
  width: 7px; height: 7px; background: var(--goud);
  transform: rotate(45deg); flex: none;
}
.eyebrow .diamond.koraal { background: var(--koraal); }
.eyebrow .dashes {
  flex: 1; height: 1px;
  background-image: repeating-linear-gradient(90deg, #3f3222 0 5px, transparent 5px 10px);
}

/* ---------- cards ---------- */

.card {
  border-radius: 22px; background: var(--raised); border: 1px solid var(--card-border);
  overflow: hidden;
}
.card-head { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.card-body { border-top: 1px solid var(--card-border); padding: 14px 18px 16px; }

.when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.when .date {
  font-family: var(--display-font); font-weight: 800; font-size: 22px; color: var(--display);
}
.opponent { font-size: 19px; font-weight: 600; color: var(--opponent); margin-top: -6px; }

.badge {
  font-family: var(--display-font); font-weight: 800; font-size: 12px; letter-spacing: 0.12em;
  padding: 4px 20px 4px 11px; clip-path: var(--notch);
}
.badge.thuis { background: var(--goud); color: var(--op-goud); }
.badge.uit { background: var(--koraal); color: var(--op-koraal); }
.badge.sm { font-size: 10px; padding: 3px 15px 3px 8px; clip-path: var(--notch-sm); }

.vrij {
  font-family: var(--display-font); font-size: 12px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted-2); border-radius: 999px; padding: 4px 14px;
  background-image: repeating-linear-gradient(135deg, #2a2015 0 5px, #221a11 5px 10px);
}

/* ---------- jouw status ---------- */

.status-band {
  display: flex; align-items: center; gap: 12px;
  background: var(--goud); border-radius: 16px; padding: 14px 16px;
  box-shadow: inset 0 0 0 2px #b7801d, 0 6px 0 -2px var(--sticker);
}
.status-band .microlabel {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #7d5b12; line-height: 1.25;
}
.status-band .word {
  font-family: var(--display-font); font-weight: 800; font-size: 34px; line-height: 1;
  color: var(--op-goud); transform: rotate(-1.5deg);
}
.status-band .word.long { font-size: 26px; }
.status-band .word.longer { font-size: 22px; }
.status-band .diamonds { margin-left: auto; display: flex; gap: 4px; }
.status-band .diamonds i {
  width: 7px; height: 7px; background: var(--op-goud); transform: rotate(45deg);
}
.status-band .diamonds i:nth-child(2) { background: var(--koraal); }

/* ---------- opstelling ---------- */

.microhead {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 10px;
}

.lineup { display: flex; flex-direction: column; gap: 2px; }

.player-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; padding: 7px 0; font-family: inherit; text-align: left;
  color: inherit; cursor: pointer;
}
.player-row .who { font-size: 15px; font-weight: 600; color: var(--name); }
.player-row.off .who { font-weight: 400; color: var(--muted-3); }

.jij {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--koraal);
  border: 1px solid var(--koraal); border-radius: 999px; padding: 1px 6px; flex: none;
}

/* Three tiers on one axis — how much of the night you play. Filled bright, filled
   muted, outlined: a ramp, not three unrelated treatments. */
.pill { margin-left: auto; font-size: 12px; font-weight: 700; border-radius: 999px; flex: none; }
.pill.full { color: var(--op-goud); background: var(--goud); padding: 3px 10px; }
.pill.first-half { color: var(--op-goud); background: var(--goud-dim); padding: 3px 10px; }
.pill.second-half { color: var(--goud); border: 1px solid var(--goud-line); padding: 2px 10px; }
.pill.off { color: var(--muted-3); font-weight: 400; padding: 3px 0; }

/* ---------- onvolledig ---------- */

.onvolledig {
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed var(--goud-line); border-radius: 14px; padding: 11px 14px;
  color: var(--goud); font-size: 14px; font-weight: 600;
}
.onvolledig .diamond {
  width: 7px; height: 7px; background: var(--koraal); transform: rotate(45deg); flex: none;
}
.onvolledig .label {
  font-family: var(--display-font); font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; font-size: 11px; color: var(--goud-dim);
}

/* ---------- het seizoen ---------- */

.rows { display: flex; flex-direction: column; gap: 10px; }

.season-row {
  width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer;
  border-radius: 16px; background: var(--row); border: 1px solid var(--row-border);
  border-left: 3px solid var(--row-edge);
  padding: 13px 14px 13px 16px; display: flex; flex-direction: column; gap: 10px;
}
.season-row.is-next { border-left-color: var(--goud); }

/* Wedstrijden you are not in recede: the surface drops away, the text steps down
   the muted ramp, and the Opstelling stays readable but stops competing. Only
   ever applied once a reader has identified themselves. */
.season-row.dim {
  background: transparent;
  border-color: #241c14;
  border-left-color: #2a2016;
}
.season-row.dim .date { color: var(--muted-2); }
.season-row.dim .opp { color: var(--muted-3); }
.season-row.dim .chips { opacity: 0.5; }
.season-row.dim .badge { opacity: 0.5; }
.season-row.dim .vrij { opacity: 0.6; }
/* Still the next Wedstrijd, just not yours — the edge stays, quieter. */
.season-row.is-next.dim { border-left-color: var(--goud-faint); }
.season-row .top { display: flex; align-items: center; gap: 9px; }
.season-row .date {
  font-family: var(--display-font); font-weight: 800; font-size: 15px; color: var(--name);
  min-width: 74px; flex: none;
}
.season-row .opp {
  font-size: 14px; font-weight: 500; color: var(--muted-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; border-radius: 8px; }
.chip.full { font-weight: 700; color: var(--op-goud); background: var(--goud); padding: 4px 9px; }
.chip.first-half {
  font-weight: 700; color: var(--op-goud); background: var(--goud-dim); padding: 4px 9px;
}
.chip.second-half {
  font-weight: 600; color: var(--goud-dim);
  border: 1px solid var(--goud-faint); padding: 3px 8px;
}
/* Speler detail's chip is a name tag, not an Extent — it carries no tier. */
.chip.name-tag {
  font-weight: 700; color: var(--op-goud); background: var(--goud-dim); padding: 4px 9px;
}
.chip.you { box-shadow: 0 0 0 2px var(--koraal); font-weight: 800; }
.chip.second-half.you { color: var(--goud); border-color: var(--goud-line); }

.legend { display: flex; gap: 14px; align-items: center; padding: 16px 2px 0; flex-wrap: wrap; }
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.legend .sw.full { background: var(--goud); }
.legend .sw.first-half { background: var(--goud-dim); }
.legend .sw.second-half { border: 1px solid var(--goud-faint); }
.legend .sw.you { background: var(--goud); box-shadow: 0 0 0 2px var(--koraal); }
.legend span { font-size: 11px; color: var(--muted-2); }

/* ---------- speler detail ---------- */

.speler-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.speler-head .naam {
  font-family: var(--display-font); font-weight: 800; font-size: 28px; color: var(--display);
}
.speler-head .chip { flex: none; }

.fixture-row {
  width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer;
  border-radius: 14px; background: var(--row); border: 1px solid var(--row-border);
  padding: 11px 14px; display: flex; align-items: center; gap: 9px;
}
.fixture-row .date {
  font-family: var(--display-font); font-weight: 800; font-size: 14px; color: var(--name);
  min-width: 74px; flex: none;
}
.fixture-row .opp {
  font-size: 14px; color: var(--muted-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.verhinderd { display: flex; flex-wrap: wrap; gap: 8px; }
.verhinderd .d {
  font-size: 13px; font-weight: 600; color: var(--muted-1);
  border: 1px dashed #4a3c28; border-radius: 10px; padding: 6px 11px;
}

.leeg { font-size: 14px; color: var(--muted-3); }

/* ---------- empty / loading / error ---------- */

.note {
  border-radius: 18px; background: var(--row); border: 1px dashed var(--card-border);
  padding: 20px 18px; color: var(--muted-1); font-size: 15px; line-height: 1.5;
}
.note strong {
  display: block; font-family: var(--display-font); font-weight: 800; font-size: 18px;
  color: var(--display); margin-bottom: 6px;
}
.note button {
  margin-top: 14px; font-family: var(--display-font); font-weight: 800; font-size: 14px;
  background: var(--goud); color: var(--op-goud); border: 0; border-radius: 12px;
  padding: 10px 16px; cursor: pointer; box-shadow: 0 4px 0 -1px var(--sticker);
}

.spinner {
  margin: 40px auto; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--goud-faint); border-top-color: var(--goud);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---------- spelerkiezer ---------- */

.sheet-scrim {
  position: fixed; inset: 0; background: rgba(10, 6, 3, 0.72);
  display: flex; align-items: flex-end; justify-content: center; z-index: 20;
}
.sheet {
  width: 100%; max-width: 460px; background: var(--raised);
  border-top: 2px solid var(--goud); border-radius: 24px 24px 0 0;
  padding: 20px 22px calc(28px + env(safe-area-inset-bottom));
  max-height: 84vh; overflow-y: auto;
}
.sheet .head { display: flex; align-items: center; gap: 8px; }
.sheet .head .diamond {
  width: 7px; height: 7px; background: var(--goud); transform: rotate(45deg);
}
.sheet .head h2 {
  font-family: var(--display-font); font-weight: 800; font-size: 22px;
  color: var(--display); margin: 0;
}
.sheet .head .close {
  margin-left: auto; font-size: 15px; color: var(--muted-2);
  background: none; border: 0; cursor: pointer; font-family: inherit; padding: 4px 8px;
}
.sheet .choices { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.choice {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--row); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 13px 14px; cursor: pointer; min-height: 48px; font-family: inherit; text-align: left;
}
.choice:hover { border-color: var(--goud); }
.choice .tag {
  font-size: 11px; font-weight: 800; color: var(--op-goud); background: var(--goud-dim);
  border-radius: 6px; padding: 3px 7px; flex: none;
}
.choice .naam { font-size: 16px; font-weight: 600; color: var(--name); }
.choice .current {
  margin-left: auto; width: 9px; height: 9px;
  background: var(--koraal); transform: rotate(45deg);
}
.choice.clear { justify-content: center; color: var(--muted-2); font-size: 14px; }
