/* ==========================================================================
   Open When... dark editorial
   ========================================================================== */
:root {
  --bg: #141416;
  --bg-2: #1b1b1e;
  --ink: #f5f0e8;
  --ink-2: #d9d3c8;
  --muted: #a59f95;
  --faint: #6f6b64;
  --line: rgba(255, 255, 255, .1);
  --line-2: rgba(255, 255, 255, .18);
  --glass: rgba(255, 255, 255, .05);
  --glass-2: rgba(255, 255, 255, .085);
  --accent: #c9b89f;
  --good: #9fb7a2;
  --bad: #c49a8c;
  --tone: #8a857e;
  --tone-a: rgba(138, 133, 126, .16);
  --r: 22px;
  --r-sm: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .9);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: 20px;
  --top: env(safe-area-inset-top, 0px);
  --bot: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
p { margin: 0; }
[hidden] { display: none !important; }

/* Ambient background + grain */
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 45% at 10% 0%, rgba(201, 184, 159, .13), transparent 70%),
    radial-gradient(60% 45% at 100% 100%, rgba(120, 135, 150, .11), transparent 70%),
    var(--bg);
}

#app { max-width: 540px; margin: 0 auto; padding: 0 var(--gutter); overflow-x: clip; }

/* View transitions */
.view {
  padding-bottom: calc(48px + var(--bot));
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}
.view.entering { opacity: 0; transform: translateY(10px); }
.view.leaving { opacity: 0; transform: translateY(-6px); transition-duration: .18s; }

/* Shared type */
.eyebrow, .kicker {
  font: 600 11px/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.kicker { color: var(--tone); filter: brightness(1.35) saturate(.8); margin-bottom: 12px; }
.kicker:empty { display: none; }
.muted { color: var(--ink-2); }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.center { text-align: center; }
.fade-in { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.glass {
  background: linear-gradient(160deg, var(--glass-2), var(--glass) 60%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

/* ---------- Home ---------- */
.home-head { padding: calc(22px + var(--top)) 2px 28px; }
.home-top { display: flex; justify-content: flex-end; margin-bottom: 28px; }
.display {
  font: 400 clamp(46px, 14vw, 64px)/0.98 var(--serif);
  letter-spacing: -.025em; margin: 0 0 14px; color: var(--ink);
}
.lede { font: italic 400 18px/1.45 var(--serif); color: var(--ink-2); max-width: 30ch; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.env {
  --flap: 62px;
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 196px; overflow: hidden; isolation: isolate;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 110%, var(--tone-a), transparent 70%),
    linear-gradient(180deg, #232326, #1c1c1f);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 18px 30px -20px rgba(0, 0, 0, .9);
  transition: transform .2s var(--ease), border-color .2s;
}
.env.wide { grid-column: 1 / -1; min-height: 180px; --flap: 72px; }
.env:active { transform: scale(.975); }
@media (hover: hover) { .env:hover { border-color: var(--line-2); transform: translateY(-2px); } }
/* side folds, like the back of a real envelope */
.env::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), rgba(255, 255, 255, .05) 50%, transparent calc(50% + .5px)) left bottom / 50% 70% no-repeat,
    linear-gradient(to top left, transparent calc(50% - .5px), rgba(255, 255, 255, .05) 50%, transparent calc(50% + .5px)) right bottom / 50% 70% no-repeat;
}
/* the flap: filled triangle with a soft shadow under it */
.flap {
  position: absolute; top: 0; left: 0; right: 0; height: var(--flap); z-index: 1; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 0 L50 100 L100 0 Z' transform='translate(0 5)' fill='black' fill-opacity='.35'/><path d='M0 0 L50 100 L100 0 Z' fill='%23313135'/><path d='M0 0 L50 100 L100 0' fill='none' stroke='white' stroke-opacity='.16' stroke-width='1' vector-effect='non-scaling-stroke'/></svg>") no-repeat top / 100% 100%;
}
.seal {
  position: absolute; left: 50%; top: calc(var(--flap) - 13px); z-index: 2;
  width: 24px; height: 24px; margin-left: -12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), transparent 45%), var(--tone);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 4px 10px rgba(0, 0, 0, .5);
}
.seal::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); }
.env.is-opened .seal { opacity: .75; }
.env-body {
  position: relative; z-index: 2; display: flex; flex-direction: column;
  padding: calc(var(--flap) + 22px) 16px 16px;
}
.env-text { font: 400 19px/1.18 var(--serif); color: var(--ink); letter-spacing: -.005em; overflow-wrap: break-word; hyphens: auto; min-width: 0; }
.env-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.env-head em { font: italic 400 13px/1.2 var(--serif); color: var(--muted); letter-spacing: .01em; }
.env.wide .env-text { font-size: 25px; max-width: 16ch; }
.env-no { font: 600 10.5px/1 var(--sans); letter-spacing: .14em; color: var(--faint); }

