:root {
  --bg: #0e0f12;
  --panel: #171a20;
  --panel-2: #1f232b;
  --line: #2e333d;
  --paper: #efe6d2;
  --ink: #1b1712;
  --text: #e9e6df;
  --dim: #9a978f;
  --amber: #ffb347;
  --red: #e0533d;
  --green: #4fc08d;
  --radius: 14px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Courier New', monospace;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); touch-action: manipulation; }
body { overflow-x: hidden; }
body { font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; min-height: 100dvh; -webkit-text-size-adjust: 100%; }
.lamp { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 45% at 50% -8%, rgba(255,179,71,.22), transparent 70%); }
main { position: relative; max-width: 640px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); min-height: 100dvh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--serif); margin: 0; letter-spacing: .01em; }
button, summary { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
summary { min-height: 44px; display: flex; align-items: center; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }

/* buttons */
.btn { min-height: 44px; border: 0; border-radius: 12px; padding: 14px 20px; font-weight: 700; letter-spacing: .02em; background: var(--amber); color: #1a1205; transition: transform .08s, filter .15s; }
@media (hover: hover) { .btn:hover { filter: brightness(1.08); } .archive button:hover, .chip:hover { border-color: var(--amber); } }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #04160d; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* home */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.demo-badge { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--amber); border: 1px solid rgba(255,179,71,.45); background: rgba(255,179,71,.08); border-radius: 999px; padding: 6px 12px; }
.a2hs { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; border-radius: var(--radius); border: 1px dashed var(--amber); font-size: 14px; }
.a2hs span { flex: 1; }
.logo { font-family: var(--serif); font-size: clamp(54px, 17vw, 88px); font-weight: 800; letter-spacing: .14em; line-height: 1; margin: 22px 0 6px; text-align: center; color: var(--paper); text-shadow: 0 0 40px rgba(255,179,71,.35); }
.logo span { color: var(--amber); }
.sub { text-align: center; color: var(--dim); font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 18px; }
.daily h2 { font-size: 26px; margin: 4px 0 4px; }
.pill { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); text-transform: uppercase; }
.pill.amber { color: var(--amber); border-color: rgba(255,179,71,.5); }
.how { margin: 16px 0 0; padding: 18px; list-style: none; display: grid; gap: 8px; color: var(--dim); font-size: 15px; }
.how b { color: var(--text); }
.archive { display: grid; gap: 8px; margin-top: 10px; }
.archive button { min-height: 56px; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.archive .t { font-weight: 600; }
.stars { color: var(--amber); letter-spacing: 2px; font-size: 13px; }
.foot { margin-top: auto; padding-top: 28px; text-align: center; color: var(--dim); font-size: 12px; font-family: var(--mono); }

/* case file */
.paper { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 20px 18px 22px; box-shadow: 0 18px 40px rgba(0,0,0,.45); transform: rotate(-.4deg); position: relative; }
.paper::before { content: 'CASE FILE'; position: absolute; top: 10px; right: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: #8a2f20; border: 2px solid #8a2f20; padding: 1px 7px; transform: rotate(4deg); opacity: .8; }
.paper h2 { font-size: 28px; line-height: 1.1; padding-right: 90px; }
.paper .meta { font-family: var(--mono); font-size: 12.5px; margin: 10px 0 12px; display: grid; gap: 2px; }
.paper .meta b { letter-spacing: .06em; }
.paper p { margin: 0 0 12px; font-family: var(--serif); font-size: 16.5px; }
.paper h3 { font-size: 13px; font-family: var(--mono); letter-spacing: .15em; text-transform: uppercase; margin: 14px 0 8px; border-bottom: 1px solid rgba(0,0,0,.25); padding-bottom: 4px; }
.evidence { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.evidence li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; font-size: 15px; font-family: var(--serif); }
.evidence .eid { font-family: var(--mono); font-weight: 700; font-size: 12px; background: var(--ink); color: var(--paper); border-radius: 4px; height: 20px; line-height: 20px; text-align: center; margin-top: 2px; }
.suspect-card { display: flex; gap: 14px; align-items: center; margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.avatar { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: radial-gradient(circle at 35% 30%, #3a3f4a, #1a1d23); border: 2px solid var(--amber); flex: none; }
.avatar.sm { width: 38px; height: 38px; font-size: 21px; border-width: 1.5px; }
.cta { margin-top: 18px; display: grid; gap: 10px; }
.cta .btn.big { font-size: 18px; padding: 17px; }

/* play: a fixed, keyboard-aware stage. --app-h / --app-top follow visualViewport (set in app.js). */
html.playing, html.playing body { overflow: hidden; overscroll-behavior: none; }
.play { position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: var(--app-h, 100dvh); z-index: 2; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.hud, .board { width: 100%; max-width: 720px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.hud { flex: none; padding-top: 10px; padding-bottom: 8px; }
.board { flex: 1; min-height: 0; display: flex; }
.stage { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.filepane { display: none; }
.clock { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.time { font-family: var(--mono); font-size: 46px; font-weight: 700; letter-spacing: .02em; line-height: 1; font-variant-numeric: tabular-nums; }
.time { transition: color .4s; display: inline-block; transform-origin: left center; }
[data-tension='warn'] .time { color: var(--amber); }
[data-tension='danger'] .time, [data-tension='out'] .time { color: var(--red); text-shadow: 0 0 18px rgba(224,83,61,.55); }
.time.pop { animation: pop .5s cubic-bezier(.2,1.5,.4,1); }
.bar { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 100%; background: var(--amber); transform-origin: left; transition: background .3s; }
[data-tension='warn'] .bar i { background: var(--amber); }
[data-tension='danger'] .bar i, [data-tension='out'] .bar i { background: var(--red); box-shadow: 0 0 12px rgba(224,83,61,.8); }
.bar { height: 8px; }
.bar i { transition: background .4s; will-change: transform; }
.clockside { display: flex; align-items: center; gap: 10px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; line-height: 1; display: grid; place-items: center; padding: 0; }
.iconbtn[aria-pressed='true'] { border-color: var(--amber); }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 6; opacity: 0; transition: opacity .6s; box-shadow: inset 0 0 120px 30px rgba(224,83,61,.55); }
[data-tension='warn'] .vignette { opacity: .22; box-shadow: inset 0 0 110px 10px rgba(255,179,71,.4); }
[data-tension='danger'] .vignette { opacity: 1; animation: heartbeat 1s ease-in-out infinite; }
[data-tension='out'] .vignette { opacity: .8; }
.qcount { font-family: var(--mono); font-size: 13px; color: var(--dim); text-align: right; }
.suspect { flex: none; display: flex; align-items: center; gap: 12px; padding: 6px 0 8px; }
.suspect .nm { font-weight: 700; line-height: 1.2; }
.suspect .rl { font-size: 13px; color: var(--dim); }
.log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; padding: 8px 2px 14px; }
.msg { display: flex; gap: 10px; max-width: 94%; animation: rise .22s ease-out; }
.msg .bubble { padding: 10px 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: rgba(255,179,71,.12); border-color: rgba(255,179,71,.45); border-top-right-radius: 4px; }
.msg.them .bubble { border-top-left-radius: 4px; }
.msg .beat { display: block; margin-top: 4px; font-size: 13.5px; color: var(--dim); font-style: italic; }
.msg.sys .bubble { background: transparent; border-style: dashed; color: var(--dim); font-size: 14px; }
.msg.sys { align-self: center; }
.dock { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 15px; color: var(--text); }
.err { color: var(--red); font-size: 14px; }
.err:empty { display: none; }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; width: 100%; min-width: 0; min-height: 48px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 12px 14px; font: inherit; font-size: 16px; }
.ask input:focus-visible { border-color: var(--amber); }
.ask .btn { min-width: 64px; }
.mic { flex: none; width: 52px; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; }
.mic.on { background: var(--red); border-color: var(--red); animation: pulse 1s infinite; }
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verdicts .btn { min-height: 50px; }
.confirm { background: var(--panel); border: 1px solid var(--amber); border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; max-width: 640px; width: 100%; margin: 0 auto; animation: sheetup .22s ease-out; }
.confirm .cq { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); margin: 0 2px; animation: blink 1s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.72); display: grid; align-items: end; padding-top: env(safe-area-inset-top); }
.sheet > div:not(.confirm) { background: var(--bg); max-height: 88dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; border: 1px solid var(--line); }

/* keyboard open: give the transcript the room */
html.kb .suspect { display: none; }
html.kb .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
html.kb .chip { flex: none; }
html.kb .dock { padding-bottom: 8px; gap: 8px; }
@media (max-height: 520px) { .suspect, .hud .qcount { display: none; } .time { font-size: 34px; } }

/* wide / landscape tablets: case file pinned left, interrogation right */
@media (min-width: 900px) {
  .hud, .board { max-width: 1240px; padding-left: 24px; padding-right: 24px; }
  .board { gap: 28px; }
  .filepane { display: block; flex: 0 0 min(42%, 480px); min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 6px 24px 2px; }
  .filebtn { display: none; }
  .stage { max-width: 680px; margin: 0 auto; }
  .time { font-size: 52px; }
}

/* reveal */
.stamp { font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 9vw, 44px); letter-spacing: .08em; text-align: center; border: 4px solid; border-radius: 10px; padding: 8px 14px; margin: 12px auto 4px; width: fit-content; transform: rotate(-3deg); }
.stamp.win { color: var(--green); } .stamp.lose { color: var(--red); }
.score { text-align: center; margin-top: 12px; }
.score .n { font-family: var(--mono); font-size: 56px; font-weight: 700; line-height: 1; }
.score .g { font-size: 18px; color: var(--amber); margin-top: 4px; }
.parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; font-family: var(--mono); font-size: 12px; text-align: center; }
.parts div { background: var(--panel-2); border-radius: 10px; padding: 8px 4px; }
.parts b { display: block; font-size: 18px; color: var(--text); }
.section { margin-top: 22px; }
.section > h3, .section > h3 { font-size: 20px; margin-bottom: 10px; }
.slip { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.slip.clear { border-left-color: var(--green); }
.slip.decoy { border-left-color: var(--amber); }
.slip .q { font-family: var(--mono); font-size: 13px; color: var(--amber); }
.slip .said { margin: 6px 0; }
.slip .truth { font-size: 14.5px; color: var(--dim); }
.slip .truth b { color: var(--text); }
.slip.miss { opacity: .85; border-left-style: dashed; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.tag.t-slip { color: var(--red); } .tag.t-clear { color: var(--green); } .tag.t-decoy { color: var(--amber); }
.sharebox { white-space: pre-wrap; font-family: var(--mono); font-size: 15px; background: #0a0b0e; border: 1px dashed var(--amber); border-radius: 12px; padding: 14px; margin: 0 0 10px; word-break: break-word; }
.log-t { font-size: 14px; display: grid; gap: 6px; }
.log-t div { display: grid; grid-template-columns: 26px 1fr; gap: 6px; }
details summary { cursor: pointer; color: var(--dim); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 40; animation: rise .2s; }
.err { color: var(--red); font-size: 14px; min-height: 20px; }
.noscript { padding: 24px; text-align: center; }

@keyframes pulse { 50% { opacity: .55; } }
@keyframes pop { 0% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes heartbeat { 0%, 100% { opacity: .35; } 14% { opacity: 1; } 28% { opacity: .5; } 42% { opacity: .95; } 70% { opacity: .35; } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-3deg) scale(2.2); } }
@media (min-width: 834px) { main { max-width: 720px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* suspect reactions: same treatment pool for every case; driven only by spoiler-free response signals */
.avatar.xl { width: 68px; height: 68px; font-size: 38px; position: relative; transition: border-color .3s; }
.avatar .face { display: block; animation: breathe 4.2s ease-in-out infinite; }
.avatar[data-state='think'] { animation: think 1.1s ease-in-out infinite; border-color: var(--dim); }
.avatar[data-state='talk'] { animation: bob .34s ease-in-out infinite; }
.avatar .face.nod { animation: nod .5s ease-out; }
.avatar .face.flinch { animation: flinch .55s ease-out; }
.sweat { position: absolute; top: -6px; right: -10px; font-size: 22px; animation: drip 1.3s ease-in forwards; pointer-events: none; }
.beat.tell { display: inline-block; background: rgba(255,179,71,.08); border-left: 2px solid rgba(255,179,71,.7); padding: 1px 8px; border-radius: 3px; animation: tell 1.6s ease-out backwards; }
.msg.me { animation: slide-r .26s cubic-bezier(.2,.9,.3,1); }
.msg.them { animation: slide-l .26s cubic-bezier(.2,.9,.3,1); }
.flyer { position: fixed; z-index: 30; pointer-events: none; display: flex; align-items: center; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(255,179,71,.6); background: #2a2217; overflow: hidden; white-space: nowrap; font-size: 16px; }
.btn.sent { animation: sent .4s ease-out; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rest { visibility: hidden; }
.play.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
/* desk lamp + paper grain */
.lamp::after { content: ''; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.paper { background-image: linear-gradient(rgba(255,255,255,.18), rgba(120,90,40,.08)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .15 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes breathe { 50% { transform: scale(1.06) translateY(-1px); } }
@keyframes think { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-1px); } }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes nod { 40% { transform: translateY(4px) rotate(4deg); } }
@keyframes flinch { 0% { transform: translateX(0); } 15% { transform: translateX(-7px) rotate(-8deg); } 30% { transform: translateX(6px) rotate(6deg); } 45% { transform: translateX(-4px); } 60% { transform: translateX(3px); } 100% { transform: none; } }
@keyframes drip { 0% { opacity: 0; transform: translateY(-4px) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(26px) scale(1); } }
@keyframes tell { 0% { background-color: rgba(255,179,71,.0); opacity: 0; } 30% { background-color: rgba(255,179,71,.35); opacity: 1; } }
@keyframes slide-r { from { opacity: 0; transform: translateX(24px); } }
@keyframes slide-l { from { opacity: 0; transform: translateX(-24px); } }
@keyframes sent { 40% { transform: scale(.92); filter: brightness(1.3); } }
@keyframes shake { 10%, 90% { transform: translate3d(-2px, 0, 0); } 20%, 80% { transform: translate3d(4px, 1px, 0); } 30%, 50%, 70% { transform: translate3d(-7px, -1px, 0); } 40%, 60% { transform: translate3d(7px, 1px, 0); } }

/* reveal sequence */
.pend { display: none !important; }
.revealwrap { display: flex; flex-direction: column; }
.revealwrap.shake { animation: shake .6s cubic-bezier(.36,.07,.19,.97); }
.stamp.slam { animation: slam .5s cubic-bezier(.2,1.2,.3,1); }
.stamp { margin-top: 24px; box-shadow: 0 0 0 0 currentColor; }
.stamp.win { text-shadow: 0 0 24px rgba(79,192,141,.45); }
.stamp.lose { text-shadow: 0 0 24px rgba(224,83,61,.45); }
.verdictline { text-align: center; margin: 8px 0 0; }
.fade { animation: fadeup .5s ease-out; }
.popin { animation: popin .35s cubic-bezier(.2,1.6,.4,1); }
.flip { animation: flipin .45s cubic-bezier(.2,.9,.3,1); transform-origin: 50% 0; }
.parts b { transition: none; }
.qn { font-family: var(--mono); font-weight: 700; color: #1a1205; background: var(--amber); border-radius: 5px; padding: 0 6px; font-size: 11px; letter-spacing: .04em; }
.slip .q { background: rgba(255,179,71,.1); border-radius: 6px; padding: 3px 8px; }
.yours .log-t { list-style: none; margin: 0; padding: 0; gap: 8px; }
.yours .log-t li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; font-size: 14.5px; }
.yours .log-t li .qn { align-self: start; text-align: center; background: var(--panel-2); color: var(--dim); padding: 2px 0; }
.yours .log-t li.hit { background: var(--panel); border-color: var(--line); }
.yours .log-t li.hit.t-slip { border-left: 3px solid var(--red); } .yours .log-t li.hit.t-clear { border-left: 3px solid var(--green); } .yours .log-t li.hit.t-decoy { border-left: 3px solid var(--amber); }
.yours .log-t li.hit .qn { background: var(--amber); color: #1a1205; }
.card.board-lb h3 { font-size: 20px; }
.lb { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.lb li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); min-height: 44px; }
.lb li.me { background: rgba(255,179,71,.14); outline: 1px solid var(--amber); font-weight: 700; }
.lb .rk { font-family: var(--mono); color: var(--dim); width: 18px; text-align: center; }
.lb .em { font-size: 22px; }
.lb small { color: var(--dim); font-weight: 400; }
.lb .sc { font-family: var(--mono); font-weight: 700; } .lb .sc.bad { color: var(--red); }
.spotlight { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(circle at 50% 45%, rgba(255,214,140,.16) 0, rgba(0,0,0,.94) 38%); animation: dim .5s ease-out; }
.spotlight .big { font-size: 96px; line-height: 1; filter: drop-shadow(0 0 30px rgba(255,179,71,.6)); animation: breathe 1.4s ease-in-out infinite; }
.spotlight .verd { font-family: var(--serif); font-size: 22px; color: var(--paper); letter-spacing: .05em; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.skiphint { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); background: rgba(14,15,18,.85); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; pointer-events: none; z-index: 10; }
@keyframes slam { 0% { opacity: 0; transform: rotate(-3deg) scale(3.2); } 55% { opacity: 1; transform: rotate(-3deg) scale(.9); } 75% { transform: rotate(-3deg) scale(1.04); } 100% { transform: rotate(-3deg) scale(1); } }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } }
@keyframes popin { from { opacity: 0; transform: scale(.4); } }
@keyframes flipin { from { opacity: 0; transform: perspective(700px) rotateX(-85deg); } }
@keyframes dim { from { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 900px) { .revealwrap { max-width: 720px; margin: 0 auto; width: 100%; } }

/* daily habit: week strip + streak stats */
.habit { padding: 14px 16px; }
.weekrow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dayc { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.dayc i { width: 100%; max-width: 44px; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.dayc small { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.dayc.win i { background: var(--green); border-color: var(--green); }
.dayc.lose i { background: var(--red); border-color: var(--red); }
.dayc.today i { border: 2px dashed var(--amber); background: transparent; }
.dayc.pre i { opacity: .25; }
.habitstats { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--dim); flex-wrap: wrap; }
.habitstats b { color: var(--text); font-family: var(--mono); font-size: 16px; }
.streakline { margin: 0 0 10px; font-weight: 600; color: var(--amber); }

/* onboarding + question log */
.confirm.ob { text-align: center; gap: 12px; }
.ob-icon { font-size: 44px; line-height: 1; }
.ob-dots { display: flex; justify-content: center; gap: 8px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ob-dots i.on { background: var(--amber); }
.tip { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--amber); background: rgba(255,179,71,.08); font-size: 14px; line-height: 1.35; }
.linkbtn { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--amber); text-decoration: underline; font-size: 14px; white-space: nowrap; }
.savednote { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); font-family: var(--mono); }
.qlogcard h3 { font-size: 18px; }

.updatebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; width: min(92vw, 460px); padding: 10px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--amber); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
