/* ==========================================================================
   Emiel wordt 7! — party styles
   Vanilla CSS, no frameworks. Palette: festive yellow/orange/red/teal/purple.
   ========================================================================== */

:root {
  --bg: #fff8e7;
  --card: #ffffff;
  --ink: #33302e;
  --ink-soft: #6b625a;
  --yellow: #ffd93d;
  --orange: #ff9a3d;
  --red: #ff4d6d;
  --teal: #06d6a0;
  --purple: #9b5de5;
  --blue: #4d96ff;
  --focus: #7b2cbf;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(51, 48, 46, 0.15);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  line-height: 1.5;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.4em; }

a { color: #d6336c; }

/* Accessible focus */
:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--purple);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 248, 231, 0.95);
  border-bottom: 3px solid var(--yellow);
}

.brand {
  margin: 0;
  font-weight: 800;
  font-size: 1.1rem;
  color: #a35a00;
}

.topnav { display: none; }

.langpicker { display: flex; gap: 8px; margin-left: auto; }

.lang-btn {
  font-size: 1.25rem;
  padding: 6px 10px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  line-height: 1.2;
  transition: transform 0.15s var(--bounce), border-color 0.15s;
}
.lang-btn:hover { transform: scale(1.12); }
.lang-btn .lang-code { font-size: 0.8rem; font-weight: 700; }
.lang-btn[aria-pressed="true"] {
  border-color: var(--purple);
  background: #f3e8ff;
}

@media (max-width: 479px) {
  /* four languages fit on one row when only the flags are shown */
  .lang-btn .lang-code { display: none; }
  .lang-btn { padding: 6px 8px; }
}

@media (min-width: 768px) {
  .topnav { display: flex; gap: 18px; }
  .topnav a { text-decoration: none; font-weight: 700; color: #a35a00; padding: 6px 2px; }
  .topnav a:hover { color: var(--red); text-decoration: underline wavy; }
  .langpicker { margin-left: 0; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 56px 16px 64px;
  background: linear-gradient(180deg, #ffe169 0%, #ffd93d 45%, #ffb703 100%);
  border-radius: 0 0 34px 34px;
}

.hero-title {
  font-size: clamp(2.4rem, 10vw, 5rem);
  font-weight: 900;
  margin: 0 0 10px;
  text-shadow: 3px 3px 0 #fff, 6px 6px 0 rgba(163, 90, 0, 0.25);
}
.hero-title .ltr {
  display: inline-block;
  animation: letter-bounce 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}
.hero-title .ltr:nth-child(3n) { color: var(--red); }
.hero-title .ltr:nth-child(3n+1) { color: var(--purple); }
.hero-title .ltr:nth-child(3n+2) { color: #1e9e6a; }

@keyframes letter-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

.hero-sub {
  font-size: clamp(1.05rem, 3.5vw, 1.4rem);
  margin: 0 auto 28px;
  max-width: 620px;
  font-weight: 600;
}

.countdown-label {
  font-weight: 800;
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.cd-box {
  background: #fff;
  border-radius: 18px;
  padding: 10px 8px;
  min-width: 72px;
  box-shadow: var(--shadow);
  animation: cd-wiggle 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.25s);
}
@keyframes cd-wiggle {
  0%, 100% { transform: rotate(0deg); }
  8% { transform: rotate(-2deg); }
  16% { transform: rotate(2deg); }
}

.cd-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.cd-lbl { font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; }

.cd-done { font-size: 1.5rem; font-weight: 900; color: var(--red); margin: 0 0 20px; }

/* Floating balloons + confetti dots in the hero */
.hero-decor { position: absolute; inset: 0; pointer-events: none; }

.hb {
  position: absolute;
  font-size: 2.4rem;
  opacity: 0.9;
  animation: hb-float 7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.hb1 { left: 6%;  top: 18%; --d: 0s; }
.hb2 { left: 84%; top: 12%; --d: 1.2s; font-size: 3rem; }
.hb3 { left: 16%; top: 62%; --d: 2.1s; font-size: 1.8rem; }
.hb4 { left: 78%; top: 58%; --d: 0.6s; font-size: 2.1rem; }
.hb5 { left: 46%; top: 4%;  --d: 1.7s; font-size: 1.6rem; }

@keyframes hb-float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(8deg); }
}

.conf-dot {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  animation: conf-drift 9s linear infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}
.conf-dot.d1 { left: 12%; top: 82%; background: var(--red);    --d: 0s; }
.conf-dot.d2 { left: 30%; top: 92%; background: var(--teal);  --d: 1.5s; }
.conf-dot.d3 { left: 52%; top: 86%; background: var(--purple);--d: 3s; }
.conf-dot.d4 { left: 68%; top: 94%; background: var(--blue);   --d: 4.5s; }
.conf-dot.d5 { left: 88%; top: 88%; background: var(--red);   --d: 2.2s; }
.conf-dot.d6 { left: 22%; top: 6%;  background: var(--teal);  --d: 5s; }
.conf-dot.d7 { left: 62%; top: 10%; background: var(--orange);--d: 6s; }
.conf-dot.d8 { left: 94%; top: 30%; background: var(--purple);--d: 3.8s; }

@keyframes conf-drift {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-90vh) rotate(540deg); opacity: 0; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: var(--red);
  padding: 14px 30px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.2s var(--bounce);
}
.btn:hover { transform: translateY(-3px) scale(1.05); background: #ff6b85; }
.btn:active { transform: translateY(1px) scale(0.97); }

.btn-big { font-size: 1.2rem; padding: 16px 38px; }

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 16px;
  text-align: center;
}

.section h2 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--purple);
}