#app.reveal .env, #app.reveal .home-head, #app.reveal .extras, #app.reveal .foot { animation: fadeUp .8s var(--ease) both; }
#app.reveal .home-head { animation-delay: .05s; }
#app.reveal .env { animation-delay: calc(.2s + var(--i) * .05s); }
#app.reveal .extras { animation-delay: .75s; }
#app.reveal .foot { animation-delay: .85s; }

.extras { margin-top: 44px; }
.section-title { font: 400 22px/1.2 var(--serif); margin: 0 0 14px; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass);
  font-size: 14px; color: var(--ink-2); transition: background .2s, border-color .2s, transform .2s;
}
.chip:active { transform: scale(.96); background: var(--glass-2); }
@media (hover: hover) { .chip:hover { border-color: var(--line-2); color: var(--ink); } }

.keeps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.keep-tile { padding: 14px; display: flex; flex-direction: column; gap: 6px; font: 400 15px/1.3 var(--serif); min-height: 90px; overflow-wrap: anywhere; }
.keep-tile .kicker { margin: 0; color: var(--muted); filter: none; }
.keep-media { width: 100%; border-radius: var(--r-sm); display: block; margin-bottom: 14px; background: #000; }
.keep-audio { width: 100%; margin-top: 14px; }

.foot { margin-top: 72px; padding-bottom: 12px; text-align: center; }
.foot p { font: italic 400 15px/1.4 var(--serif); color: var(--muted); }
.foot .sig { font: 400 12px/1.4 var(--sans); letter-spacing: .12em; color: var(--faint); margin-top: 6px; }

/* ---------- Page chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  padding: calc(12px + var(--top)) 0 10px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter);
  background: linear-gradient(var(--bg) 65%, rgba(20, 20, 22, 0));
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink-2);
  transition: transform .2s, background .2s;
}
.icon-btn:active { transform: scale(.92); background: var(--glass-2); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small svg { width: 16px; height: 16px; }

.page { padding-top: 14px; }
.page .eyebrow { color: var(--tone); filter: brightness(1.35) saturate(.8); }
.page-title {
  font: 400 clamp(32px, 9.4vw, 42px)/1.06 var(--serif); letter-spacing: -.02em;
  margin: 10px 0 26px; overflow-wrap: break-word; max-width: 18ch;
}
.page-title::first-letter { text-transform: uppercase; }
.body { display: flex; flex-direction: column; gap: 18px; }
.lede-sm { font: italic 400 17px/1.5 var(--serif); color: var(--ink-2); }

.prose p { font: 400 18px/1.62 var(--serif); color: var(--ink-2); margin-bottom: 14px; }
.prose p:last-child { margin-bottom: 0; }
.prose p.beat { color: var(--ink); font-style: italic; }
.prose.big p { font-size: 19px; }
.prose.big p:nth-child(2) { color: var(--ink); font-size: 23px; line-height: 1.35; }

.letter { padding: 26px 22px 24px; }
.letter p { font: 400 18px/1.66 var(--serif); color: var(--ink-2); margin-bottom: 16px; animation: fadeUp .7s var(--ease) both; animation-delay: calc(var(--i, 0) * .06s + .1s); }
.letter p:first-child { color: var(--ink); font-size: 22px; }
.letter p:nth-child(4) { color: var(--ink); font-style: italic; }
.letter .signoff { text-align: right; font-style: italic; color: var(--muted); margin: 6px 0 0; }
.closing-line { font: italic 400 22px/1.4 var(--serif); color: var(--ink); padding: 18px 0 6px; border-top: 1px solid var(--line); }
.statement { font: 400 26px/1.25 var(--serif); color: var(--ink); }
.closer { font: italic 400 16px/1.5 var(--serif); color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 999px;
  background: var(--ink); color: #121212; font: 600 15px/1 var(--sans); letter-spacing: .01em;
  transition: transform .2s var(--ease), opacity .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn.wide { width: 100%; }
.btn.small { min-height: 36px; padding: 0 15px; font-size: 13px; }
.btn:disabled { opacity: .35; }
.text-btn { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); padding: 8px 4px; }

.big-btn {
  width: 100%; min-height: 66px; border-radius: 999px; padding: 0 20px;
  font: 600 14px/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ink);
  background:
    radial-gradient(120% 140% at 50% 0%, var(--tone-a), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 14px 34px -18px rgba(0, 0, 0, .9);
  transition: transform .18s var(--ease), background .3s;
}
.big-btn:active { transform: scale(.97); }
.big-btn.soft { letter-spacing: .02em; text-transform: none; font: 400 17px/1.25 var(--serif); font-style: italic; min-height: 58px; }

/* ---------- Result cards ---------- */
.stage { display: flex; flex-direction: column; gap: 14px; }
.result {
  padding: 24px 22px; min-height: 200px; display: flex; flex-direction: column; justify-content: center;
  transition: opacity .17s var(--ease), transform .17s var(--ease);
}
.result.compact { min-height: 140px; }
.result.is-out { opacity: 0; transform: scale(.985); }
.result.is-in { opacity: 0; transform: translateY(6px); }
.result.is-empty { align-items: center; text-align: center; }
.hint { font: italic 400 16px/1.5 var(--serif); color: var(--muted); max-width: 26ch; }
.card-text { font: 400 22px/1.38 var(--serif); color: var(--ink); overflow-wrap: break-word; }
.card-sub { margin-top: 12px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.answer { margin-top: 16px; font: italic 400 17px/1.45 var(--serif); color: var(--accent); }
.reveal {
  align-self: flex-start; margin-top: 18px; padding: 9px 14px; border-radius: 999px; font-size: 13px;
  border: 1px dashed var(--line-2); color: var(--ink-2);
}
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.choice, .opt {
  min-height: 46px; padding: 10px 12px; border-radius: var(--r-sm); text-align: center;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); font-size: 14.5px; line-height: 1.3; color: var(--ink);
  transition: background .2s, border-color .2s, opacity .2s, transform .15s;
  overflow-wrap: anywhere;
}
.choice:active, .opt:active { transform: scale(.97); }
.is-picked { background: rgba(201, 184, 159, .16); border-color: rgba(201, 184, 159, .55); }
.is-dim { opacity: .4; }
.options { display: grid; gap: 8px; margin-top: 18px; }
.opt { text-align: left; padding: 13px 15px; }
.opt.is-right { border-color: rgba(159, 183, 162, .7); background: rgba(159, 183, 162, .14); }
.opt.is-wrong { border-color: rgba(196, 154, 140, .6); background: rgba(196, 154, 140, .12); }
.opt:disabled:not(.is-right):not(.is-wrong) { opacity: .45; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.link-out {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2);
}
.link-out svg { width: 14px; height: 14px; }

/* Decks / progress */
.progress { display: flex; gap: 5px; }
.progress span { flex: 1; height: 3px; border-radius: 3px; background: var(--line); transition: background .3s; }
.progress span.on { background: var(--ink-2); }
.progress span.now { background: var(--tone); filter: brightness(1.4); }
.deck-card { min-height: 240px; }
.done { display: flex; flex-direction: column; gap: 14px; padding: 18px 2px; }
.done-title { font: 400 26px/1.25 var(--serif); color: var(--ink); }
.done-title.big { font-size: 34px; }
.score { font: 400 84px/1 var(--serif); letter-spacing: -.03em; }
.score span { font-size: 30px; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.row > .btn { flex: 1; }
.row.between { justify-content: space-between; align-items: center; }
.row.between > .btn { flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 6px 11px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; }
.tag.dim { color: var(--muted); font-style: italic; }

/* Segmented filter */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
  padding: 8px 13px; border-radius: 999px; font-size: 13px; color: var(--muted); border: 1px solid var(--line);
  transition: background .2s, color .2s, border-color .2s;
}
.seg-btn.on { background: var(--ink); color: #121212; border-color: var(--ink); }

/* ---------- Reality check ---------- */
.reality { padding: 20px 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { display: flex; align-items: baseline; gap: 10px; font: 400 18px/1.3 var(--serif); color: var(--ink); }
.num { font: 600 11px/1 var(--sans); color: var(--muted); letter-spacing: .1em; }
textarea {
  width: 100%; resize: none; min-height: 56px; padding: 13px 14px;
  font: 400 16px/1.5 var(--sans); color: var(--ink);
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .2s, background .2s;
}
textarea::placeholder { color: var(--faint); }
textarea:focus { outline: none; border-color: var(--line-2); background: rgba(0, 0, 0, .4); }
.reality-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Rant ---------- */
.rant-choices { display: grid; gap: 10px; }
.option { display: flex; flex-direction: column; gap: 6px; padding: 20px; text-align: left; width: 100%; transition: transform .2s, border-color .2s; }
.option:active { transform: scale(.98); }
.option-title { font: 600 13px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.option-note { font: italic 400 16px/1.45 var(--serif); color: var(--ink-2); }
.rant-box { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.rant-area { min-height: 46vh; font-size: 17px; line-height: 1.6; }
.rant-area.burn { animation: burn .45s var(--ease) forwards; }
@keyframes burn { to { opacity: 0; filter: blur(8px); transform: translateY(-8px) scale(.98); } }
.gone { text-align: center; }

/* ---------- Commute drawer ---------- */
.drawer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-item { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 18px 16px; min-height: 132px; transition: transform .2s; }
.drawer-item:active { transform: scale(.97); }
.drawer-label { font: 400 22px/1.15 var(--serif); }
.drawer-item .drawer-label::first-letter { text-transform: uppercase; }
.drawer-note { font-size: 13px; color: var(--muted); line-height: 1.4; }
.drawer-item.calm { grid-column: 1 / -1; min-height: 110px; background: radial-gradient(80% 120% at 50% 120%, rgba(150, 160, 175, .12), transparent 70%), var(--glass); }
.ten-drawer .drawer-item:last-child { grid-column: 1 / -1; }

/* Calm screen */
.calm-view .topbar { background: none; }
.calm-wrap { min-height: calc(100dvh - 140px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; padding: 10px 6px 30px; }
.orb { position: relative; width: 190px; height: 190px; margin-bottom: 14px; }
.orb span {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(242, 237, 228, .22), rgba(150, 160, 175, .06) 60%, transparent 72%);
  animation: breathe 10s ease-in-out infinite;
}
.orb span:nth-child(2) { inset: 24px; background: radial-gradient(circle, rgba(242, 237, 228, .14), transparent 70%); animation-delay: -.8s; }
.orb span:nth-child(3) { inset: -26px; border: 1px solid rgba(255, 255, 255, .06); background: none; animation-delay: -1.6s; }
@keyframes breathe { 0%, 100% { transform: scale(.78); opacity: .65; } 45% { transform: scale(1.05); opacity: 1; } 55% { transform: scale(1.05); opacity: 1; } }
.calm-thought { font: italic 400 24px/1.4 var(--serif); color: var(--ink); max-width: 22ch; transition: opacity .5s; }
.calm-music { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.calm-music span { display: inline-flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--faint); padding-bottom: 2px; }
.calm-music svg { width: 13px; height: 13px; }
.calm-music small { font-size: 10.5px; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Food ---------- */
.food-result .card-text { font-size: 28px; line-height: 1.2; }
.banned { border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 14px; }
.banned summary { cursor: pointer; list-style: none; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.banned summary::-webkit-details-marker { display: none; }
.banned summary::after { content: " +"; }
.banned[open] summary::after { content: " –"; }
.banned ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.banned li { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); text-decoration: line-through; text-decoration-color: var(--faint); }

/* ---------- Songs ---------- */
.moods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mood { padding: 15px 14px; min-height: 58px; text-align: left; font: 400 16px/1.25 var(--serif); border-radius: var(--r-sm); transition: border-color .2s, background .2s, transform .15s; }
.mood:nth-child(n+5) { grid-column: 1 / -1; }
.mood:active { transform: scale(.97); }
.mood.on { border-color: rgba(201, 184, 159, .55); background: rgba(201, 184, 159, .1); }
.songs { display: flex; flex-direction: column; gap: 12px; }
.songs:empty { display: none; }
.song-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.song-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.song-list span { font: 400 17px/1.3 var(--serif); }
.song-list small { color: var(--muted); font-size: 12.5px; text-align: right; }

/* ---------- Chocolate ---------- */
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rank { font: 400 30px/1 var(--serif); color: var(--tone); filter: brightness(1.4); min-width: 22px; }
.ranking strong { display: block; font: 400 18px/1.3 var(--serif); }
.ranking small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.choc-result .card-text { font-size: 28px; }
.deploying .card-text { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Rapid-fire ---------- */
.timer { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.timer span { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: drain linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.versus { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.vs-btn { min-height: 110px; padding: 16px; font: 400 25px/1.2 var(--serif); transition: transform .15s; overflow-wrap: anywhere; }
.vs-btn:active { transform: scale(.97); }
.or { text-align: center; font: italic 400 15px/1 var(--serif); color: var(--muted); }

/* ---------- Settings sheet ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0); transition: background .26s;
}
.sheet-wrap.open { background: rgba(0, 0, 0, .55); }
.sheet {
  width: 100%; max-width: 540px; padding: 18px 20px calc(22px + var(--bot)); border-radius: 26px 26px 0 0;
  background: rgba(22, 22, 24, .92); border-bottom: 0;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sheet-head .kicker { margin: 0; color: var(--muted); filter: none; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.set-row > span { font-size: 15px; display: flex; flex-direction: column; min-width: 0; }
.set-row small { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.set-row .btn { flex: none; }
.sheet .fine { margin-top: 16px; }
.toggle { width: 50px; height: 30px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .25s; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease); }
.toggle.on { background: var(--accent); }
.toggle.on span { transform: translateX(20px); background: #141414; }

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100; background: #0c0c0e;
  display: flex; align-items: center; justify-content: center; padding: 32px 28px calc(32px + var(--bot));
  transition: opacity .9s var(--ease);
}
.intro.done { opacity: 0; pointer-events: none; }
.intro-stage { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 44px; text-align: center; transition: opacity .5s, transform .6s var(--ease); }
.intro-stage.out { opacity: 0; transform: scale(.98); }
.intro-line { opacity: 0; transform: translateY(10px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease); color: var(--ink); }
.intro-line.in { opacity: 1; transform: none; filter: none; }
.intro-line.out { opacity: 0; transform: translateY(-8px); filter: blur(4px); transition-duration: .55s; }
.intro-line.xl { font: 400 clamp(64px, 22vw, 104px)/1 var(--serif); letter-spacing: -.03em; }
.intro-line.lg { font: 400 clamp(34px, 10vw, 46px)/1.15 var(--serif); letter-spacing: -.015em; }
.intro-line.md { font: italic 400 clamp(19px, 5.4vw, 23px)/1.6 var(--serif); color: var(--ink-2); }
.intro-btn {
  opacity: 0; transform: translateY(8px); transition: opacity .9s var(--ease), transform .9s var(--ease), background .2s;
  padding: 17px 38px; border-radius: 999px; border: 1px solid rgba(242, 237, 228, .5);
  font: 600 13px/1 var(--sans); letter-spacing: .32em; text-indent: .32em; color: var(--ink);
}
.intro-btn.in { opacity: 1; transform: none; }
.intro-btn:active { background: rgba(242, 237, 228, .1); }
.intro-skip { position: absolute; bottom: calc(26px + var(--bot)); left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #3c3a37; transition: opacity .4s; }
.intro-skip.gone { opacity: 0; }

/* ---------- Narrow phones ---------- */
@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .env-text { font-size: 17px; }
  .env.wide .env-text { font-size: 22px; }
  .env-body { padding-left: 13px; padding-right: 13px; }
  .card-text { font-size: 20px; }
  .drawer-label { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .timer span { animation-duration: 4s !important; }
}
.commute-drawer .drawer-item:nth-child(3) { grid-column: 1 / -1; min-height: 110px; }
.reality textarea { min-height: 76px; overflow: hidden; }
