/* ===== Spin the Wheel — styles =====
   Mobile-first, minimal, no web fonts (keeps load time + CWV high). */

:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --ink: #1d1b2e;
  --ink-soft: #545167;
  --brand: #6c2bd9;
  --brand-dark: #5421ad;
  --accent: #f5a623;
  --border: #e3e0ee;
  --shadow: 0 6px 24px rgba(40, 24, 90, 0.08);
  --radius: 14px;
  --maxw: 1040px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 18px;
}

a { color: var(--brand-dark); }

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, var(--brand), #9333ea);
  color: #fff;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding-block: 16px;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.tagline {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ===== Hero / tool ===== */
.hero { padding-block: 26px 12px; text-align: center; }
h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.subhead {
  margin: 0 auto 22px;
  max-width: 640px;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.tool {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 860px) {
  .tool { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); text-align: left; }
}

/* Wheel */
.wheel-area { display: flex; justify-content: center; }
.wheel-stage {
  position: relative;
  width: min(92vw, 460px);
  aspect-ratio: 1 / 1;
}
#wheel {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  box-shadow: var(--shadow);
  background: var(--surface);
  touch-action: manipulation;
}
.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 26px solid var(--accent);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
  z-index: 3;
}
.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22%;
  height: 22%;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.4vw, 1.1rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  z-index: 2;
  transition: transform 0.08s ease, background 0.2s ease;
}
.spin-btn:hover { background: var(--brand-dark); }
.spin-btn:active { transform: translate(-50%, -50%) scale(0.94); }
.spin-btn:disabled { opacity: 0.55; cursor: default; }

/* Controls */
.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  text-align: left;
}
.controls-label, .presets-label {
  font-weight: 700;
  font-size: 0.9rem;
}
textarea#options {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.98rem;
  resize: vertical;
  min-height: 130px;
  background: #fbfaff;
}
textarea#options:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

.presets { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }

.toggles { margin-top: 16px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }

.action-row { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary:hover { color: var(--brand-dark); }
.share-status { margin: 8px 0 0; min-height: 1.2em; font-size: 0.85rem; color: var(--brand-dark); }

/* ===== Ad slots (placeholders) ===== */
.ad-slot {
  margin: 28px auto;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: #b4afc4;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: repeating-linear-gradient(45deg, #fafaff, #fafaff 12px, #f3f1fb 12px, #f3f1fb 24px);
}

/* ===== Content sections ===== */
.content { padding-block: 18px; }
.content h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  margin: 14px 0 10px;
  letter-spacing: -0.02em;
}
.content p { color: var(--ink-soft); max-width: 760px; }
.use-cases {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
}
@media (min-width: 640px) { .use-cases { grid-template-columns: 1fr 1fr; } }
.use-cases li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink-soft);
}
.use-cases strong { color: var(--ink); }

.faq h3 { margin: 18px 0 4px; font-size: 1.08rem; }
.faq p { margin-top: 0; }
code {
  background: #efecf9;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.88em;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 30px;
  background: #1d1b2e;
  color: #c9c5da;
  padding-block: 22px;
  font-size: 0.9rem;
}
.site-footer a { color: #d7b6ff; }
.copyright { opacity: 0.7; margin-bottom: 0; }

/* ===== Result modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 45, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 26px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 18px 50px rgba(20, 14, 45, 0.35);
  animation: pop 0.25s ease;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-emoji { font-size: 2.6rem; margin: 0; }
.modal-card h2 { margin: 4px 0 2px; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); }
.result-value { font-size: 1.7rem; font-weight: 800; margin: 6px 0 18px; word-break: break-word; color: var(--brand-dark); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .modal-card { animation: none; }
}