.section-sub { color: var(--ink-soft); max-width: 560px; margin: 0 auto 24px; }

/* Party info */
.info-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  text-align: center;
}

@media (min-width: 640px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .info-card:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .info-card:last-child { grid-column: auto; }
}

.info-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 18px;
  box-shadow: var(--shadow);
  border: 3px solid #ffe9a8;
}

.info-icon { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.info-label { font-weight: 800; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.06em; color: var(--ink-soft); margin: 0; }
.info-value { font-size: 1.15rem; font-weight: 600; margin: 6px 0; }
.info-links a {
  display: inline-block;
  margin: 8px 8px 0;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s var(--bounce);
}
.info-links a:hover { transform: scale(1.06); }

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 480px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

.gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: var(--shadow);
  transform: rotate(-1deg);
  transition: transform 0.25s var(--bounce);
}
.gallery-item:nth-child(even) { transform: rotate(1deg); }
.gallery-item:hover { transform: rotate(0) scale(1.03); }

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-empty {
  background: #fff;
  display: inline-block;
  padding: 18px 26px;
  border-radius: var(--radius);
  border: 3px dashed var(--orange);
}

/* ==========================================================================
   Games
   ========================================================================== */

.games-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  text-align: center;
}
@media (min-width: 900px) { .games-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }

.game {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px 26px;
  border: 3px solid #ffe9a8;
  box-shadow: var(--shadow);
}

