:root {
  --bg: radial-gradient(circle at 50% 0%, #211f3a 0%, #15131f 60%);
  --bg-solid: #15131f;
  --text: #fff;
  --muted: #a9a6c4;
  --faint: #76739a;
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --field-bg: rgba(0, 0, 0, 0.25);
  --field-border: rgba(255, 255, 255, 0.12);
  --item-bg: rgba(255, 255, 255, 0.03);
  --chip-bg: rgba(255, 255, 255, 0.1);
  --toggle-bg: rgba(255, 255, 255, 0.06);
  --toggle-border: rgba(255, 255, 255, 0.16);
  --accent: #ff5470;
  --accent-2: #ffb23e;
  --accent-3: #33c9a6;
  --max: 1080px;
}
[data-theme="light"] {
  --bg: radial-gradient(circle at 50% 0%, #fbfaff 0%, #eceaf5 60%);
  --bg-solid: #f3f1fa;
  --text: #1a1830;
  --muted: #555077;
  --faint: #8b87a8;
  --panel-bg: #fff;
  --panel-border: rgba(0, 0, 0, 0.08);
  --field-bg: #f4f3fa;
  --field-border: rgba(0, 0, 0, 0.12);
  --item-bg: #f6f5fb;
  --chip-bg: rgba(0, 0, 0, 0.06);
  --toggle-bg: rgba(0, 0, 0, 0.04);
  --toggle-border: rgba(0, 0, 0, 0.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent-2); margin-bottom: 12px;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 640px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 14px 24px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--toggle-bg); border: 1px solid var(--toggle-border); color: var(--text); }
.card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 18px; padding: 22px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.qa-box {
  border-left: 3px solid var(--accent-2); background: var(--panel-bg);
  border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 0 0 28px;
}
.qa-box .qa-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent-2);
}
.faq-item { border-bottom: 1px solid var(--panel-border); padding: 18px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Header */
.hdr {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg-solid) 78%, transparent);
  border-bottom: 1px solid var(--panel-border);
}
.hdr-bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; }
.brand .mark { color: var(--accent-2); transform: rotate(-20deg); }
.brand .dot { color: var(--accent); }
.hdr-nav { display: flex; gap: 24px; align-items: center; }
.hdr-nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.hdr-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  background: var(--toggle-bg); border: 1px solid var(--toggle-border);
  border-radius: 10px; width: 38px; height: 38px; font-size: 16px;
  cursor: pointer; color: var(--text);
}
.burger { display: none; }
.hdr-mobile { display: none; flex-direction: column; padding: 8px 20px 16px; gap: 4px; border-top: 1px solid var(--panel-border); }
.hdr-mobile.open { display: flex; }
.hdr-mobile a { padding: 12px 8px; font-weight: 600; }
@media (max-width: 760px) {
  .hdr-nav { display: none; }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .hdr-cta { display: none; }
}

/* Footer */
.ftr { border-top: 1px solid var(--panel-border); margin-top: 48px; padding: 48px 0 32px; }
.ftr-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 32px; }
.ftr h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin-bottom: 12px; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ftr a { color: var(--muted); font-size: 14px; }
.ftr-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; border-top: 1px solid var(--panel-border); color: var(--faint); font-size: 13px; }
.ftr-legal { display: flex; gap: 16px; }

