:root {
  --bg: #2a0a10;
  --bg2: #4a1018;
  --paper: #fbf3e4;
  --ink: #2a1a14;
  --muted: #8a6f5f;
  --gold: #e3b34c;
  --gold-d: #b8862a;
  --red: #b3202c;
  --green: #1f5b45;
  --line: #e6d6bb;
  --radius: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--paper);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--bg2), transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(227,179,76,.06) 0 2px, transparent 3px) 0 0/48px 48px,
    radial-gradient(circle at 70% 30%, rgba(227,179,76,.05) 0 1.5px, transparent 2.5px) 0 0/36px 36px,
    var(--bg);
  min-height: 100vh;
}
h1, h2, .display {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 .3rem; color: var(--gold); }
.sub { color: #e9cfc0; opacity: .85; margin: 0 0 2rem; }
.wrap { max-width: 880px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.center { text-align: center; }
.card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.03);
}
.card + .card { margin-top: 1.25rem; }
.card h2 { margin: 0 0 1rem; font-size: 1.35rem; color: var(--red); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
input, textarea {
  width: 100%; font: inherit; padding: .7rem .85rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(227,179,76,.3); }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px;
  padding: .7rem 1.1rem; background: var(--red); color: #fff;
  transition: transform .08s, filter .15s;
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none;
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-sm { padding: .4rem .65rem; font-size: .85rem; border-radius: 8px; }
.row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 200px; }
.error { color: var(--red); font-size: .9rem; margin-top: .6rem; min-height: 1.2em; }
.muted { color: var(--muted); font-size: .9rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
td.actions { text-align: right; white-space: nowrap; }
.pill { display: inline-block; font-size: .78rem; padding: .2rem .55rem; border-radius: 99px; font-weight: 600; }
.pill.ok { background: #dcefe5; color: var(--green); }
.pill.wait { background: #f3e6cf; color: #8a5a10; }
.secret { filter: blur(6px); user-select: none; transition: filter .2s; }
.secret.show { filter: none; user-select: auto; }
.link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; color: var(--muted); }
.banner { background: #f3e6cf; color: #6b4708; border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; margin-bottom: 1rem; }

/* ---------- wheel ---------- */
.stage { position: relative; width: min(88vw, 520px); aspect-ratio: 1; margin: 1rem auto 2rem; }
.stage canvas { width: 100%; height: 100%; display: block; border-radius: 50%;
  box-shadow: 0 0 0 10px var(--gold-d), 0 0 0 14px var(--gold), 0 30px 80px rgba(0,0,0,.55); }
.pointer {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 22px solid transparent; border-right: 22px solid transparent;
  border-top: 46px solid var(--paper); filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); z-index: 2;
}
.hub {
  position: absolute; inset: 50% auto auto 50%; width: 18%; aspect-ratio: 1; transform: translate(-50%,-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c9, var(--gold) 45%, var(--gold-d));
  box-shadow: 0 4px 14px rgba(0,0,0,.45); z-index: 2; display: grid; place-items: center;
  font-size: clamp(1.2rem, 4vw, 2rem);
}
.stage.shake { animation: shake .35s ease-out; }
@keyframes shake {
  0%{transform:translate(0,0)} 20%{transform:translate(-6px,2px)} 40%{transform:translate(5px,-3px)}
  60%{transform:translate(-3px,2px)} 80%{transform:translate(2px,-1px)} 100%{transform:translate(0,0)}
}
.spin-btn { font-size: 1.25rem; padding: 1rem 2.2rem; border-radius: 99px; background: var(--gold); color: var(--ink);
  box-shadow: 0 8px 0 var(--gold-d), 0 14px 30px rgba(0,0,0,.4); }
.spin-btn:active { transform: translateY(4px); box-shadow: 0 4px 0 var(--gold-d), 0 8px 20px rgba(0,0,0,.4); }

.result { margin-top: 1.5rem; opacity: 0; transform: translateY(10px) scale(.96); transition: all .5s cubic-bezier(.2,1.4,.4,1); }
.result.show { opacity: 1; transform: none; }
.result .ticket {
  display: inline-block; background: var(--paper); color: var(--ink); padding: 1.2rem 2rem 1.4rem;
  border-radius: 12px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,.4);
  border: 2px dashed var(--gold-d);
}
.result .ticket small { display: block; color: var(--muted); font-size: .85rem; margin-bottom: .2rem; }
.result .ticket strong { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: clamp(2rem, 7vw, 3.2rem); color: var(--red); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
