/* ==========================================================================
   SpinChakra — hand-authored stylesheet (no framework, no build step)
   1 tokens · 2 base · 3 layout · 4 header/footer · 5 controls · 6 cards
   7 wheel workspace · 8 tools · 9 content · 10 ads · 11 responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --radius-input: 12px;
  --radius-button: 12px;
  --radius-card: 18px;
  --radius-panel: 22px;
  --radius-pill: 9999px;

  --space-8: 0.5rem;
  --space-16: 1rem;
  --space-24: 1.5rem;
  --space-32: 2rem;
  --space-48: 3rem;
  --space-72: 4.5rem;

  /* Light — near-white slate with a violet accent */
  --background: 250 40% 99%;
  --surface: 0 0% 100%;
  --surface-2: 250 30% 97%;
  --foreground: 232 40% 12%;
  --muted-foreground: 232 12% 42%;
  --border: 250 20% 89%;
  --accent: 262 76% 54%;
  --accent-hover: 262 76% 46%;
  --accent-foreground: 0 0% 100%;
  --accent-soft: 262 80% 96%;
  --success: 152 62% 36%;
  --danger: 0 72% 50%;
  --glass: 0 0% 100% / 0.72;

  --tile-h: 262;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --shadow-sm: 0 1px 2px rgb(16 12 40 / 0.05);
  --shadow-card: 0 1px 3px rgb(16 12 40 / 0.05), 0 10px 24px -12px rgb(16 12 40 / 0.16);
  --shadow-lift: 0 2px 6px -2px rgb(16 12 40 / 0.08), 0 22px 44px -18px rgb(16 12 40 / 0.28);
  --shadow-glow: 0 18px 60px -24px hsl(262 76% 54% / 0.55);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 180ms var(--ease);

  --control-h: 2.75rem;
  --container: 1280px;
}

.dark {
  --background: 235 45% 7%;
  --surface: 234 38% 11%;
  --surface-2: 234 32% 15%;
  --foreground: 240 40% 98%;
  --muted-foreground: 235 16% 68%;
  --border: 235 24% 22%;
  --accent: 262 84% 70%;
  --accent-hover: 262 84% 78%;
  --accent-foreground: 235 45% 9%;
  --accent-soft: 262 45% 20%;
  --success: 152 60% 55%;
  --danger: 0 78% 68%;
  --glass: 234 38% 13% / 0.72;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-card: 0 1px 3px rgb(0 0 0 / 0.45), 0 12px 28px -14px rgb(0 0 0 / 0.7);
  --shadow-lift: 0 2px 8px -2px rgb(0 0 0 / 0.5), 0 26px 48px -20px rgb(0 0 0 / 0.85);
  --shadow-glow: 0 20px 70px -26px hsl(262 84% 70% / 0.6);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-16);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.1rem);
}

p {
  margin: 0 0 var(--space-16);
}

a {
  color: hsl(var(--accent));
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg,
canvas {
  max-width: 100%;
}

code {
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: hsl(var(--surface-2));
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.18em;
}

.icon.flip {
  transform: rotate(180deg);
}

:focus-visible {
  outline: 2px solid hsl(var(--accent));
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: 0.75rem 1rem;
  background: hsl(var(--surface));
  border-radius: 0 0 var(--radius-button) 0;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.container-page {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-24);
}

.container-page.narrow {
  max-width: 48rem;
}

main {
  padding-bottom: var(--space-72);
}

.section {
  margin-top: var(--space-48);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
}

.title-md {
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.7rem);
  margin-bottom: var(--space-24);
}

.page-head {
  padding: var(--space-32) 0 var(--space-24);
}

.page-head .lede {
  color: hsl(var(--muted-foreground));
  font-size: 1.075rem;
  max-width: 48rem;
  margin-bottom: 0;
}

.link-more {
  font-weight: 600;
  font-size: 0.925rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  background: hsl(var(--tile-h) 78% 95%);
  color: hsl(var(--tile-h) 62% 42%);
  margin-bottom: var(--space-16);
}

.dark .icon-tile {
  background: hsl(var(--tile-h) 44% 20%);
  color: hsl(var(--tile-h) 84% 76%);
}

