:root {
  --pine: #12372a;
  --pine-deep: #09261c;
  --cream: #fffaf0;
  --paper: #fffdf8;
  --red: #b13a32;
  --red-dark: #8d2924;
  --gold: #d6a84b;
  --ink: #19352b;
  --muted: #68776f;
  --line: #e7dfcf;
  --shadow: 0 22px 60px rgba(5, 31, 22, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.12) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 25%, rgba(255,255,255,.1) 0 2px, transparent 3px),
    linear-gradient(145deg, var(--pine-deep), var(--pine) 55%, #1d503d);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before, body::after {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  pointer-events: none;
}
body::before { top: -120px; left: -100px; }
body::after { right: -120px; bottom: -130px; }

.shell { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 60px 0 32px; }
.hero { color: white; text-align: center; margin-bottom: 30px; }
.mark { color: var(--gold); font-size: 30px; margin-bottom: 5px; }
.eyebrow, .step { margin: 0 0 8px; color: var(--gold); font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 8vw, 4rem); font-weight: 500; line-height: 1.05; }
.lede { max-width: 510px; margin: 16px auto 0; color: rgba(255,255,255,.74); line-height: 1.65; }

.card { position: relative; overflow: hidden; padding: clamp(22px, 5vw, 38px); border: 1px solid rgba(255,255,255,.7); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--red), var(--gold), var(--pine)); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; font-weight: 500; }
.count { white-space: nowrap; padding: 7px 12px; border-radius: 999px; color: var(--pine); background: #edf3ed; font-size: .8rem; font-weight: 750; }

label { display: block; margin-bottom: 8px; font-size: .86rem; font-weight: 750; }
.input-row { display: flex; gap: 10px; }
input { min-width: 0; flex: 1; height: 49px; padding: 0 15px; border: 1px solid #d5d2c8; border-radius: 12px; background: white; color: var(--ink); font: inherit; font-size: 1rem; outline: none; transition: border .2s, box-shadow .2s; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(214,168,75,.18); }
.hint { margin: 9px 0 0; color: var(--muted); font-size: .78rem; }

.button { display: inline-flex; min-height: 49px; align-items: center; justify-content: center; gap: 9px; padding: 0 19px; border: 0; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer; transition: transform .15s, background .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.button.primary { color: white; background: var(--red); box-shadow: 0 9px 24px rgba(177,58,50,.22); }
.button.primary:hover:not(:disabled) { background: var(--red-dark); }
.button.secondary { color: var(--pine); background: #e9efe9; }
.button.full { width: 100%; margin-top: 20px; }
.button:disabled { cursor: not-allowed; opacity: .42; }

.people { display: grid; gap: 9px; margin: 23px 0 0; padding: 0; list-style: none; }
.person { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; animation: enter .25s ease-out; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; color: white; background: var(--pine); font-family: Georgia, serif; font-weight: 700; }
.person-name { flex: 1; overflow-wrap: anywhere; font-weight: 700; }
.person-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.household { margin-top: 2px; color: var(--muted); font-size: .73rem; }
.household.opened { color: #33764f; font-weight: 750; }
.remove { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #8a5e59; background: transparent; font-size: 1.25rem; cursor: pointer; }
.remove:hover { color: var(--red); background: #faecea; }
.empty { margin: 24px 0 5px; padding: 25px; border: 1px dashed #d9d2c2; border-radius: 14px; color: var(--muted); text-align: center; }
.empty span { font-size: 2rem; }
.empty p { margin: 8px 0 0; }
.message { min-height: 20px; margin: 14px 0 0; color: var(--red); font-size: .85rem; font-weight: 650; }

.reveal { text-align: center; }
.reveal .section-heading { text-align: left; }
.handover, .result { padding: 30px 10px 8px; }
.handover > p:first-child, .result > p:first-child { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.handover strong, .result strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 8vw, 3.6rem); font-weight: 500; overflow-wrap: anywhere; }
.result strong { color: var(--red); }
.privacy { margin: 16px 0 0; color: var(--muted); font-size: .88rem; }
.link-intro { margin: -8px 0 20px; color: var(--muted); line-height: 1.55; }
.links .person { padding-left: 16px; }
.copy { min-height: 38px; padding: 0 12px; font-size: .78rem; }
.small-note { margin: 18px 0 0; color: var(--muted); font-size: .78rem; }
.wheel-wrap { position: relative; width: min(300px, 80vw); margin: 32px auto 10px; }
.wheel { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border: 9px solid #f4e6bd; border-radius: 50%; box-shadow: 0 10px 30px rgba(9,38,28,.22), inset 0 0 0 5px rgba(255,255,255,.45); transform: rotate(0); }
.wheel::before, .wheel::after { content: ""; position: absolute; inset: 8%; border: 2px dashed rgba(255,255,255,.55); border-radius: 50%; }
.wheel::after { inset: 24%; border-style: solid; }
.wheel-labels { position: absolute; z-index: 2; inset: 0; }
.wheel-name { position: absolute; top: 50%; left: 50%; width: 39%; overflow: hidden; color: white; font-size: var(--label-size, 12px); font-weight: 850; line-height: 1; text-align: center; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.55); white-space: nowrap; transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-102px) rotate(calc(-1 * var(--angle))); }
.wheel-name-2, .wheel-name-3 { color: #18382c; text-shadow: 0 1px rgba(255,255,255,.45); }
.wheel-center { position: absolute; z-index: 3; inset: 50% auto auto 50%; display: grid; width: 58px; height: 58px; place-items: center; border: 5px solid #f4e6bd; border-radius: 50%; color: var(--gold); background: var(--pine-deep); font-size: 1.5rem; transform: translate(-50%, -50%); }
.pointer { position: absolute; z-index: 4; top: -12px; left: 50%; width: 0; height: 0; border-top: 0; border-right: 18px solid transparent; border-bottom: 36px solid var(--gold); border-left: 18px solid transparent; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); transform: translateX(-50%) rotate(180deg); }
.wheel.spinning { animation: wheel-spin 4s cubic-bezier(.12,.58,.08,1) forwards; }
.wheel-winner { position: absolute; z-index: 5; inset: 50% auto auto 50%; width: 76%; padding: 13px 18px; border: 3px solid var(--gold); border-radius: 14px; color: white; background: rgba(9,38,28,.94); box-shadow: 0 12px 35px rgba(0,0,0,.3); transform: translate(-50%, -50%); animation: winner-pop .45s ease-out; }
.wheel-winner span { display: block; margin-bottom: 3px; color: #ead9a9; font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.wheel-winner strong { display: block; overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 7vw, 2.2rem); font-weight: 500; }
@keyframes wheel-spin { from { transform: rotate(0); } to { transform: rotate(var(--spin-end)); } }
@keyframes winner-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.72); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

@media (max-width: 390px) {
  .wheel-name { transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-88px) rotate(calc(-1 * var(--angle))); }
}
.gift { margin-top: 18px; font-size: 3rem; animation: bounce .6s ease-out; }
.finished { padding: 28px 5px 8px; }
.finished p { color: var(--muted); line-height: 1.6; }
.finish-icon { margin-bottom: 14px; color: var(--gold); font-size: 3.4rem; }
footer { padding: 24px 10px 0; color: rgba(255,255,255,.62); font-size: .75rem; line-height: 1.5; text-align: center; }
.hidden { display: none !important; }

@keyframes enter { from { opacity: 0; transform: translateY(-5px); } }
@keyframes bounce { 0% { transform: scale(.5) rotate(-8deg); } 70% { transform: scale(1.08) rotate(3deg); } 100% { transform: scale(1); } }

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 680px); padding-top: 35px; }
  .card { border-radius: 18px; }
  .input-row { align-items: stretch; flex-direction: column; }
  .section-heading { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
