
:root {
  --desk: #dfe4e1;
  --paper: #f8f9f7;
  --paper-2: #edf1ee;
  --ink: #1d272a;
  --ink-2: #48575b;
  --ink-3: #6f7d80;
  --rule: #c3cfca;
  --rule-strong: #6d887e;
  --form: #2e6a59;
  --form-soft: #dde9e3;
  --seal: #c0392b;
  --bad: #a43d2f;
  --sad: #5d5a73;
  --focus: #1f6fd1;
  --b-health: #4f8a6e; --b-happy: #b08a3a; --b-ability: #4d6f93; --b-rel: #9a5f74;
  --overlay: rgba(18, 26, 24, .55);
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 10px 30px -18px rgba(20,40,35,.35);
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", "바탕", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #0d1110; --paper: #161b1a; --paper-2: #1c2321; --ink: #d5ddd9; --ink-2: #a9b5b0; --ink-3: #85938e;
    --rule: #2f3b37; --rule-strong: #4c6159; --form: #82c2ab; --form-soft: #22302b; --seal: #e3654f; --bad: #e98572; --sad: #a7a2c4; --focus: #6aa8ff;
    --b-health: #6fb393; --b-happy: #d3ad5c; --b-ability: #7fa3cb; --b-rel: #c98aa1; --overlay: rgba(0,0,0,.66);
    --shadow: 0 10px 30px -18px rgba(0,0,0,.8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --desk: #0d1110; --paper: #161b1a; --paper-2: #1c2321; --ink: #d5ddd9; --ink-2: #a9b5b0; --ink-3: #85938e;
  --rule: #2f3b37; --rule-strong: #4c6159; --form: #82c2ab; --form-soft: #22302b; --seal: #e3654f; --bad: #e98572; --sad: #a7a2c4; --focus: #6aa8ff;
  --b-health: #6fb393; --b-happy: #d3ad5c; --b-ability: #7fa3cb; --b-rel: #c98aa1; --overlay: rgba(0,0,0,.66);
  --shadow: 0 10px 30px -18px rgba(0,0,0,.8); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--desk); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
body.locked { overflow: hidden; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.desk { padding: 24px 16px 40px; }
.sheet { max-width: 1180px; margin: 0 auto; background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shadow); padding: 22px 26px 18px; position: relative; }
.sheet::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--rule); pointer-events: none; }


.top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--rule-strong); padding-bottom: 12px; margin-bottom: 16px; position: relative; }
.title-block { margin-right: auto; }
.form-no { margin: 0; font-size: 12px; letter-spacing: .04em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
h1 { margin: 2px 0 0; font-family: var(--serif); font-weight: 700; font-size: 30px; letter-spacing: -.01em; line-height: 1.2; }
.top-tools { position: absolute; top: -6px; right: 0; display: flex; align-items: center; gap: 6px; }
.theme { background: transparent; border: 1px solid var(--rule); color: var(--ink-3); font-size: 11px; padding: 1px 8px; cursor: pointer; border-radius: 2px; }
.ver-badge { font-size: 10px; letter-spacing: .04em; color: var(--ink-3); border: 1px dashed var(--rule); padding: 0 5px; border-radius: 2px; white-space: nowrap; }
.bug-slot { display: flex; }
.bug-slot:empty { display: none; }
@media (max-width: 359px) { .top-tools { position: static; order: -1; width: 100%; justify-content: flex-end; } }   
#bugSlot .lb-open { font-size: 11px; padding: 1px 8px; min-height: 0; line-height: 1.5; border-radius: 2px; border-color: var(--rule); color: var(--ink-3); opacity: 1; white-space: nowrap; }


.btn { background: var(--paper); border: 1px solid var(--rule-strong); padding: 6px 14px; cursor: pointer; border-radius: 2px; min-height: 34px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { background: var(--paper-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--form); border-color: var(--form); color: var(--paper); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--rule); color: var(--ink-2); }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-size: 14px; color: var(--ink-2); padding: 0 4px; }
.toggle input { accent-color: var(--form); width: 16px; height: 16px; }
.tag { display: inline-block; padding: 0 5px; border: 1px solid var(--rule-strong); border-radius: 2px; font-size: 11px; line-height: 17px; color: var(--form); vertical-align: 1px; font-weight: 600; }