.icon-tile .icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* --------------------------------------------------------------------------
   4. Header / footer
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: hsl(var(--glass));
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid hsl(var(--border));
}

.header-bar {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  height: 4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: hsl(var(--foreground));
  font-weight: 700;
  font-size: 1.075rem;
  letter-spacing: -0.03em;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 11px;
  background: linear-gradient(135deg, hsl(262 76% 58%), hsl(199 90% 52%));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.header-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.95rem;
}

.header-nav a {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.header-nav a:hover,
.header-nav a[aria-current="page"] {
  color: hsl(var(--foreground));
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mobile-menu {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--surface));
  padding-block: var(--space-16);
}

.mobile-menu nav {
  display: grid;
  gap: 0.15rem;
}

.mobile-menu a {
  padding: 0.6rem 0;
  color: hsl(var(--foreground));
  font-weight: 500;
}

.site-footer {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--surface-2));
  padding-block: var(--space-48);
  font-size: 0.925rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(5, minmax(0, 1fr));
  gap: var(--space-32);
}

.footer-grid h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.footer-grid a {
  color: hsl(var(--foreground));
}

.footer-about p {
  color: hsl(var(--muted-foreground));
  max-width: 26rem;
}

.footer-about .logo {
  margin-bottom: var(--space-16);
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: hsl(var(--success));
  font-weight: 600;
}

.footer-legal {
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 0.85rem;
}

.footer-legal p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   5. Controls
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--control-h);
  padding-inline: 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition),
    box-shadow var(--transition);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: hsl(var(--accent-hover));
}

.btn-soft {
  background: hsl(var(--accent-soft));
  color: hsl(var(--accent));
  border-color: transparent;
}

.btn-ghost {
  background: hsl(var(--surface));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background: hsl(var(--surface-2));
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-button);
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background var(--transition);
}

.icon-btn:hover {
  background: hsl(var(--surface-2));
}

.menu-btn {
  display: none;
}

.icon-btn-sm {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.icon-btn-sm:hover {
  background: hsl(var(--surface-2));
  color: hsl(var(--foreground));
}

.icon-btn-sm.danger:hover {
  color: hsl(var(--danger));
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--accent));
  cursor: pointer;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  background: hsl(var(--surface-2));
  color: hsl(var(--muted-foreground));
}

.badge-lg {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  background: hsl(var(--accent-soft));
  color: hsl(var(--accent));
  margin-bottom: var(--space-16);
}

.pill {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  padding: 0 0.4rem;
  height: 1.6rem;
  border-radius: var(--radius-pill);
  background: hsl(var(--accent-soft));
  color: hsl(var(--accent));
  font-size: 0.8rem;
  font-weight: 700;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--accent));
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  margin-bottom: var(--space-16);
  box-shadow: var(--shadow-sm);
}

.field label,
.switch span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea,
.bulk-edit textarea,
.copy-row input,
.entry-add input,
.reveal textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-input);
  padding: 0.6rem 0.8rem;
}

.field input[type="text"],
.field input[type="number"],
.field select,
.copy-row input,
.entry-add input {
  height: var(--control-h);
}

.field textarea,
.bulk-edit textarea,
.reveal textarea {
  resize: vertical;
  line-height: 1.5;
}

.field input[type="range"] {
  width: 100%;
  accent-color: hsl(var(--accent));
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

.field-help {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
}

.switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  cursor: pointer;
}

.switch input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: hsl(var(--accent));
}

.switch span {
  margin: 0;
  font-weight: 500;
  font-size: 0.925rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-16);
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
}

/* The read-only share URL is long; without min-width:0 the flex item refuses to
   shrink and blows the whole options column past the container. */
.copy-row input {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: var(--space-24);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: hsl(var(--tile-h) 60% 70% / 0.5);
  text-decoration: none;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-16);
}

.card-top .icon-tile {
  margin-bottom: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.card-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: hsl(var(--accent-soft));
  color: hsl(var(--accent));
  font-size: 0.72rem;
  font-weight: 700;
}

.card-flag .icon {
  width: 0.85em;
  height: 0.85em;
}

