@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap");

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: linear-gradient(160deg, #1e2e50 0%, #2d4a2d 100%);
  padding: 24px;
}

/* ── Logo ───────────────────────────────────────────────────── */
#logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
#logo-wrap img {
  max-height: 150px;
  max-width: 375px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
  margin-bottom: 40px;
}
#logo-wrap .logo-placeholder {
  border: 2px dashed rgba(255,255,255,0.25);
  border-radius: 10px;
  padding: 12px 32px;
  color: rgba(255,255,255,0.35);
  font: 400 0.85em "Lato", sans-serif;
}

/* ── Wheel ──────────────────────────────────────────────────── */
#spin_the_wheel {
  display: inline-block;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.1), 0 20px 60px rgba(0,0,0,0.5);
}
#wheel { display: block; }

#spin {
  font: 2.5em/0 "Lato", sans-serif;
  user-select: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%; left: 50%;
  width: 30%; height: 30%;
  margin: -15%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a1a;
  box-shadow: 0 0 0 8px currentColor, 0 0px 15px 5px rgba(0,0,0,0.6);
  border-radius: 50%;
  transition: 0.8s;
  z-index: 2;
}
#spin::after {
  content: "";
  position: absolute;
  top: -17px;
  border: 10px solid transparent;
  border-bottom-color: currentColor;
  border-top: none;
}

/* ── Admin link ─────────────────────────────────────────────── */
#admin-link {
  position: fixed;
  top: 20px; right: 20px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  padding: 10px 22px;
  font: 700 0.85em "Lato", sans-serif;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.2s;
  backdrop-filter: blur(6px);
}
#admin-link:hover { background: rgba(255,255,255,0.22); }

/* ── Winner overlay ─────────────────────────────────────────── */
#winner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  justify-content: center;
  align-items: center;
}
#winner-overlay.show { display: flex; animation: overlayIn 0.35s ease; }
@keyframes overlayIn { from { opacity:0; } to { opacity:1; } }

/* Card */
#winner-card {
  width: 90vw;
  max-width: 1000px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  animation: cardPop 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
  display: flex;
  flex-direction: column;
}
@keyframes cardPop { from { transform: scale(0.7); } to { transform: scale(1); } }

/* Header: donkerblauw met logo */
#winner-card-header {
  background: #345B9B;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#winner-card-header::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #579A59, #345B9B);
}
#winner-logo {
  max-height: 153px;
  max-width: 380px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Body: wit */
#winner-card-body {
  background: #fff;
  padding: 36px 40px 28px;
  text-align: center;
}

.trophy {
  font-size: 120px;
  display: block;
  margin-bottom: 14px;
  animation: trophyBounce 0.6s 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes trophyBounce {
  from { transform: scale(0) rotate(-20deg); }
  to   { transform: scale(1) rotate(0deg); }
}

.winner-subtitle {
  font: 700 2em "Lato", sans-serif;
  color: #579A59;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.winner-label {
  font: 900 3em "Lato", sans-serif;
  color: #1a1a1a;
  line-height: 1.15;
  margin-bottom: 10px;
}

.winner-remaining {
  font: 400 0.88em "Lato", sans-serif;
  color: #aaa;
  min-height: 20px;
}
.winner-remaining.last {
  color: #c0392b;
  font-weight: 700;
}

/* Footer: lichtgrijs met knop */
#winner-card-footer {
  background: #f4f6fa;
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  border-top: 1px solid #eee;
}

#winner-close {
  background: linear-gradient(135deg, #345B9B, #2a4a80);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 11px 32px;
  font: 700 2em "Lato", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(52,91,155,0.3);
  transition: opacity 0.15s, transform 0.1s;
}
#winner-close:hover { opacity: 0.88; transform: scale(1.04); }

/* ── Confetti ───────────────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* ── Code modal ─────────────────────────────────────────────── */
#code-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 110;
  justify-content: center;
  align-items: center;
}
#code-overlay.show { display: flex; animation: overlayIn 0.3s ease; }

#code-card {
  width: 90vw;
  max-width: 1000px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  animation: cardPop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
  display: flex;
  flex-direction: column;
}

#code-card-header {
  background: #345B9B;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#code-card-header::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #579A59, #345B9B);
}
#code-logo {
  max-height: 153px;
  max-width: 380px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

#code-card-body {
  background: #fff;
  padding: 32px 36px 20px;
  text-align: center;
}
.code-title {
  font: 700 3em "Lato", sans-serif;
  color: #333;
  margin-bottom: 24px;
  letter-spacing: 0.03em;
}

.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}
.code-digit {
  width: 94px;
  height: 94px;
  border: 2px solid #ddd;
  border-radius: 10px;
  text-align: center;
  font: 700 3em "Lato", sans-serif;
  color: #222;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafafa;
}
.code-digit:focus {
  border-color: #345B9B;
  box-shadow: 0 0 0 3px rgba(52,91,155,0.15);
  background: #fff;
}
.code-error {
  font: 400 1.5em "Lato", sans-serif;
  color: #c0392b;
  min-height: 18px;
}

#code-card-footer {
  background: #f4f6fa;
  padding: 18px 36px;
  display: flex;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid #eee;
}
#code-cancel {
  background: transparent;
  color: #999;
  border: 1.5px solid #ddd;
  border-radius: 50px;
  padding: 11px 28px;
  font: 700 2em "Lato", sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}
#code-cancel:hover { background: #f0f0f0; }
#code-submit {
  background: linear-gradient(135deg, #345B9B, #2a4a80);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 11px 32px;
  font: 700 2em "Lato", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(52,91,155,0.3);
  transition: opacity 0.15s, transform 0.1s;
}
#code-submit:hover { opacity: 0.88; transform: scale(1.03); }