.form { width: 100%; border-collapse: collapse; border-top: 1px solid var(--rule-strong); }
.form th, .form td { border-bottom: 1px solid var(--rule); padding: 6px 10px; text-align: left; vertical-align: top; }
.form th { background: var(--paper-2); color: var(--form); font-weight: 600; white-space: nowrap; width: 1%; font-size: 13px; letter-spacing: .02em; }
.form td + th { border-left: 1px solid var(--rule); }
.form th + td { border-left: 1px solid var(--rule); }

.block { margin-bottom: 16px; }
.block-h { font-size: 13px; font-weight: 700; color: var(--form); margin: 0 0 6px; letter-spacing: .06em; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.block-h::before { content: ""; width: 8px; height: 8px; background: var(--form); display: inline-block; transform: translateY(-1px); }
.block-h .small { letter-spacing: 0; font-weight: 400; }


.intro { max-width: 760px; }
.intro-form td { font-size: 15px; }
.intro-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 8px; }
.intro-actions .btn { padding: 9px 22px; font-size: 16px; }
.resume { border: 1px solid var(--form); background: var(--form-soft); padding: 12px 14px; margin-bottom: 16px; }
.resume-h { margin: 0; font-weight: 700; color: var(--form); }
.resume-who { margin: 2px 0 10px; color: var(--ink-2); }
.resume-actions { display: flex; gap: 8px; flex-wrap: wrap; }