.card-body h3 {
  font-size: 1.1rem;
  margin: 0.75rem 0 0.35rem;
}

.card-body p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  margin: 0;
}

.card-foot {
  margin-top: auto;
  padding-top: var(--space-16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

.card-meta .icon {
  width: 0.95em;
  height: 0.95em;
}

.card-open {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: hsl(var(--accent));
  font-weight: 600;
  font-size: 0.9rem;
}

.card:hover .card-open .icon {
  transform: translateX(2px);
}

.card-open .icon {
  transition: transform var(--transition);
}

/* Category landing intro — the rich, crawlable paragraph under the header. */
.category-intro {
  max-width: 52rem;
  margin: 0 0 var(--space-16);
  color: hsl(var(--muted-foreground));
  font-size: 1.02rem;
  line-height: 1.7;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: var(--space-24);
}

.cat-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  padding: var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
}

.cat-card .icon-tile {
  margin-bottom: 0;
}

.cat-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.cat-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.cat-card-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(var(--accent));
}

.cat-card > .icon {
  margin-left: auto;
  color: hsl(var(--muted-foreground));
}

.why {
  margin-top: var(--space-72);
  padding-block: var(--space-48);
  background: hsl(var(--surface-2));
  border-block: 1px solid hsl(var(--border));
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--space-24);
}

.why-card {
  padding: var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
}

.why-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.why-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.925rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   7. Wheel workspace
   -------------------------------------------------------------------------- */
.hero-workspace {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
  background:
    radial-gradient(80% 60% at 20% 0%, hsl(262 84% 60% / 0.16), transparent 60%),
    radial-gradient(70% 60% at 85% 10%, hsl(199 90% 55% / 0.14), transparent 60%);
}

.hero-copy {
  max-width: 46rem;
}

.hero-copy h1 {
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem);
  margin-bottom: 0.35rem;
}

.hero-tagline {
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, hsl(262 76% 58%), hsl(199 90% 52%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: hsl(var(--muted-foreground));
  font-size: 1.05rem;
  margin-bottom: var(--space-16);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-24);
}

/* Wheel + optional desktop sidebar ad. The ad column never overlaps the
   wheel and disappears entirely below 1100px. */
.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-24);
  align-items: start;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(19rem, 22rem);
  gap: var(--space-24);
  align-items: start;
}

.workspace-stage,
.workspace-panels {
  min-width: 0;
}

.workspace-panels {
  display: grid;
  /* minmax(0,1fr), not the implicit auto column, so a wide child (the share
     URL, the embed code) can't size the track past the container. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-16);
}

.wheel-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-16);
  padding: var(--space-24);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-panel);
  background-color: hsl(var(--surface));
  background-repeat: no-repeat;
  background-position: center top;
  box-shadow: var(--shadow-card);
}

.wheel-stage:fullscreen {
  border-radius: 0;
  align-content: center;
  background-color: hsl(var(--background));
}

.wheel-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  text-align: center;
}

.wheel-frame {
  position: relative;
  width: 100%;
  max-width: 39rem;
  aspect-ratio: 1;
  filter: drop-shadow(var(--shadow-glow));
}

.wheel-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  touch-action: manipulation;
}

/* Pointer sits at 3 o'clock — the wheel's 0° — and points inward. */
.wheel-pointer {
  position: absolute;
  top: 50%;
  right: -2px;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-block: 0.85rem solid transparent;
  border-right: 1.5rem solid hsl(var(--foreground));
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.35));
}

.spin-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 24%;
  aspect-ratio: 1;
  min-width: 4.5rem;
  border: 4px solid hsl(var(--surface));
  border-radius: 50%;
  background: linear-gradient(140deg, hsl(262 76% 58%), hsl(232 82% 55%));
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.95rem, 0.7rem + 0.7vw, 1.2rem);
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgb(16 12 40 / 0.7);
  transition: transform 150ms var(--ease), filter var(--transition);
}

.spin-hub:hover {
  transform: translate(-50%, -50%) scale(1.05);
  filter: brightness(1.07);
}

