:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #6d28d9;
  --accent-ink: #ffffff;
  --pop: #0f172a;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 18px; }

/* header / footer / crumbs */
.site-head { border-bottom: 1px solid var(--line); background: var(--card); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 800; font-size: 19px; color: var(--pop); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.nav a { color: var(--muted); font-size: 15px; margin-left: 18px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 18px 0 4px; }
.crumbs a { color: var(--muted); }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 10px 0 14px; }
.lead { color: var(--muted); margin: 0 0 20px; }
h2 { font-size: 20px; margin: 30px 0 12px; letter-spacing: -.01em; }
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 50px; color: var(--muted); font-size: 14px; background: var(--card); }
.site-foot a { color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* the tool: wheel stage + controls, side by side on wide screens */
.tool { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; margin: 8px 0 18px; }
.wheel-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.wheel-holder { width: 100%; max-width: 440px; }
.wheel-svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 6px 16px rgba(15,23,42,.18)); }
.wheel-rot { transform-box: fill-box; transform-origin: center; }
.wheel-label { fill: #ffffff; font-family: inherit; font-weight: 700; paint-order: stroke; stroke: rgba(15,23,42,.35); stroke-width: 2.4px; }
.wheel-hub { fill: #ffffff; stroke: #e2e8f0; stroke-width: 2; }
.wheel-hub-dot { fill: var(--accent); }
.wheel-pointer { fill: var(--pop); stroke: #ffffff; stroke-width: 2; }

.spin-btn {
  font: inherit; font-weight: 800; font-size: 20px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px;
  padding: 14px 46px; letter-spacing: .02em; box-shadow: var(--shadow);
}
.spin-btn:hover { filter: brightness(1.08); }
.spin-btn:disabled { opacity: .55; cursor: default; }

.result {
  width: 100%; max-width: 440px; min-height: 30px; text-align: center;
  font-size: 18px; font-weight: 600; color: var(--muted);
}
.result.win { color: var(--ink); }
.result .who { color: var(--accent); font-weight: 800; font-size: 22px; }

/* controls */
.controls { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.controls label.lbl { display: block; font-size: 13px; color: var(--muted); margin: 0 0 5px; font-weight: 600; }
textarea {
  width: 100%; min-height: 240px; resize: vertical; padding: 12px 13px; font-size: 15px;
  line-height: 1.5; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.toggle input { width: auto; }
.mini-btn { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; }
.mini-btn:hover { border-color: var(--accent); }
.count { font-size: 13px; color: var(--muted); margin-left: auto; }

/* link grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 10px; }
.grid a { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink); font-size: 15px; }
.grid a:hover { border-color: var(--accent); text-decoration: none; }
.chip-emoji { margin-right: 6px; }

/* prose + ads */
.prose { margin: 22px 0; }
.prose p { margin: 0 0 14px; }
.ad-slot {
  margin: 22px 0;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #eef2f6, #eef2f6 10px, #f4f7fa 10px, #f4f7fa 20px);
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #94a3b8; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}

@media (max-width: 780px) {
  .tool { grid-template-columns: 1fr; }
  .wheel-holder { max-width: 380px; }
}
@media (max-width: 620px) {
  h1 { font-size: 23px; }
  .spin-btn { width: 100%; }
}