.game { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; column-gap: 26px; align-items: start; }
.game > * { min-width: 0; }
.controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 8px 0; margin: -8px 0 10px; border-bottom: 1px solid var(--rule); }
.speed { display: inline-flex; border: 1px solid var(--rule-strong); }
.chip { background: transparent; border: 0; border-right: 1px solid var(--rule); padding: 5px 9px; cursor: pointer; font-variant-numeric: tabular-nums; min-width: 38px; }
.chip:last-child { border-right: 0; }
.chip[aria-pressed="true"] { background: var(--form); color: var(--paper); }
#btnNext.on { background: var(--form-soft); border-color: var(--form); }
.yr-sec { font-size: 12.5px; color: var(--ink-2); border: 1px dashed var(--rule-strong); padding: 3px 8px; white-space: nowrap; }
.yearbar { flex-basis: 100%; display: flex; align-items: center; gap: 8px; }
.yb-label { font-size: 12px; color: var(--ink-2); min-width: 7.5em; white-space: nowrap; }
.yb-track { flex: 1; height: 6px; position: relative; background: var(--paper-2); border: 1px solid var(--rule); overflow: hidden;
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 12 - 1px), var(--rule-strong) calc(100% / 12 - 1px), var(--rule-strong) calc(100% / 12)); }
.yb-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--form); opacity: .75; }
.choices { list-style: none; margin: 0 0 8px; padding: 0; max-height: 9.5em; overflow-y: auto; border-top: 1px solid var(--rule); }
.choices li { font-size: 13px; padding: 4px 2px; border-bottom: 1px dashed var(--rule); display: grid; grid-template-columns: 3.2em 1fr; gap: 6px; }
.choices li.muted { display: block; }
.choices li b { font-weight: 600; }
.choices .imp { color: var(--seal); font-size: 11px; margin-right: 4px; }
.d-imp { display: inline-block; background: var(--seal); color: #fff; font-size: 11px; padding: 0 6px; margin-right: 6px; letter-spacing: 0; border-radius: 2px; }
.opt .st { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.opt .st::before { content: '↳ '; color: var(--ink-3); }
.d-wait { margin: 8px 0 0; font-size: 12.5px; color: var(--seal); }
.ledger { overflow-anchor: none; }
.hint { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--ink-3); min-height: 1.2em; }
.col-l, .col-r { min-width: 0; }


.scene { margin: 0 0 14px; position: relative; border: 1px solid var(--rule-strong); background: var(--paper-2); }
.scene canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; image-rendering: crisp-edges; }
.scene-age { position: absolute; left: 8px; top: 6px; display: flex; align-items: baseline; gap: 6px; background: rgba(248, 249, 247, .86); color: #1d272a; padding: 0 8px 1px; border: 1px solid rgba(29, 39, 42, .25); }
.scene-age b { font-family: var(--serif); font-size: 20px; font-variant-numeric: tabular-nums; }
.scene-age span { font-size: 12px; color: #48575b; font-variant-numeric: tabular-nums; }
.scene figcaption { font-size: 12.5px; color: var(--ink-2); padding: 5px 9px 6px; border-top: 1px solid var(--rule); background: var(--paper); line-height: 1.45; }


.bars { display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: 62px 1fr 30px; align-items: center; gap: 8px; font-size: 13px; }
.bl { color: var(--ink-2); white-space: nowrap; }
.bt { height: 10px; background: var(--paper-2); border: 1px solid var(--rule); position: relative; overflow: hidden; }
.bt i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width calc(.5s * var(--fx, 1)) ease; }
.bar[data-k="health"] i { background: var(--b-health); } .bar[data-k="happy"] i { background: var(--b-happy); }
.bar[data-k="ability"] i { background: var(--b-ability); } .bar[data-k="rel"] i { background: var(--b-rel); }
.bv { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bar.up .bv { color: var(--form); } .bar.down .bv { color: var(--bad); }
.cards { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule-strong); margin-top: 10px; }
.card { padding: 6px 10px; min-width: 0; }
.card + .card { border-left: 1px solid var(--rule); }
.card span { display: block; font-size: 11px; color: var(--ink-3); }
.card b { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card b .why { display: block; font-family: var(--sans, inherit); font-size: 11.5px; font-weight: 400; color: var(--ink-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


.focus-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { border: 1px solid var(--rule-strong); background: var(--paper); padding: 4px 11px; cursor: pointer; border-radius: 999px; font-size: 14px; min-height: 32px; }
.fchip[aria-checked="true"] { background: var(--form); border-color: var(--form); color: var(--paper); }
.fchip:disabled { opacity: .45; cursor: default; }
.focus-desc { margin: 6px 0 0; color: var(--ink-2); min-height: 1.4em; }


.peers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.peer { border: 1px solid var(--rule); border-top: 2px solid var(--rule-strong); padding: 6px 9px 7px; min-width: 0; background: var(--paper); }
.peer-top { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.peer-name { font-weight: 700; }
.peer-age { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.peer-meta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peer-doing { font-size: 12.5px; color: var(--ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.peer-line { font-size: 12px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; line-height: 1.45; }
.peer.dead { border-top-color: var(--seal); }
.peer.dead .peer-age { color: var(--seal); }


.lifemap { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; }
.lifemap i { aspect-ratio: 1; border: 1px solid var(--rule); background: transparent; position: relative; }
.lifemap i.past { border-color: transparent; }
.lifemap i.now { outline: 2px solid var(--ink); outline-offset: -1px; }
.lifemap i.exp { border: 1px dashed var(--seal); }
.lifemap i.gone { background: var(--ink-3) !important; opacity: .55; }
.surv { margin-top: 10px; }
.surv svg { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--rule); }
.surv p { margin: 4px 0 0; color: var(--ink-2); }


.ledger-head, .row { display: grid; grid-template-columns: 52px 40px 1fr; }
.ledger-head { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: var(--paper-2); font-size: 12px; color: var(--form); font-weight: 600; }
.ledger-head span { padding: 4px 8px; }
.ledger-head span + span { border-left: 1px solid var(--rule); }
.ledger { height: min(64vh, 720px); overflow-y: auto; border-bottom: 1px solid var(--rule); overscroll-behavior: contain; }
.row { border-bottom: 1px dashed var(--rule); animation: rowIn calc(.35s * var(--fx, 1)) ease; }
.row > .y, .row > .a { padding: 6px 8px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row > .a { border-left: 1px solid var(--rule); color: var(--ink-2); }
.row > .t { padding: 5px 10px 6px; border-left: 1px solid var(--rule); min-width: 0; }
.row .ln { margin: 0; font-weight: 400; cursor: pointer; border-radius: 2px; }
.row .ln:hover { background: var(--paper-2); }
.row .ln + .ln { margin-top: 3px; }
.row .ln.big { font-weight: 600; }
.row .ln.bad { color: var(--bad); }
.row .ln.death { color: var(--seal); font-weight: 700; }
.row .ln.stat { color: var(--ink-3); font-size: 0.93em; }
.row .ln.stat::before { content: '자료'; display: inline-block; margin-right: 6px; padding: 0 4px; border: 1px solid var(--rule-strong); border-radius: 2px; font-size: 11px; line-height: 16px; vertical-align: 1px; color: var(--form); }
.row .ln.choice { color: var(--form); font-size: .93em; }
.row .ln.starred::after { content: ' ★'; color: var(--b-happy); }
.row .money { display: block; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.row .money.minus { color: var(--bad); }
.row .note { display: block; font-size: 12.5px; color: var(--ink-2); border-left: 2px solid var(--b-happy); padding-left: 7px; margin-top: 4px; font-style: italic; }
.row.quiet > .t { color: var(--ink-3); font-size: 12px; }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }


.modal { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dcard { background: var(--paper); border: 1px solid var(--rule-strong); box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 20px 14px; position: relative; }
.dcard::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }
.d-kind { margin: 0; font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }
.d-title { margin: 2px 0 6px; font-family: var(--serif); font-size: 23px; line-height: 1.3; }
.d-body { margin: 0 0 8px; color: var(--ink); }
.d-stat { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.d-opts { display: grid; gap: 7px; }
.opt { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--rule-strong); padding: 9px 11px; cursor: pointer; border-radius: 2px; position: relative; z-index: 1; }
.opt:focus { outline: none; }
.opt:focus-visible { outline: 2px solid var(--focus, var(--form)); outline-offset: 1px; }
@media (hover: hover) { .d-opts:not(.fresh) .opt:hover { border-color: var(--form); background: var(--paper-2); } }   
.opt .no { width: 22px; height: 22px; border: 1px solid var(--form); color: var(--form); display: grid; place-items: center; font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.opt .lb { display: block; font-weight: 600; }
.opt .hn { display: block; font-size: 12px; color: var(--ink-3); }
.opt.soon { border-color: var(--form); box-shadow: inset 3px 0 0 var(--form); }
.d-auto { margin-top: 10px; }
.d-auto-bar { height: 4px; background: var(--paper-2); position: relative; overflow: hidden; }
.d-auto-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--form); }
.d-auto p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); }
.d-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.reflect input, .leave input { width: 100%; border: 1px solid var(--rule-strong); background: var(--paper); padding: 8px 10px; border-radius: 2px; margin-top: 6px; }
.pill { position: fixed; right: 16px; bottom: 16px; z-index: 40; background: var(--form); color: var(--paper); border: 0; padding: 10px 16px; border-radius: 999px; cursor: pointer; box-shadow: 0 8px 22px -10px rgba(0,0,0,.6); font-weight: 600; }


.end { border-top: 2px solid var(--rule-strong); padding-top: 16px; margin-top: 8px; }
.cert { border: 1.5px solid var(--ink-2); padding: 18px 20px; position: relative; max-width: 860px; }
.cert::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--rule); pointer-events: none; }
.cert-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: relative; }
.cert-head .form-no { flex-basis: 100%; }
.cert-title { font-family: var(--serif); font-size: 28px; margin: 0; letter-spacing: .3em; }
.cert-sum { margin: 12px 0; line-height: 1.75; }
.cert-form th { width: 112px; }
.cert-form td { font-size: 14px; }
.cert-form td .sub { display: block; font-size: 12px; color: var(--ink-3); }
.seal { width: 86px; height: 86px; border: 3px solid var(--seal); border-radius: 50%; color: var(--seal); display: grid; place-items: center; transform: rotate(-12deg); flex: 0 0 auto; opacity: .88; position: relative; }
.seal::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--seal); border-radius: 50%; }
.seal span { font-family: var(--serif); font-weight: 700; font-size: 17px; line-height: 1.05; writing-mode: vertical-rl; height: 2.3em; letter-spacing: .05em; }
.care-note { font-size: 13px; color: var(--ink-2); border-left: 3px solid var(--rule-strong); padding-left: 10px; margin: 12px 0 0; }
.leave { margin: 18px 0 8px; max-width: 640px; }
.leave-row { display: flex; gap: 8px; }
.leave-row input { margin-top: 0; }
.leave-row .btn { white-space: nowrap; flex: 0 0 auto; }
.end-sub-h { margin-top: 18px; }
.end-events { margin: 8px 0 6px; padding-left: 0; list-style: none; counter-reset: ev; }
.end-events li { counter-increment: ev -1; padding: 5px 0 5px 34px; border-bottom: 1px dashed var(--rule); position: relative; }
.end-events li::before { content: counter(ev); position: absolute; left: 4px; top: 5px; font-size: 12px; color: var(--form); font-variant-numeric: tabular-nums; border: 1px solid var(--form); width: 20px; text-align: center; line-height: 18px; }
.end-nums { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule-strong); margin: 14px 0; }
.end-nums div { padding: 10px 12px; }
.end-nums div + div { border-left: 1px solid var(--rule); }
.end-nums b { display: block; font-family: var(--serif); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.end-nums span { font-size: 12px; color: var(--ink-3); }
.cmp th { width: auto; }
.cmp thead th { border-bottom: 1px solid var(--rule-strong); }
.cmp tbody th { color: var(--ink-2); }
.cmp td { font-variant-numeric: tabular-nums; }
.cmp td.note { color: var(--ink-3); font-size: 12px; }
.end-peers { margin: 14px 0; font-size: 14px; color: var(--ink-2); }
.end-peers b { color: var(--ink); }
.end-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0 6px; }
.copied { font-size: 13px; color: var(--form); }


