/* Rad van Fortuin - licht en fel.
   Lichte, koele ondergrond; het rad is het enige verzadigde ding op de pagina.
   Het licht komt van boven en draait NIET mee: de belichting ligt als losse
   laag over het draaiende vlak. */

:root {
  --papier-boven: #f7f9fc;
  --papier-onder: #dfe6ef;
  --inkt: #141a22;
  --inkt-zacht: #5b6574;

  --goud: #f2b705;
  --goud-licht: #ffe89a;
  --goud-diep: #a86f03;

  --rood: #e5342a;
  --azuur: #1b87dd;
  --groen: #12a05c;

  --rad-maat: min(92vw, 33rem);
  --randdikte: 6.5%;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  padding: clamp(1.25rem, 4vh, 2.75rem) 1rem calc(clamp(1.25rem, 4vh, 2.75rem) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Archivo", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--inkt);
  background:
    radial-gradient(44rem 30rem at 50% 38%, rgba(255, 219, 128, 0.42), transparent 66%),
    linear-gradient(170deg, var(--papier-boven) 0%, #eaeff6 46%, var(--papier-onder) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

.machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  animation: aanlichten 0.7s 0.05s ease both;
}

@keyframes aanlichten {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- opschrift ---------- */

.wordmark {
  margin: 0;
  font-size: clamp(1.9rem, 7vw, 2.9rem);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--inkt);
}

.inzet {
  margin: 0.6rem 0 0;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--inkt-zacht);
}

/* ---------- podium ---------- */

.podium {
  position: relative;
  width: var(--rad-maat);
  margin: clamp(1.3rem, 4vh, 2.2rem) 0 clamp(1.5rem, 4.5vh, 2.4rem);
}

.grondschaduw {
  position: absolute;
  left: 50%;
  bottom: -4%;
  width: 62%;
  height: 7%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(30, 44, 66, 0.3), rgba(30, 44, 66, 0));
  filter: blur(7px);
}

.rad {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-shadow:
    0 26px 46px -20px rgba(24, 38, 58, 0.55),
    0 4px 12px rgba(24, 38, 58, 0.18);
}

/* ---------- de gouden rand ---------- */

.rand {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 214deg,
    #a86f03 0deg, #e0a413 22deg, #fff2c4 46deg, #f2b705 70deg, #9c6704 104deg,
    #dda412 140deg, #ffeeb4 172deg, #e0a413 200deg, #a06805 232deg,
    #dda412 268deg, #fff5d2 300deg, #edb00a 330deg, #a86f03 360deg);
  /* donkere haarlijn buitenom: anders loopt het goud weg in de lichte pagina */
  box-shadow:
    0 0 0 2px rgba(60, 42, 8, 0.55),
    inset 0 0 0 1px rgba(255, 248, 226, 0.55),
    inset 0 0 18px rgba(88, 58, 6, 0.35);
}

/* sponning waar het vlak in ligt */
.rand::after {
  content: "";
  position: absolute;
  inset: var(--randdikte);
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 0 2px rgba(60, 42, 8, 0.5),
    inset 0 2px 7px rgba(40, 30, 6, 0.4);
}

/* ---------- klinknagels op de rand ---------- */

.studs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stud {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.5%;
  height: 2.5%;
  margin: -1.25% 0 0 -1.25%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fffaea, #f2c848 46%, #9c6704 100%);
  box-shadow: 0 1px 2px rgba(60, 42, 8, 0.55), inset 0 0 0 0.5px rgba(70, 48, 8, 0.5);
  transform: rotate(var(--hoek)) translateY(calc(var(--rad-maat) * -0.4675)) rotate(calc(-1 * var(--hoek)));
}

body.draait .stud { animation: flonker 0.7s ease-in-out infinite; animation-delay: var(--beurt); }

@keyframes flonker {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.45); }
}

/* ---------- het draaiende vlak ---------- */

.vlak {
  position: absolute;
  inset: var(--randdikte);
  border-radius: 50%;
  overflow: hidden;
  will-change: transform;
}

