[hidden] {
  display: none !important;
}
:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f0eff8;
  --text: #171525;
  --muted: #6f6b80;
  --border: #e7e4ef;
  --accent: #6d5dfc;
  --accent-dark: #5545e8;
  --shadow: 0 18px 55px rgba(34, 28, 75, .12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 10% 0%, #eeeaff 0, transparent 30%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, textarea, select { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar {
  height: 74px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.82); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand img { filter: drop-shadow(0 5px 8px rgba(109,93,252,.2)); }
.brand strong { color: var(--accent); }
.topnav { display: flex; gap: 8px; }
.nav-btn, .secondary-btn, .primary-btn, .text-btn, .icon-btn {
  border: 0; background: transparent; color: var(--text); border-radius: 12px; padding: 10px 14px; font-weight: 700;
}
.nav-btn:hover, .secondary-btn:hover, .icon-btn:hover { background: var(--surface-2); }
.nav-btn.accent, .primary-btn {
  color: white; background: linear-gradient(135deg, var(--accent), #8b6cff); box-shadow: 0 8px 20px rgba(109,93,252,.25);
}
.primary-btn:hover { transform: translateY(-1px); }
.app-shell { max-width: 1320px; margin: 0 auto; padding: 42px 24px 70px; }

.hero { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 30px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; font-weight: 900; color: var(--accent); }
.hero h1 { font-size: clamp(38px, 5vw, 64px); line-height: .98; letter-spacing: -.045em; margin: 9px 0 15px; }
.hero h1 span { color: var(--accent); }
.hero p { max-width: 650px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.quick-stats { display: flex; gap: 12px; }
.quick-stats div { min-width: 110px; padding: 14px 16px; background: rgba(255,255,255,.75); border: 1px solid var(--border); border-radius: 16px; text-align: center; }
.quick-stats b { display: block; font-size: 21px; }
.quick-stats span { color: var(--muted); font-size: 12px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .8fr); gap: 22px; align-items: stretch; }
.wheel-card, .entries-card { background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.wheel-card { padding: 24px; }
.wheel-stage { position: relative; width: min(100%, 690px); aspect-ratio: 1; margin: auto; display: grid; place-items: center; }
#wheelCanvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 20px rgba(30,20,70,.14)); }
.pointer {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  z-index: 5; width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent;
  border-top: 42px solid #171525; filter: drop-shadow(0 4px 4px rgba(0,0,0,.18));
}
.spin-button {
  position: absolute; width: 116px; height: 116px; border-radius: 50%; border: 8px solid rgba(255,255,255,.9);
  color: white; background: linear-gradient(145deg, var(--accent), #8b6cff); box-shadow: 0 12px 30px rgba(77,59,190,.3);
  display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 6;
}
.spin-button span { font-size: 22px; font-weight: 1000; letter-spacing: .08em; }
.spin-button small { opacity: .8; font-size: 9px; margin-top: 3px; }
.spin-button:active { transform: scale(.97); }
.spin-button:disabled { cursor: wait; opacity: .8; }
.wheel-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding-top: 15px; }

.entries-card { padding: 24px; display: flex; flex-direction: column; min-height: 640px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; }
.card-heading h2 { margin: 5px 0 16px; font-size: 25px; }
.icon-btn { font-size: 22px; width: 42px; height: 42px; padding: 0; }
#entriesInput {
  width: 100%; flex: 1; min-height: 360px; resize: vertical; border: 1px solid var(--border); border-radius: 16px;
  background: #faf9fd; padding: 16px; outline: none; color: var(--text); line-height: 1.65;
}
#entriesInput:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(109,93,252,.1); }
.entry-tools { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px 14px; color: var(--muted); font-size: 12px; }
.text-btn { color: var(--accent); padding: 4px 0; }
.tip-box { display: flex; gap: 10px; background: #f5f3ff; border: 1px solid #e8e3ff; padding: 12px; border-radius: 14px; font-size: 12px; color: #5f5875; line-height: 1.5; }
.tip-box p { margin: 0; }

.features { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 22px; }
.features article, .about { background: rgba(255,255,255,.82); border: 1px solid var(--border); border-radius: 20px; padding: 24px; }
.feature-icon { font-size: 28px; }
.features h3 { margin: 12px 0 7px; }
.features p, .about p { color: var(--muted); line-height: 1.6; margin: 0; }
.about { margin-top: 18px; text-align: center; }
.about h2 { margin: 0 0 8px; font-size: 25px; }

.footer { padding: 26px 4vw; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20,16,36,.58); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(6px); }
.modal { width: min(520px, 100%); background: white; border-radius: 24px; padding: 30px; box-shadow: 0 30px 100px rgba(0,0,0,.25); position: relative; }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: var(--surface-2); width: 38px; height: 38px; border-radius: 50%; font-size: 24px; }
.modal h2 { font-size: 34px; margin: 7px 0 24px; letter-spacing: -.03em; }
.winner-modal { text-align: center; overflow: hidden; }
.winner-modal h2 { font-size: clamp(38px, 8vw, 64px); color: var(--accent); overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: center; gap: 10px; }
.settings-grid { display: grid; gap: 16px; margin-bottom: 22px; }
.settings-grid label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; color: var(--muted); }
.settings-grid select { border: 1px solid var(--border); padding: 12px; border-radius: 12px; background: white; color: var(--text); }
.toggle-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; }
.toggle-row input { accent-color: var(--accent); width: 18px; height: 18px; }
.full { width: 100%; padding: 13px 16px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #171525; color: white; padding: 12px 18px; border-radius: 12px; z-index: 80; transition: .25s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

.confetti { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, #6d5dfc 2px, transparent 3px), radial-gradient(circle, #ffb84d 2px, transparent 3px), radial-gradient(circle, #ff6b9d 2px, transparent 3px); background-size: 52px 52px, 61px 61px, 73px 73px; opacity: .18; animation: drift .8s ease-out; }
@keyframes drift { from { transform: translateY(-20px) scale(.9); opacity: 0; } to { transform: none; opacity: .18; } }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .entries-card { min-height: 500px; }
  #entriesInput { min-height: 250px; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 16px; height: 64px; }
  .brand span { font-size: 13px; }
  .topnav .nav-btn:not(.accent) { display: none; }
  .app-shell { padding: 30px 14px 50px; }
  .hero { display: block; }
  .quick-stats { margin-top: 18px; }
  .quick-stats div { flex: 1; }
  .wheel-card, .entries-card { padding: 14px; border-radius: 18px; }
  .spin-button { width: 92px; height: 92px; border-width: 6px; }
  .spin-button span { font-size: 18px; }
  .features { grid-template-columns: 1fr; }
  .footer { display: block; text-align: center; line-height: 2; }
}
