:root {
  /* Kleuren uit het C-ploeg-logo: roodbruin, vlammend oranje, perkamentgeel */
  --bg: #fbf3e2;
  --card: #fffaf0;
  --text: #2b1a12;
  --muted: #7a6455;
  --line: #ecdcc0;
  --red: #a8321a;
  --red-soft: #fbe3cf;
  --gold: #d9820f;
  --ok: #2f8a4a;
  --header: linear-gradient(100deg, #7d2410 0%, #b8411a 60%, #e0731c 100%);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18120e;
    --card: #231a14;
    --text: #f4e9da;
    --muted: #b09a86;
    --line: #3a2c21;
    --red: #ff7a45;
    --red-soft: #3d2416;
    --gold: #ffc14d;
    --ok: #5cc985;
    --header: linear-gradient(100deg, #5e1a0b 0%, #8e2f12 60%, #b9561a 100%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--red); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.warn { color: var(--gold); }
.loading { padding: 2rem; text-align: center; color: var(--muted); }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
textarea { resize: vertical; }
label { display: block; margin: .5rem 0; font-size: .9rem; color: var(--muted); }
label input, label select { margin-top: .25rem; color: var(--text); }
button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: .5rem .8rem;
  cursor: pointer;
}
button:disabled { opacity: .5; }
button.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
button.wide { width: 100%; margin: .5rem 0; padding: .7rem; }
button.icon { border: none; background: none; color: var(--muted); padding: .3rem .5rem; }
button.link { border: none; background: none; color: var(--red); padding: 0; font-size: .85rem; }
button.small-btn { font-size: .8rem; padding: .3rem .55rem; }
button.bad { color: var(--red); }

/* Layout */
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; }
header.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .45rem 16px; background: var(--header); color: #fff;
}
header.top .muted { color: #ffe2c4; text-align: right; line-height: 1.25; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.brand img { height: 46px; width: auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.brand small { display: block; font-size: .72rem; color: #ffe2c4; letter-spacing: .02em; }
main { padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); }
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(8, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs a {
  display: flex; flex-direction: column; align-items: center;
  padding: .45rem 0 .5rem; font-size: .6rem; color: var(--muted); text-decoration: none;
}
nav.tabs a span { font-size: 1.3rem; filter: grayscale(.6); }
nav.tabs a.on { color: var(--red); font-weight: 600; }
nav.tabs a.on span { filter: none; }
@media (min-width: 760px) {
  nav.tabs { max-width: 720px; margin: 0 auto; border-radius: 14px 14px 0 0; border: 1px solid var(--line); }
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 0 0 12px;
}
.card.err, .warnbox { border-color: var(--gold); }
details > summary { cursor: pointer; }
.date { font-size: 1.3rem; margin: .3rem 0 .8rem; text-transform: capitalize; }
.badge, .pill {
  display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 99px;
  background: var(--red-soft); color: var(--red); font-weight: 600; vertical-align: middle;
}
.badge { background: #fff; color: #a8321a; }
.pill.warn { color: var(--gold); }
.row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.row input { flex: 1; min-width: 8em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: .3rem 0; }

/* Sluitingstijd */
.sluit { border-left: 5px solid var(--red); }
.sluit .big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--red); }
.countdown { font-weight: 600; margin-top: -.2rem; }

/* Agenda */
.ev { display: flex; gap: .5rem; align-items: baseline; border-bottom: 1px dashed var(--line); }
.ev:last-child { border-bottom: none; }
.ev-time { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3em; }
.ev-body { flex: 1; }
.day h3 { text-transform: capitalize; }
.day.today { border-color: var(--red); }

/* Menu */
.choices { display: grid; gap: .5rem; }
.choices button {
  display: grid; grid-template-columns: 1fr auto; text-align: left; width: 100%;
  padding: .6rem .8rem; gap: 0 .5rem;
}
.choices button span { grid-column: 1; font-size: .88rem; color: var(--muted); }
.choices button em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-weight: 700; }
.choices button.chosen { border: 2px solid var(--red); background: var(--red-soft); }
.choice-wrap .muted { padding: .15rem .3rem 0; }
.order { margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.datenav { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; text-transform: capitalize; }
.datenav button { font-size: 1.3rem; padding: .2rem .9rem; }

/* Films */
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px; gap: 3px; }
.seg button { flex: 1; border: none; background: none; border-radius: 9px; padding: .45rem .3rem; font-size: .9rem; }
.seg button.on { background: var(--card); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .8rem; }
.chip { border-radius: 99px; padding: .3rem .75rem; font-size: .88rem; }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.movie {
  display: flex; gap: .8rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; margin-bottom: 10px;
}
.poster { width: 72px; height: 108px; object-fit: cover; border-radius: 8px; flex: none; background: var(--line); }
.poster.ph { display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--muted); }
.small-movie .poster { width: 48px; height: 72px; }
.movie-body { flex: 1; min-width: 0; }
.reason { color: var(--ok); }
.reason::before { content: "→ "; }
.votes { display: flex; gap: .4rem; margin: .35rem 0 .2rem; }
.votes button.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.votes button.on.bad { background: var(--red); border-color: var(--red); }
#search-results { margin-top: .6rem; }

