/* ===== Trope Machine — Soft Pop Claymorphism ===== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Nunito:wght@500;700;800&display=swap');

:root {
  --bg: #f3eefe;
  --bg-2: #e8e0fb;
  --clay: #fbf9ff;
  --clay-deep: #ece6fa;
  --ink: #2d2450;
  --ink-2: #5d5482;
  --muted: #8f88ad;
  --pop: #ff7a90;          /* coral — primary action */
  --pop-2: #ffd166;        /* butter — lock */
  --pop-3: #7ed9b8;        /* mint — success */
  --pop-4: #9d8cff;        /* lilac — secondary */
  --hi: rgba(255,255,255,.9);
  --lo: rgba(72, 48, 140, .18);
  --lo-2: rgba(72, 48, 140, .10);
  /* clay shadow = soft drop + inner highlight + inner shade */
  --clay-shadow: 0 10px 24px -8px var(--lo), 0 2px 0 var(--hi) inset, 0 -4px 10px -6px var(--lo) inset;
  --clay-shadow-hover: 0 16px 32px -10px var(--lo), 0 2px 0 var(--hi) inset, 0 -4px 10px -6px var(--lo) inset;
  --clay-pressed: 0 3px 8px -4px var(--lo), 0 4px 10px -4px var(--lo) inset;
  --r: 22px; --r-sm: 14px; --r-pill: 999px;
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --ease: cubic-bezier(.34, 1.4, .5, 1);      /* springy */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
[data-theme="dark"] {
  --bg: #221c3a;
  --bg-2: #1a152e;
  --clay: #2f2750;
  --clay-deep: #271f45;
  --ink: #f3eeff;
  --ink-2: #c9c0ea;
  --muted: #8f86b6;
  --pop: #ff8aa0;
  --pop-2: #ffd97a;
  --pop-3: #8fe3c4;
  --pop-4: #a99cff;
  --hi: rgba(255,255,255,.12);
  --lo: rgba(0, 0, 0, .45);
  --lo-2: rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body); font-weight: 700;
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg-2), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, var(--bg-2), transparent 60%),
              var(--bg);
  color: var(--ink);
  display: flex; flex-direction: column;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--pop-4); outline-offset: 3px; border-radius: var(--r-pill); }
kbd {
  font-family: var(--font-body); font-size: .68em; font-weight: 800;
  color: var(--ink-2); background: var(--clay-deep);
  border-radius: 6px; padding: .1em .45em; margin-left: .4em; vertical-align: middle;
  box-shadow: 0 2px 0 var(--lo-2);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Header ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.6rem;
}
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark {
  width: 2.4rem; height: 2.4rem; border-radius: 12px;
  background: url('../favicon.svg') center / contain no-repeat;
  box-shadow: 0 8px 18px -6px var(--pop), 0 2px 0 var(--hi) inset;
  position: relative;
}
.brand-name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: .01em; }
.brand-tag {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); background: var(--clay);
  border-radius: var(--r-pill); padding: .3rem .75rem;
  box-shadow: var(--clay-shadow);
}
.controls { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* genre select, styled as a clay pill */
.genre-select {
  font: inherit; font-weight: 800; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2); background: var(--clay);
  border: 0; border-radius: var(--r-pill); padding: .35rem 1.9rem .35rem .85rem;
  box-shadow: var(--clay-shadow); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  transition: transform .18s var(--ease), box-shadow .18s;
}
.genre-select:hover { transform: translateY(-2px); box-shadow: var(--clay-shadow-hover); }
.genre-select:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.credit { flex-basis: 100%; text-align: center; font-weight: 700; }
.credit a { color: var(--pop); text-decoration: none; font-weight: 800; border-bottom: 2px solid var(--pop); }
.credit a:hover { color: var(--pop-4); border-color: var(--pop-4); }
@media (min-width: 900px) { .credit { flex-basis: auto; } }