.vlak svg { display: block; width: 100%; height: 100%; }

/* Belichting over het vlak: blijft staan terwijl het rad eronder draait. */
.belichting {
  position: absolute;
  inset: var(--randdikte);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(46% 40% at 32% 17%, rgba(255, 255, 255, 0.4), transparent 72%),
    radial-gradient(92% 92% at 50% 46%, transparent 56%, rgba(20, 30, 45, 0.28) 100%);
  box-shadow: inset 0 5px 14px rgba(20, 30, 45, 0.3);
}

/* ---------- naaf ---------- */

.naaf {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13%;
  height: 13%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 200deg,
    #a86f03 0%, #f2b705 14%, #fff2c4 27%, #dda412 42%, #9c6704 58%,
    #f2b705 74%, #ffeeb4 86%, #a86f03 100%);
  box-shadow:
    0 0 0 2px rgba(60, 42, 8, 0.55),
    0 5px 12px rgba(24, 38, 58, 0.45);
}

.naaf::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #3a4250, #161c25 72%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ---------- klepel ---------- */

.klepel {
  position: absolute;
  left: 50%;
  top: -3.6%;
  z-index: 4;
  width: 13%;
  transform-origin: 50% 24%;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 6px rgba(24, 38, 58, 0.5));
}

.klepel svg { display: block; width: 100%; height: auto; }

/* ---------- knop ---------- */

.plaat {
  font-family: inherit;
  font-size: clamp(1rem, 3.6vw, 1.12rem);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #fff;
  padding: 1rem 2.6rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(176deg, #262f3c 0%, #141a22 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 12px 22px -10px rgba(20, 26, 34, 0.75);
  transition: transform 0.16s ease, box-shadow 0.24s ease, background 0.24s ease;
  -webkit-tap-highlight-color: transparent;
}

.plaat:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(176deg, #303b4b 0%, #1b222c 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 18px 28px -12px rgba(20, 26, 34, 0.8);
}

.plaat:active:not(:disabled) { transform: translateY(0); }
.plaat:focus-visible { outline: 3px solid var(--goud); outline-offset: 3px; }

.plaat:disabled {
  cursor: default;
  background: #aeb7c3;
  box-shadow: none;
}

/* ---------- de uitslag ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(14, 20, 30, 0.55);
  backdrop-filter: blur(5px);
  animation: opdoemen 0.25s ease both;
}

.overlay[hidden] { display: none; }

.bon {
  --accent: #6d7885;
  position: relative;
  width: min(100%, 21rem);
  padding: 2.4rem 1.9rem 1.7rem;
  text-align: center;
  background: #fff;
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow: 0 30px 60px -18px rgba(10, 18, 30, 0.6);
  animation: bonuit 0.42s cubic-bezier(0.2, 1.1, 0.35, 1) both;
}

.bon-band {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.65rem;
  background: var(--accent);
}

.bon.een { --accent: #e5342a; }
.bon.twee { --accent: #1b87dd; }
.bon.vijf { --accent: #12a05c; }
.bon.jackpot { --accent: #f2b705; }

.bon-bedrag {
  margin: 0.3rem 0 0;
  font-size: clamp(4rem, 21vw, 5.6rem);
  font-weight: 900;
  font-stretch: 105%;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--accent);
}

.bon.jackpot .bon-bedrag { color: #d99f04; }

.bon-tekst {
  margin: 0.9rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: #46505e;
}

.bon.jackpot .bon-tekst { color: var(--inkt); font-weight: 700; }

.bon-knop {
  margin-top: 1.7rem;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 0;
  background: var(--inkt);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.bon-knop:hover { background: #2c3644; }
.bon-knop:focus-visible { outline: 3px solid var(--goud); outline-offset: 3px; }

@keyframes opdoemen { from { opacity: 0; } to { opacity: 1; } }
@keyframes bonuit {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .machine, .overlay, .bon { animation: none; opacity: 1; transform: none; }
  body.draait .stud { animation: none; }
}
