/* A Thousand Maybes — chapter-book styling. Colors come from the current world's theme (see G.theme). */
:root {
  --accent: #b0476f; --accent2: #c9a227; --bg1: #2a1830; --bg2: #6b3358; --accent-soft: #f6e4ec; --accent-deep: #6b2543;
  --paper: #fdf8f1; --ink: #2d2430; --muted: #7d6f80; --line: #e7dccf;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --sans: "Nunito", "Segoe UI", system-ui, sans-serif;
  --fs: 19px;
}
* { box-sizing: border-box; }
html { background: var(--bg1); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--sans); font-size: 15px;
  background: radial-gradient(1200px 700px at 80% -10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%), linear-gradient(160deg, var(--bg1), var(--bg2)) fixed; transition: background .6s; }
body.size-s { --fs: 17px; } body.size-l { --fs: 21px; } body.size-xl { --fs: 24px; }
body.no-motion * { animation: none !important; transition: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); margin: 0; }
h3 { font-size: 18px; margin: 22px 0 10px; color: var(--accent-deep); }
h3 small { font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: 13px; }
code { background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 16px;
  background: color-mix(in srgb, var(--bg1) 86%, transparent); backdrop-filter: blur(8px); color: #fff; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.12); }
.tb-l, .tb-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tb-world { font-family: var(--display); font-size: 16px; } .tb-date { opacity: .75; }
.tb-moments { color: #ff8fb0; letter-spacing: 3px; font-size: 17px; }
.tb-btn { background: rgba(255,255,255,.12); border: 0; border-radius: 9px; padding: 5px 10px; color: #fff; font-size: 16px; }
.tb-btn:hover { background: rgba(255,255,255,.25); }

/* layout */
.page { max-width: 900px; margin: 0 auto; padding: 18px 16px 60px; }
.paper { background: var(--paper); border-radius: 18px; padding: 26px 30px 30px; box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.6); position: relative; }
.paper.narrow { max-width: 560px; margin: 0 auto; }
.paper .banner { margin: -26px -30px 22px; border-radius: 18px 18px 0 0; }
.scene .paper { border-radius: 0 0 18px 18px; }
.scene > .banner { border-radius: 18px 18px 0 0; }

/* art */
.art { position: relative; height: 190px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 18px; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-emoji { font-size: 70px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); letter-spacing: 8px; animation: float 6s ease-in-out infinite; z-index: 1; text-align: center; }
.art-glow { position: absolute; inset: 0; background: radial-gradient(420px 200px at 50% 110%, rgba(255,255,255,.28), transparent 70%), radial-gradient(2px 2px at 12% 22%, #fff, transparent), radial-gradient(2px 2px at 82% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 14%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 60%, rgba(255,255,255,.7), transparent), radial-gradient(2px 2px at 92% 70%, rgba(255,255,255,.7), transparent); pointer-events: none; }
@keyframes float { 50% { transform: translateY(-7px); } }

/* scene / prose */
.chapter { font-size: 30px; text-align: center; color: var(--accent-deep); margin: 4px 0 6px; font-weight: 700; letter-spacing: .3px; }
.chapter.left { text-align: left; } .chapter.big { font-size: 46px; }
.chapter::after { content: "❦"; display: block; font-size: 16px; color: var(--accent2); margin-top: 6px; font-weight: 400; }
.chapter.left::after { display: none; }
.eyebrow { text-transform: uppercase; letter-spacing: 4px; font-size: 12px; color: var(--accent); margin: 0 0 6px; }
.prose { font-family: var(--serif); font-size: var(--fs); line-height: 1.62; }
.prose p { margin: 0 0 .9em; opacity: 0; animation: rise .7s ease forwards; }
.prose.result p { animation-delay: 0s; }
.prose > p:first-child::first-letter { font-family: var(--display); font-size: 3.1em; float: left; line-height: .82; padding: 6px 8px 0 0; color: var(--accent); }
.prose.result > p:first-child::first-letter { font-size: 1em; float: none; padding: 0; color: inherit; font-family: inherit; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lead { font-family: var(--serif); font-size: calc(var(--fs) - 1px); color: #5a4d5c; margin: 0 0 14px; }
.who { float: right; width: 104px; margin: 2px 0 10px 18px; text-align: center; font-family: var(--display); font-size: 14px; color: var(--accent-deep); }
.who .portrait { width: 104px; box-shadow: 0 6px 18px rgba(0,0,0,.2); border-radius: 14px; }
.picked { font-family: var(--serif); font-style: italic; color: var(--accent); border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin: 6px 0 14px; font-size: calc(var(--fs) - 1px); }
.after { clear: both; margin-top: 12px; }
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.choice { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 13px; padding: 13px 18px; font-family: var(--serif); font-size: calc(var(--fs) - 1px); line-height: 1.35; transition: all .18s; position: relative; }
.choice:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateX(4px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.choice .tone { display: block; font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); margin-bottom: 3px; }
.choice.cont { text-align: center; background: var(--accent); color: #fff; border-color: var(--accent); font-family: var(--display); letter-spacing: .5px; }
.choice.cont:hover { background: var(--accent-deep); transform: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.chip { font-size: 12.5px; background: #f1ebe4; border-radius: 99px; padding: 4px 11px; animation: pop .4s ease backwards; }
.chip.up { background: #e3f3e4; color: #23683a; } .chip.down { background: #fbe4e4; color: #9a2b2b; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* cutscene */
.cutscene { position: fixed; inset: 0; z-index: 100; background: #0b0810; display: flex; flex-direction: column; cursor: pointer; animation: fade .5s; }
.cutscene.out { opacity: 0; transition: opacity .35s; }
.cutscene .cut-art { flex: 1; height: auto; border-radius: 0; } .cutscene .art-emoji { font-size: clamp(80px, 16vw, 170px); }
.cut-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 8vw 46px; background: linear-gradient(transparent, rgba(8,5,12,.92) 45%); color: #fff; text-align: center; }
.cut-text p { font-family: var(--serif); font-size: clamp(21px, 2.6vw, 32px); line-height: 1.45; max-width: 900px; margin: 0 auto 12px; animation: rise 1s ease; font-style: italic; }
.cut-hint { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; opacity: .55; }
.cut-skip { position: absolute; top: 16px; right: 18px; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 99px; padding: 6px 14px; font-size: 12px; }
@keyframes fade { from { opacity: 0; } }

/* buttons */
.btn { background: var(--accent); color: #fff; border: 1.5px solid var(--accent); border-radius: 12px; padding: 10px 20px; font-weight: 700; transition: all .15s; display: inline-block; cursor: pointer; }
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.ghost { background: transparent; color: var(--accent-deep); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.big { padding: 14px 30px; font-size: 17px; font-family: var(--display); letter-spacing: .4px; }
.btn.big small { display: block; font-family: var(--sans); font-weight: 400; font-size: 11px; opacity: .8; letter-spacing: 1px; text-transform: uppercase; }
.btn.sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.disabled, [disabled] { opacity: .42; pointer-events: none; filter: grayscale(.5); }
.back { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 0; margin-bottom: 6px; } .back:hover { color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.center { justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 18px auto 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 18px; } .tabs.center { justify-content: center; }
.tabs button { background: rgba(255,255,255,.7); border: 1.5px solid var(--line); border-radius: 99px; padding: 7px 15px; font-size: 14px; }
.tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* hub */
.hub .hub-banner { height: 150px; }
.hub-head { text-align: center; color: #fff; margin: -64px 0 22px; position: relative; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.hub-head h1 { font-size: 38px; } .hub-head p { margin: 2px 0 0; opacity: .92; font-family: var(--serif); font-size: 18px; font-style: italic; }
.notes { background: rgba(255,255,255,.93); border-left: 4px solid var(--accent2); border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; font-size: 14px; }
.notes p { margin: 3px 0; }
.hub-grid { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
.me-card { padding: 16px; display: flex; gap: 12px; } .me-card .portrait { width: 96px; flex: none; }
.me-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; flex: 1; }
.me-info strong { font-family: var(--display); font-size: 19px; } .me-info em { color: var(--accent); font-style: normal; font-weight: 700; margin-bottom: 4px; }
.hearts { background: rgba(255,255,255,.12); border-radius: 18px; padding: 12px 14px; color: #fff; }
.hearts h3 { color: #fff; margin: 0 0 8px; } .hearts .muted { color: rgba(255,255,255,.75); margin: 8px 2px 2px; font-size: 13px; }
.li-card { display: flex; gap: 12px; width: 100%; text-align: left; background: var(--paper); color: var(--ink); border: 2px solid transparent; border-radius: 14px; padding: 9px; margin-bottom: 8px; transition: all .15s; }
.li-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.25); border-color: var(--accent); }
.li-card.partner { border-color: var(--accent2); } .li-card.ex { opacity: .6; }
.li-card .portrait { width: 70px; flex: none; }
.li-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .li-info strong { font-family: var(--display); font-size: 17px; }
.li-info em { font-size: 12px; color: var(--muted); font-style: normal; margin-bottom: 3px; }
.portrait { border-radius: 12px; overflow: hidden; line-height: 0; } .portrait svg, .portrait img { width: 100%; height: auto; display: block; border-radius: 12px; }
.portrait.large { width: 170px; flex: none; box-shadow: 0 8px 22px rgba(0,0,0,.22); border-radius: 16px; } .portrait.huge { width: 230px; margin: 0 auto 10px; box-shadow: 0 10px 28px rgba(0,0,0,.25); border-radius: 18px; }
.meter { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); } .meter span { min-width: 22px; white-space: nowrap; }
.meter b { flex: 1; height: 7px; background: #eadfd6; border-radius: 99px; overflow: hidden; min-width: 40px; } .meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s; }
.meter.tru i { background: #4f8fbf; } .meter.pas i { background: #e2683a; } .meter.drama i { background: #8a5fc0; }
.me-info .meter span { min-width: 104px; } .li-page .meter span { min-width: 108px; } .li-page .meter { font-size: 13px; margin: 5px 0; }
.sec { color: #fff; margin: 24px 2px 10px; } .sec small { color: rgba(255,255,255,.7); }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; } .actions.tall { grid-template-columns: 1fr; }
.action { display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; text-align: left; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: all .15s; align-items: center; }
.action:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.a-ic { font-size: 26px; grid-row: span 2; } .a-l { font-family: var(--display); font-size: 17px; font-weight: 700; } .action small { color: var(--muted); font-size: 12.5px; }
.turnpage { text-align: center; margin-top: 26px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.turnpage .ghost { color: #fff; border-color: rgba(255,255,255,.4); } .turnpage .ghost:hover { background: rgba(255,255,255,.14); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cards.wide, .cards.small { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } .cards.outfits { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 3px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: all .15s; }
button.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.card strong { font-family: var(--display); font-size: 16px; line-height: 1.2; } .card small { color: var(--muted); font-size: 12.5px; line-height: 1.35; } .card em { font-style: normal; font-weight: 700; color: var(--accent); font-size: 13px; margin-top: auto; padding-top: 4px; }
.c-ic { font-size: 28px; } .card.fit .portrait { margin-bottom: 6px; } .card .row { margin-top: 8px; flex-wrap: wrap; }
.cards.worlds { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 6px; }
.card.world { color: #fff; border-color: transparent; min-height: 132px; text-shadow: 0 1px 6px rgba(0,0,0,.6); } .card.world small { color: rgba(255,255,255,.88); } .card.world .c-ic { font-size: 34px; }
.card.world.on { box-shadow: 0 0 0 3px #fff, 0 10px 26px rgba(0,0,0,.5); background: inherit; }
.world-detail { margin: 6px 0 16px; } .world-detail h2 { font-size: 30px; color: var(--accent-deep); } .world-detail p { font-family: var(--serif); font-size: 18px; margin: 4px 0 10px; }
.cast { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; } .cast figure { margin: 0; width: 112px; text-align: center; } .cast figcaption { font-size: 12.5px; margin-top: 5px; font-family: var(--display); color: var(--accent-deep); }

/* LI page, journal */
.li-head { display: flex; gap: 20px; margin-bottom: 12px; } .li-head > div:last-child { flex: 1; min-width: 0; }
.arche { color: var(--accent); margin: 0 0 8px; } .blurb { font-family: var(--serif); font-size: 18px; margin: 0 0 12px; font-style: italic; }
.facts { list-style: none; padding: 12px 16px; margin: 0 0 18px; background: #f6efe6; border-radius: 12px; font-size: 14px; display: grid; gap: 5px; }
.memories { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.memories li { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 15px; align-items: center; }
.memories strong { font-family: var(--display); font-size: 16.5px; } .memories p { margin: 2px 0; font-family: var(--serif); font-size: 16px; color: #5a4d5c; } .memories small { color: var(--muted); font-size: 12px; }
.m-ic { font-size: 28px; } .memories .locked { opacity: .5; }
.slots { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.slots li { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.slots small { display: block; color: var(--muted); font-size: 12.5px; } .slots span { display: flex; gap: 6px; flex: none; }
.ledger { margin: 14px auto; border-collapse: collapse; font-size: 15px; min-width: 280px; } .ledger td { padding: 5px 12px; text-align: left; border-bottom: 1px dashed var(--line); } .ledger td:last-child { text-align: right; font-weight: 700; }
.ledger .tot td { border-bottom: 0; border-top: 2px solid var(--ink); font-family: var(--display); font-size: 17px; }
.warn { color: #a12f2f; font-weight: 700; } .fin { font-family: var(--display); font-size: 24px; color: var(--accent); margin: 22px 0 6px; letter-spacing: 3px; }
.ending .prose p { opacity: 1; animation: none; font-size: calc(var(--fs) + 2px); } .big-emoji { font-size: 78px; }

/* forms */
.text-in { width: 100%; max-width: 360px; padding: 11px 15px; border: 2px solid var(--line); border-radius: 12px; font: inherit; font-family: var(--serif); font-size: 20px; background: #fff; display: block; margin: 8px auto; text-align: center; }
.text-in:focus { outline: none; border-color: var(--accent); } .text-in.area { max-width: none; height: 120px; font-family: monospace; font-size: 13px; text-align: left; margin: 0 0 8px; }
.field { display: block; margin: 16px 0; } .field > span { display: block; font-weight: 700; margin-bottom: 6px; color: var(--accent-deep); } .field .text-in { margin: 0; text-align: left; } input[type=range] { width: 100%; max-width: 360px; accent-color: var(--accent); }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; } .swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.12); }
.look-grid { display: grid; grid-template-columns: 250px 1fr; gap: 26px; } .look-preview { text-align: center; position: sticky; top: 70px; align-self: start; }
.wiz-title { text-align: center; font-size: 36px; color: var(--accent-deep); margin-bottom: 4px; } .wizard > .wiz-title, .wizard > .lead { color: #fff; }
.wiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; gap: 10px; } .wizard > .wiz-nav .ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.wizard > .wiz-nav { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg1) 40%); }
.dots { display: flex; gap: 7px; } .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(128,128,128,.35); } .dots i.on { background: var(--accent); transform: scale(1.3); } .dots i.done { background: var(--accent2); }
.modgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .howto { padding-left: 20px; line-height: 1.8; }
.warnbox { background: #fdeeee; border: 1px solid #f0bcbc; border-radius: 12px; padding: 10px 16px; font-size: 13px; } .okbox { background: #e7f5e8; border-radius: 12px; padding: 10px 16px; color: #23683a; font-weight: 700; }
details { margin-top: 8px; font-size: 13px; } .packs { grid-template-columns: 1fr 1fr; }

/* title */
.title { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.title-card { text-align: center; color: #fff; position: relative; z-index: 2; }
.title-card .eyebrow { color: #ffc2d6; } .title h1 { font-size: clamp(54px, 10vw, 112px); line-height: .95; font-weight: 700; text-shadow: 0 6px 40px rgba(0,0,0,.45); }
.title h1 span { font-style: italic; color: #ffc2d6; } .title-sub { font-family: var(--serif); font-size: 19px; opacity: .85; margin: 18px 0 30px; font-style: italic; }
.title-btns { display: flex; flex-direction: column; gap: 10px; max-width: 300px; margin: 0 auto; } .title .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); } .title .btn.ghost:hover { background: rgba(255,255,255,.14); }
.title .btn.big:not(.ghost) { background: #fff; color: var(--accent-deep); border-color: #fff; }
.floaters i { position: absolute; bottom: -40px; color: rgba(255,190,214,.55); font-style: normal; animation: up 11s linear infinite; }
@keyframes up { to { transform: translateY(-115vh) rotate(40deg); opacity: 0; } }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #231a26; color: #fff; padding: 11px 22px; border-radius: 99px; z-index: 200; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: rise .4s; max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transition: opacity .5s; }

@media (max-width: 720px) {
  .hub-grid, .look-grid, .modgrid, .packs { grid-template-columns: 1fr; } .look-preview { position: static; } .paper { padding: 20px 18px 24px; } .paper .banner { margin: -20px -18px 18px; }
  .li-head { flex-direction: column; align-items: center; } .who { width: 78px; } .who .portrait { width: 78px; } .art { height: 140px; } .art-emoji { font-size: 52px; } .tb-date { display: none; }
}
.hub-banner .art-emoji { opacity: .4; font-size: 54px; transform: translateY(-22px); animation: none; }

/* AI chat */
.chat { max-width: 760px; display: flex; flex-direction: column; height: calc(100vh - 50px); padding-bottom: 14px; }
.chat-head { display: flex; gap: 12px; align-items: center; color: #fff; margin-bottom: 10px; } .chat-head .portrait { width: 54px; flex: none; } .chat-head strong { font-family: var(--display); font-size: 20px; display: block; } .chat-head small { opacity: .8; font-size: 12.5px; }
.chat-log { flex: 1; overflow-y: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.msg { display: flex; } .msg.me { justify-content: flex-end; } .msg.old { opacity: .55; }
.bub { max-width: 78%; padding: 10px 15px; border-radius: 18px; font-family: var(--serif); font-size: var(--fs); line-height: 1.4; background: #efe7dd; border-bottom-left-radius: 5px; animation: rise .3s; }
.msg.me .bub { background: var(--accent); color: #fff; border-radius: 18px; border-bottom-right-radius: 5px; } .bub em { opacity: .8; }
.typing .bub { display: inline-flex; gap: 5px; padding: 14px 16px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.divider { text-align: center; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 8px 0; } .more { align-self: center; }
.chat-in { display: flex; gap: 8px; background: #fff; border-radius: 0 0 18px 18px; padding: 10px; border-top: 1px solid var(--line); }
.chat-in textarea { flex: 1; border: 0; resize: none; font: inherit; font-family: var(--serif); font-size: var(--fs); padding: 8px 10px; outline: none; background: transparent; } .chat-btns { display: flex; flex-direction: column; gap: 6px; }
.pill-toggle { display: inline-flex; background: rgba(255,255,255,.12); border-radius: 99px; padding: 2px; } .pill-toggle button { background: none; border: 0; color: #fff; padding: 5px 12px; border-radius: 99px; font-size: 13px; } .pill-toggle button.on { background: #fff; color: var(--accent-deep); }
.stack.wide { max-width: none; margin: 0; } .field .text-in { max-width: none; font-size: 16px; font-family: var(--sans); }

.choice.own { border-style: dashed; background: transparent; } .own-in { height: 90px; font-family: var(--serif); font-size: var(--fs); }

/* photos */
img.avatar.photo { width: 100%; aspect-ratio: 5 / 6; object-fit: cover; object-position: center 20%; display: block; border-radius: 12px; }
.banner.photo { height: auto; aspect-ratio: 3 / 2; max-height: 70vh; } .banner.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade .8s; }
.extras { clear: both; text-align: right; margin: 4px 0 -4px; min-height: 4px; } .picrow { margin-top: 10px; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; } .album figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.album img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; } .album figcaption { padding: 8px 12px; font-family: var(--display); font-size: 15px; } .album small { display: block; font-family: var(--sans); color: var(--muted); font-size: 12px; }

.scene > .banner.photo { aspect-ratio: auto; height: auto; max-height: none; background: #0d0a12 !important; } .scene > .banner.photo img { position: static; width: 100%; height: auto; max-height: 82vh; object-fit: contain; display: block; }
.album img { object-position: center 20%; }

.ownline { display: flex; gap: 8px; align-items: stretch; margin-top: 4px; } .ownline .own-in { flex: 1; height: 62px; margin: 0; max-width: none; text-align: left; } .ownline .btn { white-space: nowrap; }

/* the book (Journal → Story) */
.bk-years { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.book { font-family: var(--serif); font-size: var(--fs); line-height: 1.6; }
.bk-month { font-family: var(--display); color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin: 26px 0 10px; font-size: 20px; }
.bk-entry { margin: 0 0 20px; } .bk-entry h4 { font-family: var(--display); font-size: 18px; margin: 0 0 6px; color: var(--accent-deep); }
.bk-entry p { margin: 0 0 .7em; } .bk-pick { font-style: italic; color: var(--accent); border-left: 3px solid var(--accent); padding-left: 12px; }
.bk-result { color: #4a3e4c; } .bk-pic { margin: 6px 0 12px; } .bk-pic img { width: 100%; border-radius: 12px; display: block; }
.bk-chat .bk-line { margin: 0 0 .35em; } .bk-chat .bk-line.me b { color: var(--accent); } .bk-recap { font-style: italic; color: var(--muted); margin-top: .6em; }

/* phones */
html { -webkit-text-size-adjust: 100%; } button, .choice, .action, .card { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.chat { height: calc(100vh - 50px); height: calc(100dvh - 50px); }
@media (hover: none) { .choice:hover { transform: none; } .action:hover, button.card:hover, .li-card:hover { transform: none; } }
@media (max-width: 720px) {
  body { font-size: 15px; } .page { padding: 12px 10px 40px; }
  .topbar { padding: 6px 10px; flex-wrap: nowrap; gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); }
  .tb-l { min-width: 0; flex: 1; flex-wrap: nowrap; } .tb-world { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; min-width: 0; }
  .tb-r { flex-wrap: nowrap; gap: 6px; flex: none; } .tb-moments { letter-spacing: 1px; font-size: 14px; } .tb-money { font-size: 13px; } .tb-btn { padding: 6px 9px; }
  .chapter { font-size: 24px; } .chapter.big { font-size: 34px; } .hub-head h1 { font-size: 30px; } .hub-head { margin-top: -54px; }
  .actions { grid-template-columns: 1fr 1fr; gap: 8px; } .action { grid-template-columns: 1fr; padding: 10px 11px; } .a-ic { grid-row: auto; font-size: 22px; } .a-l { font-size: 15px; } .action small { font-size: 11.5px; }
  .actions.tall { grid-template-columns: 1fr; } .actions.tall .action { grid-template-columns: 34px 1fr; } .actions.tall .a-ic { grid-row: span 2; }
  .turnpage { flex-direction: column; } .turnpage .btn { width: 100%; }
  .cards, .cards.wide, .cards.small { grid-template-columns: 1fr; } .cards.outfits { grid-template-columns: 1fr 1fr; } .cards.worlds { grid-template-columns: 1fr 1fr; } .card.world { min-height: 112px; } .card.world small { display: none; }
  .me-card .portrait { width: 80px; } .me-info .meter span { min-width: 92px; }
  .li-head .portrait.large { width: 150px; } .li-page .meter span { min-width: 92px; }
  .choice { padding: 12px 14px; } .text-in, .ownline .own-in, .chat-in textarea, input, textarea { font-size: 16px !important; }
  .ownline { flex-direction: column; } .ownline .btn { width: 100%; }
  .chat-head small { display: none; } .chat-in { padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); } .bub { max-width: 86%; }
  .pill-toggle button { padding: 5px 8px; font-size: 12px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; } .tabs button { flex: none; }
  .wiz-title { font-size: 28px; } .wizard > .wiz-nav { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .swatch { width: 34px; height: 34px; } .album { grid-template-columns: 1fr; }
  .cut-text { padding: 50px 6vw max(30px, env(safe-area-inset-bottom)); }
  .ledger { min-width: 0; width: 100%; } .modgrid { gap: 8px; }
}
