:root {
  --yellow: #FFEC71;
  --cream: #FFF7BA;
  --ink: #504F49;
  --white: #FDFDFD;
  --black: #060707;
  --pink: #DD2A7D;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(env(safe-area-inset-top), 18px) 16px max(env(safe-area-inset-bottom), 16px);
}

.top { text-align: center; flex: none; }
.brand {
  font-size: clamp(0.85rem, 2vh, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
}
h1 {
  margin: 0.15em 0 0.1em;
  font-size: clamp(2.2rem, 6.5vh, 4rem);
  line-height: 1.05;
  font-weight: 800;
  color: var(--black);
}
#sub {
  margin: 0;
  font-size: clamp(1.1rem, 2.8vh, 1.6rem);
  font-weight: 600;
}

.stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- wheel ---------- */
.wheel-wrap {
  --size: min(92vw, calc(100dvh - 210px));
  position: relative;
  width: var(--size);
  height: var(--size);
  flex: none;
  filter: drop-shadow(0 14px 24px rgba(80, 79, 73, 0.25));
  cursor: pointer;
}
.wheel-wrap.pop { animation: pop 0.7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop {
  0%   { transform: scale(0.88) rotate(-25deg); }
  100% { transform: scale(1) rotate(0); }
}

.rot { position: absolute; inset: 0; will-change: transform; }
.rot.idle { animation: idle 26s linear infinite; }
@keyframes idle { to { transform: rotate(360deg); } }
.rot canvas { width: 100%; height: 100%; display: block; }

.pointer {
  position: absolute;
  top: -3.5%;
  left: 50%;
  width: 9%;
  height: 11%;
  transform: translateX(-50%);
  background: var(--pink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 3;
}

.hub {
  position: absolute;
  top: 50%; left: 50%;
  width: 27%; height: 27%;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font);
  font-weight: 800;
  font-size: calc(var(--size) * 0.052);
  line-height: 1.1;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 calc(var(--size) * 0.012) var(--white), 0 6px 14px rgba(0, 0, 0, 0.3);
  z-index: 2;
  cursor: pointer;
}
.hub.pulse { animation: pulse 1.4s ease-in-out infinite; }
.hub.big { font-size: calc(var(--size) * 0.054); }
.hub:disabled { opacity: 0.85; cursor: default; }
@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.09); }
}

/* ---------- modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;       /* top-aligned so the iPad keyboard doesn't hide the fields */
  justify-content: center;
  padding: max(env(safe-area-inset-top), 3vh) 16px 16px;
  background: rgba(80, 79, 73, 0.6);
  overflow-y: auto;
  z-index: 10;
  animation: fade 0.25s ease;
}
.modal.hidden { display: none; }
@keyframes fade { from { opacity: 0; } }

.card {
  width: min(100%, 540px);
  background: var(--white);
  border-radius: 28px;
  padding: 26px 28px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  -webkit-user-select: auto;
  user-select: auto;
}
.card h2 {
  margin: 0 0 6px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--black);
}
.lead { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.35; }

label { display: block; margin: 12px 0 6px; font-weight: 700; font-size: 1.05rem; }
.opt { font-weight: 500; opacity: 0.7; }

input[type="text"], input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 1.25rem;          /* 16px+ stops iOS zooming in on focus */
  padding: 15px 16px;
  border: 2px solid #E5DFA4;
  border-radius: 14px;
  background: var(--white);
  color: var(--black);
  outline: none;
  -webkit-appearance: none;
}
input[type="text"]:focus, input[type="email"]:focus { border-color: var(--ink); }
input.bad { border-color: var(--pink); }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.3;
  margin: 16px 0 4px;
}
.check input { width: 26px; height: 26px; flex: none; accent-color: var(--ink); margin: 0; }

.error { min-height: 1.4em; margin: 10px 0 4px; color: var(--pink); font-weight: 700; }

button.primary {
  width: 100%;
  height: 62px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.6; }
button.link {
  display: block;
  margin: 10px auto 0;
  padding: 10px 18px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}
.fine { margin: 8px 0 0; font-size: 0.85rem; opacity: 0.75; text-align: center; line-height: 1.35; }

.result { text-align: center; margin-top: 4vh; }
.result h2 { font-size: 2.4rem; }
.prize {
  margin: 8px 0 8px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--black);
  background: var(--yellow);
  border-radius: 20px;
  padding: 18px 16px;
}
.claim { margin: 0 0 14px; font-size: 1.2rem; font-weight: 600; }
.deepdive {
  background: var(--cream);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 1.1rem;
  line-height: 1.35;
}

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

@media (prefers-reduced-motion: reduce) {
  .rot.idle, .hub.pulse { animation: none; }
}
