/* Big Talk */

@property --c1 { syntax: '<color>'; inherits: true; initial-value: #8a3f9e; }
@property --c2 { syntax: '<color>'; inherits: true; initial-value: #22103a; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #ff9ec0; }

:root {
  --bg: #0d0a12;
  --panel: #1b1524;
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, 0.76);
  --ink-3: rgba(255, 255, 255, 0.55);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.1);
  --yes: #63e6a6;
  --no: #ff7086;
  --heart: #ff5c8a;
  --out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow: hidden;
  transition: --c1 0.8s var(--out), --c2 0.8s var(--out), --accent 0.8s var(--out);
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.42s var(--spring), background-color 0.2s, opacity 0.2s, color 0.2s;
}
button:disabled { cursor: default; }
button:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.8); outline-offset: 3px; }
button.pressed { transform: scale(1.1); transition: transform 0.12s var(--out); }
svg {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
[hidden] { display: none !important; }

/* One-shot animations */
.pop { animation: pop 0.45s var(--spring); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 100% { transform: scale(1); } }
.punch { animation: punch 0.5s var(--spring); }
@keyframes punch { 0% { transform: scale(1); } 30% { transform: scale(1.45) rotate(-8deg); } 100% { transform: scale(1); } }
.shake { animation: shake 0.4s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.spin svg { animation: spin 0.5s var(--out); }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
.num-pop { display: inline-block; animation: numpop 0.5s var(--spring); }
@keyframes numpop { 0% { transform: scale(1); } 30% { transform: scale(1.4); color: #fff; } 100% { transform: scale(1); } }

/* Ambient glow behind everything, tinted by the open deck */
.ambient {
  position: fixed;
  inset: -12%;
  pointer-events: none;
  background:
    radial-gradient(55% 42% at 12% 2%, color-mix(in oklab, var(--c1) 58%, transparent), transparent 72%),
    radial-gradient(60% 46% at 100% 100%, color-mix(in oklab, var(--c2) 85%, transparent), transparent 72%),
    radial-gradient(38% 30% at 88% 14%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 72%);
}

/* Views */
.view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.3s var(--out), transform 0.45s var(--out), visibility 0s 0.45s;
}
#home.view:not(.on) { transform: translateX(-28px); }
.view.on {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.35s var(--out), transform 0.5s var(--out), visibility 0s;
}

.icon-btn {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--line);
}
.icon-btn:hover { background: var(--glass-2); }
.icon-spacer { width: 46px; flex: none; }
.badge {
  position: absolute; top: -3px; right: -5px;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px;
  background: var(--heart);
  font-size: 13px; font-weight: 800; line-height: 22px; text-align: center;
  box-shadow: 0 0 0 3px var(--bg);
}
.dot {
  position: absolute; top: 8px; right: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- Home */

#home {
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--st) + 14px) 16px calc(var(--sb) + 32px);
}
#home > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.home-top { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.wordmark {
  margin: 0;
  font: 700 34px/1 var(--serif);
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 144;
}
.top-actions { display: flex; gap: 10px; }
.top-actions .icon-btn:first-child svg { color: var(--heart); }

.today, .tile {
  position: relative;
  overflow: hidden;
  text-align: left;
  color: #fff;
  background: linear-gradient(150deg, var(--tc1), var(--tc2));
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.today::after, .tile::after, .card::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 70% at 0% 0%, rgba(255, 255, 255, 0.2), transparent 55%);
}
.tile-mark, .card-mark {
  position: absolute;
  pointer-events: none;
  opacity: 0.12;
}
.tile-mark svg, .card-mark svg { width: 100%; height: 100%; stroke-width: 1.3; }

.today {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
  margin-bottom: 20px;
  padding: 20px 22px 24px;
  border-radius: 28px;
  min-height: 168px;
}
.today .tile-mark { width: 190px; height: 190px; right: -34px; bottom: -48px; transform: rotate(-12deg); }
.today-top { display: flex; align-items: center; gap: 10px; }
.today-label {
  font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.2);
}
.today-deck { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.today-deck svg { width: 18px; height: 18px; }
.today-q {
  position: relative;
  font: 600 25px/1.22 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
  max-width: 34ch;
}
.today-done {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 15px; font-weight: 700;
  padding: 6px 12px 6px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.92); color: #1a1220;
}
.today-done svg { width: 18px; height: 18px; stroke-width: 3; }