.spin-hub:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.spin-hub:disabled {
  filter: grayscale(0.7);
  cursor: not-allowed;
}

.is-spinning .spin-hub {
  pointer-events: none;
  opacity: 0.9;
}

.winner-banner {
  min-height: 2.6rem;
  margin: 0;
  padding: 0.35rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: hsl(var(--accent));
  background: transparent;
  opacity: 0;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  transform: translateY(4px);
  overflow-wrap: anywhere;
}

.winner-banner.is-visible {
  opacity: 1;
  transform: none;
  background: hsl(var(--accent-soft));
}

.stage-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.stage-tools .btn {
  font-size: 0.875rem;
  padding-inline: 0.85rem;
  min-height: 2.4rem;
}

/* Panels ------------------------------------------------------------------ */
.panel {
  padding: var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  margin: 0;
}

.panel-empty {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  margin: 0;
}

.entry-list {
  list-style: none;
  margin: 0 0 var(--space-16);
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 26rem;
  overflow-y: auto;
  counter-reset: entry;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: hsl(var(--surface-2));
}

.entry-row.is-dragging {
  opacity: 0.55;
}

.entry-grip {
  display: grid;
  place-items: center;
  width: 1.5rem;
  color: hsl(var(--muted-foreground));
  cursor: grab;
}

.entry-label,
.entry-weight {
  font: inherit;
  font-size: 0.925rem;
  color: hsl(var(--foreground));
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  min-width: 0;
}

.entry-label {
  flex: 1;
}

.entry-weight {
  width: 3.6rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.entry-label:focus,
.entry-weight:focus {
  background: hsl(var(--background));
  border-color: hsl(var(--accent));
  outline: none;
}

.entry-tools {
  display: flex;
  gap: 0.1rem;
}

.entry-add {
  display: flex;
  gap: 0.5rem;
}

.entry-add input {
  flex: 1;
}

.bulk-edit {
  margin-top: var(--space-16);
}

.bulk-edit label {
  display: block;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.4rem;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  max-height: 15rem;
  overflow-y: auto;
}

.history-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: hsl(var(--surface-2));
  font-size: 0.9rem;
}

.history-index {
  display: grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: hsl(var(--accent-soft));
  color: hsl(var(--accent));
  font-size: 0.75rem;
  font-weight: 700;
}

.history-label {
  flex: 1;
  overflow-wrap: anywhere;
}

.history-list time {
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.reveal {
  margin-top: var(--space-16);
  padding-top: var(--space-16);
  border-top: 1px solid hsl(var(--border));
}

.reveal label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.qr-holder {
  display: grid;
  place-items: center;
  padding: var(--space-16);
  background: #fff;
  border-radius: var(--radius-input);
  margin-bottom: var(--space-16);
}

.qr-holder svg {
  width: 100%;
  max-width: 15rem;
  height: auto;
}

.qr-holder .panel-empty {
  color: #475569;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 60;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-pill);
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
}

/* Post-spin result dialog ------------------------------------------------- */
.result-modal[hidden] {
  display: none;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: var(--space-16);
}

.result-backdrop {
  position: absolute;
  inset: 0;
  background: hsl(235 45% 5% / 0.55);
  backdrop-filter: blur(2px);
}

.result-dialog {
  position: relative;
  width: min(26rem, 100%);
  padding: var(--space-32) var(--space-24) var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-lift);
  text-align: center;
  animation: result-pop 220ms var(--ease-out);
}

@keyframes result-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

