/* Lumenhold Academy — UI styles */
:root {
  --night: #0e1124;
  --night-2: #161a35;
  --night-3: #20264a;
  --line: rgba(233, 214, 160, 0.16);
  --gold: #d9b45a;
  --gold-2: #f0d58c;
  --parch: #f4ecd8;
  --parch-2: #e9dcbd;
  --ink: #2a2238;
  --ink-2: #5a4e66;
  --muted: #a49cb8;
  --text: #ece6f6;
  --good: #7fd18b;
  --bad: #ff8a80;
  --radius: 18px;
  --serif: "Crimson Pro", "Iowan Old Style", Georgia, serif;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(96, 80, 200, 0.25), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(200, 120, 60, 0.12), transparent 60%),
    radial-gradient(1.2px 1.2px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 68% 28%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 62%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 8%, #fff6 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 6% 52%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 90%, #fff5 50%, transparent 51%);
}
#app { position: relative; z-index: 1; height: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ---------------- Title ---------------- */
.title-screen { height: 100%; display: grid; place-items: center; padding: 24px 16px; overflow: auto; }
.title-panel { width: min(520px, 100%); text-align: center; }
.title-crest { color: var(--gold); margin-bottom: 8px; }
.title-panel h1 { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 8vw, 64px); margin: 0; letter-spacing: 0.02em; color: var(--gold-2); text-shadow: 0 0 30px rgba(240, 213, 140, 0.25); }
.title-panel .sub { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 19px; margin: 6px 0 28px; }
.title-panel .wip { margin: -16px auto 22px; max-width: 460px; text-align: left; padding: 6px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.title-form { background: rgba(22, 26, 53, 0.8); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: left; backdrop-filter: blur(6px); }
.title-form label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 6px; }
.title-form input { width: 100%; background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--text); font: 500 16px var(--sans); }
.title-form .row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--night-3); border-radius: 12px; padding: 11px 18px; font-weight: 600; transition: transform .12s, background .2s, border-color .2s; }
.btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(180deg, #e7c470, #c99a3a); color: #23190a; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.grow { flex: 1; }
.howto { margin-top: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.howto b { color: var(--text); font-weight: 600; }
.credits { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 6px; row-gap: 2px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.credits a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.credits a:hover, .credits a:focus-visible { color: var(--text); text-decoration-color: currentColor; }
.credits > span:not(:last-child)::after { content: '·'; margin-left: 6px; opacity: 0.5; }
.fb-dialog .credits { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
details.adv { margin-top: 14px; color: var(--muted); font-size: 13px; }
details.adv summary { cursor: pointer; }
details.adv input { margin-top: 8px; }

/* language picker */
.lang-row { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; color: var(--muted); }
.lang-btn { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.lang-btn.on { border-color: var(--gold); color: var(--gold-2); background: rgba(217, 180, 90, .1); }
.lang-btn:hover { border-color: var(--gold); }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; }
.dice-btn { flex: none; display: flex; align-items: center; justify-content: center; padding: 0 12px; }
.title-form .pron-label { margin-top: 14px; }
.pron-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- Layout ---------------- */
.game { height: 100%; display: grid; grid-template-columns: 1fr 340px; grid-template-rows: auto auto 1fr; grid-template-areas: "top top" "meters side" "stage side"; }
.top { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: rgba(14, 17, 36, 0.7); backdrop-filter: blur(6px); }
.brand { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--gold-2); white-space: nowrap; }
.date { flex: 1; min-width: 0; }
.date .when { font-family: var(--display); font-size: 20px; font-weight: 600; }
.date .when small { font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 8px; letter-spacing: 0.04em; }
.timeline { display: flex; gap: 3px; margin-top: 5px; max-width: 520px; }
.timeline i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
.timeline i.done { background: rgba(217, 180, 90, 0.55); }
.timeline i.now { background: var(--gold-2); box-shadow: 0 0 8px var(--gold); }
.timeline i.summer { background: rgba(120, 200, 255, 0.12); }
.timeline i.summer.done { background: rgba(120, 200, 255, 0.45); }
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--night-2); display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--gold); }
.side-toggle { display: none; }