.deck-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 186px;
  padding: 16px;
  border-radius: 26px;
  animation: tileIn 0.6s var(--spring) backwards;
  animation-delay: calc(var(--i) * 35ms);
}
@keyframes tileIn { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
.tile:hover { transform: translateY(-3px); }
.tile.pressed { transform: scale(1.05); }
.tile .tile-mark { width: 150px; height: 150px; right: -30px; bottom: -34px; transform: rotate(-12deg); }
.tile-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.tile-icon svg { width: 25px; height: 25px; stroke-width: 2.1; }
.tile-text { position: relative; display: flex; flex-direction: column; gap: 3px; }
.tile-name { font: 700 25px/1.05 var(--serif); letter-spacing: -0.015em; }
.tile-sub { font-size: 15px; color: rgba(255, 255, 255, 0.82); line-height: 1.25; }
.tile-progress { position: relative; display: flex; align-items: center; gap: 10px; }
.tile-bar { flex: 1; height: 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.22); overflow: hidden; }
.tile-bar i { display: block; height: 100%; border-radius: 6px; background: #fff; }
.tile-count { font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, 0.9); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (min-width: 720px) {
  #home { padding-top: calc(var(--st) + 28px); }
  .deck-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .tile { min-height: 210px; padding: 20px; }
  .today { padding: 26px 30px 30px; }
  .today-q { font-size: 30px; }
  .wordmark { font-size: 40px; }
}

/* ---------- Deck view */

#deck { padding: calc(var(--st) + 8px) 0 calc(var(--sb) + 16px); }
.deck-top {
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 14px;
  width: 100%; max-width: 720px; margin: 0 auto;
  flex: none;
}
.deck-title {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.deck-title.pressed { transform: scale(1.04); }
.deck-name { font: 700 22px/1.1 var(--serif); letter-spacing: -0.01em; }
.deck-filter { font-size: 14px; font-weight: 600; color: var(--ink-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-filter:empty { display: none; }

.progress { width: 100%; max-width: 472px; margin: 0 auto 16px; padding: 8px 20px 0; flex: none; }
.bar {
  position: relative;
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 99px; }
.bar-skip { background: rgba(255, 255, 255, 0.2); transition: left 0.7s var(--out), width 0.5s var(--out); }
.bar-back { background: #fff; transition: width 0.2s var(--out); }
.bar-fill {
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 70%, var(--c1)), var(--accent));
  box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 60%, transparent);
  transition: width 0.75s var(--out);
}
.bar .bar-flash { right: 0; width: auto; background: #fff; opacity: 0; }
.bar-flash.go { animation: barflash 0.45s ease-out; }
@keyframes barflash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.bar.punch { animation: barpunch 0.5s var(--spring); }
@keyframes barpunch { 0% { transform: scale(1); } 25% { transform: scale(1.04, 1.8); } 100% { transform: scale(1); } }
.bar-text {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 15px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.bar-text b { color: #fff; font-weight: 800; }

.stack {
  position: relative;
  flex: 1 1 auto;
  min-height: 300px;
  max-height: 660px;
  width: min(calc(100% - 32px), 440px);
  margin: auto auto 0;
}

.actions {
  flex: none;
  display: flex; justify-content: center; align-items: center;
  gap: 14px;
  padding: 10px 16px 0;
  margin-bottom: auto;
}
.act {
  position: relative;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 26px -8px rgba(0, 0, 0, 0.6);
}
.act:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.act:disabled { opacity: 0.3; }
.act-sm { width: 52px; height: 52px; }
.act-md { width: 62px; height: 62px; }
.act-lg { width: 74px; height: 74px; }
.act-md svg { width: 28px; height: 28px; }
.act-lg svg { width: 34px; height: 34px; stroke-width: 2.7; }
.act-skip { color: var(--no); }
.act-yes { color: var(--yes); }
.act-heart { color: var(--heart); }
.act-heart.on svg { fill: currentColor; }
.act-heart.on { background: rgba(255, 92, 138, 0.18); }
.act .dot { top: 6px; right: 6px; }

/* ---------- Cards */

.card {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 32px;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 20px;
  border-radius: 32px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(155deg, var(--k1), var(--k2));
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform-origin: 50% 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  will-change: transform;
}
.card.dragging { cursor: grabbing; }
.card-grain {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.card-mark { width: 280px; height: 280px; right: -60px; bottom: -60px; transform: rotate(-12deg); opacity: 0.09; }
.shade { position: absolute; inset: 0; background: #0b0710; opacity: var(--shade, 0); pointer-events: none; border-radius: inherit; }
.card-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.card-flash.go { animation: cardflash 0.55s ease-out; }
@keyframes cardflash { 0% { opacity: var(--fl, 0.35); } 100% { opacity: 0; } }

.card-top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  flex: none;
}
.card-theme { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-right { display: flex; align-items: center; gap: 10px; flex: none; }
.depth { display: inline-flex; align-items: center; gap: 7px; }
.depth b { display: inline-flex; gap: 3px; }
.depth i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); }
.depth i.on { background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, 0.6); }
.fav-mark { display: none; color: #fff; }
.fav-mark svg { width: 20px; height: 20px; fill: currentColor; stroke-width: 1.5; }
.card.fav .fav-mark { display: inline-grid; }

.card-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  padding: 10px 0;
}
.kind {
  align-self: flex-start;
  padding: 7px 13px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 14px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.2;
}
.hint { margin: -4px 0 0; font-size: 16px; line-height: 1.3; color: rgba(255, 255, 255, 0.82); }
.q {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-wrap: pretty;
  font-variation-settings: 'opsz' 72;
  transition: font-size 0.45s var(--out);
}
.q.len-s { font-size: 36px; line-height: 1.14; text-wrap: balance; }
.q.len-m { font-size: 31px; }
.q.len-l { font-size: 27px; }
.q.len-xl { font-size: 24px; }
.blank {
  display: inline-block;
  width: 2.2em; height: 0.9em;
  margin-left: 0.25em;
  border-bottom: 3px solid rgba(255, 255, 255, 0.75);
  vertical-align: baseline;
  animation: blank 1.6s ease-in-out infinite;
}
@keyframes blank { 50% { border-color: rgba(255, 255, 255, 0.3); } }

.follow { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s var(--out); }
.follow > div { overflow: hidden; min-height: 0; }
.card.deep .follow { grid-template-rows: 1fr; }
.follow-inner {
  padding-top: 14px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.28);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s 0.12s var(--out), transform 0.6s 0.12s var(--spring);
}
.card.deep .follow-inner { opacity: 1; transform: none; }
.follow-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.follow-label svg { width: 18px; height: 18px; stroke-width: 2.6; }
.follow-q { margin: 6px 0 0; font: 500 22px/1.28 var(--serif); text-wrap: pretty; }

.card-foot { position: relative; display: flex; align-items: center; min-height: 50px; flex: none; }
.card-foot:empty { min-height: 0; }
.deeper-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 50px; padding: 0 20px 0 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: 17px; font-weight: 700;
}
.deeper-btn svg { stroke-width: 2.6; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(3px); } 90% { transform: translateY(-1px); } }
.deeper-btn:hover { background: rgba(255, 255, 255, 0.28); }
.card.deep .deeper-btn { opacity: 0; transform: scale(0.7); pointer-events: none; transition: opacity 0.25s, transform 0.3s var(--out); }

/* Would you rather */
.wyr { display: flex; flex-direction: column; gap: 8px; font-size: 22px; }
.wyr.opt-m { font-size: 20px; }
.wyr.opt-l { font-size: 18px; }
.opt {
  text-align: left;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-family: var(--serif);
  font-size: 1em;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: pretty;
}
.opt:hover { background: rgba(255, 255, 255, 0.22); }
.opt.on { background: #fff; color: color-mix(in oklab, var(--k2) 80%, #000); box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.5); }
.or {
  align-self: center;
  position: relative; z-index: 1;
  margin: -22px 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--k1) 50%, var(--k2));
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--k1) 40%, var(--k2)), 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: var(--sans);
  font-size: 14px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}