/* Wheel */
.wheel-app { display: flex; gap: 36px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.stage { display: flex; flex-direction: column; align-items: center; }
.pointer { font-size: 34px; color: var(--accent-2); margin-bottom: -10px; z-index: 3; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.wheel-wrap { position: relative; width: 320px; height: 320px; }
.wheel {
  width: 320px; height: 320px; border-radius: 50%;
  border: 10px solid #fff; box-shadow: 0 18px 50px rgba(0,0,0,.45);
  position: relative; transition: transform 4.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.wheel svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 74px; height: 74px; border-radius: 50%; border: 5px solid var(--bg-solid);
  background: #fff; color: #15131f; font-weight: 800; font-size: 15px;
  letter-spacing: .04em; cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.4);
  z-index: 4; transition: transform .15s ease;
}
.hub:not(:disabled):hover { box-shadow: 0 6px 22px rgba(255,178,62,.5); }
.hub:disabled { opacity: .55; cursor: not-allowed; }
.result { margin-top: 22px; min-height: 56px; text-align: center; }
.result-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-2); font-weight: 700; }
.result-name { display: block; font-size: 28px; font-weight: 800; }
.result-hint { color: var(--faint); font-size: 14px; }
.winner-anim { animation: pop .45s cubic-bezier(.16,1,.3,1); }
.error-box { display: inline-flex; align-items: center; gap: 9px; background: rgba(255,84,112,.14); border: 1px solid rgba(255,84,112,.4); border-radius: 12px; padding: 10px 16px; animation: shake .4s ease; }
.error-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; }
.error-text { color: #ff9fb0; font-size: 14px; font-weight: 600; }
.toggle-row { margin-top: 8px; display: flex; gap: 8px; }
.toggle { background: var(--toggle-bg); border: 1px solid var(--toggle-border); border-radius: 20px; padding: 7px 16px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.panel { width: 320px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 18px; padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.count { background: var(--chip-bg); border-radius: 20px; padding: 2px 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input-row { display: flex; gap: 8px; margin-bottom: 14px; }
.input-row input { flex: 1; background: var(--field-bg); border: 1px solid var(--field-border); border-radius: 10px; padding: 11px 12px; color: var(--text); font-size: 14px; }
.add-btn { background: var(--accent); border: none; border-radius: 10px; padding: 0 18px; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.add-btn:hover { filter: brightness(1.08); }
.opt-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.opt-item { display: flex; align-items: center; gap: 10px; background: var(--item-bg); border-radius: 10px; padding: 9px 10px; }
.opt-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.opt-name { flex: 1; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-remove { background: none; border: none; color: var(--faint); font-size: 20px; cursor: pointer; padding: 0 4px; }
.opt-empty { color: var(--faint); font-size: 14px; text-align: center; padding: 20px 0; }
.panel-foot { display: flex; gap: 8px; margin-top: 14px; }
.ghost { flex: 1; background: transparent; border: 1px solid var(--toggle-border); border-radius: 10px; padding: 9px 0; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.warning { background: rgba(255,178,62,.12); border: 1px solid rgba(255,178,62,.3); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 9px; }
.warn-text { font-size: 13px; color: #ffd591; line-height: 1.4; }
.warn-btn { align-self: flex-start; background: var(--accent-2); border: none; border-radius: 8px; padding: 7px 14px; color: #15131f; font-weight: 700; font-size: 13px; cursor: pointer; }
.raffle-badge { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-shadow: 0 2px 6px rgba(0,0,0,.55); pointer-events: none; }
.raffle-num { font-size: 60px; font-weight: 800; color: #fff; line-height: 1; }
.raffle-word { font-size: 13px; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; }

@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .wheel { transition: transform .8s ease-out; } .error-box { animation: none; } }

/* 3D tilt scene */
.scene { perspective: 1100px; width: 320px; height: 320px; display: flex; align-items: center; justify-content: center; }
.tilt { position: relative; width: 320px; height: 320px; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.ground { position: absolute; left: 50%; top: 50%; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 70%); transform: translate(-50%, -50%) translateZ(-40px); pointer-events: none; }
.rim { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(#d8d8e0, #9a9aa8); transform: translateZ(-26px); box-shadow: 0 0 0 2px rgba(0,0,0,.15); pointer-events: none; }
.wheel-wrap { transform-style: preserve-3d; }
.hub { transition: transform .15s ease; }

/* Recent winners history */
.history { margin-top: 18px; border-top: 1px solid var(--panel-border); padding-top: 14px; }
.history-head { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 700; margin-bottom: 8px; }
.history-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: rgba(255,178,62,.14); color: var(--accent-2); border-radius: 20px; padding: 4px 11px; font-size: 12px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .tilt { transition: transform .2s ease; } }
