:root {
  /* FC De Kampioenen — pitch, cream scoresheet, club red & gold */
  --pitch:       #15803d;
  --pitch-light: #1c8a44;
  --pitch-dark:  #0b4a23;
  --cream:       #f7f3e6;
  --cream-2:     #efe8d3;
  --ink:         #1d2716;
  --ink-soft:    #5d6b4f;
  --red:         #c8102e;
  --red-dark:    #9c0c22;
  --gold:        #f4c20d;
  --line:        rgba(11, 74, 35, 0.18);
  --radius: 14px;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* mowed-pitch stripes */
  background-color: var(--pitch);
  background-image: repeating-linear-gradient(
    90deg,
    var(--pitch) 0,
    var(--pitch) 56px,
    var(--pitch-light) 56px,
    var(--pitch-light) 112px
  );
  color: #f3f7ee;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: #ffe9a8; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ---- top bar ---- */
header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--pitch-dark);
  border-bottom: 5px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand .crest { width: 46px; height: 54px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark {
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-transform: uppercase;
}
.wordmark .accent { color: var(--gold); }
.tagline { font-size: 0.72rem; color: #b9e3c5; font-style: italic; letter-spacing: 0.01em; }

.topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar .email { color: #b9e3c5; font-size: 0.9rem; }

/* ---- type ---- */
h1 { font-size: 1.9rem; margin: 0 0 4px; letter-spacing: -0.01em; color: #fff; }
h2 { font-size: 1.25rem; margin: 0 0 12px; color: var(--ink); }
.muted { color: #d6ecdd; }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.loader { text-align: center; color: #eaf6ee; padding: 40px; }

/* ---- cards (cream scoresheet) ---- */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-top: 4px solid var(--pitch);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.card + .card { margin-top: 18px; }
.card .muted { color: var(--ink-soft); }
.card a:not(.btn) { color: var(--red); }
/* Links styled as buttons keep their button text colour, not the card link red */
.card a.btn { color: #fff; }
.card a.btn.danger { color: var(--red); }

label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: 0.92rem; color: var(--ink); }

input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%;
  padding: 11px 13px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.98rem;
  font-family: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--pitch); border-color: transparent; }
textarea { resize: vertical; min-height: 72px; }
input[type="file"] { color: var(--ink); font-size: 0.9rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--red-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--pitch); border: 2px solid var(--gold); }
.btn.secondary:hover { background: var(--pitch-dark); }
.btn.danger { background: transparent; border: 2px solid var(--red); color: var(--red); }
.btn.danger:hover { background: rgba(200, 16, 46, 0.1); }
.btn.small { padding: 7px 12px; font-size: 0.8rem; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mt { margin-top: 18px; }
.mt-sm { margin-top: 10px; }

.checkbox-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.checkbox-row input { width: auto; width: 18px; height: 18px; accent-color: var(--pitch); }
.checkbox-row label { margin: 0; }

.error { color: var(--red); margin-top: 12px; min-height: 1em; font-size: 0.9rem; font-weight: 600; }
.notice {
  color: #0f6b3a;
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 4px solid #138a4a;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

/* ---- badges ---- */
.badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.open { background: var(--gold); color: var(--pitch-dark); }
.badge.closed { background: #b9b29a; color: #2c2c20; }

/* ---- poll list ---- */
.poll-item {
  display: block;
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.06s, border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.poll-item:hover { border-left-color: var(--red); transform: translateX(2px); }
.poll-item h3 { margin: 0 0 4px; font-size: 1.1rem; color: var(--ink); }
.poll-item .muted { color: var(--ink-soft); }

/* ---- option editor (create) ---- */
.opt-row { display: flex; gap: 8px; margin-top: 8px; }
.opt-row input { flex: 1; }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb {
  width: 84px; height: 84px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--line);
  background: #fff;
}

/* ---- voting ---- */
.option-card {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
}
.option-card:hover { border-color: var(--pitch); }
.option-card.selected { border-color: var(--pitch); background: rgba(21, 128, 61, 0.1); }
.option-card .label { font-weight: 700; flex: 1; }
.option-card input { width: 18px; height: 18px; accent-color: var(--pitch); }

/* image options: large image, no filename, native input hidden */
.opts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.option-card.image {
  flex-direction: column;
  align-items: stretch;
  padding: 8px;
  position: relative;
  gap: 0;
  margin-top: 0;
}
.option-card.image input { display: none; }
.vote-img {
  width: 100%;
  max-height: 320px;
  min-height: 160px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--cream-2);
  display: block;
}
.option-card.image.selected::after {
  content: "✓";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pitch);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ---- results ---- */
.result-row { margin-top: 14px; }
.result-row.winner .result-head .label::after { content: " 🏆"; }
.result-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.result-head .pct { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 700; }
.result-head .label { font-weight: 700; color: var(--ink); display: flex; align-items: center; }
.bar-track {
  margin-top: 6px;
  height: 14px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pitch), var(--gold));
  border-radius: 999px;
  transition: width 0.5s ease;
}
.result-row.winner .bar-fill { background: linear-gradient(90deg, var(--gold), var(--red)); }
.result-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; vertical-align: middle; margin-right: 10px; border: 1px solid var(--line); }
.voters { margin-top: 6px; color: var(--ink-soft); font-style: italic; }

/* ---- voter overview ---- */
.voter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.voter-row:last-child { border-bottom: 0; }
.voter-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.voter-name { font-weight: 700; color: var(--ink); }
.voter-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.voter-choice {
  background: var(--paper, #f4efe6);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.voter-choice-img {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.share-box { display: flex; gap: 8px; margin-top: 8px; }
.share-box input { font-family: monospace; font-size: 0.85rem; }

/* ---- auth ---- */
.auth-wrap { max-width: 420px; margin: 6vh auto 0; }
.pol-hero {
  display: block;
  margin: 0 auto 10px;
  width: 128px; height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--gold);
  background: var(--pitch-light);
  box-shadow: var(--shadow);
}
.tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.tabs button {
  flex: 1; padding: 10px; background: var(--cream-2); border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 10px; cursor: pointer; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.tabs button.active { background: var(--red); color: #fff; border-color: transparent; }

/* ---- character avatars & speech bubbles (Pol / Boma) ---- */
.pol {
  width: 84px; height: 84px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  background: var(--pitch-light);
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
}
.bubble {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.bubble::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: var(--cream);
}
.bubble.bubble-right::before {
  left: auto; right: -12px;
  border-right-color: transparent;
  border-left-color: var(--cream);
}

/* ---- Boma hero (top of the voting page) ---- */
.boma-hero {
  max-width: 880px;
  margin: 22px auto 4px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.boma-hero .pol {
  width: 120px; height: 120px;
  border-width: 4px;
}
.boma-hero .bubble {
  font-size: 1.6rem;
  font-weight: 800;
  padding: 16px 26px;
  border-radius: 18px;
  letter-spacing: 0.01em;
}
.boma-hero .bubble::before { border-width: 10px; }

/* ---- footer with Pol ---- */
.footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer .pol {
  width: 108px; height: 108px;
  border-width: 4px;
}
.footer .bubble {
  font-size: 1.3rem;
  font-weight: 800;
  padding: 16px 24px;
  border-radius: 18px;
}
.footer .bubble::before { border-width: 10px; }
.footer .footer-note {
  width: 100%;
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #cdeed6;
}

@media (max-width: 520px) {
  .wordmark { font-size: 1.4rem; }
  .tagline { display: none; }
  .brand .crest { width: 40px; height: 47px; }
}
