/* Unplayable app. Shadow Hands look: near-black, bone and grey. Gold only on the mark, earned seals and purchase
   buttons; red only for Red Flags and wrong answers. */
:root {
  --bg: #0A0908;
  --bg-2: #110F0D;
  --card: #161412;
  --card-2: #1D1A16;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --bone: #EEE7DA;
  --hi: #F4EFE6;
  --mute: #A89D8E;
  --dim: #74695E;
  --gold: #C9A45C;
  --gold-hi: #EBD49A;
  --gold-lo: #8C6B2F;
  --red: #B23A30;
  --red-hi: #E0594C;
  --foil: linear-gradient(100deg, #8a6a2e 0%, #ead394 22%, #b8913f 40%, #f7e8b6 55%, #a8823a 72%, #e3c57f 88%, #7c5d26 100%);
  --sans: 'Inter Tight', -apple-system, Helvetica, Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --r: 10px;
  --tabh: 64px;
  --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 { margin: 0; background: var(--bg); color: var(--bone); }
body { font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; min-height: 100vh; }
body.noscroll { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--bone); text-decoration-color: rgba(238, 231, 218, .3); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0 0 .9em; padding-left: 1.2em; }
li { margin: .25em 0; }
b, strong { color: var(--hi); font-weight: 600; }
::selection { background: rgba(201, 164, 92, .35); }

#app { max-width: 640px; margin: 0 auto; padding: calc(var(--st) + 14px) 16px calc(var(--tabh) + var(--sb) + 28px); min-height: 100vh; }
body.full #app { padding-bottom: calc(var(--sb) + 24px); }
body.full #tabs { display: none; }

/* tab bar */
#tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 0; padding: 6px 6px calc(6px + var(--sb)); background: rgba(10, 9, 8, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
#tabs a { flex: 1; max-width: 128px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; text-decoration: none; color: var(--dim); font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#tabs a.on { color: var(--bone); }

/* type */
.lbl { font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.lbl.gold { color: var(--gold); }
.lbl.red { color: var(--red-hi); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
.mute { color: var(--mute); }
.dim { color: var(--dim); }
.small { font-size: 13.5px; line-height: 1.5; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.sp { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.gap { height: 18px; }
.hr { height: 1px; background: var(--line); margin: 20px 0; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 40px; }
.top .mark { width: 30px; height: 30px; }
.top h1 { font-size: 22px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 10px 10px 10px 0; text-decoration: none; }
.back::before { content: ''; width: 9px; height: 9px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line-2); border-radius: 99px; font: 500 12px/1 var(--mono); color: var(--bone); white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill.gold { border-color: rgba(201, 164, 92, .45); color: var(--gold-hi); }

/* surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card.tight { padding: 14px; }
.card.link { display: block; text-decoration: none; transition: border-color .2s, background .2s; }
.card.link:active { background: var(--card-2); }
.card.red { border-color: rgba(178, 58, 48, .45); background: linear-gradient(180deg, rgba(178, 58, 48, .10), rgba(178, 58, 48, .02)); }
.card.gold { border-color: rgba(201, 164, 92, .35); }
.list { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 14px 18px; border-radius: 12px; background: var(--bone); color: #0A0908; font-weight: 600; font-size: 16px; text-decoration: none; letter-spacing: -.01em; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--bone); border: 1px solid var(--line-2); }
.btn.buy { background: var(--foil); color: #1a1408; }
.btn.red { background: var(--red); color: #fff; }
.btn.sm { min-height: 40px; padding: 9px 14px; font-size: 14px; border-radius: 10px; width: auto; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; }
.tlink { color: var(--mute); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* the strings: 99 threads under a control bar, cut as you master each move */
.strings { width: 100%; height: auto; display: block; overflow: visible; }
.strings .bar { stroke: var(--gold); stroke-width: 7; stroke-linecap: round; }
.strings line.s { stroke: var(--bone); stroke-width: 2.2; stroke-linecap: round; opacity: .16; transition: opacity .6s; }
.strings line.s.seen { opacity: .45; }
.strings line.s.ix { stroke: var(--red-hi); }
.strings .cut .up { stroke: var(--gold); opacity: .95; stroke-width: 2.4; stroke-linecap: round; }
.strings .cut .down { stroke: var(--dim); opacity: .55; stroke-width: 2.2; stroke-linecap: round; }
.strings .cut.new .down { animation: fall 1.4s cubic-bezier(.3, 0, .6, 1) both; }
@keyframes fall { 0% { transform: translateY(-40px); opacity: .9; } 100% { transform: none; opacity: .55; } }

.hero { text-align: center; padding: 6px 0 4px; }
.hero .rank { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; margin: 6px 0 4px; letter-spacing: .01em; }
.xpbar { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; margin: 10px 0 6px; }
.xpbar i { display: block; height: 100%; background: var(--bone); border-radius: 6px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.xpbar.gold i { background: var(--foil); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.stat span { font: 500 10px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }

.cta { position: relative; overflow: hidden; display: block; text-decoration: none; padding: 20px; border-radius: 14px; background: var(--bone); color: #0A0908; }
.cta h2 { color: #0A0908; font-size: 22px; }
.cta p { margin: 4px 0 0; color: #3b352d; font-size: 14.5px; }
.cta .lbl { color: #5b5246; }
.cta.done { background: var(--card); color: var(--bone); border: 1px solid var(--line); }
.cta.done h2 { color: var(--bone); }
.cta.done p, .cta.done .lbl { color: var(--mute); }
.cta .arrow { position: absolute; right: 18px; top: 50%; width: 12px; height: 12px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: translateY(-50%) rotate(45deg); }

/* quests */
.quest { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.quest:first-of-type { border-top: 0; }
.quest .box { width: 22px; height: 22px; flex: none; border: 1.5px solid var(--line-2); border-radius: 6px; display: grid; place-items: center; }
.quest.ok .box { background: var(--bone); border-color: var(--bone); }
.quest.ok .box::after { content: ''; width: 10px; height: 5px; border-left: 2px solid #0A0908; border-bottom: 2px solid #0A0908; transform: translateY(-1px) rotate(-45deg); }
.quest.ok .t { color: var(--mute); text-decoration: line-through; text-decoration-color: var(--dim); }
.quest .xp { font: 500 12px var(--mono); color: var(--mute); }

/* chapter path */
.card.chap { display: flex; align-items: center; gap: 14px; padding: 14px; }
.chap .num { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--bone); }
.chap.sealed .num { border-color: var(--gold); color: var(--gold-hi); box-shadow: 0 0 0 3px rgba(201, 164, 92, .12); }
.chap.ix .num { border-color: rgba(224, 89, 76, .5); color: var(--red-hi); }
.chap h3 { font-size: 16px; }
.chap .meter { display: flex; gap: 3px; margin-top: 7px; }
.chap .meter i { flex: 1; height: 4px; border-radius: 2px; background: var(--card-2); }
.chap .meter i.seen { background: rgba(238, 231, 218, .35); }
.chap .meter i.m { background: var(--bone); }
.chap.ix .meter i.m { background: var(--red-hi); }

/* drill */
.qwrap { display: flex; flex-direction: column; min-height: calc(100vh - var(--st) - 60px); }
.qtop { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.qtop .x { width: 36px; height: 36px; display: grid; place-items: center; color: var(--mute); font-size: 24px; line-height: 1; }
.prog { flex: 1; height: 6px; background: var(--card-2); border-radius: 6px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--bone); transition: width .4s; }
.lives { display: flex; gap: 4px; }
.lives i { width: 9px; height: 9px; border-radius: 50%; background: var(--red-hi); }
.lives i.off { background: var(--card-2); }
.timer { height: 3px; background: var(--card-2); border-radius: 3px; overflow: hidden; margin: -8px 0 16px; }
.timer i { display: block; height: 100%; background: var(--mute); transform-origin: left; }
.qkind { margin-bottom: 10px; }
.qprompt { font-size: 19px; line-height: 1.45; color: var(--hi); margin-bottom: 20px; }
.qprompt.scene { font-size: 16px; line-height: 1.6; color: var(--bone); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; max-height: 42vh; overflow: auto; }
.qprompt.tag { font-family: var(--serif); font-style: italic; font-size: 26px; font-weight: 500; line-height: 1.25; }
.redact { display: inline-block; background: var(--bone); color: transparent; border-radius: 3px; height: .95em; vertical-align: -.1em; min-width: 3.2em; opacity: .85; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { text-align: left; width: 100%; padding: 15px 16px; min-height: 56px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-2); color: var(--bone); font-size: 16px; line-height: 1.4; transition: background .15s, border-color .15s, transform .1s; }
.opt:active { transform: scale(.985); }
.opt .on { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.opt .num { font: 500 11px var(--mono); color: var(--dim); margin-right: 8px; }
.opt.right { background: rgba(238, 231, 218, .12); border-color: var(--bone); }
.opt.wrong { background: rgba(178, 58, 48, .14); border-color: var(--red-hi); }
.opt.fade { opacity: .45; }
.opts.done .opt { pointer-events: none; }
.feedback { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); animation: up .3s ease both; }
.feedback.ok { border-color: rgba(238, 231, 218, .5); }
.feedback.no { border-color: rgba(224, 89, 76, .55); }
.feedback h3 { font-size: 18px; margin-bottom: 6px; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.qfoot { margin-top: auto; padding-top: 18px; position: sticky; bottom: calc(var(--sb) + 10px); }
.combo { font: 600 12px var(--mono); color: var(--gold-hi); letter-spacing: .08em; }

/* results */
.big { font-family: var(--serif); font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.ring { position: relative; width: 150px; height: 150px; margin: 8px auto 14px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--card-2); }
.ring .fg { stroke: var(--bone); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }
.ring.gold .fg { stroke: var(--gold); }
.ring .v { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 46px; font-weight: 600; }
.earn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(201, 164, 92, .4); background: rgba(201, 164, 92, .06); animation: up .4s ease both; }
.earn .ico { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--gold); display: grid; place-items: center; color: var(--gold-hi); font-family: var(--serif); font-weight: 600; font-size: 17px; }

/* codex */
.search { width: 100%; padding: 13px 14px 13px 40px; border-radius: 12px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2374695E' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px 50% / 18px no-repeat; border: 1px solid var(--line-2); font-size: 16px; outline: none; }
.search:focus { border-color: var(--mute); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line-2); font: 500 12px/1 var(--mono); color: var(--mute); background: transparent; white-space: nowrap; }
.chip.on { background: var(--bone); color: #0A0908; border-color: var(--bone); }
.titem { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.titem .n { width: 30px; flex: none; font: 500 12px var(--mono); color: var(--dim); text-align: right; }
.titem .nm { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.15; }
.titem .tg { font-size: 13px; color: var(--mute); line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.dots { display: flex; gap: 3px; flex: none; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--card-2); }
.dots i.on { background: var(--bone); }
.dots.m i.on { background: var(--gold); }
.tcard-head { text-align: center; padding: 10px 0 18px; }
.tcard-head .numeral { font: 500 12px var(--mono); letter-spacing: .14em; color: var(--mute); }
.tcard-head h1 { font-family: var(--serif); font-size: 42px; font-weight: 600; letter-spacing: 0; margin: 8px 0 10px; line-height: 1.05; }
.tcard-head .tag { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--bone); line-height: 1.35; max-width: 30ch; margin: 0 auto; }
.sec { margin-top: 22px; }
.sec > .lbl { margin-bottom: 8px; display: block; }
.sec .body { font-size: 16px; line-height: 1.62; color: var(--bone); }
.sec .body p:last-child { margin-bottom: 0; }
.locked { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--mute); font-size: 15px; }
.locked svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--gold); stroke-width: 1.8; }
.arcana { position: relative; display: block; width: 62%; max-width: 260px; margin: 6px auto 18px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(201, 164, 92, .4); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.arcana img { width: 100%; aspect-ratio: 1104 / 1526; object-fit: cover; }
.arcana.lockd { width: 44%; max-width: 190px; }
.arcana.lockd img { filter: grayscale(1) brightness(.22) blur(5px); }
.arcana .veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 14px; font-size: 12.5px; line-height: 1.4; color: var(--mute); }
.arcana .veil svg { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1.8; }
.arcana .veil b { color: var(--bone); font-family: var(--serif); font-size: 16px; }
.deck { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.deck a { position: relative; display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); aspect-ratio: 1104 / 1526; background: var(--card); }
.deck a.got { border-color: rgba(201, 164, 92, .55); }
.deck img { width: 100%; height: 100%; object-fit: cover; }
.deck a:not(.got) img { filter: grayscale(1) brightness(.28) blur(2px); }
.deck a span { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font: 500 9px var(--mono); color: var(--mute); letter-spacing: .08em; }

/* badges */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { text-align: center; }
.badge .b { width: 54px; height: 54px; margin: 0 auto 6px; border-radius: 50%; border: 1px dashed var(--line-2); display: grid; place-items: center; font-family: var(--serif); font-size: 19px; color: var(--dim); font-weight: 600; }
.badge.got .b { border: 1px solid var(--gold); color: var(--gold-hi); background: radial-gradient(circle at 50% 35%, rgba(201, 164, 92, .18), transparent 70%); }
.badge span { font-size: 11px; line-height: 1.25; color: var(--mute); display: block; }
.badge.got span { color: var(--bone); }

/* chat: Read the Room + The Room */
.chat { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 16px; font-size: 15.5px; line-height: 1.5; animation: up .25s ease both; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--bone); color: #0A0908; border-bottom-right-radius: 5px; }
.msg.them { align-self: flex-start; background: var(--card-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg .who { display: block; font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-bottom: 4px; }
.composer { position: sticky; bottom: calc(var(--tabh) + var(--sb) + 8px); z-index: 5; display: flex; gap: 8px; align-items: flex-end; padding: 10px; margin: 8px -6px 0; background: rgba(22, 20, 18, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: 18px; }
body.full .composer { bottom: calc(var(--sb) + 8px); }
.composer textarea { flex: 1; min-height: 24px; max-height: 160px; resize: none; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.45; padding: 6px 6px; }
.composer button.send { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--bone); color: #0A0908; display: grid; place-items: center; }
.composer button.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.composer button.send[disabled] { opacity: .35; }
.thinking { align-self: flex-start; display: flex; gap: 10px; align-items: center; color: var(--mute); font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 8px 2px; }
.thinking .eye { width: 34px; height: 18px; position: relative; }
.thinking .eye::before { content: ''; position: absolute; inset: 0; border: 1.5px solid var(--mute); border-radius: 50% / 50%; }
.thinking .eye::after { content: ''; position: absolute; width: 7px; height: 7px; top: 5.5px; left: 13px; border-radius: 50%; background: var(--bone); animation: look 1.6s ease-in-out infinite; }
@keyframes look { 0%, 100% { transform: translateX(-8px); } 50% { transform: translateX(8px); } }
.prompts { display: flex; flex-direction: column; gap: 8px; }
.prompts button { text-align: left; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-size: 14.5px; line-height: 1.4; color: var(--bone); }

.reading { align-self: stretch; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 18px; animation: up .35s ease both; }
.reading .sect { margin-top: 18px; }
.reading .sect > .lbl { display: block; margin-bottom: 8px; }
.press { display: flex; gap: 3px; margin: 8px 0 2px; }
.press i { flex: 1; height: 8px; border-radius: 2px; background: var(--card-2); }
.press i.on { background: var(--bone); }
.press.hot i.on { background: var(--red-hi); }
.move { display: block; text-decoration: none; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); margin-top: 8px; background: var(--bg-2); }
.move .nm { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.move .why { font-size: 14px; color: var(--mute); margin-top: 2px; line-height: 1.45; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin: 10px 0; line-height: 1.45; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 23px; height: 23px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font: 500 12px var(--mono); color: var(--bone); }
.say { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--bone); color: #0A0908; margin-top: 8px; font-size: 15.5px; line-height: 1.45; font-weight: 500; }
.say .q { flex: 1; }
.say button { flex: none; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #5b5246; padding: 3px 0 3px 6px; }
.habit { display: flex; gap: 12px; align-items: center; }
.habit .k { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-hi); display: grid; place-items: center; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.ai-note { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.ai-note button { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }
.help { border-color: rgba(224, 89, 76, .6); }
.help p { font-size: 14.5px; }
.followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.followups button { padding: 9px 13px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 13.5px; color: var(--bone); text-align: left; }

.setting { background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 14px; padding: 14px 16px; font-size: 14.5px; color: var(--mute); line-height: 1.5; }
.setting b { color: var(--bone); }
.turns { font: 500 11px var(--mono); color: var(--mute); letter-spacing: .08em; }

/* sheets + overlays */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .65); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + var(--sb)); animation: sheet .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { margin-bottom: 8px; }
.field { width: 100%; padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-2); font-size: 16px; outline: none; }
.field:focus { border-color: var(--mute); }
textarea.field { min-height: 96px; resize: vertical; line-height: 1.45; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: var(--bone); padding: 10px 0; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--bone); margin-top: 1px; }

#toast { position: fixed; z-index: 80; left: 50%; top: calc(var(--st) + 12px); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 12px; background: var(--bone); color: #0A0908; font-size: 14.5px; font-weight: 600; transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.xp { background: var(--foil); color: #1a1408; }

.levelup { position: fixed; inset: 0; z-index: 70; background: radial-gradient(circle at 50% 40%, rgba(201, 164, 92, .16), transparent 60%), #0A0908; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; animation: fade .3s ease both; }
.levelup .mark { width: 120px; height: 120px; margin-bottom: 18px; animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(201, 164, 92, 0)); } 50% { filter: drop-shadow(0 0 22px rgba(201, 164, 92, .55)); } }
.levelup .big { font-size: 54px; margin: 8px 0 10px; }

.onb { min-height: calc(100vh - var(--st) - 40px); display: flex; flex-direction: column; justify-content: center; padding: 20px 4px; }
.onb .mark { width: 92px; height: 92px; margin: 0 auto 24px; }
.onb h1 { font-family: var(--serif); font-size: 48px; text-align: center; letter-spacing: .02em; }
.onb .lead { text-align: center; font-size: 17px; color: var(--mute); margin: 12px auto 28px; max-width: 30ch; line-height: 1.5; }
.code { font-family: var(--serif); font-size: 19px; line-height: 1.45; }

.empty { text-align: center; color: var(--mute); padding: 30px 10px; font-size: 15px; }
.log-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.log-item .nm { font-family: var(--serif); font-size: 18px; font-weight: 600; }

@media (min-width: 700px) {
  #app { padding-top: calc(var(--st) + 28px); }
  .qprompt { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