.game h3 { font-size: 1.4rem; color: #a35a00; }
.game-how { color: var(--ink-soft); margin: 0 0 10px; }
.game-stats { font-weight: 800; color: var(--blue); margin: 0 0 6px; min-height: 1.4em; }
.game-msg { font-weight: 800; color: #1e9e6a; min-height: 1.6em; margin: 0 0 12px; }

/* Shared win-pop animation (used by the tic-tac-toe winning line) */
@keyframes match-pop {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.12); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* Balloon pop arena */
.pop-arena {
  position: relative;
  height: 320px;
  margin: 0 auto 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #bde0fe 0%, #ffc8dd 100%);
  border: 3px solid #ffe9a8;
}
@media (max-width: 479px) { .pop-arena { height: 260px; } }

.balloon {
  position: absolute;
  bottom: 0;
  width: 58px;
  height: 70px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: radial-gradient(circle at 30% 30%, #ffffff88, transparent 45%),
    radial-gradient(circle at 65% 65%, #ffffff55, transparent 50%),
    var(--balloon-color, var(--red));
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  animation: rise var(--dur, 6s) linear infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 0.15s var(--bounce);
}
.balloon:hover { transform: scale(1.1); }
.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 34px;
  background: rgba(51, 48, 46, 0.4);
}

@keyframes rise {
  from { transform: translateY(110px); }
  to { transform: translateY(-460px); }
}

.balloon.popped {
  animation: pop 0.3s ease-out forwards;
  pointer-events: none;
}
@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Rock-paper-scissors */
.rps-choices {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 16px;
}

.rps-btn {
  width: 84px;
  height: 84px;
  padding: 0;
  border: 4px solid #ffe9a8;
  border-radius: 50%;
  background: #fff;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--bounce), border-color 0.2s;
}
.rps-btn:hover { transform: translateY(-4px) scale(1.08); border-color: var(--yellow); }
.rps-btn:active { transform: scale(0.95); }
.rps-btn.picked { border-color: var(--teal); }

@media (max-width: 479px) {
  .rps-btn { width: 76px; height: 76px; font-size: 2.3rem; }
  .rps-choices { gap: 10px; }
}

/* Tic-tac-toe */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 300px;
  margin: 0 auto 16px;
}

.ttt-cell {
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid #ffe9a8;
  border-radius: 14px;
  background: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s;
}
.ttt-cell:hover { border-color: var(--yellow); background: #fffdf5; }
.ttt-cell.ttt-win {
  border-color: var(--teal);
  background: #d8f7ee;
  animation: match-pop 0.4s var(--bounce);
}
.ttt-cell.x, .ttt-cell.o { cursor: default; }

/* ==========================================================================
   Jokes
   ========================================================================== */

.joke-text {
  background: #fff;
  border: 3px dashed var(--purple);
  border-radius: var(--radius);
  padding: 26px 22px;
  max-width: 560px;
  margin: 0 auto 22px;
  font-size: 1.2rem;
  font-weight: 600;
  min-height: 3.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   RSVP
   ========================================================================== */

.rsvp-form {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
  display: grid;
  gap: 20px;
}

.field { border: 0; padding: 0; margin: 0; }

.field label, .field legend {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.field input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 14px 16px;
  border: 3px solid #ffe9a8;
  border-radius: 14px;
  background: #fff;
}
.field input[type="text"]:focus-visible { border-color: var(--purple); outline: 4px solid var(--focus); outline-offset: 2px; }

.radios { display: flex; gap: 14px; flex-wrap: wrap; }

.radio-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.radio-big {
  flex: 1 1 160px;
  text-align: center;
  padding: 18px 14px;
  border-radius: 18px;
  border: 3px solid #ffe9a8;
  background: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.2s var(--bounce);
  box-shadow: var(--shadow);
}
.radio-big:hover { transform: translateY(-3px) scale(1.03); }

.radio-input:focus-visible + .radio-big { outline: 4px solid var(--focus); outline-offset: 3px; }

.radio-input:checked + .radio-yes { background: var(--teal); color: #fff; border-color: var(--teal); }
.radio-input:checked + .radio-no { background: #8d99ae; color: #fff; border-color: #8d99ae; }

.field-err {
  color: #c81e4a;
  font-weight: 700;
  margin: 8px 0 0;
}

/* Honeypot: hidden from humans, visible to bots */
.hp-field {
  position: absolute;
  left: -9999px;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.rsvp-msg {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 18px auto 0;
  max-width: 520px;
}
.rsvp-msg.ok { color: #1e9e6a; }
.rsvp-msg.err { color: #c81e4a; }

/* ==========================================================================
   Confetti burst (JS-created pieces)
   ========================================================================== */

.confetti-piece {
  position: fixed;
  top: -20px;
  z-index: 999;
  pointer-events: none;
  border-radius: 3px;
  animation: confetti-fall var(--dur, 2.4s) linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-4vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.6; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  text-align: center;
  padding: 30px 16px 40px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .hb, .conf-dot, .cd-box { animation: none; }
  .hero-title .ltr { animation: none; }
  .balloon { animation: none; transform: none; }
  .balloon.popped { opacity: 0; }
  .confetti-piece { display: none; }
}
