:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #5f6c7b;
  --accent: #c45c26;
  --accent-dark: #9a4520;
  --border: #e2d8cc;
  --ok: #2f6b3a;
  --error: #b42318;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background-color: #87ceeb;
  background-image:
    radial-gradient(circle at 88% 10%, #fff6a8 0%, #f5b942 7%, rgba(245, 185, 66, 0.35) 14%, transparent 26%),
    radial-gradient(ellipse 140px 48px at 18% 14%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(ellipse 100px 36px at 42% 18%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(ellipse 80px 28px at 62% 12%, rgba(255, 255, 255, 0.32), transparent),
    linear-gradient(180deg, #87ceeb 0%, #b8dff5 32%, #f9e4b8 62%, #e8c878 78%, #8bc96a 88%, #5a9e42 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

/* Vlaggenlijn + confetti */
body::before {
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80'%3E%3Cpath stroke='%23c45c26' stroke-width='2' fill='none' d='M0 8 Q300 28 600 8 T1200 8'/%3E%3Cpolygon fill='%23c45c26' points='40,8 70,8 55,32'/%3E%3Cpolygon fill='%232f6b3a' points='120,8 150,8 135,34'/%3E%3Cpolygon fill='%23e8b923' points='200,8 230,8 215,30'/%3E%3Cpolygon fill='%23ff6b35' points='280,8 310,8 295,33'/%3E%3Cpolygon fill='%23c45c26' points='360,8 390,8 375,31'/%3E%3Cpolygon fill='%232f6b3a' points='440,8 470,8 455,34'/%3E%3Cpolygon fill='%23e8b923' points='520,8 550,8 535,29'/%3E%3Cpolygon fill='%23ff6b35' points='600,8 630,8 615,32'/%3E%3Cpolygon fill='%23c45c26' points='680,8 710,8 695,33'/%3E%3Cpolygon fill='%232f6b3a' points='760,8 790,8 775,31'/%3E%3Cpolygon fill='%23e8b923' points='840,8 870,8 855,34'/%3E%3Cpolygon fill='%23ff6b35' points='920,8 950,8 935,30'/%3E%3Cpolygon fill='%23c45c26' points='1000,8 1030,8 1015,32'/%3E%3Cpolygon fill='%232f6b3a' points='1080,8 1110,8 1095,33'/%3E%3Crect fill='%23c45c26' x='80' y='52' width='8' height='12' rx='1' transform='rotate(25 84 58)'/%3E%3Crect fill='%23e8b923' x='250' y='48' width='7' height='10' rx='1' transform='rotate(-15 253 53)'/%3E%3Crect fill='%232f6b3a' x='420' y='55' width='8' height='11' rx='1' transform='rotate(40 424 60)'/%3E%3Crect fill='%23ff6b35' x='590' y='50' width='7' height='12' rx='1' transform='rotate(-30 593 56)'/%3E%3Crect fill='%23c45c26' x='760' y='54' width='8' height='10' rx='1' transform='rotate(20 764 59)'/%3E%3Crect fill='%23e8b923' x='930' y='49' width='7' height='11' rx='1' transform='rotate(-25 933 54)'/%3E%3Crect fill='%232f6b3a' x='1100' y='53' width='8' height='12' rx='1' transform='rotate(35 1104 59)'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: top center;
  background-size: 1200px 80px;
  opacity: 0.92;
}

/* Barbecue-tafereel onderaan */
body::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: min(42vh, 320px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 280'%3E%3Cellipse cx='400' cy='268' rx='420' ry='28' fill='%234a8f38' opacity='0.35'/%3E%3Cpath fill='%232a2a2a' d='M310 200h180v36H310z'/%3E%3Cpath fill='%234a4a4a' d='M325 168h150v36H325z'/%3E%3Crect fill='%232a2a2a' x='340' y='236' width='10' height='32' rx='2'/%3E%3Crect fill='%232a2a2a' x='450' y='236' width='10' height='32' rx='2'/%3E%3Cellipse cx='370' cy='218' rx='14' ry='22' fill='%23ff6b35' opacity='0.85'/%3E%3Cellipse cx='400' cy='212' rx='16' ry='28' fill='%23ffdd57' opacity='0.9'/%3E%3Cellipse cx='430' cy='218' rx='14' ry='22' fill='%23ff6b35' opacity='0.85'/%3E%3Ccircle cx='365' cy='175' r='14' fill='rgba(255,255,255,0.45)'/%3E%3Ccircle cx='385' cy='155' r='18' fill='rgba(255,255,255,0.35)'/%3E%3Ccircle cx='410' cy='140' r='20' fill='rgba(255,255,255,0.3)'/%3E%3Ccircle cx='120' cy='230' r='28' fill='%23fff' stroke='%23e2d8cc' stroke-width='4'/%3E%3Crect x='108' y='224' width='24' height='10' rx='3' fill='%23c45c26'/%3E%3Ccircle cx='680' cy='230' r='28' fill='%23fff' stroke='%23e2d8cc' stroke-width='4'/%3E%3Crect x='668' y='224' width='24' height='10' rx='3' fill='%238b4513'/%3E%3Ctext x='95' y='195' font-size='36'%3E%F0%9F%8E%89%3C/text%3E%3Ctext x='655' y='195' font-size='36'%3E%F0%9F%8D%96%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: min(100%, 800px) auto;
  opacity: 0.55;
}

.page-confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.page-confetti--alt span {
  opacity: 0.75;
}

.page-confetti span {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: var(--w);
  height: var(--h);
  background: var(--color);
  opacity: 0.9;
  border-radius: 2px;
  transform: rotate(var(--rotate, 0deg));
}

.festive-confetti span {
  position: absolute;
  top: -24px;
  left: var(--left);
  width: var(--w);
  height: var(--h);
  background: var(--color);
  opacity: 0.9;
  border-radius: 2px;
  animation: confetti-fall var(--duration) linear infinite;
  animation-delay: var(--delay);
}

.confetti-burst {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
}

.confetti-burst span {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--h);
  background: var(--color);
  border-radius: 2px;
  animation: confetti-burst-fly 0.72s ease-out forwards;
}

@keyframes confetti-burst-fly {
  from {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.85rem;
  font-weight: 700;
}

.site-title {
  font-family: "Baloo 2", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(2.25rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--accent-dark);
  text-shadow: 2px 3px 0 rgba(232, 185, 35, 0.45);
}

header p {
  margin: 0;
  color: var(--muted);
  max-width: 540px;
  margin-inline: auto;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.field {
  margin-bottom: 1rem;
}

.field > label,
.field > .field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  cursor: pointer;
  margin: 0;
}

.radio-option input[type="radio"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.person-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #faf8f5;
}

.person-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.meat-slots {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.meat-slots .field {
  margin-bottom: 0;
}

.meat-counter {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin-top: 0.35rem;
}

.meat-counter.complete {
  color: var(--ok);
}

.meat-counter.over {
  color: var(--error);
}

.hidden {
  display: none !important;
}

button[type="submit"],
.btn {
  display: inline-block;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

button[type="submit"]:hover:not(:disabled),
.btn:hover {
  background: var(--accent-dark);
}

button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.message {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.message.error {
  background: #fdecea;
  color: var(--error);
  border: 1px solid #f5c2c0;
}

.message.success {
  background: #e8f5eb;
  color: var(--ok);
  border: 1px solid #b8dfc4;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--accent-dark);
}

/* Admin */
.admin-wrap {
  max-width: 960px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #faf8f5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat {
  background: #faf8f5;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.stat strong {
  display: block;
  font-size: 1.4rem;
}

/* Success modal */
.success-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.success-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 51, 0.55);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.35s ease;
}

.success-modal__panel {
  position: relative;
  width: min(100%, 420px);
  background: var(--card);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 48px rgba(31, 41, 51, 0.22);
  padding: 0 1.5rem 1.5rem;
  text-align: center;
  animation: modal-pop-in 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}

.success-modal__panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: var(--accent-dark);
}

.success-modal__text {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.success-modal__btn {
  width: auto;
  min-width: 12rem;
  padding-inline: 1.5rem;
}

.festive-scene {
  position: relative;
  height: 168px;
  margin: 0 -1.5rem 1.25rem;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
}

.festive-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #87ceeb 0%, #f9e4b8 72%, #c8e6a0 100%);
}

.festive-sun {
  position: absolute;
  top: 18px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6a8, #f5b942);
  box-shadow: 0 0 24px rgba(245, 185, 66, 0.65);
  animation: sun-pulse 2.5s ease-in-out infinite;
}

.festive-bunting {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px 0;
}

.festive-bunting span {
  flex: 1;
  max-width: 28px;
  height: 22px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  animation: bunting-sway 2.2s ease-in-out infinite;
}

.festive-bunting span:nth-child(odd) {
  background: #c45c26;
}
.festive-bunting span:nth-child(even) {
  background: #2f6b3a;
}
.festive-bunting span:nth-child(3n) {
  background: #e8b923;
}

.festive-bunting span:nth-child(1) { animation-delay: 0s; }
.festive-bunting span:nth-child(2) { animation-delay: 0.15s; }
.festive-bunting span:nth-child(3) { animation-delay: 0.3s; }
.festive-bunting span:nth-child(4) { animation-delay: 0.1s; }
.festive-bunting span:nth-child(5) { animation-delay: 0.25s; }
.festive-bunting span:nth-child(6) { animation-delay: 0.05s; }
.festive-bunting span:nth-child(7) { animation-delay: 0.2s; }

.festive-grass {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: linear-gradient(180deg, #8bc96a, #5a9e42);
}

.festive-grill {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  z-index: 2;
}

.festive-grill__body {
  height: 36px;
  background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
  border-radius: 6px 6px 4px 4px;
  border: 2px solid #1a1a1a;
}

.festive-grill__lid {
  position: absolute;
  top: -14px;
  left: 8px;
  right: 8px;
  height: 18px;
  background: linear-gradient(180deg, #6a6a6a, #3d3d3d);
  border-radius: 50% 50% 4px 4px;
  border: 2px solid #2a2a2a;
}

.festive-grill__legs {
  position: absolute;
  bottom: -18px;
  left: 12px;
  right: 12px;
  height: 20px;
}

.festive-grill__legs::before,
.festive-grill__legs::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 20px;
  background: #2a2a2a;
  border-radius: 0 0 3px 3px;
}

.festive-grill__legs::before {
  left: 8px;
  transform: rotate(-8deg);
}
.festive-grill__legs::after {
  right: 8px;
  transform: rotate(8deg);
}

.festive-flames {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 1;
}

.festive-flames span {
  width: 14px;
  height: 22px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #ffdd57, #ff6b35, #c45c26);
  animation: flame-flicker 0.55s ease-in-out infinite alternate;
}

.festive-flames span:nth-child(2) {
  height: 28px;
  animation-delay: 0.12s;
}
.festive-flames span:nth-child(3) {
  animation-delay: 0.24s;
}

.festive-smoke {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.festive-smoke span {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  filter: blur(6px);
  animation: smoke-rise 2.8s ease-out infinite;
}

.festive-smoke span:nth-child(1) {
  animation-delay: 0s;
}
.festive-smoke span:nth-child(2) {
  animation-delay: 0.6s;
  width: 22px;
  height: 22px;
}
.festive-smoke span:nth-child(3) {
  animation-delay: 1.2s;
}

.festive-plate {
  position: absolute;
  bottom: 38px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #e2d8cc;
  box-shadow: var(--shadow);
  z-index: 2;
}

.festive-plate--left {
  left: 18%;
}
.festive-plate--right {
  right: 18%;
}

.festive-plate--left::after,
.festive-plate--right::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #8b4513, #c45c26);
}

.festive-guest {
  position: absolute;
  bottom: 52px;
  font-size: 1.75rem;
  z-index: 4;
  animation: guest-bounce 1.8s ease-in-out infinite;
}

.festive-guest--left {
  left: 8%;
  animation-delay: 0.2s;
}
.festive-guest--right {
  right: 8%;
}

.festive-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes sun-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes bunting-sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes flame-flicker {
  from { transform: scaleY(0.92); opacity: 0.85; }
  to { transform: scaleY(1.08); opacity: 1; }
}

@keyframes smoke-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  20% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translateY(-48px) scale(1.4);
  }
}

@keyframes guest-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(var(--fall, 110vh)) translateX(var(--drift, 0))
      rotate(var(--spin, 720deg));
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .success-modal__backdrop,
  .success-modal__panel,
  .festive-sun,
  .festive-bunting span,
  .festive-flames span,
  .festive-smoke span,
  .festive-guest,
  .festive-confetti span,
  .confetti-burst span {
    animation: none;
  }

  .confetti-burst {
    display: none;
  }
}

@media (max-width: 520px) {
  .row-2 {
    grid-template-columns: 1fr;
  }
}
