/* ── Plinko Drop — sunny boardwalk arcade ───────────────────────────
   Sky blue with cream clouds, honey-wood board, chrome pegs,
   candy-striped rails, carnival-sign prize slots, bouncy display. */

:root {
  --sky: #8fd0f2;
  --sky-deep: #5cb3e3;
  --cloud: #fdf9ef;
  --wood: #d9a45f;
  --wood-deep: #b57f3c;
  --coral: #f2695c;
  --teal: #2b9d8f;
  --marigold: #f4a927;
  --ink: #35404d;
  --ink-soft: #7c8894;
  --card: #ffffff;
  --line: #e4e9ee;
  --err: #e0504a;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Mulish', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { position: relative; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

.wrap { width: 100%; max-width: 540px; margin: 0 auto; padding: 0 20px; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Clouds ───────────────────────────────────────────────────────── */
.clouds { position: absolute; inset: 0; pointer-events: none; }

.clouds span {
  position: absolute;
  width: 130px;
  height: 38px;
  background: var(--cloud);
  border-radius: 999px;
  opacity: 0.85;
  box-shadow: 26px -14px 0 -4px var(--cloud), -30px -10px 0 -8px var(--cloud);
  animation: cloudslide 46s linear infinite;
}

.clouds span:nth-child(1) { top: 7%; left: -140px; animation-delay: 0s; }
.clouds span:nth-child(2) { top: 20%; left: -140px; animation-delay: 16s; transform: scale(0.7); }
.clouds span:nth-child(3) { top: 46%; left: -140px; animation-delay: 32s; transform: scale(0.55); opacity: 0.6; }

@keyframes cloudslide {
  to { transform: translateX(calc(100vw + 280px)); }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { position: relative; text-align: center; padding: 46px 0 22px; }

.kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #fff;
  background: var(--coral);
  border-radius: 999px;
  padding: 6px 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 3.8rem);
  color: #fff;
  text-shadow: 0 4px 0 rgba(43, 74, 96, 0.3);
}

.hero .sub { margin-top: 8px; color: #fff; font-weight: 700; opacity: 0.95; }

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(253, 249, 239, 0.92);
  text-align: center;
}

/* ── Board ────────────────────────────────────────────────────────── */
.board-frame {
  position: relative;
  background: linear-gradient(160deg, var(--wood), var(--wood-deep));
  border-radius: 18px;
  padding: 12px 12px 0;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.4),
    0 20px 46px rgba(43, 74, 96, 0.4);
  margin-bottom: 22px;
}

/* candy-striped rails */
.board-frame::before,
.board-frame::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  background: repeating-linear-gradient(-45deg, var(--coral) 0 10px, #fff 10px 20px);
  border-radius: 18px;
}

.board-frame::before { left: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.board-frame::after { right: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }

#board {
  display: block;
  width: 100%;
  height: auto;
  background: #f7ecd9;
  border-radius: 10px 10px 0 0;
}

.slot-labels {
  position: relative;
  display: flex;
  margin: 0 -12px;
  padding: 0 12px;
}

.slot-label {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #fff;
  padding: 10px 4px 12px;
  border-radius: 0 0 6px 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.slot-label.win-0 { background: var(--coral); }
.slot-label.win-1 { background: var(--teal); }
.slot-label.win-2 { background: var(--marigold); }
.slot-label.lose { background: #93857a; opacity: 0.85; }

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 26px 24px 28px;
  box-shadow: 0 16px 40px rgba(43, 74, 96, 0.28);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 18px;
}

/* Fields */
.field { margin-bottom: 14px; }

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

label {
  display: block;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #f8fafb;
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--teal); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.7; }

.fine { margin-top: 12px; text-align: center; color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }

.form-error { color: var(--err); font-weight: 800; text-align: center; margin-top: 12px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 30px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.2;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(120deg, var(--coral), #d94b3e);
  color: #fff;
  box-shadow: 0 6px 0 #a83229;
}

.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 0 #a83229; }

.btn-ghost {
  background: #f8fafb;
  color: var(--ink);
  border: 2px solid var(--line);
  font-size: 0.9rem;
  padding: 10px 20px;
}

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ───────────────────────────────────────────────────────── */
.result-card { text-align: center; margin-top: 12px; }

.result-kicker {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}

.lose-kicker { color: var(--ink-soft); }

.result-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; }

.code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 6px;
  flex-wrap: wrap;
}

.code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  background: var(--ink);
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
}

.qr-wrap { margin: 16px 0 6px; }

.qr-wrap img { width: 150px; height: 150px; border-radius: 10px; border: 4px solid var(--ink); }

.qr-note { color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; margin-top: 8px; }

.expiry { color: var(--coral); font-weight: 800; font-size: 0.9rem; margin-top: 12px; }

.result-note { color: var(--ink-soft); font-weight: 600; margin-top: 12px; font-size: 0.92rem; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .field-grid { grid-template-columns: 1fr; }
  .slot-label { font-size: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .clouds { display: none; }
}