/* ---- Buttons (clay pills) ---- */
.btn {
  font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer;
  background: var(--clay); color: var(--ink);
  border: 0; border-radius: var(--r-pill);
  padding: .65rem 1.15rem;
  box-shadow: var(--clay-shadow);
  transition: transform .18s var(--ease), box-shadow .18s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--clay-shadow-hover); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: var(--clay-pressed); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(160deg, #ff8ea3, var(--pop));
  color: #fff;
  box-shadow: 0 10px 24px -8px var(--pop), 0 2px 0 rgba(255,255,255,.5) inset, 0 -4px 10px -6px rgba(120,0,40,.35) inset;
}
.btn-primary kbd { color: #fff; background: rgba(255,255,255,.22); box-shadow: 0 2px 0 rgba(120,0,40,.25); }
.btn-primary:hover { box-shadow: 0 16px 30px -10px var(--pop), 0 2px 0 rgba(255,255,255,.5) inset, 0 -4px 10px -6px rgba(120,0,40,.35) inset; }
.btn-icon { width: 2.6rem; height: 2.6rem; padding: 0; display: grid; place-items: center; }
#btn-chaos.active {
  background: linear-gradient(160deg, #ffd36e, var(--pop-4, #ff8ea3));
  color: #3a2100;
  box-shadow: 0 10px 24px -8px rgba(255, 180, 40, .55), 0 2px 0 rgba(255,255,255,.5) inset;
}
.count {
  display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .4rem;
  margin-left: .4rem; border-radius: var(--r-pill);
  font-size: .68rem; background: var(--pop-4); color: #fff;
}

.btn-cta {
  text-decoration: none; display: inline-flex; align-items: center;
  background: linear-gradient(160deg, #b3a6ff, var(--pop-4)); color: #fff;
  box-shadow: 0 10px 24px -8px var(--pop-4), 0 2px 0 rgba(255,255,255,.45) inset, 0 -4px 10px -6px rgba(40,20,120,.35) inset;
}
.btn-cta:hover { box-shadow: 0 16px 30px -10px var(--pop-4), 0 2px 0 rgba(255,255,255,.45) inset, 0 -4px 10px -6px rgba(40,20,120,.35) inset; }

/* theme glyph — sun/moon blob */
.theme-glyph {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--pop-2);
  box-shadow: 0 0 0 3px var(--clay-deep), 0 0 14px var(--pop-2);
  transition: transform .5s var(--ease), clip-path .4s, background .3s;
}
[data-theme="dark"] .theme-glyph { background: var(--pop-4); clip-path: circle(50% at 65% 40%); box-shadow: 0 0 0 3px var(--clay-deep), 0 0 14px var(--pop-4); }

.icon-btn {
  font: inherit; font-weight: 800; cursor: pointer; line-height: 1;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  background: var(--clay-deep); color: var(--ink-2);
  border: 0; border-radius: 50%;
  box-shadow: 0 3px 0 var(--lo-2), 0 1px 0 var(--hi) inset;
  transition: transform .18s var(--ease), background .15s, color .15s, box-shadow .15s;
}
.icon-btn:hover { transform: translateY(-2px); color: var(--ink); }
.icon-btn:active { transform: translateY(1px); box-shadow: 0 0 0 var(--lo-2), 0 2px 6px -2px var(--lo) inset; }
.btn-remove:hover { background: var(--pop); color: #fff; }
.btn-reroll:hover { background: var(--pop-3); color: #143d2e; }
.btn-edit:hover { background: var(--pop-4); color: #fff; }

/* ---- Header dropdown (+ Reel) ---- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + .6rem); right: 0; z-index: 30;
  min-width: 13rem; padding: .4rem;
  display: flex; flex-direction: column; gap: .2rem;
  background: var(--clay);
  border-radius: var(--r-sm);
  box-shadow: var(--clay-shadow-hover);
  animation: pop-in .22s var(--ease);
  transform-origin: top right;
}
.menu-item {
  font: inherit; font-weight: 700; font-size: .9rem; text-align: left; cursor: pointer;
  background: transparent; color: var(--ink);
  border: 0; border-radius: 10px;
  padding: .6rem .8rem;
  transition: background .12s, transform .15s var(--ease);
}
.menu-item:hover { background: var(--clay-deep); transform: translateX(2px); }

/* ---- Board ---- */
.board-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--reel-count, 5), minmax(0, 1fr));
  gap: 1.1rem;
  padding: 1rem 1.6rem 1.6rem;
  align-items: stretch;
}
.board { display: contents; }
@media (max-width: 1100px) { .board-wrap { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); } }
@media (max-width: 560px)  { .board-wrap { grid-template-columns: 1fr; padding: .8rem 1rem 1.2rem; } }