.result-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.result-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.result-winner {
  margin: 0.35rem 0 var(--space-24);
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

/* "Continue to the dedicated wheel" shortcut — the primary CTA when a winning
   option has its own wheel. Full-width above the secondary actions. */
.result-link {
  width: 100%;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
/* Beat `.btn { display: … }` so the hidden attribute actually hides it. */
.result-link[hidden] {
  display: none;
}
.result-link svg {
  transition: transform 0.15s ease;
}
.result-link:hover svg,
.result-link:focus-visible svg {
  transform: translateX(3px);
}

.result-modal-actions {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 420px) {
  .result-modal-actions {
    grid-template-columns: 1fr 1fr;
  }

  .result-modal-actions [data-result-again] {
    grid-column: 1 / -1;
  }
}

/* Consent banner ---------------------------------------------------------- */
.consent {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 65;
  transform: translateX(-50%);
  width: min(46rem, calc(100% - 2rem));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
}

.consent-text {
  flex: 1 1 18rem;
  margin: 0;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.consent-text .icon {
  color: hsl(var(--success));
  margin-right: 0.15rem;
}

.consent-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.consent-actions .btn {
  min-height: 2.4rem;
}

/* Embed view -------------------------------------------------------------- */
body.bare {
  background: hsl(var(--background));
}

.embed-page {
  padding: var(--space-16);
}

.workspace-compact {
  display: block;
}

.embed-credit {
  display: block;
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

/* --------------------------------------------------------------------------
   8. Tool UI
   -------------------------------------------------------------------------- */
.tool {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--space-24);
  padding: var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
}

.field-grid {
  display: grid;
  gap: var(--space-16);
  align-content: start;
}

.result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-24);
  background: hsl(var(--surface-2));
  border-radius: var(--radius-card);
  min-height: 13rem;
}

.result-empty {
  color: hsl(var(--muted-foreground));
  margin: 0;
  text-align: center;
}

.result-headline {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}

.result-detail {
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-16);
}

.result-rows {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.result-rows > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  padding-top: 0.45rem;
  border-top: 1px solid hsl(var(--border));
}

.result-rows dt {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.result-rows dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.tool button[type="submit"] {
  opacity: 0.55;
  pointer-events: none;
}

.tool.is-ready button[type="submit"] {
  opacity: 1;
  pointer-events: auto;
}

.tool-nojs {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
}

.tool.is-ready .tool-nojs {
  display: none;
}

/* --------------------------------------------------------------------------
   9. Content: breadcrumbs, prose, FAQ, premium, 404
   -------------------------------------------------------------------------- */
.breadcrumbs {
  padding-top: var(--space-24);
  font-size: 0.875rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: hsl(var(--muted-foreground));
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumbs a {
  color: hsl(var(--muted-foreground));
}

.faq-list {
  display: grid;
  gap: 0.7rem;
}

.faq-list details {
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  padding: 0 var(--space-24);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-16) 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary .icon {
  color: hsl(var(--muted-foreground));
  transition: transform var(--transition);
}

.faq-list details[open] summary .icon {
  transform: rotate(45deg);
}

.faq-list p {
  color: hsl(var(--muted-foreground));
  margin-top: 0;
}

.prose {
  max-width: 48rem;
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: var(--space-32);
}

.prose ol,
.prose ul {
  padding-left: 1.25rem;
  color: hsl(var(--muted-foreground));
  display: grid;
  gap: 0.4rem;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.steps li {
  position: relative;
  padding-left: 2.4rem;
  color: hsl(var(--foreground));
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: hsl(var(--accent-soft));
  color: hsl(var(--accent));
  font-size: 0.85rem;
  font-weight: 700;
}

.premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-16);
}

.premium-card {
  padding: var(--space-24);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  background: hsl(var(--surface));
}

.premium-card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.premium-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.925rem;
  margin: 0;
}

.not-found {
  padding-top: var(--space-48);
  text-align: center;
}

.not-found .hero-actions {
  justify-content: center;
  margin-bottom: var(--space-48);
}

/* --------------------------------------------------------------------------
   10. Ads — reserved, never over the wheel, collapsed on small screens
   -------------------------------------------------------------------------- */
.ad-slot {
  display: grid;
  place-items: center;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius-card);
  color: hsl(var(--muted-foreground));
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: hsl(var(--surface-2) / 0.5);
}

.ad-top {
  min-height: 90px;
  margin-bottom: var(--space-24);
}

.ad-sidebar {
  min-height: 600px;
  width: 300px;
  position: sticky;
  top: 5rem;
}

.ad-in-content,
.ad-between {
  min-height: 100px;
  margin-block: var(--space-32);
}

/* --------------------------------------------------------------------------
   10b. Discovery — search overlay + Netflix-style browse rows
   -------------------------------------------------------------------------- */