/* Trakteren */
.treat { display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.treat:last-child { border-bottom: none; }
.treat.done { opacity: .75; }
.rank { margin: 0; padding-left: 1.4rem; }
.rank li { padding: .15rem 0; }
.meter { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter div { height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }

/* Beheer */
.user { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.user:last-child { border-bottom: none; }
.card form + form { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; text-align: center; }
.login-card form { text-align: left; margin-top: .5rem; }
.logo { width: 170px; height: auto; margin: -4px auto 6px; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.login { background: radial-gradient(circle at 50% 0%, var(--red-soft), var(--bg) 70%); }
.colofon { text-align: center; margin: 1.2rem 0 .5rem; }
.colofon img { width: 110px; height: auto; opacity: .95; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 1rem; }

dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); width: min(92vw, 380px); }
dialog::backdrop { background: rgba(0,0,0,.45); }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; z-index: 20;
  max-width: 90vw; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.toast.err { background: var(--red); color: #fff; }
.notice { display: block; border-color: var(--gold); background: var(--red-soft); text-decoration: none; color: var(--text); font-weight: 600; }

/* Vrijschrijven */
.entrants { list-style: none; margin: .4rem 0; padding: 0; }
.entrants li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.entrants li:last-child { border-bottom: none; }
.entrants li b { flex: 1; }
label.check { display: flex; align-items: center; gap: .5rem; color: var(--text); }
label.check input { width: auto; margin: 0; }
.titles { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.title-tile { background: var(--red-soft); border-radius: 12px; padding: .5rem; text-align: center; display: flex; flex-direction: column; font-size: .85rem; }
.title-tile span { font-size: 1.6rem; }
.title-tile b { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--red); }
.title-tile small { color: var(--muted); }
table.score { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.score th, table.score td { padding: .35rem .3rem; border-bottom: 1px solid var(--line); text-align: center; }
table.score th:first-child, table.score td:first-child { text-align: left; }
table.score tr.me td { font-weight: 700; background: var(--red-soft); }

.draw-overlay { position: fixed; inset: 0; z-index: 30; background: rgba(20,10,5,.7); display: grid; place-items: center; padding: 16px; }
.draw-card { background: var(--card); border-radius: 18px; padding: 18px; width: min(100%, 420px); max-height: 92vh; overflow: auto; text-align: center; }
.wheel-wrap { position: relative; width: min(78vw, 300px); margin: .6rem auto; }
.wheel { width: 100%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 6px 20px rgba(0,0,0,.35); will-change: transform; }
.wheel svg { display: block; width: 100%; height: 100%; }
.pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 1.8rem; color: var(--red); text-shadow: 0 2px 3px rgba(0,0,0,.4); line-height: 1; }
.draw-status { font-size: 1.15rem; font-weight: 700; min-height: 1.6em; }
.draw-results { list-style: none; padding: 0; margin: .4rem 0 .8rem; text-align: left; }
.draw-results li { padding: .3rem .5rem; border-radius: 8px; margin-bottom: .25rem; }
.draw-results li.win { background: var(--red-soft); font-weight: 600; }
.draw-results li.lose { color: var(--muted); }
.center-row { justify-content: center; }

/* Filmstemming en scores */
.crit:empty { display: none; }
.pill.fresh { color: var(--red); }
.pill.rotten { color: var(--ok); }
.poll-opts { display: grid; gap: .5rem; margin: .4rem 0 .6rem; }
.poll-opt {
  display: flex; gap: .7rem; align-items: flex-start; text-align: left; width: 100%; padding: .55rem;
}
.poll-opt .poster { width: 48px; height: 72px; }
.poll-opt.chosen { border: 2px solid var(--red); background: var(--red-soft); }
.poll-body { display: grid; gap: .2rem; flex: 1; min-width: 0; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--red); transition: width .4s; }
.draft { display: grid; gap: .4rem; margin: .5rem 0 .7rem; }
.draft-slot {
  display: flex; gap: .6rem; align-items: center; padding: .4rem; border: 1px solid var(--line); border-radius: 10px;
}
.draft-slot > span { flex: 1; min-width: 0; }
.draft-slot .poster { width: 36px; height: 54px; font-size: 1.1rem; }
.draft-slot.empty { justify-content: center; min-height: 54px; border-style: dashed; color: var(--muted); }
.results li { margin-bottom: .45rem; }

/* Sfeerstemming */
.sfeer-vote { margin: .7rem 0 .4rem; padding-top: .6rem; border-top: 1px solid var(--line); display: grid; gap: .4rem; }
.sfeer-vote output { font-weight: 700; margin-left: .3rem; }
.sfeer-vote input[type=range] { width: 100%; accent-color: var(--red); margin: 0; }
.range-ends { display: flex; justify-content: space-between; margin-top: -.2rem; }
.sfeer-vote textarea { width: 100%; font: inherit; resize: vertical; }
.sfeer-vote .small-btn { justify-self: start; }
.tips li { margin: .3rem 0; }
.choice-static {
  display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .5rem .8rem;
  border: 1px solid var(--line); border-radius: 10px;
}
.choice-static span { font-size: .88rem; color: var(--muted); }
.choice-static em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-weight: 700; }
.choice-static.chosen { border: 2px solid var(--red); background: var(--red-soft); }
.choices button:disabled { opacity: .75; cursor: default; }
.whoami { color: inherit; text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.who { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.omgeving { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); white-space: nowrap; }
.datenav .small { text-transform: none; font-weight: 400; }

/* Tv-locatie en dagstaat (in aanbouw) */
.tvpill { font-size: .72rem; padding: .05rem .4rem; }
.card.soon { border-style: dashed; }
.todo li { margin: .2rem 0; }
.todo label { display: flex; gap: .5rem; align-items: center; }

/* Ploegen */
.crests { display: flex; justify-content: center; gap: .5rem; margin-bottom: .4rem; }
.crests img { height: 40px; width: auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.shared { display: flex; align-items: center; gap: .6rem; margin: .1rem 0 .7rem; }
.shared img { height: 44px; width: auto; }
.shared span { display: block; }
label.inline { display: inline-block; margin: .2rem 0; }
label.inline select { width: auto; margin: 0 0 0 .3rem; padding: .15rem .4rem; }
pre.report { white-space: pre-wrap; font-size: .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .6rem; }

/* Rooster */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: .72rem; color: var(--muted); }
.day {
  position: relative; aspect-ratio: 1 / 1; padding: 2px; border-radius: 9px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.day b { font-size: .95rem; }
.day small { font-size: .58rem; color: var(--muted); letter-spacing: .02em; min-height: .7rem; }
.day i { position: absolute; top: 1px; right: 3px; font-style: normal; font-size: .55rem; }
.day u { position: absolute; top: 1px; left: 2px; text-decoration: none; font-size: .64rem; line-height: 1; }
.day.past { opacity: .55; }
.prog h3 { margin: .7rem 0 .2rem; font-size: .92rem; }
.prog:first-of-type h3 { margin-top: .2rem; }
.prog li { display: flex; gap: .4rem; align-items: baseline; }
.duty-nav { justify-content: space-between; align-items: center; margin: -.2rem 0 .6rem; }
.chip-wrap { display: inline-flex; align-items: center; }
.chip.own { border-style: dashed; }
.chip-x { border: none; background: none; padding: 0 .2rem; font-size: .75rem; color: var(--muted); }
.chip.add { color: var(--muted); }
.day.today { outline: 2px solid var(--gold); outline-offset: -2px; }
.day.mine { background: var(--red); border-color: var(--red); color: #fff; }
.day.mine small { color: #ffe2c4; }
.day.part { background: var(--gold); border-color: var(--gold); }
.day.off { background: var(--line); }
.day.req { box-shadow: inset 0 0 0 2px var(--gold); }
.day.give { box-shadow: 0 0 0 3px var(--text); }
.day.want { box-shadow: 0 0 0 3px var(--ok); background: color-mix(in srgb, var(--ok) 25%, var(--card)); }
.legend { margin: .6rem 0 .2rem; line-height: 1.8; }
.key { display: inline-block; width: .9em; height: .9em; border-radius: 3px; vertical-align: -.1em; margin: 0 .25em 0 .5em; border: 1px solid var(--line); }
.key.mine { background: var(--red); } .key.part { background: var(--gold); } .key.off { background: var(--line); }
.shiftlist li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .2rem 0; }
.shiftlist select { width: auto; }
.steps { padding-left: 1.2rem; }
.steps li.now { font-weight: 600; }
.steps li.done { color: var(--muted); }
.swap { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.swap:last-child { border-bottom: none; }
.swap.dim { opacity: .6; }
.imp { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .4rem; }
.imp h3 { margin: .7rem 0 .2rem; }
.imp code { font-size: .8rem; padding: 0 .3rem; border-radius: 4px; background: rgba(127, 127, 127, .18); }
.cat-nu { display: flex; align-items: center; gap: .8rem; }
.cat-nu > div { flex: 1; }
.cat-nu .cat-getal { font-size: 2.6rem; font-weight: 800; line-height: 1; min-width: 1.4em; text-align: center; color: var(--ok); }
.cat-nu.zwaar { border: 1px solid var(--gold); background: var(--red-soft); border-radius: 10px; padding: .5rem .7rem; }
.cat-nu.zwaar .cat-getal { color: var(--red); }
#luchtmacht details[data-lm] { margin-top: .6rem; }
.indeling { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin: .5rem 0; }
.ind-voertuig { border: 1px solid var(--line, #0002); border-radius: 10px; padding: .4rem .55rem; font-size: .88rem; }
.ind-plek { display: flex; gap: .4rem; }
.ind-plek .muted { min-width: 3.2em; }
.ind-plek.mij, .ind-mij { font-weight: 700; color: var(--red); }
.ind-plek.tekort { color: var(--gold); }
.ind-ik { font-size: 1.05rem; }
.ind-opties li { margin: .25rem 0; }
.ind-nee { color: var(--muted); }
.lm-nacht { margin-top: .6rem; padding: .4rem .6rem; border-left: 3px solid var(--gold); }