.replay { position: fixed; inset: 0; z-index: 60; background: #11161a; color: #e9ece6; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; cursor: pointer; user-select: none; }
.rp-prog { position: absolute; top: 12px; left: 16px; right: 96px; display: flex; gap: 4px; }
.rp-prog i { flex: 1; height: 3px; background: rgba(233, 236, 230, .22); position: relative; overflow: hidden; }
.rp-prog i b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #e9ece6; }
.rp-prog i.done b { width: 100%; }
.rp-skip { position: absolute; top: 4px; right: 12px; background: transparent; border: 1px solid rgba(233,236,230,.4); color: #e9ece6; padding: 4px 12px; border-radius: 2px; cursor: pointer; font-size: 13px; }
.rp-stage { width: min(720px, 100%); text-align: center; }
.rp-stage canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; image-rendering: crisp-edges; display: block; border: 1px solid rgba(233,236,230,.25); }
.rp-age { font-family: var(--serif); font-size: 30px; margin: 16px 0 4px; font-variant-numeric: tabular-nums; }
.rp-cap { font-size: 18px; line-height: 1.6; margin: 0 auto; max-width: 600px; min-height: 3.2em; color: #d5dad3; }
.rp-tap { position: absolute; bottom: 14px; font-size: 12px; color: rgba(233,236,230,.5); margin: 0; }
.rp-title { text-align: center; max-width: 560px; animation: fadeIn 1.2s ease; }
.rp-name { font-family: var(--serif); font-size: 38px; margin: 0; letter-spacing: .08em; }
.rp-years { font-size: 16px; color: #b9c0b8; margin: 4px 0 26px; font-variant-numeric: tabular-nums; }
.rp-days { font-size: 18px; margin: 0 0 18px; }
.rp-line { font-family: var(--serif); font-size: 24px; line-height: 1.6; margin: 0 0 30px; }
.rp-title .btn { background: transparent; color: #e9ece6; border-color: rgba(233,236,230,.5); }
.rp-stage.fade { animation: fadeIn .6s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


.cardview { width: min(420px, 100%); text-align: center; }
.cardview img { width: 100%; max-height: 66vh; object-fit: contain; border: 1px solid var(--rule); background: var(--paper-2); }


.foot { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 8px; }
.foot details { margin: 6px 0; }
.foot summary { cursor: pointer; font-weight: 600; color: var(--form); font-size: 14px; padding: 4px 0; }
.howto ul { margin: 4px 0; padding-left: 18px; color: var(--ink-2); }
.lives ol { margin: 6px 0; padding-left: 22px; font-size: 13px; color: var(--ink-2); }
.src-table { margin: 8px 0; font-size: 13px; }
.src-table td { font-variant-numeric: tabular-nums; }
.src-table .est { display: inline-block; font-size: 11px; color: var(--seal); border: 1px solid currentColor; padding: 0 4px; margin-left: 4px; line-height: 1.4; }
.src-list { font-size: 12px; color: var(--ink-2); padding-left: 18px; }
.src-list a { color: var(--form); }


.draw { max-width: 760px; }
.draw-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.draw-head .block-h { margin: 0; }
.draw-stack { display: flex; gap: 0; min-height: 0; margin: 0 0 10px; padding-left: 4px; overflow: hidden; }
.draw-stack:empty { display: none; }
.mini { flex: 0 0 auto; width: 104px; padding: 6px 8px; margin-left: -10px; background: var(--paper); border: 1px solid var(--rule-strong); box-shadow: var(--shadow); font-size: 11px; line-height: 1.35; color: var(--ink-2); transform: rotate(var(--rot, -3deg)); }
.mini:first-child { margin-left: 0; }
.mini b { display: block; font-family: var(--serif); font-size: 14px; color: var(--ink); }
.mini .st { color: var(--seal); letter-spacing: -.05em; }
.draw-stage { perspective: 900px; }
.bcard { position: relative; background: var(--paper); border: 2px solid var(--rule-strong); outline: 1px solid var(--rule); outline-offset: -7px; padding: 18px 18px 14px; box-shadow: var(--shadow); transform-origin: 50% 60%; }
.bcard.deal { animation: bdeal calc(.75s) cubic-bezier(.2,.9,.25,1.15) both; }
@keyframes bdeal { 0% { transform: rotateY(88deg) translateY(14px) scale(.9); opacity: .2; } 55% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.bc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.bc-top .bc-title { font-family: var(--serif); letter-spacing: .3em; color: var(--ink-2); font-size: 13px; }
.bc-name { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; padding-right: 76px; }
.bc-name b { font-family: var(--serif); font-size: 30px; line-height: 1.1; color: var(--ink); }
.bc-stars { color: var(--seal); font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.bc-grade { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; padding-right: 76px; }
.bc-rows { width: 100%; border-collapse: collapse; font-size: 14px; }
.bc-rows th { text-align: left; font-weight: 600; color: var(--form); white-space: nowrap; padding: 6px 10px 6px 0; vertical-align: top; width: 4.8em; border-top: 1px dashed var(--rule); }
.bc-rows td { padding: 6px 0; border-top: 1px dashed var(--rule); color: var(--ink); }
.bc-rows .bc-src { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.bc-grade b { font-weight: 600; color: var(--ink); }
.rar { display: inline-block; margin-left: 6px; font-size: 11px; line-height: 17px; padding: 0 5px; border: 1px solid var(--rule-strong); border-radius: 2px; color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.rar.r3 { border-color: var(--b-happy); color: var(--b-happy); }
.rar.r4 { border-color: var(--seal); color: var(--seal); font-weight: 600; }
.bc-story { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.bseal { position: absolute; top: 46px; right: 16px; width: 64px; height: 64px; border: 3px solid var(--seal); border-radius: 50%; color: var(--seal); display: grid; place-items: center; transform: rotate(-12deg); opacity: .85; font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: .1em; pointer-events: none; }
.bseal::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--seal); border-radius: 50%; }
.bcard.deal .bseal { animation: bstamp .32s .62s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes bstamp { 0% { transform: scale(2.3) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(-12deg); opacity: .85; } }
.draw-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.draw-btns .btn { padding: 9px 18px; font-size: 16px; }
.draw-note { margin-top: 6px; }
@media (max-width: 480px) { .bcard { padding: 14px 12px 10px; } .bc-name b { font-size: 26px; } .bc-rows { font-size: 13px; } .bseal { width: 54px; height: 54px; font-size: 13px; top: 42px; right: 10px; } .bc-name, .bc-grade { padding-right: 62px; } .draw-btns .btn { flex: 1 1 auto; } }

@media (prefers-reduced-motion: reduce) {
  .bcard.deal, .bcard.deal .bseal { animation: none; }
  .row, .rp-title, .rp-stage.fade { animation: none; }
  .bt i { transition: none; }
}


@media (max-width: 860px) {
  .game { display: flex; flex-direction: column; align-items: stretch; }
  .col-l, .col-r { display: contents; }
  .controls { order: 0; }
  .scene { order: 1; }
  .stats { order: 2; }
  .focus { order: 3; }
  .choices-wrap { order: 4; }
  .ledger-wrap { order: 4; }
  .peers-wrap { order: 5; }
  .map-wrap { order: 6; }
  .a-id { order: 7; }
  .ledger { height: 52vh; }
}
@media (max-width: 520px) {
  .desk { padding: 0; }
  .sheet { border: 0; padding: 12px 16px 12px; box-shadow: none; }
  .sheet::before { display: none; }
  h1 { font-size: 24px; }
  .top { gap: 10px; margin-bottom: 12px; padding-bottom: 8px; }
  .controls { gap: 5px; padding: 6px 0; }
  .controls .btn { padding: 4px 9px; min-height: 32px; font-size: 14px; }
  .chip { min-width: 0; padding: 4px 6px; font-size: 13px; }
  .toggle { font-size: 13px; }
  .form th, .form td { padding: 5px 7px; }
  .ledger-head, .row { grid-template-columns: 40px 30px 1fr; }
  .row > .y, .row > .a { padding: 6px 4px; font-size: 11px; }
  .ledger-head span { padding: 4px 4px; }
  .row > .t { padding: 5px 8px 6px; font-size: 14px; }
  .peers { gap: 6px; }
  .peer { padding: 6px 7px; }
  .lifemap { gap: 1px; }
  .end-nums b { font-size: 16px; }
  .end-nums div { padding: 8px; }
  .seal { width: 66px; height: 66px; }
  .seal span { font-size: 14px; }
  .cert { padding: 14px 12px; }
  .cert-title { font-size: 22px; letter-spacing: .2em; }
  .cert-form th { width: 76px; white-space: normal; }
  .id-form tr.rrn { display: none; }
  .hide-sm { display: none; }
  .dcard { padding: 16px 14px 12px; }
  .d-title { font-size: 20px; }
  .rp-age { font-size: 24px; }
  .rp-cap { font-size: 16px; }
  .rp-name { font-size: 30px; }
  .rp-line { font-size: 20px; }
}


.music-slot:empty, .music-intro:empty, .net-line:empty, .net-end:empty { display: none; }
.music-slot .lm-toggle { font-size: 13px; padding: 5px 10px; min-height: 32px; }
.music-intro { margin: 2px 0 6px; font-size: 13px; color: var(--ink-3); }
.music-intro .lm-toggle { font-size: 12.5px; padding: 3px 10px; }
.net-line { margin: -8px 0 10px; color: var(--ink-3); }
.net-end { margin: 14px 0 4px; }

.site-links{display:flex;flex-wrap:wrap;gap:6px 16px;margin:20px 0 4px;font-size:13px;opacity:.85}
.site-links a{color:inherit;text-decoration:underline;text-underline-offset:3px}