/* Timer on "Try this" cards */
.timer {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 24px 0 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: 21px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.timer-ring { position: relative; width: 44px; height: 44px; }
.timer-ring svg { position: absolute; inset: 0; width: 44px; height: 44px; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 4; }
.timer-ring .trk { stroke: rgba(255, 255, 255, 0.22); }
.timer-ring .arc { stroke: #fff; stroke-dasharray: 100; stroke-dashoffset: 0; }
.timer-ico { position: absolute; inset: 0; display: grid; place-items: center; }
.timer-ico svg { position: static; transform: none; width: 20px; height: 20px; }
.timer.running { background: rgba(255, 255, 255, 0.28); }
.timer.done { background: #fff; color: color-mix(in oklab, var(--k2) 80%, #000); }
.timer.done .timer-ring .arc { stroke: currentColor; }

/* Stamps while dragging */
.stamp {
  position: absolute; top: 74px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border: 3px solid #fff;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
  font-size: 22px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}
.stamp svg { width: 26px; height: 26px; stroke-width: 3.2; }
.stamp-yes { left: 22px; transform: rotate(-12deg) scale(var(--sk, 1)); color: #fff; }
.stamp-no { right: 22px; transform: rotate(12deg) scale(var(--sk, 1)); }
.stamp-pop { animation: stamppop 0.35s var(--spring); }
@keyframes stamppop { 40% { scale: 1.2; } }

/* Static card inside a sheet */
.card.still { position: relative; inset: auto; min-height: 380px; height: 100%; cursor: default; touch-action: auto; }

/* End of a run */
.end, .empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  text-align: center;
}
.end {
  position: absolute; inset: 0 0 32px;
  padding: 28px 22px;
  border-radius: 32px;
  border: 2px dashed rgba(255, 255, 255, 0.16);
}
.end h3, .empty h3 { margin: 4px 0 0; font: 700 28px/1.15 var(--serif); text-wrap: balance; }
.end p, .empty p { margin: 0; font-size: 17px; color: var(--ink-2); text-wrap: balance; }
.end-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  box-shadow: 0 10px 30px -8px var(--c1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.end-icon svg { width: 34px; height: 34px; }
.end-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; width: 100%; max-width: 300px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 22px;
  border-radius: 99px;
  background: #fff; color: #170f1d;
  font-size: 17px; font-weight: 800;
}
.btn svg { width: 22px; height: 22px; stroke-width: 2.4; }
.btn.ghost { background: var(--glass-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line); }

/* First-time tips */
.coach {
  position: absolute; inset: 0 0 32px; z-index: 40;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  padding: 26px 24px;
  border-radius: 32px;
  background: rgba(12, 8, 18, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.coach-row { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 600; line-height: 1.3; }
.ci { width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--glass-2); }
.ci.yes { color: var(--yes); }
.ci.no { color: var(--no); }
.ci.heart { color: var(--heart); }
.ci.heart svg { fill: currentColor; }
.coach-keys { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.coach .btn { margin-top: 8px; }

/* ---------- Sheets */

.scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(6, 3, 10, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.35s var(--out);
}
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 10px 20px calc(var(--sb) + 22px);
  border-radius: 30px 30px 0 0;
  background: var(--panel);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(105%);
  transition: transform 0.5s cubic-bezier(0.32, 1.25, 0.5, 1), translate 0.3s var(--out);
}
.sheet.on { transform: none; }
.grip { width: 44px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.25); margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 14px; font: 700 26px/1.15 var(--serif); touch-action: none; }
.sheet h4 { margin: 18px 0 10px; font-size: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.primary {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 56px; margin-top: 22px;
  border-radius: 99px;
  background: #fff; color: #170f1d;
  font-size: 18px; font-weight: 800;
}
@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto;
    width: 520px;
    max-height: 86vh;
    padding: 18px 26px 26px;
    border-radius: 30px;
    transform: translate(-50%, -44%) scale(0.96);
    opacity: 0;
    transition: transform 0.45s var(--spring), opacity 0.25s;
  }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grip { display: none; }
}

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 5px; border-radius: 20px; background: var(--glass); }
.seg button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  height: 62px; border-radius: 15px;
  font-size: 16px; font-weight: 700; color: var(--ink-2);
}
.seg button b { display: flex; gap: 3px; }
.seg button i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.seg button.on { background: #fff; color: #170f1d; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 16px;
  border-radius: 99px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px; font-weight: 600;
}
.chip .n { font-size: 14px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip.on { background: #fff; color: #170f1d; box-shadow: none; }
.chip.on .n { color: rgba(23, 15, 29, 0.55); }

.sheet-q { margin: 0 0 14px; font: 600 21px/1.28 var(--serif); color: var(--ink-2); text-wrap: pretty; }
textarea {
  width: 100%;
  min-height: 160px;
  padding: 16px 18px;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--line);
  color: #fff;
  font: 18px/1.45 var(--sans);
  resize: vertical;
  outline: none;
}
textarea:focus { box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--accent) 80%, transparent); }
textarea::placeholder { color: var(--ink-3); }