/* ---- Reel (clay slab) ---- */
.reel {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 20rem;
  background: var(--clay);
  border-radius: var(--r);
  box-shadow: var(--clay-shadow);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s, background .3s;
  animation: rise .4s var(--ease) both;
}
.reel:hover { transform: translateY(-3px); box-shadow: var(--clay-shadow-hover); }
.reel-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .9rem 1rem .5rem 1.2rem;
}
.reel-label {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: .85rem; letter-spacing: .02em; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reel-actions { display: flex; gap: .3rem; flex-shrink: 0; }
/* the recessed "window" the text sits in — pressed into the clay */
.reel-window {
  flex: 1; display: grid; place-items: center;
  margin: 0 .9rem; padding: 1.4rem 1rem;
  background: var(--clay-deep);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 10px -4px var(--lo) inset, 0 -1px 0 var(--hi) inset;
  overflow: hidden; perspective: 700px;
  transition: background .3s, box-shadow .3s;
}
.reel-value {
  margin: 0; text-align: center;
  font-family: var(--font-body); font-weight: 800;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.3;
  text-wrap: balance;
}
.reel-edit {
  display: block; width: 100%; height: 100%;
  border: 0; background: transparent; resize: none; outline: none;
  color: inherit;
}
.reel-window:focus-within { box-shadow: 0 0 0 3px var(--pop-4) inset, 0 4px 10px -4px var(--lo) inset; }
.reel-foot {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem 1.2rem .8rem;
  font-size: .68rem; font-weight: 800; color: var(--muted);
  min-height: 2.3rem;
}
.reel-foot::before { content: ''; }
.reel.locked .reel-foot::before { content: '● Locked'; color: #9a6a00; letter-spacing: .04em; }
[data-theme="dark"] .reel.locked .reel-foot::before { color: var(--pop-2); }

/* ---- Report ---- */
/* Sits in the same bottom-left corner the "Locked" label occupies, so the
   two are naturally mutually exclusive - no point flagging text once it's kept. */
.report-slot { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); }
.reel.locked .report-slot { display: none; }
.btn-report {
  font: inherit; font-weight: 800; font-size: .72rem; line-height: 1; cursor: pointer;
  width: 1.4rem; height: 1.4rem;
  display: grid; place-items: center;
  background: transparent; color: var(--muted);
  border: 1px solid currentColor; border-radius: 50%;
  opacity: .5;
  transition: opacity .15s, background .15s, color .15s, transform .15s var(--ease);
}
.btn-report:hover { opacity: 1; background: var(--pop); color: #fff; border-color: var(--pop); transform: translateY(-1px); }
.report-menu {
  top: auto; bottom: calc(100% + .5rem); left: 0; right: auto;
  transform-origin: bottom left;
  min-width: 11rem;
}
.report-menu .menu-item[data-reason="doesnt_make_sense"] { font-weight: 900; }

/* Lock glyph — padlock whose shackle swings open */
.lock-glyph { position: relative; width: 11px; height: 9px; background: currentColor; border-radius: 2.5px; margin-top: 5px; }
.lock-glyph::before {
  content: ''; position: absolute; left: 1.5px; top: -6px;
  width: 4px; height: 6px; border: 2px solid currentColor; border-bottom: 0;
  border-radius: 5px 5px 0 0;
  transition: transform .25s var(--ease);
  transform-origin: bottom right;
}
.reel:not(.locked) .lock-glyph::before { transform: translateX(3px) rotate(24deg); }

/* Locked — butter clay */
.reel.locked { background: linear-gradient(170deg, #ffe59a, var(--pop-2)); color: #3b2a00; }
.reel.locked .reel-label { color: #6b4e00; }
.reel.locked .reel-window { background: rgba(255,255,255,.55); box-shadow: 0 4px 10px -4px rgba(120,80,0,.35) inset; }
.reel.locked .icon-btn { background: rgba(255,255,255,.6); color: #6b4e00; box-shadow: 0 3px 0 rgba(120,80,0,.2); }
.reel.locked .btn-lock { background: #3b2a00; color: var(--pop-2); }
[data-theme="dark"] .reel.locked { background: linear-gradient(170deg, #6a5420, #4c3c14); color: var(--pop-2); }
[data-theme="dark"] .reel.locked .reel-label { color: var(--pop-2); }
[data-theme="dark"] .reel.locked .reel-window { background: rgba(0,0,0,.25); color: #fff3cf; }
[data-theme="dark"] .reel.locked .icon-btn { background: rgba(255,255,255,.1); color: var(--pop-2); }
.lock-pulse { animation: squish .4s var(--ease); }
.unlock-pulse { animation: squish .3s var(--ease); }

/* Spinning / settle */
.reel.spinning .reel-window { box-shadow: 0 0 0 3px var(--pop-4) inset, 0 4px 10px -4px var(--lo) inset; }
.reel.spinning .reel-value { animation: blur-roll .09s linear infinite; color: var(--muted); }
.reel.settle { animation: squish .35s var(--ease); }
.reel.settle .reel-value { animation: land .36s var(--ease); }
.reel.settle .reel-window { box-shadow: 0 0 0 3px var(--pop-3) inset, 0 4px 10px -4px var(--lo) inset; }

@keyframes blur-roll {
  0%   { transform: translateY(-40%) rotateX(28deg); filter: blur(2px); opacity: .25; }
  50%  { transform: translateY(0)    rotateX(0);     filter: blur(1px); opacity: .65; }
  100% { transform: translateY(40%)  rotateX(-28deg); filter: blur(2px); opacity: .25; }
}
@keyframes land {
  0%   { transform: translateY(-30%) scale(1.03); opacity: 0; filter: blur(3px); }
  70%  { transform: translateY(2%);  opacity: 1; filter: blur(0); }
  100% { transform: translateY(0); }
}
@keyframes squish {
  0%   { transform: scale(1, 1); }
  35%  { transform: scale(1.03, .96); }
  70%  { transform: scale(.98, 1.02); }
  100% { transform: scale(1, 1); }
}
@keyframes pop-in { 0% { transform: scale(.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { 0% { transform: translateY(14px) scale(.98); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
.reel.enter { animation: rise .35s var(--ease); }

/* ---- Saved modal (clay card) ---- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(45, 36, 80, .35); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s;
}
.drawer-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; left: 50%; top: 50%; z-index: 45;
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(80vh, 40rem);
  display: flex; flex-direction: column;
  background: var(--clay);
  border-radius: var(--r);
  box-shadow: var(--clay-shadow-hover);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.92) translateY(16px);
  transition: transform .3s var(--ease), opacity .2s;
}
.drawer.open { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem .6rem; }
.drawer-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.save-form { display: flex; gap: .5rem; padding: .6rem 1rem; }
.save-form input {
  flex: 1; min-width: 0; font: inherit; font-weight: 700; font-size: .9rem;
  background: var(--clay-deep); color: var(--ink);
  border: 0; border-radius: var(--r-pill); padding: .6rem 1rem;
  box-shadow: 0 3px 8px -3px var(--lo) inset;
}
.save-form input:focus { outline: 3px solid var(--pop-4); outline-offset: 0; }
.save-form .btn { padding: .55rem .9rem; }
.saved-list { list-style: none; margin: 0; padding: .6rem 1rem 1rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .6rem; }
.saved-item { border-radius: var(--r-sm); background: var(--clay-deep); overflow: hidden; box-shadow: 0 1px 0 var(--hi) inset; }
.saved-main { display: flex; align-items: stretch; }
.saved-load {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  font: inherit; font-weight: 700; text-align: left; cursor: pointer;
  background: transparent; color: var(--ink); border: 0; padding: .75rem 1rem;
  transition: background .12s;
}
.saved-load:hover { background: rgba(157,140,255,.15); }
.saved-name { font-weight: 800; font-size: .95rem; }
.saved-meta { font-size: .68rem; color: var(--muted); }
.saved-delete { align-self: center; margin-right: .6rem; }
.saved-preview {
  list-style: none; margin: 0; padding: .4rem 1rem .8rem;
  display: none; flex-direction: column; gap: .35rem; font-size: .8rem;
}
.saved-item:hover .saved-preview, .saved-item:focus-within .saved-preview { display: flex; }
.pv-label { font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: block; }
.pv-value { font-weight: 700; line-height: 1.3; }
.saved-empty { padding: 2rem 1.4rem; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.55; }

/* ---- Status bar / toast ---- */
.statusbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .5rem 1.6rem 1rem;
  font-size: .72rem; font-weight: 800; color: var(--muted);
}
.hint kbd { margin: 0 .1em; }
.toast {
  position: fixed; left: 50%; bottom: 3.5rem;
  transform: translate(-50%, 10px) scale(.95);
  background: var(--ink); color: var(--bg);
  font-weight: 800; font-size: .88rem; padding: .65rem 1.1rem;
  border-radius: var(--r-pill); box-shadow: 0 12px 28px -8px var(--lo);
  opacity: 0; transition: opacity .18s, transform .3s var(--ease);
  z-index: 50; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Welcome page (marketing root) ===== */
/* Reuses .topbar/.brand/.btn/.icon-btn/.theme-glyph/.statusbar/.credit as-is. */

.link-quiet {
  font-family: var(--font-body); font-weight: 800; font-size: .82rem;
  color: var(--ink-2); text-decoration: none;
  padding: .5rem .3rem;
}
.link-quiet:hover { color: var(--ink); }

.hero { max-width: 52rem; margin: 0 auto; padding: 2.6rem 1.8rem 1.5rem; text-align: center; }
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.06; letter-spacing: -.01em;
  margin: 0 0 1.1rem;
}
.hero h1 .accent { color: var(--pop); white-space: nowrap; }
.hero p.sub {
  font-size: clamp(1rem, 2vw, 1.18rem); font-weight: 700; color: var(--ink-2);
  line-height: 1.55; margin: 0 auto 2rem; max-width: 40rem;
}
.hero-ctas { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: .9rem; }
.hero-ctas .btn { padding: .85rem 1.6rem; font-size: .95rem; text-decoration: none; }
.hero-note { font-size: .82rem; font-weight: 700; color: var(--muted); margin: 0; }

/* ---- Live reel-strip preview ---- */
.strip-wrap { max-width: 74rem; margin: 2.4rem auto 0; padding: 0 1.8rem; }
.strip { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .9rem; }
.mini-reel {
  position: relative;
  background: var(--clay);
  border-radius: var(--r);
  box-shadow: var(--clay-shadow);
  padding: .9rem .9rem 1rem;
  display: flex; flex-direction: column; gap: .6rem;
  min-height: 12.5rem;
  animation: rise .5s var(--ease) both;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.mini-reel:hover { transform: translateY(-3px); box-shadow: var(--clay-shadow-hover); }
.mini-label {
  font-family: var(--font-display); font-weight: 600; font-size: .74rem;
  letter-spacing: .02em; color: var(--ink-2); display: flex; align-items: center; gap: .35rem;
}
.mini-window {
  flex: 1; display: grid; place-items: center; text-align: center;
  background: var(--clay-deep);
  border-radius: var(--r-sm);
  padding: .8rem .6rem;
  box-shadow: 0 4px 10px -4px var(--lo) inset, 0 -1px 0 var(--hi) inset;
  font-weight: 800; font-size: .84rem; line-height: 1.35;
}
.mini-reel.locked { background: linear-gradient(170deg, #ffe59a, var(--pop-2)); color: #3b2a00; }
.mini-reel.locked .mini-label { color: #6b4e00; }
.mini-reel.locked .mini-window { background: rgba(255,255,255,.55); box-shadow: 0 4px 10px -4px rgba(120,80,0,.35) inset; }
[data-theme="dark"] .mini-reel.locked { background: linear-gradient(170deg, #6a5420, #4c3c14); color: var(--pop-2); }
[data-theme="dark"] .mini-reel.locked .mini-label { color: var(--pop-2); }
[data-theme="dark"] .mini-reel.locked .mini-window { background: rgba(0,0,0,.25); color: #fff3cf; }
.mini-reel.settle { animation: squish .35s var(--ease); }
.mini-reel.settle .mini-window { animation: land .32s var(--ease); }
.mini-lock { position: relative; width: 10px; height: 8px; background: currentColor; border-radius: 2.5px; flex-shrink: 0; display: none; }
.mini-lock::before {
  content: ''; position: absolute; left: 1.3px; top: -5.5px;
  width: 3.5px; height: 5.5px; border: 1.8px solid currentColor; border-bottom: 0;
  border-radius: 5px 5px 0 0;
}
.mini-reel.locked .mini-lock { display: block; }
.strip-caption { text-align: center; margin-top: 1rem; font-size: .78rem; font-weight: 800; color: var(--muted); }
@media (max-width: 900px) { .strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 560px)  { .strip { grid-template-columns: 1fr 1fr; } }

/* ---- Feature cards ---- */
.features-wrap { max-width: 62rem; margin: 4.2rem auto 0; padding: 0 1.8rem 3.5rem; }
.features-head { text-align: center; margin-bottom: 1.8rem; }
.features-head h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .5rem; }
.features-head p { color: var(--ink-2); font-weight: 700; margin: 0; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.1rem; }
.feature-card {
  background: var(--clay);
  border-radius: var(--r);
  box-shadow: var(--clay-shadow);
  padding: 1.5rem 1.4rem;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--clay-shadow-hover); }
.feature-glyph { width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; margin-bottom: .9rem; font-size: 1.15rem; }
.feature-glyph-mint { background: linear-gradient(145deg, #a4f0d4, var(--pop-3)); color: #143d2e; }
.feature-glyph-butter { background: linear-gradient(145deg, #ffe59a, var(--pop-2)); color: #6b4e00; }
.feature-glyph-lilac { background: linear-gradient(145deg, #c3b6ff, var(--pop-4)); color: #fff; }
.feature-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 0 0 .5rem; }
.feature-card p { margin: 0; color: var(--ink-2); font-size: .9rem; line-height: 1.55; font-weight: 700; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.welcome-foot { justify-content: center; }

/* ===== Guided tour (?tour=1) ===== */
.tour-welcome-body { padding: 1.1rem 1.4rem 1.4rem; }
.tour-welcome-body p { margin: 0 0 .7rem; line-height: 1.5; }
.tour-welcome-note { color: var(--muted); font-size: .85rem; }
.tour-welcome-actions { display: flex; gap: .6rem; margin-top: 1rem; }

.tour-scrim {
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none;
  opacity: 0; transition: opacity .22s;
}
.tour-scrim.show { opacity: 1; }
.tour-spot {
  position: fixed; border-radius: var(--r-sm);
  box-shadow: 0 0 0 4px var(--pop-4), 0 0 26px 4px var(--pop-4), 0 0 0 9999px rgba(20, 12, 45, .55);
  transition: top .32s var(--ease), left .32s var(--ease), width .32s var(--ease), height .32s var(--ease);
}
.tour-callout {
  position: fixed;
  width: min(21rem, calc(100vw - 2rem));
  background: var(--clay);
  border-radius: var(--r);
  box-shadow: var(--clay-shadow-hover);
  padding: 1.1rem 1.2rem;
  pointer-events: auto;
  transition: top .32s var(--ease), left .32s var(--ease);
}
.tour-step-count { font-size: .7rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.tour-step-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin: .3rem 0 .4rem; }
.tour-step-body { margin: 0 0 .9rem; line-height: 1.5; font-size: .92rem; color: var(--ink-2); }
.tour-callout-actions { display: flex; align-items: center; gap: .5rem; }
.tour-spacer { flex: 1; }
.tour-callout-actions .btn { padding: .5rem 1rem; font-size: .85rem; }
.btn-link {
  font: inherit; font-weight: 800; font-size: .82rem; color: var(--muted);
  background: none; border: 0; cursor: pointer; padding: .5rem .2rem;
}

/* ===== Legal pages (/terms, /privacy) ===== */
.legal-wrap { max-width: 44rem; margin: 0 auto; padding: 1rem 1.8rem 4rem; flex: 1; }
.legal-wrap h1 { font-family: var(--font-display); font-weight: 700; font-size: 2rem; margin: 0 0 .3rem; }
.legal-updated { color: var(--muted); font-size: .82rem; font-weight: 700; margin: 0 0 2rem; }
.legal-wrap h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  margin: 2rem 0 .7rem;
}
.legal-wrap p, .legal-wrap li { line-height: 1.6; font-size: .95rem; color: var(--ink-2); }
.legal-wrap ul { margin: 0 0 1rem; padding-left: 1.3rem; }
.legal-wrap li { margin-bottom: .4rem; }
.legal-wrap a { color: var(--pop); font-weight: 800; text-decoration: none; border-bottom: 2px solid var(--pop); }
.legal-wrap a:hover { color: var(--pop-4); border-color: var(--pop-4); }
.legal-wrap strong { color: var(--ink); }
.btn-link:hover { color: var(--ink); text-decoration: underline; }