.icon-tile-sm {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  margin-bottom: 0;
}

.icon-tile-sm .icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* Header search trigger */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-button);
  background: hsl(var(--surface-2));
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition);
}

.search-trigger:hover {
  background: hsl(var(--muted));
}

.search-trigger .icon {
  color: hsl(var(--muted-foreground));
}

.search-kbd {
  font-size: 0.72rem;
  font-family: var(--font-sans);
  padding: 0.08rem 0.35rem;
  border: 1px solid hsl(var(--border));
  border-radius: 5px;
  background: hsl(var(--surface));
}

.search-trigger-icon {
  display: none;
}

/* Search overlay */
.search-modal[hidden] {
  display: none;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: clamp(1rem, 6vh, 5rem) 1rem 1rem;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: hsl(235 45% 5% / 0.55);
  backdrop-filter: blur(3px);
}

.search-panel {
  position: relative;
  width: min(40rem, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  animation: result-pop 180ms var(--ease-out);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: var(--space-16);
  border-bottom: 1px solid hsl(var(--border));
}

.search-box > .icon {
  flex: none;
  color: hsl(var(--muted-foreground));
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1.05rem;
  color: hsl(var(--foreground));
}

.search-input:focus {
  outline: none;
}

.search-results {
  overflow-y: auto;
  padding: var(--space-8);
}

.search-hint,
.search-group-label {
  margin: 0;
  padding: 0.6rem 0.6rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.search-empty {
  padding: var(--space-24);
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.s-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-input);
  color: inherit;
}

.s-item:hover,
.s-item[aria-selected="true"] {
  background: hsl(var(--surface-2));
  text-decoration: none;
}

.s-item[aria-selected="true"] {
  box-shadow: inset 0 0 0 1.5px hsl(var(--accent));
}

.s-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.s-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-sub {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.s-item .badge {
  flex: none;
}

body.no-scroll {
  overflow: hidden;
}

/* Browse rows (carousels) */
.browse {
  display: grid;
  gap: var(--space-48);
  margin-top: var(--space-48);
}

/* Grid/flex items default to min-width:auto, which lets the fixed-width card
   track blow the column out to its full content width instead of scrolling.
   Pinning min-width:0 down the chain keeps the track inside the container. */
.browse > .row,
.carousel {
  min-width: 0;
}

.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.row-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  letter-spacing: -0.02em;
}

.row-title .icon {
  color: hsl(var(--accent));
}

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: var(--space-16);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 14px;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border)) transparent;
}

.carousel-track > .card {
  flex: 0 0 auto;
  width: 15.5rem;
  scroll-snap-align: start;
}

.carousel-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 2;
  display: none;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid hsl(var(--border));
  border-radius: 50%;
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: opacity var(--transition), background var(--transition);
}

.carousel.has-overflow .carousel-arrow {
  display: grid;
}

.carousel-prev {
  left: -0.6rem;
}

.carousel-next {
  right: -0.6rem;
}

.carousel-arrow:hover {
  background: hsl(var(--surface-2));
}

.carousel-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

/* On touch devices the track scrolls naturally — arrows would just cover cards. */
@media (hover: none) {
  .carousel-arrow {
    display: none !important;
  }
}

/* My Decisions -------------------------------------------------------------- */
.decisions {
  display: grid;
  gap: var(--space-32);
}

.decisions-nojs {
  color: hsl(var(--muted-foreground));
}

.dec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
}

.dec-head h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.15rem;
}

.dec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.dec-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: 0.85rem 1rem;
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.dec-item .icon-tile-sm {
  margin-bottom: 0;
}

.dec-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dec-title {
  font-weight: 600;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dec-title:hover {
  color: hsl(var(--accent));
}

.dec-meta {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.dec-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
}

.dec-actions .btn {
  min-height: 2.2rem;
  padding-inline: 0.9rem;
}

.decisions-empty {
  text-align: center;
  padding: var(--space-48) var(--space-24);
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius-panel);
}

.decisions-empty .icon-tile {
  margin-inline: auto;
}

.decisions-empty h2 {
  margin-bottom: 0.4rem;
}

