:root {
  --ink: #1b1712;
  --paper: #f3ecdf;
  --paper-2: #e7dfd0;
  --brass: #b68b3e;
  --brass-2: #e7d3a1;
  --pine: #234237;
  --danger: #8d2e2e;
  --night: #12100c;
  --muted: #6f675c;
  --line: rgba(27, 23, 18, 0.14);
  font-family: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--paper);
  background: var(--night);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 90% 48% at 50% -8%, rgba(182, 139, 62, 0.34), transparent 58%),
    linear-gradient(180deg, #1c1813 0%, var(--night) 42%);
}

button, input { font: inherit; }

button { cursor: pointer; }

.shell {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.top { margin-bottom: 22px; }

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  color: var(--brass-2);
}

h1 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", Palatino, serif;
  font-size: clamp(40px, 8vw, 56px);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-family: "Fraunces", Palatino, serif;
  font-size: 32px;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(243, 236, 223, 0.08);
  border: 1px solid rgba(231, 211, 161, 0.18);
}

.switch button {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  background: transparent;
  color: var(--paper);
}

.switch button.is-active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}

.screen { margin-top: 18px; }

.screen[hidden] { display: none !important; }

.panel, .ticket {
  background: var(--paper);
  color: var(--ink);
  border-radius: 28px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

form { margin-top: 18px; }

.field { margin-bottom: 12px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.field input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--pine);
}

.field input[aria-invalid="true"] {
  background: #fbf4f1;
  box-shadow: inset 0 0 0 1.5px var(--danger);
}

.error {
  min-height: 0;
  margin: 6px 2px 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.35;
}

.error:empty { display: none; }

.form-error { margin: 0 0 12px; }

.primary, .hub {
  border: 0;
}

.primary {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  background: var(--pine);
  color: var(--paper);
  font-weight: 600;
}

a.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary:disabled, .hub:disabled { cursor: progress; opacity: 0.72; }

.text {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text.light { color: var(--brass-2); }

.ticket { text-align: center; }

.ticket-kicker, .result-kicker, .ticket-kode-label {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}

.ticket-kicker { color: var(--pine); }

.ticket-kode-label {
  margin-top: 18px;
  color: var(--muted);
}

.ticket-kode {
  margin: 4px 0 8px;
  font-family: "Fraunces", Palatino, serif;
  font-size: 72px;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.ticket-note {
  margin: 0 0 14px;
  color: var(--pine);
  font-size: 14px;
  line-height: 1.4;
}

.ticket-note.is-error { color: var(--danger); }

.ticket-data {
  margin: 8px 0 18px;
  text-align: left;
  border-top: 1px dashed rgba(27, 23, 18, 0.25);
}

.ticket-data div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(27, 23, 18, 0.08);
}

.ticket-data dt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket-data dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

body.is-stage .switch { display: none; }

body.is-stage h1 { font-size: 36px; }

.wheel-meta {
  margin: 10px 0 0;
  color: var(--brass-2);
}

.stage {
  position: relative;
  width: min(88vw, 420px);
  margin: 18px auto 0;
  aspect-ratio: 1;
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.38));
}

.pointer {
  position: absolute;
  z-index: 2;
  top: -2px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 28px solid var(--brass-2);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.35));
}

.hub {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f8efd8, #d7b56a 42%, #8d6424 78%);
  color: #1c1408;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow:
    inset 0 0 0 7px rgba(255, 248, 230, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}

.hub:disabled { cursor: default; }

.stage-note, .stage-error {
  text-align: center;
}

.stage-note {
  margin: 16px 0 0;
  color: rgba(243, 236, 223, 0.72);
}

.stage-error { color: #f0b4b0; }

.result {
  margin-top: 16px;
  padding: 16px 18px 18px;
  text-align: center;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
}

.result[hidden] { display: none !important; }

.result-kicker { color: var(--pine); }

.result-prize {
  margin: 6px 0 0;
  font-family: "Fraunces", Palatino, serif;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 3px;
}

body[data-page="hadiah"] .shell {
  width: min(980px, 100%);
}

.claim-status {
  margin: 8px 0 0;
  color: var(--brass-2);
}

.claim-board {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.empty-claim { margin: 0; }

.claim-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 24px;
  padding: 18px 18px 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.claim-prize {
  margin: 0;
  font-family: "Fraunces", Palatino, serif;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.claim-card .ticket-data { margin-top: 8px; }

@media (min-width: 860px) {
  .claim-board { grid-template-columns: 1fr 1fr; }
  .empty-claim { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  #wheel { transition: none !important; }
}