.settings .set-row { display: flex; align-items: center; justify-content: space-between; height: 60px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--line); }
.switch { position: relative; width: 58px; height: 34px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); }
.switch i { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.4s var(--spring); }
.switch.on { background: var(--yes); }
.switch.on i { transform: translateX(24px); }
.set-stats { margin: 18px 0 8px; font-size: 16px; color: var(--ink-2); }
.set-btn {
  display: flex; align-items: center;
  width: 100%; height: 56px; margin-top: 8px; padding: 0 20px;
  border-radius: 18px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 17px; font-weight: 600; text-align: left;
}
.set-btn:hover { background: var(--glass-2); }
.set-btn.danger { color: var(--no); }
.set-btn.armed { background: var(--no); color: #fff; }
.set-btn.pressed { transform: scale(1.03); }
.set-note { margin: 16px 0 0; font-size: 15px; color: var(--ink-3); line-height: 1.4; }

.card-sheet .card-holder { position: relative; height: min(62dvh, 520px); }
.card-sheet .card.still { height: 100%; min-height: 0; }
.card-sheet-btns { display: flex; justify-content: center; gap: 16px; margin-top: 18px; }

/* ---------- Saved */

#saved { padding-top: calc(var(--st) + 8px); }
.saved-title { flex: 1; margin: 0; text-align: center; font: 700 22px/1.1 var(--serif); }
.tabs {
  flex: none;
  display: flex; gap: 8px;
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 18px;
  border-radius: 99px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px; font-weight: 700;
}
.tab .n { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tab.on { background: #fff; color: #170f1d; box-shadow: none; }
.tab.on .n { color: rgba(23, 15, 29, 0.55); }
.saved-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 4px 16px calc(var(--sb) + 28px);
}
.play-favs {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 60px; margin-bottom: 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff4f86, #8f1d5c);
  box-shadow: 0 14px 30px -12px #ff4f86, inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-size: 18px; font-weight: 800;
}
.play-favs.pressed { transform: scale(1.03); }
.row {
  position: relative;
  display: flex; align-items: flex-start; gap: 6px;
  margin-bottom: 10px;
  border-radius: 22px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(var(--k1), var(--k2)); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 16px 4px 16px 20px; text-align: left; }
.row-main.pressed { transform: scale(1.02); }
.row-deck { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ka); }
.row-deck svg { width: 16px; height: 16px; }
.row-q { font: 600 20px/1.3 var(--serif); text-wrap: pretty; }
.row-note { font-size: 16px; line-height: 1.45; color: var(--ink-2); white-space: pre-wrap; padding-left: 12px; border-left: 2px solid rgba(255, 255, 255, 0.2); }
.row-meta { font-size: 14px; color: var(--ink-3); }
.row-heart { flex: none; width: 52px; height: 52px; margin: 8px 8px 0 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.row-heart.on { color: var(--heart); }
.row-heart.on svg { fill: currentColor; }
.empty { padding: 70px 24px; }
.empty .end-icon { background: var(--glass-2); box-shadow: none; }
.more { width: 100%; margin-top: 6px; }

/* ---------- Floating feedback */

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; }
.flyaway {
  position: fixed; z-index: 95;
  pointer-events: none;
  font-size: 22px; font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  animation: flyaway 1.1s var(--out) forwards;
}
.flyaway.heart { color: #ffd1df; }
.flyaway.big { font: 700 40px/1 var(--serif); animation-duration: 1.8s; }
@keyframes flyaway {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); }
  14% { opacity: 1; transform: translate(-50%, -70%) scale(1.18); }
  28% { transform: translate(-50%, -80%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}
.toast {
  position: fixed; left: 50%; bottom: calc(var(--sb) + 28px); z-index: 96;
  padding: 14px 22px;
  border-radius: 99px;
  background: #fff; color: #170f1d;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 30px) scale(0.9);
  opacity: 0;
  transition: transform 0.45s var(--spring), opacity 0.25s;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Sizes */

@media (max-height: 700px) {
  .deck-top { height: 50px; }
  .progress { padding-top: 4px; }
  .bar-text { margin-top: 6px; font-size: 14px; }
  .progress { margin-bottom: 10px; }
  .card { padding: 18px 20px 16px; bottom: 28px; }
  .act-sm { width: 48px; height: 48px; }
  .act-md { width: 56px; height: 56px; }
  .act-lg { width: 66px; height: 66px; }
  .actions { gap: 12px; padding-top: 6px; }
}
@media (min-width: 720px) {
  .q.len-s { font-size: 40px; }
  .q.len-m { font-size: 34px; }
  .q.len-l { font-size: 30px; }
  .q.len-xl { font-size: 26px; }
  .follow-q { font-size: 24px; }
  .card { padding: 26px 28px 22px; }
  .stack { width: 460px; }
  .actions { gap: 18px; padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