.decisions-empty p {
  color: hsl(var(--muted-foreground));
  max-width: 32rem;
  margin-inline: auto;
}

.decisions-empty .hero-actions {
  justify-content: center;
  margin-top: var(--space-24);
}

/* --------------------------------------------------------------------------
   10c. Navigation — categories dropdown, header CTA, mobile bottom nav
   -------------------------------------------------------------------------- */
.header-nav {
  align-items: center;
}

.nav-dd {
  position: relative;
  display: inline-flex;
}

.nav-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

.nav-dd-btn:hover,
.nav-dd-btn.is-active,
.nav-dd.is-open .nav-dd-btn {
  color: hsl(var(--foreground));
}

.nav-dd-btn .icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--transition);
}

.nav-dd.is-open .nav-dd-btn .icon {
  transform: rotate(180deg);
}

.nav-dd-panel {
  position: absolute;
  top: calc(100% + 0.85rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: min(42rem, 92vw);
  padding: var(--space-16);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-lift);
  animation: dd-in 160ms var(--ease-out);
}

.nav-dd-panel[hidden] {
  display: none;
}

@keyframes dd-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}

.nav-dd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
}

.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-input);
  color: inherit;
}

.nav-dd-item:hover {
  background: hsl(var(--surface-2));
  text-decoration: none;
}

.nav-dd-item .icon-tile-sm {
  margin-bottom: 0;
}

.nav-dd-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-dd-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-dd-count {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.nav-dd-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  font-weight: 600;
  font-size: 0.9rem;
}

.header-cta {
  height: 2.5rem;
  padding-inline: 1rem;
  font-size: 0.9rem;
  background: linear-gradient(180deg, hsl(262 78% 60%), hsl(262 76% 50%));
  box-shadow: 0 1px 2px rgb(16 12 40 / 0.2), inset 0 1px 0 hsl(0 0% 100% / 0.18);
}

.header-cta .icon {
  width: 1.05rem;
  height: 1.05rem;
}

.mobile-menu-label {
  margin: 0.85rem 0 0.15rem;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

/* App-style bottom nav — shown only on phones (rules in the 760 block). */
.bottom-nav {
  display: none;
}

/* --------------------------------------------------------------------------
   10e. Wheel workspace — accordion sidebar, similar wheels, empty, celebration
   -------------------------------------------------------------------------- */
.panel-acc {
  padding: 0;
  overflow: hidden;
}

.acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin: 0;
  padding: var(--space-16) var(--space-24);
  cursor: pointer;
  list-style: none;
  transition: background var(--transition);
}

.acc-head::-webkit-details-marker {
  display: none;
}

.acc-head:hover {
  background: hsl(var(--surface-2));
}

.acc-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  font-weight: 600;
}

.acc-title > .icon {
  color: hsl(var(--muted-foreground));
}

.acc-chevron {
  display: inline-flex;
  color: hsl(var(--muted-foreground));
  transition: transform var(--transition);
}

.panel-acc[open] .acc-chevron {
  transform: rotate(180deg);
}

.acc-body {
  display: grid;
  gap: var(--space-16);
  padding: 0 var(--space-24) var(--space-24);
}

.acc-body .switch,
.acc-body .row-actions,
.acc-body .reveal {
  margin-top: 0;
}

.acc-actions {
  display: flex;
  justify-content: flex-end;
}

.panel-empty {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* A display value beats the [hidden] UA rule, so restore it explicitly. */
.panel-empty[hidden] {
  display: none;
}

.panel-empty .icon {
  color: hsl(var(--muted-foreground));
}

/* Similar wheels */
.similar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.similar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-input);
  color: inherit;
}

.similar-item:hover {
  background: hsl(var(--surface-2));
  text-decoration: none;
}

.similar-item .icon-tile-sm {
  margin-bottom: 0;
}

.similar-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-item > .icon:last-child {
  color: hsl(var(--muted-foreground));
}

/* In-wheel empty state */
.wheel-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
}

.workspace.is-empty .wheel-empty {
  display: flex;
}

.workspace.is-empty .spin-hub {
  display: none;
}

.wheel-empty .icon-tile {
  margin-bottom: 0;
}

