:root {
  --papier: #f7f1e6;
  --papier-donker: #efe6d4;
  --inkt: #2b2220;
  --inkt-zacht: #6b5d55;
  --rood: #8e1c1c;
  --rood-donker: #6e1414;
  --goud: #9c7a2e;
  --goud-licht: #b8913a;
  --lijn: #d9ccb3;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  color: var(--inkt);
  font-family: var(--sans);
  background: radial-gradient(ellipse at 50% 0%, #fbf7ef 0%, var(--papier) 60%, var(--papier-donker) 100%) fixed;
  -webkit-text-size-adjust: 100%;
}

/* Kop */
.kop { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 28px 32px 8px; }
.kop .titel { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .18em; text-transform: uppercase; color: var(--rood); }
.ornament { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--goud-licht); margin: 6px auto 0; max-width: 420px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: var(--goud-licht); opacity: .6; }

/* Kaart */
.kaart {
  position: relative;
  background: #fffdf8; border: 1px solid var(--lijn); border-radius: 14px;
  padding: 32px 32px 28px; box-shadow: 0 10px 30px -18px rgba(60, 30, 10, .35);
}
.stap { font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--goud); font-weight: 600; }
.kaart h2, .raadsel { font-family: var(--serif); font-weight: normal; font-size: 1.8rem; line-height: 1.3; margin: 8px 0 8px; color: var(--rood); }
.uitleg { color: var(--inkt-zacht); font-size: 1.15rem; line-height: 1.5; margin: 0 0 22px; }
.invoer { display: flex; gap: 10px; align-items: center; }
.veld {
  width: 100%; flex: 1; min-width: 0;
  font-size: 1.6rem; padding: 14px 18px; border: 1.5px solid var(--lijn); border-radius: 10px;
  background: #fff; color: var(--inkt); font-family: var(--sans);
}
.veld:focus { outline: none; border-color: var(--goud-licht); box-shadow: 0 0 0 3px rgba(184, 145, 58, .25); }
.veld:disabled { background: #f6f1e7; color: var(--inkt-zacht); }
.eenheid { font-size: 1.4rem; color: var(--inkt-zacht); }
button {
  font-family: var(--sans); font-size: 1.25rem; font-weight: 600;
  padding: 16px 28px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--rood); color: #fff7e8; touch-action: manipulation;
}
button:hover { background: var(--rood-donker); }
button:focus-visible { outline: 3px solid var(--goud-licht); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: default; }
.knop-rij { margin-top: 14px; display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.kansen { margin-right: auto; color: var(--inkt-zacht); font-size: 1.1rem; }
.melding { min-height: 1.6em; margin-top: 16px; font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; color: var(--rood); }
.melding.goed { color: #2f5d2a; }
.hint { margin-top: 10px; padding: 12px 16px; border-left: 3px solid var(--goud-licht); background: #fbf5e8; color: var(--inkt); font-size: 1.1rem; line-height: 1.45; }

.schud { animation: schud .45s; }
@keyframes schud { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.zegel { position: absolute; right: -22px; top: -22px; width: 96px; height: 96px; opacity: 0; transform: scale(1.8) rotate(-18deg); pointer-events: none; }
.zegel.aan { animation: stempel .45s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes stempel { to { opacity: 1; transform: scale(1) rotate(-12deg); } }

/* Inloggen */
.inlog { max-width: 640px; margin: 0 auto; padding: 48px 32px; }

/* Spel: tablet liggend = twee kolommen */
.spel {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px;
  max-width: 1180px; margin: 0 auto; padding: 32px 48px 48px; align-items: start;
}
.label { font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--inkt-zacht); margin-bottom: 14px; }
.regels { font-family: var(--serif); font-size: clamp(1.5rem, 2.5vw, 2.1rem); line-height: 1.55; margin: 0; }
.regels span { display: block; }
.regels.nieuw span { opacity: 0; transform: translateY(6px); animation: verschijn .7s ease forwards; }
@keyframes verschijn { to { opacity: 1; transform: none; } }

.eerder { margin-bottom: 28px; color: var(--inkt-zacht); }
.eerder summary { cursor: pointer; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; padding: 6px 0; }
.eerder div { font-family: var(--serif); font-size: 1.1rem; line-height: 1.5; border-left: 2px solid var(--lijn); padding-left: 16px; margin-top: 8px; max-height: 40vh; overflow: auto; }
.eerder p { margin: 0 0 12px; }

/* Slot */
.slot { max-width: 820px; margin: 0 auto; padding: 40px 40px 64px; text-align: center; }
.slot .regels { font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin-bottom: 40px; }
.cadeau { text-align: left; }
.cadeau-tekst { font-family: var(--serif); font-size: 1.7rem; line-height: 1.45; margin: 12px 0 0; }
.cadeau-foto { display: block; width: 100%; margin-top: 20px; border-radius: 10px; }

/* Huizenronde */
.huis { margin: 14px 0 6px; }
.huis img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: var(--papier-donker); }
.huis figcaption { margin-top: 8px; font-size: 1rem; color: var(--inkt-zacht); letter-spacing: .02em; }

/* Filmpje */
.video-plek video { display: block; width: 100%; max-height: 78vh; background: #000; }
.video { position: fixed; inset: 0; background: rgba(30, 15, 10, .82); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 10; }
.video-binnen { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(560px, 100%); max-height: 100%; }
.video-plek { width: 100%; background: #000; border-radius: 12px; overflow: hidden; }
.video-plek iframe { display: block; width: 100%; height: min(78vh, 900px); border: 0; }
.video-plek .fout-groot {
  aspect-ratio: 9 / 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--rood); color: #fff7e8; font-family: var(--serif); text-align: center; padding: 24px;
}
.video-plek .fout-groot strong { font-size: clamp(4rem, 12vw, 8rem); letter-spacing: .05em; animation: schud .5s 2; }
.video-melding { margin: 0; color: #fff7e8; font-family: var(--serif); font-size: 1.6rem; text-align: center; min-height: 1.2em; }
.video-link { color: #fff7e8; font-size: 1.2rem; }

/* Tablet staand en telefoon: alles onder elkaar */
@media (orientation: portrait), (max-width: 900px) {
  .spel { grid-template-columns: 1fr; gap: 32px; padding: 24px 28px 64px; }
}
@media (max-width: 520px) {
  .kaart { padding: 24px 20px 20px; }
  .zegel { right: -8px; top: -30px; width: 76px; height: 76px; }
  .spel, .inlog, .slot { padding-left: 16px; padding-right: 16px; }
  .veld { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .regels.nieuw span, .zegel.aan, .schud, .fout-groot strong { animation: none !important; opacity: 1; transform: none; }
}
