/* Haorendam huisstijl: kleuren uit haorendam.nl (opmaak-01.css) */
:root {
  --rood: #e30613;
  --rood-donker: #b8040f;
  --geel: #ffed00;
  --geel-diep: #ffcb05;
  --blauw: #4772b7;
  --blauw-donker: #2f4f8f;
  --inkt: #1b1b1b;
  --wit: #fff;
  --radius: 14px;
  --kop: "Luckiest Guy", "Arial Black", Impact, sans-serif;
  --tekst: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--tekst);
  color: var(--inkt);
  background: var(--geel) url(/static/img/bg-yellow.jpg);
  min-height: 100vh;
}
main { max-width: 560px; margin: 0 auto; }
a { color: var(--blauw-donker); }
img { max-width: 100%; display: block; }

/* ---------- topbar ---------- */
.topbar {
  position: relative;
  max-width: 560px; margin: 0 auto;
  display: flex; justify-content: center; align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 16px 4px;
}
.logo img { height: 92px; width: auto; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); }
.menu { position: absolute; right: 16px; top: 28px; z-index: 20; }
.menu summary {
  list-style: none; cursor: pointer; width: 44px; height: 40px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px 4px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; height: 5px; background: var(--inkt); border-radius: 3px; }
.menu nav {
  position: absolute; right: 0; top: 46px; min-width: 220px;
  background: var(--wit); border: 3px solid var(--inkt); border-radius: var(--radius);
  box-shadow: 0 6px 0 rgba(0,0,0,.2); overflow: hidden;
}
.menu nav a { display: block; padding: 12px 16px; font-weight: 800; text-decoration: none; color: var(--inkt); border-bottom: 1px solid #eee; }
.menu nav a:last-child { border-bottom: 0; }
.menu nav a:active, .menu nav a:hover { background: var(--geel); }

/* ---------- flash ---------- */
.flash {
  max-width: 528px; margin: 8px auto; padding: 12px 16px; border-radius: var(--radius);
  font-weight: 800; border: 3px solid var(--inkt); background: #d9f7d0;
}
.flash-error { background: #ffd9d9; }

/* ---------- hero (blauw met rode banner + mascotte) ---------- */
.hero {
  position: relative; min-height: 150px;
  background: var(--blauw) url(/static/img/bg-blue-skew.jpg);
  padding: 22px 16px 10px; overflow: hidden;
}
.hero-small { min-height: 120px; }
.banner {
  position: relative; z-index: 2; display: inline-block; margin: 8px 0 0;
  font: 400 clamp(1.45rem, 7vw, 2.1rem)/1.05 var(--kop); text-transform: uppercase;
  color: var(--wit); background: var(--rood); padding: 12px 16px 8px;
  transform: rotate(-4deg); box-shadow: 4px 5px 0 rgba(0,0,0,.25); max-width: 64%;
  text-shadow: 2px 2px 0 rgba(0,0,0,.25);
}
.mascot { position: absolute; right: -6px; top: 4px; height: 190px; width: auto; z-index: 1; }
.hero-small .mascot { height: 150px; }

.blue-band { background: var(--blauw) url(/static/img/bg-blue-skew.jpg); padding: 6px 12px 24px; }
.note { color: var(--wit); margin: 4px 4px 12px; font-weight: 600; }
.cat-desc { color: var(--wit); margin: -4px 4px 12px; font-size: .95rem; opacity: .9; }
.voted-banner {
  background: var(--geel); border: 3px solid var(--inkt); border-radius: var(--radius);
  padding: 10px 14px; font-weight: 800; margin: 0 0 12px;
}
.empty { color: var(--wit); text-align: center; padding: 24px; }

/* ---------- categorie-tabs ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 48px;
  text-align: center; padding: 8px 10px 5px; border-radius: 14px;
  font: 400 1rem/1.05 var(--kop); text-transform: uppercase; text-decoration: none;
  color: var(--inkt); background: var(--wit); border: 3px solid var(--inkt);
}
.tab.active { background: var(--rood); color: var(--wit); }
.check { color: #19a33a; }
.tab.active .check { color: var(--geel); }

/* ---------- kaarten ---------- */
.cards { display: grid; gap: 14px; }
.card {
  display: block; text-decoration: none; color: var(--inkt);
  border: 4px solid var(--geel); border-radius: var(--radius); overflow: hidden;
  background: var(--geel); box-shadow: 0 5px 0 rgba(0,0,0,.25);
  transition: transform .08s;
}
.card:active { transform: translateY(2px); }
.card-mine { border-color: #19a33a; }
.card-img { position: relative; aspect-ratio: 16 / 7; background: #ddd; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; left: 8px; top: 8px; min-width: 44px; height: 44px; padding: 6px 8px 0;
  background: var(--rood); color: var(--wit); border: 3px solid var(--wit); border-radius: 8px;
  font: 400 1.9rem/1 var(--kop); text-align: center; box-shadow: 2px 2px 0 rgba(0,0,0,.3);
}
.badge-lg { left: 16px; top: 12px; min-width: 64px; height: 64px; font-size: 2.8rem; padding-top: 10px; }
.stamp {
  position: absolute; right: 8px; bottom: 8px; background: #19a33a; color: var(--wit);
  font: 400 1rem/1 var(--kop); padding: 6px 10px 4px; border-radius: 8px; transform: rotate(-3deg);
}
.card-body { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 10px; }
.card-body h3 { margin: 0; font: 400 1.35rem/1.1 var(--kop); text-transform: uppercase; }
.card-body p { margin: 2px 0 0; font-size: .95rem; }
.chevron { width: 24px; height: 24px; flex: none; }

/* ---------- detail ---------- */
.detail-photo { position: relative; background: #ddd; aspect-ratio: 4 / 3.4; overflow: hidden; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 100% 94%, 75% 97%, 50% 95%, 25% 98%, 0 95%); }
.detail { padding: 6px 16px 28px; text-align: center; }
.detail-title {
  margin: 10px 0 0; font: 400 clamp(2rem, 10vw, 2.8rem)/1 var(--kop); color: var(--rood);
  text-transform: uppercase; text-shadow: 2px 2px 0 rgba(0,0,0,.12); overflow-wrap: anywhere;
}
.detail-sub { margin: 4px 0 14px; font-size: 1.2rem; font-weight: 600; }
.panel {
  background: var(--wit); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px;
  text-align: left; box-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.panel h2 { margin: 0 0 8px; font: 400 1.5rem/1.1 var(--kop); color: var(--rood); text-transform: uppercase; }
.panel h2 small { font: 600 .9rem var(--tekst); color: #666; text-transform: none; }
.desc { line-height: 1.55; white-space: pre-line; margin: 0 0 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border-top: 2px solid #ddd; padding-top: 12px; }
.facts div + div { border-left: 2px solid #ddd; padding-left: 12px; }
.facts dt { font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; }

.btn-vote {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 16px 12px 10px; cursor: pointer;
  font: 400 3rem/1 var(--kop); color: var(--wit); text-transform: uppercase;
  background: var(--rood); border: 4px solid var(--wit); outline: 3px solid var(--rood);
  border-radius: 18px; box-shadow: 0 6px 0 var(--rood-donker);
}
.btn-vote svg { width: 46px; height: 46px; margin-top: -6px; }
.btn-vote:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--rood-donker); }
.vote-done { font: 400 1.4rem/1.2 var(--kop); color: #19a33a; background: var(--wit); border-radius: var(--radius); padding: 14px; }
.vote-done.muted { color: #555; font: 700 1rem var(--tekst); }
.back { display: inline-block; margin-top: 16px; font-weight: 800; }

/* ---------- formulieren ---------- */
.form label { display: block; font-weight: 800; margin: 0 0 12px; }
.form small { font-weight: 400; color: #555; }
.form input:not([type=file]), .form textarea, .form select, .row input, .row select {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400;
  border: 2px solid #bbb; border-radius: 10px; background: #fff;
}
.form input:focus, .form textarea:focus { outline: 3px solid var(--geel-diep); border-color: var(--inkt); }
.form input[type=file] { margin-top: 6px; font: inherit; max-width: 100%; }
.fixed { margin: 0 0 14px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 110px; font-weight: 800; margin-bottom: 12px; }
.btn {
  display: inline-block; padding: 12px 22px 9px; border: 3px solid var(--inkt); border-radius: 12px;
  background: var(--rood); color: var(--wit); font: 400 1.25rem/1 var(--kop); text-transform: uppercase;
  text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.btn-small { font-size: 1rem; padding: 10px 14px 7px; margin-bottom: 12px; }
.btn-danger { background: var(--inkt); }
.linklike { background: none; border: 0; padding: 0; color: var(--blauw-donker); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.linklike.danger { color: var(--rood); }

/* ---------- admin ---------- */
.page-admin main { padding: 0 12px 24px; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 6px; }
.admin-nav a {
  padding: 8px 12px 5px; border: 3px solid var(--inkt); border-radius: 999px; background: var(--wit);
  font: 400 1rem/1 var(--kop); text-transform: uppercase; color: var(--inkt); text-decoration: none;
}
.admin-nav a.active { background: var(--rood); color: var(--wit); }
.admin-nav form { margin-left: auto; }
.whoami { margin: 0 0 12px; font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stats div { background: var(--blauw); color: var(--wit); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.stats b { display: block; font: 400 1.6rem/1 var(--kop); }
.stats span { font-size: .8rem; }
.ranking { list-style: none; padding: 0; margin: 0; }
.ranking li { padding: 8px 0; border-bottom: 1px solid #eee; }
.rank-head { display: flex; gap: 10px; align-items: center; }
.rank-head a { flex: 1; font-weight: 800; color: var(--inkt); text-decoration: none; }
.pos { width: 28px; height: 28px; border-radius: 50%; background: #eee; display: grid; place-items: center; font-weight: 800; flex: none; }
.winner .pos { background: var(--geel); outline: 2px solid var(--inkt); }
.votes { font: 400 1.4rem/1 var(--kop); color: var(--rood); }
.bar { height: 8px; background: #eee; border-radius: 4px; margin: 6px 0 0 38px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blauw); }
.winner .bar span { background: var(--rood); }
.wagen-admin-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.wagen-admin-head h3 { margin: 0 0 4px; }
.qr { width: 120px; height: 120px; flex: none; image-rendering: pixelated; border: 1px solid #ddd; }
.url { font-size: .8rem; word-break: break-all; margin: 0 0 6px; }
.small { font-size: .85rem; }
.actions { gap: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.table form { display: inline; }
.danger-zone { border: 3px solid var(--rood); }
code { background: #f2f2f2; padding: 1px 5px; border-radius: 4px; word-break: break-all; }

.footer { text-align: center; font-size: .8rem; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); color: #4a4300; }

@media (min-width: 600px) {
  main { margin-top: 8px; }
  .hero, .blue-band { border-radius: var(--radius); }
  .hero { border-radius: var(--radius) var(--radius) 0 0; }
  .blue-band { border-radius: 0 0 var(--radius) var(--radius); }
}
.cards + .panel { margin-top: 14px; }
.voting-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voting-status p { margin: 0; font-size: 1.1rem; }
.voting-status.is-open { border: 3px solid #19a33a; }
.voting-status.is-closed { border: 3px solid var(--rood); }