.wheel-empty p {
  margin: 0;
  max-width: 15rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

/* Winner celebration — a throwaway canvas above everything, never interactive. */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  pointer-events: none;
}

/* A gentle idle pulse invites the first spin (motion-safe, never while spinning). */
@media (prefers-reduced-motion: no-preference) {
  .workspace:not(.is-spinning):not(.is-empty) .spin-hub {
    animation: hub-pulse 2.8s var(--ease) infinite;
  }
}

@keyframes hub-pulse {
  0%,
  100% {
    box-shadow: 0 8px 22px -8px rgb(16 12 40 / 0.7);
  }
  50% {
    box-shadow: 0 10px 30px -6px hsl(262 80% 60% / 0.85);
  }
}

/* --------------------------------------------------------------------------
   10d. Homepage — hero CTAs + stats, browse lead-in, audience band
   -------------------------------------------------------------------------- */
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-24);
}

.btn-lg {
  min-height: 3rem;
  padding-inline: 1.4rem;
  font-size: 1rem;
}

.hero-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-32);
  margin: var(--space-32) 0 0;
  padding: 0;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
}

.hero-stats strong {
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-stats span {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.browse-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
}

.browse-intro .title-md {
  margin-bottom: 0.25rem;
}

.browse-intro-sub {
  margin: 0;
  color: hsl(var(--muted-foreground));
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-24);
}

.audience-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-24);
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.audience-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: hsl(var(--tile-h) 60% 70% / 0.5);
  text-decoration: none;
}

.audience-card h3 {
  font-size: 1.1rem;
  margin: 0.6rem 0 0.35rem;
}

.audience-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.925rem;
  flex: 1;
  margin: 0 0 var(--space-16);
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
/* Collapse the search pill to an icon before the header gets crowded, while
   the full nav + CTA are still shown (down to 760px). */
@media (max-width: 1023px) {
  .search-trigger {
    display: none;
  }

  .search-trigger-icon {
    display: grid;
  }
}

/* The sidebar ad only appears when there's room for it beside a full-size
   wheel — never at the wheel's expense. */
@media (min-width: 1500px) {
  .workspace-shell {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 1499px) {
  .ad-sidebar {
    display: none;
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .tool {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header-nav {
    display: none;
  }

  .menu-btn {
    display: grid;
  }

  .header-actions {
    margin-left: auto;
  }

  /* Swap the roomy search pill for a compact icon button on phones. */
  .search-trigger {
    display: none;
  }

  .search-trigger-icon {
    display: grid;
  }

  /* The header CTA is replaced by the bottom nav's Wheel tab on phones. */
  .header-cta {
    display: none;
  }

  .carousel-track > .card {
    width: 13.5rem;
  }

  .hero-stats {
    gap: var(--space-24);
  }

  .hero-cta-row .btn {
    flex: 1 1 auto;
  }

  /* Bottom navigation */
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    justify-content: space-around;
    padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
    background: hsl(var(--glass));
    backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid hsl(var(--border));
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.4rem 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
  }

  .bottom-nav-item .icon {
    width: 1.35rem;
    height: 1.35rem;
  }

  .bottom-nav-item[aria-current="page"] {
    color: hsl(var(--accent));
  }

  /* Clear the fixed bar so it never covers the last of the content. */
  body {
    padding-bottom: calc(3.9rem + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  .consent {
    bottom: calc(4.25rem + env(safe-area-inset-bottom));
  }

  .container-page {
    padding-inline: var(--space-16);
  }

  .wheel-stage {
    padding: var(--space-16);
  }

  .stage-tools .btn {
    flex: 1 1 8rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-24);
  }

  /* The top banner is a desktop placement — on a phone it would push the
     wheel below the fold, so it is dropped rather than shrunk. */
  .ad-top {
    display: none;
  }

  .hero-workspace {
    padding-top: var(--space-16);
  }

  .hero-sub {
    font-size: 1rem;
    margin-bottom: var(--space-16);
  }

  .winner-banner {
    min-height: 2.2rem;
  }

  .entry-list {
    max-height: 20rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .entry-weight {
    width: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