.meters { grid-area: meters; display: flex; justify-content: center; gap: clamp(10px, 3vw, 34px); padding: 14px 16px 4px; }
.meter { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; }
.meter .orb { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--night-2); border: 1.5px solid rgba(255, 255, 255, 0.12); overflow: hidden; display: grid; place-items: center; }
.meter .fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c); opacity: 0.9; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.meter .orb .ico { position: relative; z-index: 1; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.meter .val { font-size: 12px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.meter .lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.meter.low .orb { border-color: var(--bad); animation: pulse 1.6s infinite; }
.meter.number .num { height: 46px; display: flex; align-items: center; gap: 4px; color: var(--c); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.meter.number .num .val { font-size: inherit; font-weight: inherit; color: var(--text); }
.meter.number.low .num .val { color: var(--bad); }
.meter.number .due { height: 19px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }   /* level with the orbs' value line */
.meter.number .due.neg { color: var(--bad); } .meter.number .due.pos { color: var(--good); }
.meter-group { display: flex; gap: inherit; }
.meter-group.numbers { padding-left: clamp(6px, 2vw, 22px); border-left: 1px solid var(--line); }
.meter .dot { position: absolute; top: -9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 8px var(--gold); opacity: 0; transform: scale(.4); transition: opacity .15s, transform .15s; }
.meter.preview .dot { opacity: 1; transform: scale(1); }
.float-chip { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 13px; pointer-events: none; animation: floatUp 1.6s ease-out forwards; text-shadow: 0 1px 3px #000; white-space: nowrap; }
.float-chip.pos { color: var(--good); } .float-chip.neg { color: var(--bad); }
/* Mana's changes float in blue (lighter for a gain), apart from the other meters' green and red. */
#m-mana .float-chip.pos { color: #a9dcff; } #m-mana .float-chip.neg { color: #6fa8e8; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 138, 128, 0.2); } }

/* ---------------- Stage & card ---------------- */
.stage { grid-area: stage; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 10px 16px 18px; min-height: 0; overflow: hidden; }
.deck { position: relative; width: min(400px, 100%); flex: 1 1 auto; max-height: 610px; min-height: 380px; margin-top: 8px; }
.ghost { position: absolute; inset: 0; border-radius: var(--radius); background: var(--parch-2); opacity: .22; transform: translateY(10px) scale(.96); }
.ghost.two { opacity: .1; transform: translateY(20px) scale(.92); }
.card { position: absolute; inset: 0; border-radius: var(--radius); background: var(--parch); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.4) inset; overflow: hidden; display: flex; flex-direction: column; touch-action: none; user-select: none; cursor: grab; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s; will-change: transform; }
.card.dragging { cursor: grabbing; transition: none; }
.card.enter { animation: cardIn .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes cardIn { from { transform: translateY(30px) scale(.94); opacity: 0; } }
.card-art { position: relative; flex: 0 0 auto; aspect-ratio: 400 / 210; background: #222; overflow: hidden; }
.card-art .scene { width: 100%; height: 100%; display: block; }
.card-art .tagline { position: absolute; left: 12px; top: 10px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 245, 220, 0.85); background: rgba(0, 0, 0, 0.28); padding: 4px 8px; border-radius: 6px; }
.card-art .src { position: absolute; right: 12px; top: 10px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 245, 220, 0.8); }
.card-body { flex: 1 1 auto; padding: 16px 20px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.card-body h2 { font-family: var(--display); font-size: 27px; line-height: 1.05; margin: 0; font-weight: 700; color: #241b33; }
.card-body .text { font-family: var(--serif); font-size: 17.5px; line-height: 1.42; margin: 0; color: #2f2640; white-space: pre-line; }
.card-body .scene-note { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-2); border-left: 2px solid rgba(90, 78, 102, 0.3); padding-left: 8px; margin: 2px 0 0; }
.actor-row { display: flex; align-items: center; gap: 10px; }
/* NPC portraits (src/art.js): the PNG layer covers the procedural one, which shows again if the image fails and is removed. */
.avatar:has(.av-min) .av-orig { visibility: hidden; }
.actor-row .avatar { flex: 0 0 auto; border-radius: 50%; box-shadow: 0 0 0 2px var(--parch), 0 0 0 3px rgba(42, 34, 56, .25); }
.actor-row .who b { display: block; font-weight: 600; font-size: 14px; }
.actor-row .who span { font-size: 12px; color: var(--ink-2); }
.bond-badge { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: rgba(42, 34, 56, .1); color: var(--ink-2); margin-left: auto; white-space: nowrap; }
.bond-friend, .bond-close { background: #d8efd9; color: #2d6a3a; }
.bond-partner { background: #f8d7df; color: #9a2848; }
.bond-rival, .bond-nemesis { background: #f6d8cf; color: #9a3a22; }
.bond-ex { background: #e6e0ee; color: #5a4e66; }

.card-label { position: absolute; top: 14px; max-width: 70%; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14.5px; line-height: 1.2; background: rgba(20, 16, 34, 0.86); color: #fff3d6; opacity: 0; pointer-events: none; transition: opacity .1s; z-index: 3; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.card-label.left { left: 14px; } .card-label.right { right: 14px; text-align: right; }
.card .tap-note { text-align: center; font-size: 12px; color: var(--ink-2); padding: 0 0 12px; letter-spacing: .06em; }

.outcome .card-body { justify-content: center; }
.outcome .say { font-family: var(--serif); font-size: 19px; line-height: 1.45; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(42, 34, 56, .08); color: var(--ink); }
.chip .ico { width: 14px; height: 14px; }
.chip.pos { background: #dcefdc; color: #24612f; } .chip.neg { background: #f6dcd8; color: #8a2a20; }
.chip.note { background: #ebe3f6; color: #4a3a6a; }
.spell-banner { display: flex; align-items: center; gap: 8px; width: 100%; margin: 2px 0 6px; padding: 9px 12px; border-radius: 12px; font-weight: 700; font-size: 14px; color: #5a3d08; background: linear-gradient(90deg, #f7e2a6, #f1cf7a); box-shadow: 0 0 0 1px rgba(160, 110, 20, .35), 0 4px 14px rgba(200, 150, 40, .35); animation: spell-glow 1.6s ease-out 1; }
.dark .spell-banner { color: #2a1d05; }
@keyframes spell-glow { from { box-shadow: 0 0 0 1px rgba(160, 110, 20, .35), 0 0 28px rgba(255, 200, 80, .9); } }
.chip.check-ok { background: #dfeaf8; color: #22497a; } .chip.check-fail { background: #f3e2cf; color: #7a4a1a; }
.dark .chip { background: rgba(255, 255, 255, .07); color: var(--text); }
.dark .chip.pos { background: rgba(127, 209, 139, .14); color: var(--good); }
.dark .chip.neg { background: rgba(255, 138, 128, .14); color: var(--bad); }
.dark .chip.note { background: rgba(180, 150, 240, .14); color: #cdb8f6; }

.choices { display: flex; gap: 10px; width: min(400px, 100%); margin-top: 14px; }
.choice { flex: 1; min-height: 52px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--night-2); font-weight: 600; font-size: 14px; line-height: 1.25; display: flex; align-items: center; gap: 8px; text-align: left; transition: border-color .15s, background .15s, transform .12s; }
.choice.right { justify-content: flex-end; text-align: right; }
.choice:hover:not(:disabled) { border-color: var(--gold); background: var(--night-3); }
.choice:disabled { opacity: .45; }
.choice .arrow { color: var(--gold); font-size: 18px; flex: 0 0 auto; }
.choice .chk { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.choice .chk.roll svg { vertical-align: -2px; }
.choice .chk.roll.combat { color: #f0a868; font-weight: 600; }
.chip.combat { border-color: rgba(240, 168, 104, .55); }
.choice.single { justify-content: center; text-align: center; }

/* ---------------- Side panel ---------------- */
.side { grid-area: side; border-left: 1px solid var(--line); background: rgba(14, 17, 36, 0.92); display: flex; flex-direction: column; min-height: 0; }
.side-top { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.side-top .tabs { flex: 1; min-width: 0; border-bottom: 0; }
.side-close, .side-scrim { display: none; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; padding: 12px 6px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--gold-2); border-bottom-color: var(--gold); }
.tab-body { flex: 1; overflow-y: auto; padding: 14px 16px 30px; }
.sec-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 16px 0 8px; }
.sec-h:first-child { margin-top: 0; }
.skill { display: grid; grid-template-columns: 22px 1fr 34px; align-items: center; gap: 8px; margin: 7px 0; }
.skill .ico { color: var(--gold); }
.skill .nm { font-size: 13.5px; font-weight: 500; }
.skill .bar { grid-column: 2; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 4px; }
.skill .bar b { display: block; height: 100%; background: linear-gradient(90deg, #8a6ad8, var(--gold)); }
.skill .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.state { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .05); margin-bottom: 6px; }
.state .ico { flex: 0 0 auto; color: var(--gold); margin-top: 2px; }
.state.debuff .ico { color: var(--bad); } .state.buff .ico { color: var(--good); } .state.class .ico { color: #8ac4ff; } .state.club .ico { color: #d0a0ff; } .state.job .ico { color: #f0c060; }
.state b { font-size: 13px; font-weight: 600; display: block; }
.state p { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.state .left { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.state .grow { flex: 1; min-width: 0; }
.state .prep { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 5px; }
.state .prep b { display: block; height: 100%; background: linear-gradient(90deg, #5a8ad8, #8ac4ff); }
.person { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .05); margin-bottom: 8px; cursor: pointer; }
.person .avatar { flex: 0 0 auto; border-radius: 50%; }
.person .info { flex: 1; min-width: 0; }
.person .nm { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.person .ttl { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .desc { display: none; font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.person.open .desc { display: block; }
.relbar { position: relative; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .08); margin-top: 7px; }
.relbar b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.relbar i { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; border-radius: 1px; background: #e0708a; }
.chip.capped { opacity: .75; }
.side .bond-badge { margin-left: auto; font-size: 9.5px; background: rgba(255, 255, 255, .08); color: var(--muted); }
.side .bond-friend, .side .bond-close { background: rgba(127, 209, 139, .15); color: var(--good); }
.side .bond-partner { background: rgba(224, 112, 138, .2); color: #f4a0b4; }
.side .bond-rival, .side .bond-nemesis { background: rgba(255, 138, 128, .15); color: var(--bad); }
.thread { margin: 4px 0 12px; padding: 10px 12px; border: 1px solid rgba(232, 200, 120, .22); border-radius: 10px; background: rgba(232, 200, 120, .05); }
.thread .th-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.thread .th-act { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.th-sub { margin: 8px 0 2px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.th-sub.log-head { margin-top: 14px; }
.thread.done { opacity: .62; }
.th-row { position: relative; padding: 3px 0 3px 16px; font-size: 12.5px; line-height: 1.45; }
.th-row::before { position: absolute; left: 0; top: 3px; color: #e8c878; }
.th-row.clue::before { content: '✦'; }
.th-row.clue.key::before { content: '✷'; color: #ffd76a; }
.th-row.lead::before { content: '→'; color: var(--muted); }
.th-row.lead.done { opacity: .55; }
.th-row.lead.done b { text-decoration: line-through; }
.log-item { padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 13px; line-height: 1.45; }
.log-item .when { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.log-item b { font-weight: 600; }
.log-item .ch { color: var(--gold-2); }
.log-item .say { color: var(--muted); font-family: var(--serif); font-size: 14px; }
.empty { color: var(--muted); font-size: 13px; font-style: italic; }

/* ---------------- Overlays ---------------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(6, 8, 20, 0.72); backdrop-filter: blur(5px); animation: fade .25s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--night-2); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 40px 100px rgba(0, 0, 0, .6); animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
.modal.dark { color: var(--text); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.modal-art { aspect-ratio: 400 / 96; overflow: hidden; border-radius: 22px 22px 0 0; }
.modal-art .scene { width: 100%; height: 100%; display: block; }
.modal-body { padding: 20px 24px 24px; }
.modal h2 { font-family: var(--display); font-size: 32px; margin: 0 0 6px; color: var(--gold-2); font-weight: 700; line-height: 1.05; }
.modal .text { font-family: var(--serif); font-size: 17.5px; line-height: 1.45; color: #d9d2e8; margin: 0 0 6px; white-space: pre-line; }
.modal .scene-note { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.opt { text-align: left; border: 1px solid var(--line); background: var(--night-3); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .12s, background .15s; }
.opt:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); background: #262d58; }
.opt b { font-weight: 600; font-size: 14.5px; }
.opt small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.opt small.course { display: block; color: var(--text); opacity: .85; }
.opt small.course svg { vertical-align: -2px; color: var(--gold); }
.opt small.warn { color: var(--bad); }
.opt.locked small.why { display: block; color: var(--bad); }
.opt .aff { display: flex; gap: 4px; margin-top: 4px; color: var(--gold); }
.opt:disabled { opacity: .45; }
.opt:disabled b::before { content: "🔒 "; font-size: 12px; }
.opt .num { font-size: 11px; color: var(--muted); }

.origin-modal { width: min(760px, 100%); }
.origin-opt .money { color: var(--text); }
.origin-opt .money svg { vertical-align: -2px; color: var(--gold); }
.origin-opt .warn { color: #f0a868; }
.origin-opt.poor { border-color: rgba(240, 168, 104, .45); }
.month-modal { width: min(460px, 100%); text-align: center; }
.month-modal .big { font-family: var(--display); font-weight: 700; font-size: 46px; color: var(--gold-2); line-height: 1; margin: 6px 0 2px; }
.month-modal .yr { color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.month-modal .season { font-family: var(--serif); font-style: italic; color: #cfc6e2; margin: 10px 0 0; font-size: 16px; }
.summary { text-align: left; margin: 18px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.summary .row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.summary .row .lbl { font-size: 13px; font-weight: 600; flex: 0 0 40%; color: #d8d0ea; }
.summary .row .chips { flex: 1; justify-content: flex-end; }
.summary .row.say { font-family: var(--serif); font-size: 14.5px; color: var(--muted); }

.ending-modal { width: min(620px, 100%); text-align: center; }
.ending-modal .kicker { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .18em; margin-top: 4px; }
.ending-modal h2 { font-size: 42px; margin-top: 6px; }
.ending-modal .text { text-align: left; }
.final-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 18px 0; text-align: left; }
.final-stats div { background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.final-stats b { display: block; font-size: 17px; color: var(--text); }
.final-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0 18px; }
.final-people span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; background: rgba(255, 255, 255, .04); padding: 4px 10px 4px 4px; border-radius: 999px; }
.final-people .avatar { border-radius: 50%; }

.errors { max-width: 760px; margin: 40px auto; padding: 20px; background: #2a1020; border: 1px solid #a03050; border-radius: 14px; font-family: ui-monospace, monospace; font-size: 13px; white-space: pre-wrap; }

/* debug */
.debug-btn { position: fixed; right: 14px; bottom: 14px; z-index: 30; }
.debug-panel { position: fixed; right: 14px; bottom: 62px; width: 340px; max-height: 70vh; overflow: auto; z-index: 30; background: #111428; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 12.5px; }
.debug-panel input, .debug-panel select { width: 100%; background: var(--night); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 4px 0; font: 12.5px ui-monospace, monospace; }
.debug-panel .row { display: flex; gap: 6px; margin: 6px 0; }
.debug-panel .btn { padding: 6px 10px; font-size: 12px; }
.debug-panel pre { white-space: pre-wrap; font-size: 11px; color: var(--muted); max-height: 200px; overflow: auto; }

/* ---------------- Playtest feedback ---------------- */
/* Lives on <body> (above menus and month/ending overlays, below the feedback dialog and debug panel). */
.fb-bar { position: fixed; left: 14px; bottom: 14px; z-index: 25; display: flex; align-items: center; gap: 2px; padding: 4px 5px; background: rgba(17, 20, 40, .94); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-size: 10.5px; color: var(--muted); }
.fb-t { display: flex; align-items: center; gap: 1px; padding: 0 4px 0 8px; }
.fb-t + .fb-t { border-left: 1px solid var(--line); }
.fb-lbl { text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; white-space: nowrap; }
.fb-r, .fb-c, .fb-open { background: transparent; border: 1px solid transparent; border-radius: 999px; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; font-size: 14px; line-height: 1; transition: opacity .15s, border-color .15s, background .15s; }
.fb-r { filter: grayscale(1); opacity: .55; }
.fb-r:hover, .fb-c:hover, .fb-open:hover { opacity: 1; border-color: var(--line); }
.fb-r.on { filter: none; opacity: 1; }
.fb-r.up.on { background: rgba(127, 209, 139, .18); border-color: rgba(127, 209, 139, .55); }
.fb-r.down.on { background: rgba(255, 138, 128, .18); border-color: rgba(255, 138, 128, .55); }
.fb-open, .fb-c { color: var(--gold-2); opacity: .75; }
.fb-open { margin-left: 2px; }
.fb-open.has, .fb-c.has { opacity: 1; background: rgba(217, 180, 90, .15); border-color: rgba(217, 180, 90, .45); }

.fb-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(6, 8, 20, .6); backdrop-filter: blur(3px); animation: fade .2s; }
.fb-dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--night-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.fb-dialog h3 { font-family: var(--display); font-size: 26px; color: var(--gold-2); margin: 0 0 2px; }
.fb-intro { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.45; }
.fb-item { border-top: 1px solid var(--line); padding: 12px 0; }
.fb-head { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fb-title { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; margin: 2px 0; }
.fb-chose { font-size: 12.5px; color: var(--gold-2); }
.fb-rate { display: flex; gap: 8px; margin: 8px 0; }
.fb-rate .fb-r { width: auto; height: auto; padding: 6px 14px; font-size: 13px; color: var(--text); border-color: var(--line); filter: none; opacity: .75; }
.fb-rate .fb-r.on { opacity: 1; }
.fb-dialog textarea { width: 100%; min-height: 66px; resize: vertical; background: var(--night); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: 14px/1.45 var(--sans); }
.fb-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.set-row { border-top: 1px solid var(--line); padding: 12px 0; }
.set-row b { display: block; font-size: 15px; margin-bottom: 2px; }
.set-row .fb-intro { margin-bottom: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-b { padding: 6px 14px; font-size: 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--night); color: var(--text); opacity: .7; cursor: pointer; }
.seg-b.on { opacity: 1; border-color: var(--gold-2); color: var(--gold-2); }
.fb-mini { display: flex; gap: 2px; margin-top: 4px; }
.fb-mini .fb-r, .fb-mini .fb-c { width: 24px; height: 24px; font-size: 12px; }
.fb-note { font-size: 12.5px; color: var(--gold-2); font-style: italic; margin-top: 2px; white-space: pre-line; }
.fb-log { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.linkish { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--gold-2); }
.linkish:hover { border-color: var(--gold); }

/* ---------------- Previews, spells, bars (v0.3) ---------------- */
.pv { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 3px; font-size: 11px; font-weight: 600; opacity: .92; }
.pv i { font-style: normal; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-weight: 700; font-size: 1.1em; letter-spacing: -.02em; }
.pv i.pos { color: var(--good); } .pv i.neg { color: var(--bad); } .pv i.more { color: var(--muted); }
.pv .ico { width: 12px; height: 12px; }
.pv.multi { flex-direction: column; gap: 1px; }
.pvl { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
.pvl b { font-weight: 700; color: var(--gold-2); margin-right: 2px; }
.opt .pv { justify-content: flex-start; }
.choices { flex-wrap: wrap; }
.choice.up { flex: 1 1 100%; justify-content: center; border-color: rgba(120, 170, 255, .45); background: linear-gradient(180deg, rgba(60, 90, 160, .35), rgba(30, 40, 90, .35)); }
.choice.up:hover:not(:disabled) { border-color: #8fb8ff; }
.chip.check-part { background: rgba(230, 184, 74, .18); color: var(--gold-2); }
.meter.neg .fill { background: #7a5ac8; }
.meter.pos .fill { background: var(--gold); }
.meter .ico-pos { display: none; }
.meter.pos .ico-pos { display: contents; }
.meter.pos .ico-neg { display: none; }
.meter .ico-pos svg, .meter .ico-neg svg { position: relative; z-index: 1; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.map-fest { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: rgba(240, 200, 104, .12); border: 1px solid rgba(240, 200, 104, .35); color: var(--gold-2); font-size: 13.5px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 14px; background: var(--night-3); border: 1px solid var(--line); color: var(--text); font-size: 13.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); animation: toast 2.6s ease forwards; pointer-events: none; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
/* Time of day and season (M7; feedback 2026-10-15b): src/sky.js draws a scene behind the game. The tint is strong at
   the top and gone by the middle of the screen, so the bottom half keeps the page's own colour. */
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* Beside the side panel on wide screens, so the sun and the skyline sit in the play area. */
/* Only while the panel is there: the title page and other full-width screens get the sky edge to edge. */
@media (min-width: 901px) { body:has(.game) #sky { right: 340px; } }
#sky > * { position: absolute; left: 0; right: 0; top: 0; }
#sky .sky-tint, #sky .sky-season { height: 100%; transition: opacity 1.2s ease; }
#sky .sky-tint { background: var(--sky, none); }
#sky .sky-season { background: var(--sky-season, none); }
#sky .sky-svg { height: 62vh; opacity: .9; }
#sky .sky-svg svg { width: 100%; height: 100%; display: block; animation: fade 1.2s ease; }
#sky canvas { width: 100%; height: 100%; }
#sky[data-slot="morning"] { --sky: linear-gradient(180deg, rgba(255, 168, 120, .74) 0%, rgba(255, 196, 150, .42) 22%, rgba(255, 214, 170, .12) 38%, transparent 52%); }
#sky[data-slot="noon"] { --sky: linear-gradient(180deg, rgba(110, 170, 255, .76) 0%, rgba(160, 205, 255, .44) 22%, rgba(220, 235, 255, .12) 38%, transparent 52%); }
#sky[data-slot="afternoon"] { --sky: linear-gradient(180deg, rgba(255, 186, 80, .72) 0%, rgba(255, 200, 120, .4) 22%, rgba(255, 210, 150, .12) 38%, transparent 52%); }
#sky[data-slot="evening"] { --sky: linear-gradient(180deg, rgba(120, 60, 160, .62) 0%, rgba(230, 100, 120, .42) 20%, rgba(255, 150, 110, .2) 36%, transparent 52%); }
#sky[data-slot="night"] { --sky: linear-gradient(180deg, rgba(30, 50, 160, .66) 0%, rgba(40, 60, 170, .36) 22%, rgba(50, 70, 170, .12) 38%, transparent 52%); }
#sky[data-slot="midnight"] { --sky: linear-gradient(180deg, rgba(60, 20, 130, .72) 0%, rgba(70, 30, 140, .4) 22%, rgba(60, 30, 120, .14) 38%, transparent 52%); }
#sky[data-season="autumn"] { --sky-season: linear-gradient(180deg, rgba(220, 120, 40, .16), transparent 45%); }
#sky[data-season="winter"] { --sky-season: linear-gradient(180deg, rgba(200, 225, 255, .2), transparent 45%); }
#sky[data-season="spring"] { --sky-season: linear-gradient(180deg, rgba(190, 240, 190, .12), rgba(250, 190, 215, .08) 25%, transparent 45%); }
#sky[data-season="summer"] { --sky-season: linear-gradient(180deg, rgba(255, 225, 120, .14), transparent 45%); }
.sky-clouds { animation: sky-drift 90s ease-in-out infinite alternate; }
.sky-rays { animation: sky-spin 120s linear infinite; }
.sky-aurora { animation: sky-shimmer 9s ease-in-out infinite alternate; }
@keyframes sky-drift { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
@keyframes sky-spin { to { transform: rotate(360deg); } }
@keyframes sky-shimmer { from { opacity: .2; } to { opacity: .45; } }
.panel-res { display: flex; gap: 8px; margin: 2px 0 10px; flex-wrap: wrap; }
.pres { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--muted); }
.pres b { color: var(--text); font-variant-numeric: tabular-nums; }
.pres.low { border-color: var(--bad); }
.state.spell .left { color: #8fb8ff; }
.title-form .notice { margin-top: 14px; padding: 10px 12px; border: 1px solid rgba(255, 138, 128, .4); border-radius: 10px; font-size: 13px; color: var(--text); background: rgba(255, 138, 128, .08); }

/* ---------------- The map and the day (v0.3 phase 2b) ---------------- */
.map-modal { width: min(1000px, 100%); }
.map-modal .modal-body { padding: 16px 18px 18px; }
.mapwrap { display: flex; flex-direction: column; gap: 10px; }
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.map-title { font-family: var(--display); font-size: 24px; color: var(--gold-2); font-weight: 700; }
.map-q { font-family: var(--serif); font-style: italic; color: var(--muted); }
.map-picks { display: flex; gap: 8px; flex-wrap: wrap; }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted); min-height: 36px; }
.pick-chip.set { border-style: solid; border-color: var(--gold); color: var(--gold-2); background: rgba(217, 180, 90, .1); }
.pick-chip.locked { border-color: #e8b04a; color: #f2c46d; }
.pc-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid currentColor; font-size: 11px; }
.map-frame { position: relative; width: 100%; aspect-ratio: 960 / 680; border-radius: 14px; overflow: hidden; background: #0d1222; }
.map-base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-tint { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; }
.season-autumn .map-tint { background: rgba(214, 140, 60, .22); } .season-winter .map-tint { background: rgba(190, 215, 255, .25); }
.season-spring .map-tint { background: rgba(240, 170, 210, .16); } .season-summer .map-tint { background: rgba(240, 210, 110, .2); }
/* The dot sits on the place's position and is the only hit area; labels, badges and pins never block a neighbour. */
.mk { position: absolute; transform: translate(-50%, -21px); pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 4px; min-width: 44px; min-height: 44px; color: var(--text); }
.mk-dot { pointer-events: auto; position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(28, 34, 64, .92); border: 2px solid #c7cbe6; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); font-weight: 700; }
.mk-label { font-family: var(--serif); font-size: 13px; text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; }
.mk.st-closed .mk-dot { opacity: .5; border-color: #8a8fae; } .mk.st-closed .mk-label { opacity: .6; }
.mk.visited .mk-dot { border-style: dashed; }
.mk.st-hinted .mk-dot { border-style: dashed; border-color: #b9bde0; background: rgba(28, 34, 64, .6); color: #cfd3f0; }
.mk.mine .mk-dot { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 180, 90, .25), 0 3px 10px rgba(0, 0, 0, .5); }
.mk.mine.k-job .mk-dot { border-color: #e8875a; box-shadow: 0 0 0 3px rgba(232, 135, 90, .25), 0 3px 10px rgba(0, 0, 0, .5); }
.mk.fest .mk-dot { border-color: #f2c46d; box-shadow: 0 0 14px 4px rgba(242, 196, 109, .55); }
.mk.fest-later .mk-dot { border-color: #f2c46d; border-style: dotted; }
.mk.picked .mk-dot { background: var(--gold); color: #23190a; }
.mk:hover, .mk:focus-visible { z-index: 2; }
.mk:focus-visible .mk-dot { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.mk-n { position: absolute; top: -8px; right: -10px; background: var(--gold-2); color: #23190a; border-radius: 999px; font-size: 10px; padding: 0 5px; }
.mk-news { position: absolute; top: -9px; left: -9px; font-style: normal; color: #fff4c2; text-shadow: 0 0 6px #f2c46d; }
.mk-badge { font-size: 11px; font-weight: 600; background: #e8b04a; color: #23190a; border-radius: 999px; padding: 1px 7px; }
.mk.k-job .mk-badge { background: #e8875a; } .mk-badge.urgent { background: #ff8a80; }
.mk-pins { display: flex; gap: 2px; } .mk-pins .pin { display: inline-block; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px #000; } .mk-pins .more { font-size: 10px; padding: 0 3px; background: #333a5c; border-radius: 6px; }
.map-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.ml-row { position: static; transform: none; pointer-events: auto; flex-direction: row; justify-content: flex-start; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 44px; }
.ml-row b { min-width: 180px; } .ml-row span { color: var(--muted); font-size: 13px; } .ml-row em { margin-left: auto; color: var(--gold-2); font-style: normal; font-size: 13px; }
.ml-row.picked { border-color: var(--gold); }
.map-status { min-height: 18px; font-size: 13px; color: var(--gold-2); }
.map-actions { display: flex; justify-content: space-between; gap: 10px; }
.slotchip { position: absolute; right: 12px; bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: rgba(20, 16, 34, .7); border-radius: 999px; padding: 3px 9px; }
.opt.sel { border-color: var(--gold); background: rgba(217, 180, 90, .14); }
.sec-h .gpa { float: right; color: var(--gold-2); text-transform: none; letter-spacing: 0; }
.state.track.job .left { color: #e8875a; }
@media (max-width: 600px) { .mk-label { font-size: 11px; } .mk-dot { width: 28px; height: 28px; } .map-title { font-size: 20px; } }

/* ---------------- Saved games ---------------- */
.btn.ghost-btn { background: transparent; }
.slot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.slot-row b { display: block; font-size: 14px; }
.slot-row span { color: var(--muted); font-size: 12.5px; }
.slot-acts { display: flex; gap: 6px; flex-shrink: 0; }
.sync-code { display: block; margin-top: 4px; font: 600 14px ui-monospace, monospace; letter-spacing: .06em; color: var(--gold-2); user-select: all; }
.sync-in { flex: 1; min-width: 0; background: var(--night); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: var(--text); font: 500 14px ui-monospace, monospace; text-transform: uppercase; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .game { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "meters" "stage"; }
  .side { position: fixed; inset: 0 0 0 auto; width: min(380px, 92vw); z-index: 15; transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); background: #10142b; box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
  .side.open { transform: none; }
  .side-toggle { display: grid; }
  .side-close { display: grid; flex-shrink: 0; margin: 0 10px 0 4px; width: 34px; height: 34px; font-size: 22px; line-height: 1; color: var(--muted); }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(4, 5, 14, .55); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  .side-scrim.on { opacity: 1; pointer-events: auto; }
  .brand { display: none; }
  .top { padding: 10px 16px; }
  .stage { padding-bottom: 60px; }
  .overlay { padding-bottom: 64px; }
}
@media (max-width: 520px) {
  .meter.number .due { white-space: normal; line-height: 1.05; height: auto; min-height: 19px; max-width: 64px; font-size: 10px; text-align: center; }
  .top { gap: 8px; padding: 8px 12px; }
  .top-actions { gap: 4px; }
  .icon-btn { width: 34px; height: 34px; }
  .date .when { font-size: 17px; }
  .date .when small { display: block; margin-left: 0; }
  .meters { gap: 6px; padding: 10px 8px 2px; }
  .meter { width: 52px; }
  .meter .orb { width: 40px; height: 40px; }
  .meter.number .num { height: 40px; font-size: 17px; }
  .meter .lbl { font-size: 9px; letter-spacing: .04em; }
  .card-body h2 { font-size: 24px; }
  .card-body .text { font-size: 16.5px; }
  .deck { min-height: 340px; }
  .choice { font-size: 13px; }
  .modal-body { padding: 16px; }
}
@media (max-height: 760px) {
  .card-art { aspect-ratio: 400 / 160; }
}
/* Reduced motion: Settings → Motion → Reduced (on the first visit it copies the device's reduce-motion preference;
   the device setting itself is not followed after that). Animations and transitions finish at once, and run once:
   an endless loop squeezed to .01ms would flicker thousands of times a second. The sky's endless loops stop outright. */
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
html[data-motion="reduced"] .sky-clouds, html[data-motion="reduced"] .sky-rays, html[data-motion="reduced"] .sky-aurora { animation: none !important; }

/* ---------------- Simplified Chinese ---------------- */
html:lang(zh-CN), html:lang(zh) {
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Source Han Serif SC", serif;
  --display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
}
html:lang(zh-CN) .card-body .text, html:lang(zh) .card-body .text { font-size: 16.5px; line-height: 1.7; }
html:lang(zh-CN) .card-body h2, html:lang(zh) .card-body h2 { font-size: 24px; letter-spacing: .02em; }
html:lang(zh-CN) .modal .text, html:lang(zh-CN) .outcome .say, html:lang(zh) .modal .text, html:lang(zh) .outcome .say { line-height: 1.7; font-size: 16.5px; }
html:lang(zh-CN) .meter .lbl, html:lang(zh-CN) .sec-h, html:lang(zh-CN) .tagline, html:lang(zh-CN) .kicker, html:lang(zh-CN) .yr { letter-spacing: .04em; }
html:lang(zh-CN) .title-panel h1 { letter-spacing: .08em; }
