/* ================= Main menu ================= */
.mm { position: absolute; inset: 0; pointer-events: none; }
.mm > * { pointer-events: auto; }
.mm-col {
  position: absolute; right: 5rem; top: 50%; transform: translateY(-50%); width: 38rem; text-align: center;
  padding: 3rem 2rem; border-radius: 2rem;
  background: radial-gradient(ellipse at center, rgba(8, 5, 3, .72) 0%, rgba(8, 5, 3, .45) 55%, rgba(8, 5, 3, 0) 75%);
}
.mm-title { font-family: var(--f-display); font-size: 6.4rem; line-height: 1; color: var(--gold); text-shadow: 0 .2rem 0 #2a1608, 0 0 2.4rem rgba(255, 170, 60, .35); }
.mm-sub { font-style: italic; color: #b89a6a; font-size: 1.9rem; margin-top: .6rem; }
.mm-div { margin: 1.6rem 3rem; filter: sepia(1) saturate(2.4) brightness(1.5); }
.mm-list { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.mm-item {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 1rem; width: 30rem;
  padding: .5rem 0; font-family: var(--f-display); font-size: 3.1rem; color: #cdb07a;
  text-shadow: 0 .2rem .4rem #000; transition: color .2s ease, text-shadow .2s ease, transform .2s ease;
  opacity: 0; animation: mmIn .6s ease forwards;
}
.mm-item .mm-flame { width: 1.6rem; height: 3.4rem; opacity: 0; transition: opacity .2s ease; filter: drop-shadow(0 0 .6rem rgba(255, 150, 40, .8)); }
.mm-item:focus { outline: none; }
.mm-item:focus-visible, .mm-item.hot, .mm-item:hover { color: var(--gold-bright); text-shadow: 0 0 1.6rem rgba(255, 180, 70, .55), 0 .2rem .4rem #000; transform: scale(1.04); }
.mm-item:focus-visible .mm-flame, .mm-item.hot .mm-flame, .mm-item:hover .mm-flame { opacity: 1; animation: flick .18s infinite alternate; }
.mm.leaving .mm-col { opacity: 0; transform: translateY(-50%) translateX(3rem); transition: all .6s ease; }
.mm.leaving .mm-foot { opacity: 0; transition: opacity .4s ease; }
@keyframes mmIn { from { opacity: 0; transform: translateX(2rem); } to { opacity: 1; transform: none; } }
@keyframes flick { from { transform: scaleY(1) translateY(0); } to { transform: scaleY(1.12) translateY(-.15rem); } }
.mm-foot { position: absolute; left: 0; right: 0; bottom: 2rem; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 3rem; color: #9c8058; font-size: 1.5rem; }
.mm-rotate { display: flex; align-items: center; gap: 1rem; background: rgba(0, 0, 0, .45); padding: .4rem 1rem; border-radius: 2rem; }
.mm-rot { font-size: 2.4rem; color: var(--gold); width: 3.4rem; height: 3.4rem; border-radius: 50%; border: .15rem solid rgba(214, 178, 94, .4); line-height: 1; }
.mm-rot:hover { background: rgba(214, 178, 94, .15); }
.mm-compass { color: var(--gold-bright); font-family: var(--f-display); font-size: 1.8rem; }
.mm-ver { font-style: italic; opacity: .8; }

/* ================= Options ================= */
.opt-tabs { display: flex; justify-content: center; gap: .6rem; margin-bottom: 1.2rem; }
.opt-tab { font-family: var(--f-display); font-size: 2.2rem; padding: .3rem 1.4rem; border-radius: .4rem; color: var(--ink-soft); }
.opt-tab:hover { background: var(--wash); }
.opt-tab.sel { color: var(--ink); background: var(--wash-strong); }
.opt-content { min-height: 26rem; }
.opt-row { display: grid; grid-template-columns: 19rem 1fr 9rem; align-items: center; gap: 1.2rem; padding: .55rem .4rem; border-bottom: .1rem dashed var(--ink-faint); }
.opt-label { font-family: var(--f-display); font-size: 2rem; }
.opt-val { text-align: right; font-size: 1.6rem; color: var(--ink-soft); }
.opt-row input[type=range] { width: 100%; accent-color: var(--blood); }
.opt-row input[type=checkbox] { width: 2rem; height: 2rem; accent-color: var(--blood); justify-self: start; }
.opt-row select { font-size: 1.6rem; padding: .3rem .6rem; background: rgba(255, 245, 220, .6); border: .15rem solid var(--ink-faint); border-radius: .4rem; color: var(--ink); }
.opt-key { justify-self: start; min-width: 12rem; font-size: 1.8rem; }
.opt-note { font-style: italic; color: var(--ink-soft); font-size: 1.6rem; margin-top: 1.4rem; }

/* ================= Journal frame ================= */
.jscreen { position: absolute; inset: 0; animation: fadein .4s ease; }
.journal {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 123.18rem; height: 72rem;
  background: url('../assets/ui/book_open.webp') center/100% 100% no-repeat;
  filter: drop-shadow(0 1rem 3rem rgba(0, 0, 0, .7));
}
.page { position: absolute; top: 5.6%; height: 88%; display: flex; flex-direction: column; }
.page-left { left: 9.2%; width: 38.2%; }
.page-right { left: 55.2%; width: 33.1%; }
.muted { color: var(--ink-soft); font-style: italic; }
.small { font-size: 1.4rem; }
.warn { color: var(--blood); }

/* sheet header (left page top) */
.sheet-head { display: grid; grid-template-columns: 14.5rem 18rem 1fr; gap: .8rem; height: 19.5rem; align-items: center; }
.sh-stats { display: flex; flex-direction: column; gap: .15rem; }
.sh-stat { display: flex; justify-content: space-between; font-family: var(--f-display); font-size: 1.95rem; line-height: 1.25; }
.sh-stat b { font-weight: 400; min-width: 4.4rem; text-align: right; }
.sh-portrait { position: relative; height: 19rem; display: flex; align-items: center; justify-content: center; }
.sh-oval {
  width: 11.6rem; height: 15.6rem; border-radius: 50%; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 58%, transparent 72%); mask-image: radial-gradient(ellipse at center, #000 58%, transparent 72%);
  background: rgba(110, 70, 30, .15);
}
.sh-oval img { width: 100%; height: 100%; object-fit: cover; }
.sh-oval-empty { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--f-display); font-size: 5rem; color: var(--ink-faint); }
.sh-meter { position: absolute; top: 50%; transform: translateY(-50%); width: 4.6rem; height: 17rem; }
.sh-meter img { width: 100%; height: 100%; opacity: .9; }
.sh-meter-l { left: -.2rem; }
.sh-meter-r { right: -.2rem; }
.sh-mlabel { position: absolute; font-family: var(--f-display); font-size: 1.15rem; color: var(--ink-soft); white-space: nowrap; }
.sh-meter-l .sh-mlabel, .sh-meter-r .sh-mlabel { left: 50%; transform: translateX(-50%); }
.sh-mlabel.top { top: -1.6rem; }
.sh-mlabel.bot { bottom: -1.6rem; }
.sh-meter img.sh-mark { position: absolute; width: 42%; height: auto; opacity: 1; transition: left .4s, top .4s, transform .4s; filter: drop-shadow(0 .05rem .05rem rgba(255, 245, 220, .5)); }
.sh-id { display: flex; flex-direction: column; gap: .2rem; text-align: center; font-family: var(--f-display); font-size: 1.9rem; line-height: 1.25; }
.sh-id i { color: var(--ink-faint); font-family: var(--f-body); font-size: 1.6rem; }
.sh-name { font-size: 2.4rem; color: var(--blood); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* left page lower: steps + record */
.lp-lower { flex: 1; display: grid; grid-template-columns: 22rem 1fr; gap: 2rem; min-height: 0; }
.steps { display: flex; flex-direction: column; gap: .2rem; }
.step {
  display: grid; grid-template-columns: 4rem 1fr 2rem; align-items: center; text-align: left;
  padding: .45rem .8rem; border-radius: .4rem; font-family: var(--f-display); font-size: 2.15rem; transition: background .15s;
}
.step:hover:not(:disabled) { background: var(--wash); }
.step:disabled { opacity: .3; cursor: default; }
.step.cur { background: var(--wash-strong); box-shadow: inset .4rem 0 0 var(--blood); }
.step-n { font-family: var(--f-sc); font-size: 1.5rem; color: var(--ink-soft); }
.step-check { color: var(--good); font-size: 1.8rem; text-align: right; }
.lp-record { display: flex; flex-direction: column; gap: 1rem; }
.quickstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.qs { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qs img { width: 4.6rem; height: 4.6rem; opacity: .85; }
.qs span { font-family: var(--f-sc); font-size: 1.3rem; color: var(--ink-soft); }
.qs b { font-family: var(--f-display); font-weight: 400; font-size: 2.6rem; line-height: 1; }
.saves-mini { border-top: .1rem solid var(--ink-faint); padding-top: .6rem; }
.sm-title { font-family: var(--f-display); font-size: 1.9rem; margin-bottom: .2rem; }
.sm-row { display: flex; justify-content: space-between; font-size: 1.6rem; line-height: 1.4; }
.sm-row b { font-family: var(--f-display); font-weight: 400; font-size: 1.8rem; }
.lp-actions { display: flex; justify-content: space-between; padding-top: .6rem; border-top: .1rem solid var(--ink-faint); }

/* right page */
.rp-title { text-align: center; font-size: 4rem; margin: .4rem 0 .2rem; }
.rp-body { flex: 1; min-height: 0; padding: 1rem .6rem 1rem 0; display: flex; flex-direction: column; gap: .2rem; }
.rp-body > * { flex-shrink: 0; }
.rp-help { height: 15rem; flex-shrink: 0; overflow-y: auto; padding: .8rem 1rem; margin-top: .4rem; border-top: .15rem solid var(--ink-faint); font-size: 1.6rem; line-height: 1.4; }
.rp-help h3 { font-size: 2.3rem; margin-bottom: .3rem; }
.rp-help p { margin: .3rem 0; }
.rp-help ul.traits { margin: .3rem 0; padding-left: 2rem; }
.rp-help .phrase { font-family: var(--f-display); color: var(--blood); font-size: 1.9rem; }
.rp-nav { display: flex; justify-content: space-between; align-items: center; padding-top: .6rem; border-top: .1rem solid var(--ink-faint); gap: .4rem; flex-wrap: wrap; }
.rp-nav .ink-btn { font-size: 2rem; padding: .45rem 1.1rem; }
.sub-head { font-family: var(--f-display); font-size: 2.2rem; margin: 1.2rem 0 .4rem; padding-bottom: .2rem; border-bottom: .1rem solid var(--ink-faint); }
.tab-on { background: var(--wash-strong) !important; box-shadow: inset 0 -.25rem 0 var(--blood); }
.class-mode, .sub-tabs { display: flex; gap: .6rem; justify-content: center; margin-bottom: .8rem; }
.class-mode .ink-btn, .sub-tabs .ink-btn { font-size: 1.9rem; padding: .3rem 1.2rem; }

/* gender + portraits */
.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.gender-row .opt { justify-content: center; font-size: 2.4rem; }
.portrait-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; padding: .4rem; }
.pg-item { aspect-ratio: 3 / 4; border-radius: .6rem; overflow: hidden; border: .2rem solid transparent; background: rgba(110, 70, 30, .15); transition: transform .15s ease, border-color .15s; }
.pg-item:hover { transform: translateY(-.2rem); border-color: var(--ink-faint); }
.pg-item.sel { border-color: var(--blood); box-shadow: 0 0 0 .2rem rgba(110, 29, 26, .3); }
.pg-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-upload { display: grid; place-items: center; font-family: var(--f-display); font-size: 1.8rem; color: var(--ink-soft); border: .2rem dashed var(--ink-faint); line-height: 1.1; }

/* alignment */
.al-wrap { position: relative; padding: 3rem 0 0 3.4rem; }
.al-axis-top { position: absolute; top: .4rem; left: 3.4rem; right: 0; display: flex; justify-content: space-between; font-family: var(--f-sc); font-size: 1.5rem; color: var(--ink-soft); }
.al-axis-top::after { content: ''; position: absolute; left: 9rem; right: 9rem; top: 50%; border-top: .12rem dashed var(--ink-faint); }
.al-axis-side { position: absolute; left: 0; top: 3rem; bottom: 0; width: 2.4rem; display: flex; flex-direction: column; justify-content: space-between; align-items: center; font-family: var(--f-sc); font-size: 1.5rem; color: var(--ink-soft); }
.al-axis-side span { writing-mode: vertical-rl; transform: rotate(180deg); }
.al-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.al-cell { aspect-ratio: 1.15; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; border-radius: .6rem; border: .15rem solid var(--ink-faint); padding: .4rem; transition: background .15s; text-align: center; }
.al-cell:hover:not(.disabled) { background: var(--wash); }
.al-cell.sel { background: var(--wash-strong); border-color: var(--blood); box-shadow: inset 0 0 0 .15rem var(--blood); }
.al-cell.disabled { opacity: .3; cursor: not-allowed; }
.al-name { font-family: var(--f-display); font-size: 2rem; line-height: 1.05; }
.al-phrase { font-size: 1.3rem; font-style: italic; color: var(--ink-soft); }

/* abilities */
.ab-table { display: flex; flex-direction: column; gap: .2rem; }
.ab-row { display: grid; grid-template-columns: 12.5rem 5.4rem 13.4rem 6rem 1fr;   /* fixed dice column: the −/+ line up whatever the adjustment */ align-items: center; gap: .6rem; padding: .35rem .6rem; border-radius: .4rem; }
.ab-row:hover { background: var(--wash); }
.ab-row.prime .ab-name::after { content: ' ✦'; color: var(--blood); font-size: 1.3rem; vertical-align: super; }
.ab-name { font-family: var(--f-display); font-size: 2.1rem; }
.ab-val { font-family: var(--f-display); font-weight: 400; font-size: 2.6rem; text-align: center; }
.ab-val.rolling { color: var(--blood); }
.ab-val.bad { color: #a8201a; text-decoration: underline wavy rgba(168, 32, 26, .55); text-underline-offset: .35rem; }   /* outside the race/class limits after a change */
.ab-mod { font-size: 1.35rem; color: var(--ink-soft); font-style: italic; text-align: right; }
.ab-totals { display: flex; justify-content: space-around; margin: 1rem 0 .6rem; font-family: var(--f-display); font-size: 2rem; }
.ab-totals b { font-weight: 400; font-size: 2.4rem; margin-left: .4rem; }
.ab-buttons { display: flex; justify-content: center; gap: 1rem; }
.btn-ico { width: 2.4rem; height: 2.4rem; }

/* list tables (profs, thief, spells) */
.pts-line { text-align: center; font-family: var(--f-display); font-size: 2rem; margin-bottom: .6rem; }
.pts-line b { font-weight: 400; font-size: 2.4rem; color: var(--blood); margin-left: .3rem; }
.list-table { display: flex; flex-direction: column; }
.lt-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem; padding: .3rem .6rem; border-radius: .4rem; text-align: left; width: 100%; border-bottom: .1rem dashed rgba(58, 36, 18, .15); }
.lt-row:hover { background: var(--wash); }
.lt-name { font-family: var(--f-display); font-size: 1.95rem; }
.lt-base { font-size: 1.5rem; }
.lt-total { font-family: var(--f-display); font-weight: 400; font-size: 2.1rem; min-width: 4.6rem; text-align: right; }
.list-table .lt-row:has(.lt-base) { grid-template-columns: 1fr 5rem auto 5rem; }
.lt-row.spell { grid-template-columns: 2.4rem 1fr auto; }
.lt-row.spell.sel { background: var(--wash-strong); }
.lt-row.spell.disabled { opacity: .35; }
.chk { font-size: 1.9rem; color: var(--blood); text-align: center; }
.lt-school { font-size: 1.35rem; font-style: italic; color: var(--ink-soft); }
.lt-school.mine { color: var(--blood); }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .2rem; }
.spec-grid .opt { font-size: 1.75rem; padding: .4rem .6rem; }

/* appearance */
.ap-top { display: grid; grid-template-columns: 14rem 1fr; gap: 1.2rem; align-items: center; }
.figure-wrap { height: 20rem; }
.figure { width: 100%; height: 100%; }
.figure-wrap.doll3d { width: 14rem; height: 24rem; flex-shrink: 0; }   /* the 3D paper doll in Appearance */
.figure-wrap.doll3d canvas { width: 100%; height: 100%; display: block; }
.sw-row { display: grid; grid-template-columns: 8rem 1fr; align-items: center; gap: .6rem; margin: .3rem 0; }
.sw-label { font-family: var(--f-display); font-size: 1.8rem; }
.sw-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.sw { width: 2.2rem; height: 2.2rem; border-radius: .3rem; border: .15rem solid rgba(40, 20, 8, .5); }
.sw.sel { outline: .25rem solid var(--blood); outline-offset: .1rem; }
.bio { width: 100%; resize: none; font-size: 1.7rem; line-height: 1.4; padding: .8rem 1rem; background: rgba(255, 248, 225, .35); border: .15rem solid var(--ink-faint); border-radius: .4rem; color: var(--ink); }
.bio:focus, .name-input:focus { outline: none; border-color: var(--ink-soft); background: rgba(255, 248, 225, .55); }

/* name */
.name-wrap { padding-top: 6rem; text-align: center; }
.name-input { width: 85%; text-align: center; font-family: var(--f-display); font-size: 4rem; padding: .4rem 1rem; background: transparent; border: 0; border-bottom: .15rem solid var(--ink-faint); color: var(--blood); }

/* record */
.rec { flex: 1; min-height: 0; padding-right: .8rem; }
.rec section { margin-bottom: 1.2rem; }
.rec h3 { font-size: 2.3rem; border-bottom: .1rem solid var(--ink-faint); margin-bottom: .3rem; padding-bottom: .1rem; }
.rec-table { width: 100%; border-collapse: collapse; font-size: 1.55rem; }
.rec-table td { padding: .2rem .3rem; vertical-align: top; }
.rec-table td:first-child { font-family: var(--f-display); font-size: 1.75rem; white-space: nowrap; width: 1%; padding-right: 1.2rem; }
.rec-list { margin: .2rem 0; padding-left: 2rem; font-size: 1.55rem; line-height: 1.4; }
.rec-bio { flex: 1; min-height: 0; margin-top: 1rem; font-size: 1.65rem; line-height: 1.45; }
.rec-bio h3 { font-size: 2.3rem; }

/* vault */
.vault-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .3rem; padding: .8rem .4rem; }
.vault-item { display: grid; grid-template-columns: 4.8rem 1fr; gap: 1rem; align-items: center; text-align: left; padding: .4rem .6rem; border-radius: .5rem; }
.vault-item:hover { background: var(--wash); }
.vault-item.sel { background: var(--wash-strong); box-shadow: inset .4rem 0 0 var(--blood); }
.vi-portrait { width: 4.8rem; height: 6.4rem; border-radius: 40%; overflow: hidden; background: rgba(110, 70, 30, .15); }
.vi-portrait img { width: 100%; height: 100%; object-fit: cover; }
.vi-text b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 2.2rem; }
.vi-text small { font-size: 1.45rem; color: var(--ink-soft); font-style: italic; }
.vault-details { max-height: 24rem; overflow: auto; font-size: 1.5rem; border-top: .1rem solid var(--ink-faint); padding-top: .4rem; }
.vault-details summary { font-family: var(--f-display); font-size: 1.9rem; cursor: pointer; }
.vault-details .rec { overflow: visible; }
.vault-mode { text-align: center; margin: .4rem 0; }
.vault-empty { margin: auto; text-align: center; font-family: var(--f-display); font-size: 2.4rem; }
.vault-empty img { width: 10rem; opacity: .7; border-radius: 1rem; }
/* voice sets, on the Appearance step */
.voice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .5rem; }
.voice-opt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .5rem 3.4rem .5rem .8rem; border-radius: .4rem; background: rgba(110, 70, 30, .08); box-shadow: inset 0 0 0 .1rem var(--ink-faint); cursor: inherit; text-align: left; font: inherit; color: inherit; border: 0; }
.voice-opt b { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; }
.voice-opt small { font-size: 1.2rem; font-style: italic; color: var(--ink-soft); }
.voice-opt.sel { background: rgba(80, 150, 70, .18); box-shadow: inset 0 0 0 .2rem #3a7a3a; }
.voice-opt.other { opacity: .75; }
.voice-play { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); padding: .1rem .7rem; font-size: 1.4rem; }
.voice-modal { width: 100%; max-height: 52vh; overflow: auto; }
.voice-modal .voice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* random name buttons under the name field */
.name-roll { display: flex; gap: 1rem; justify-content: center; margin-top: 1.6rem; }
/* difficulty question when an adventure begins */
.diff-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.diff-row { display: grid; grid-template-columns: 1.6rem 1fr; grid-template-areas: 'r n' 'r t'; align-items: start; column-gap: .6rem; row-gap: .1rem; padding: .45rem .8rem; border: .1rem solid transparent; border-radius: .4rem; cursor: pointer; }
.diff-row:hover { border-color: var(--ink-faint); }
.diff-row.on { border-color: var(--ink-soft); background: rgba(120, 80, 30, .08); }
.diff-row input { grid-area: r; margin-top: .45rem; accent-color: var(--blood); }
.diff-name { grid-area: n; font-family: var(--f-display); font-size: 1.6rem; color: var(--blood); }
.diff-text { grid-area: t; font-size: 1.2rem; line-height: 1.3; }
.diff-list { max-height: 52vh; overflow-y: auto; }
/* spell icons in creation lists, and the starting-memorization slots */
.lt-row.spell { grid-template-columns: 3rem 1fr auto; }
.sp-ic { position: relative; width: 2.6rem; height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .35rem; overflow: hidden; box-shadow: 0 0 0 .1rem rgba(58, 36, 18, .45); background: rgba(58, 36, 18, .12); flex: none; }
.sp-ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sp-ic .sp-glyph { font-size: 1.5rem; color: var(--ink-soft); }
.sp-ic.on { box-shadow: 0 0 0 .18rem var(--blood); }
.sp-ic .sp-tick { position: absolute; right: -.05rem; bottom: -.15rem; font-size: 1.1rem; font-weight: bold; color: #fff; text-shadow: 0 0 .25rem #000, 0 0 .15rem #000; }
.sp-ic.empty { background: rgba(58, 36, 18, .06); box-shadow: inset 0 0 0 .1rem rgba(58, 36, 18, .3); }
.lt-row.spell.full:not(.sel) { opacity: .7; }
.memo-slots { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin: .4rem 0 .9rem; }
.memo-slot { display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 6.4rem; padding: .3rem; border-radius: .4rem; background: none; }
.memo-slot.full:hover { background: var(--wash); }
.memo-slot .sp-ic { width: 3.4rem; height: 3.4rem; }
.memo-name { font-size: 1.15rem; text-align: center; line-height: 1.1; color: var(--ink-soft); }
/* the dice behind each ability score (charCreate diceFaces) */
.ab-dice { display: flex; gap: .2rem; align-items: center; font-size: 1.2rem; min-width: 0; overflow: hidden; }
.ab-dice i { font-style: normal; width: 1.9rem; height: 1.9rem; line-height: 1.8rem; text-align: center; border-radius: .3rem; border: .1rem solid #7a5a3a; background: #f3e7c6; color: #3a2414; font-weight: bold; }
.ab-dice i.drop { opacity: .35; text-decoration: line-through; }
.ab-dice img.ab-shot { width: 2.4rem; height: 2.4rem; object-fit: contain; filter: drop-shadow(0 .1rem .15rem rgba(0,0,0,.35)); }
.ab-dice img.ab-shot.drop { opacity: .4; filter: grayscale(.8); margin-left: .35rem; }
.ab-dice em { font-style: normal; color: var(--ink-soft); margin-left: .1rem; }
.ab-dice em.up { color: var(--blood); }
.opt-text { font: inherit; padding: .2rem .5rem; border: .1rem solid #8a6a3a; border-radius: .3rem; background: rgba(255, 250, 235, .7); color: var(--ink); min-width: 18rem; }
.nwp-kind { margin: .8rem 0 .2rem; font-family: var(--f-display); font-size: 1.7rem; border-bottom: .1rem solid var(--ink-faint); }
.nwp-kind .small { font-family: var(--f-body); font-size: 1.25rem; font-style: italic; color: var(--ink-soft); }
.lt-row.fixed { opacity: .85; cursor: default; }
/* proficiency vignettes (assets/proficiencies, 3:2 with soft edges): always at their own shape */
.nwp-art { float: right; height: 9rem; width: auto; max-width: 45%; object-fit: contain; margin: 0 0 .4rem .8rem; }

.ab-val.updated { animation: abUpd .5s ease-out; }
@keyframes abUpd { from { color: var(--blood); transform: scale(1.18); } to { color: inherit; transform: none; } }

/* editing a recorded character: build steps are shown for review only (their sub-tabs still switch) */
.rp-readonly button, .rp-readonly input, .rp-readonly select, .rp-readonly textarea, .rp-readonly .pg-item, .rp-readonly label { pointer-events: none; }
.rp-readonly button:not(.sub-tabs button), .rp-readonly input, .rp-readonly select { opacity: .7; }
.rp-readonly .sub-tabs button { pointer-events: auto; }
.readonly-note { font-style: italic; color: #7a4a20; text-align: center; margin: 0 0 .6rem; }
/* Story selection shares the launcher's leather-and-parchment character frame. */
.story-intro { margin: .2rem 0 .6rem; font-size: 1.7rem; }
.story-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1.2rem; padding: .4rem; }
.story-card { flex: 0 0 auto; display: flex; align-items: center; gap: 1.8rem; width: 100%; padding: 1.2rem 1.5rem; text-align: left; color: var(--ink, #302015); font: inherit; border: 1px solid #876239; border-radius: .4rem; background: rgba(255, 239, 194, .28); cursor: pointer; }
.story-card-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: .7rem; }
.story-cover { position: relative; isolation: isolate; overflow: hidden; flex: 0 0 10.5rem; width: 10.5rem; aspect-ratio: 2 / 3; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 1rem .7rem 1.2rem 1.1rem; color: #e7ca86; background: linear-gradient(90deg, #120b07, #352014 9%, #654429 12%, #352014 16%, #27190f); border: 1px solid #6c4a27; border-radius: .2rem .5rem .5rem .2rem; box-shadow: .25rem .35rem .5rem #30201555, inset 0 0 0 .45rem #c49a4e22; }
.story-cover.forthcoming { background: linear-gradient(90deg, #0b1410, #223c2f 9%, #6b7950 12%, #223c2f 16%, #17291f); }
.story-cover-series { font-family: var(--f-sc); font-size: 1rem; letter-spacing: .1rem; }
.story-cover-emblem { display: block; width: 7.4rem; height: 7.4rem; object-fit: contain; }
.story-cover.forthcoming .story-cover-emblem { width: 5rem; height: 5rem; filter: brightness(2.4) saturate(.6); }
.story-cover-title { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.1; text-align: center; }
.story-cover-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.story-card.selected { background: rgba(255, 237, 179, .65); border-color: #68451e; box-shadow: inset .4rem 0 #68451e; }
.story-card:hover { background: rgba(255, 237, 179, .5); }
.story-card:focus-visible { outline: .25rem solid #315970; outline-offset: .15rem; }
.story-card-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.story-card-heading strong { font-size: 2.7rem; }
.story-status { font-size: 1.5rem; font-weight: bold; white-space: nowrap; }
.story-meta { font-size: 1.6rem; font-style: italic; }
.story-description { font-size: 1.8rem; line-height: 1.4; }
.story-detail { flex-shrink: 0; min-height: 4.4rem; margin: 1rem .4rem 0; font-size: 1.6rem; line-height: 1.4; }
/* Account gate stays above the launcher and never shows vault data before login. */
.admin-cover { --admin-unit: var(--u); color: #ead4a8; }
.admin-cover > h1 { position: absolute; top: calc(var(--u) * 46); width: 100%; margin: 0; text-align: center; font-family: var(--f-display); font-size: calc(var(--u) * 48); font-weight: normal; }
.admin-toolbar { position: absolute; top: calc(var(--u) * 115); left: 9%; right: 9%; display: flex; justify-content: space-between; gap: 30px; }
.admin-tabs { display: flex; gap: calc(var(--u) * 14); }
.admin-toolbar .cv-plate { width: calc(var(--u) * 140); }
.admin-toolbar > .cv-plate { width: calc(var(--u) * 110); }
.admin-content { position: absolute; top: calc(var(--u) * 184); bottom: calc(var(--u) * 100); left: 8%; right: 8%; display: grid; grid-template-columns: 32% 1fr; gap: calc(var(--u) * 22); }
.admin-directory { min-height: 0; display: flex; flex-direction: column; }
.admin-list, .admin-detail { overflow-y: auto; min-width: 0; padding: calc(var(--u) * 15); background: var(--parch) center / 400px; color: var(--ink); border: 2px solid #5e3e22; box-shadow: 0 3px 12px #0006; scrollbar-width: thin; scrollbar-color: #8a6742 transparent; font-size: calc(var(--u) * 18); }
.admin-list { flex: 1; }
.admin-entry { display: block; width: 100%; padding: calc(var(--u) * 11) calc(var(--u) * 7); text-align: left; border-bottom: 1px solid #79573055; }
.admin-entry strong, .admin-entry span { display: block; overflow-wrap: anywhere; }
.admin-entry strong { font-family: var(--f-display); font-size: calc(var(--u) * 23); font-weight: normal; }
.admin-entry span { font-size: calc(var(--u) * 15); margin-top: 5px; }
.admin-entry:hover, .admin-entry.selected { background: #956b2e33; }
.admin-entry:focus-visible { outline: 2px solid #755121; outline-offset: -2px; }
.admin-detail h2 { font-family: var(--f-display); font-weight: normal; font-size: calc(var(--u) * 30); margin: 0 0 10px; }
.admin-detail p { line-height: 1.35; }
.admin-note { font-size: calc(var(--u) * 16); }
.admin-field { display: flex; flex-direction: column; gap: 6px; margin: calc(var(--u) * 12) 0; }
.admin-field select, .admin-field textarea { width: 100%; font: inherit; color: var(--ink); padding: 8px; border: 1px solid #866039; background: #fff6dc99; color-scheme: light; }
.admin-check { display: flex; align-items: center; gap: 8px; margin: calc(var(--u) * 12) 0; }
.admin-check input { accent-color: #695027; width: 18px; height: 18px; }
.admin-detail .cv-plate { max-width: calc(var(--u) * 280); margin-top: 12px; }
.admin-reset { margin-top: 22px; }
.admin-emergency { margin: 20px 0; padding: 12px; border: 1px solid #873e29; background: #8a2a1e15; }
.admin-emergency p { font-size: calc(var(--u) * 16); }
.admin-emergency a { color: #6e2516; }
.admin-status { position: absolute; left: 9%; right: 9%; bottom: calc(var(--u) * 40); font-size: calc(var(--u) * 18); }
.admin-pager { display: flex; align-items: center; justify-content: space-between; font-size: calc(var(--u) * 15); }
.admin-pager .ink-btn { color: #ead4a8; font-size: calc(var(--u) * 17); }
.admin-temporary { display: block; user-select: text; font-size: calc(var(--u) * 20); overflow-wrap: anywhere; }
.admin-bug-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-screenshot { width: 100%; height: auto; margin-top: 18px; }
.admin-detail details { margin-top: 18px; }
.admin-detail pre { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; font-size: calc(var(--u) * 14); }
@media (max-width: 680px) {
  .admin-gate .admin-cover { --u: 1px; width: 100%; height: auto; min-height: 100vh; padding: 24px 16px; }
  .admin-cover > h1 { position: relative; inset: auto; font-size: 36px; }
  .admin-toolbar, .admin-content, .admin-status { position: relative; inset: auto; margin-top: 20px; }
  .admin-toolbar { flex-wrap: wrap; gap: 14px; }
  .admin-tabs { gap: 12px; flex-wrap: wrap; }
  .admin-toolbar .cv-plate { width: 140px; }
  .admin-content { grid-template-columns: 1fr; }
  .admin-list { max-height: 220px; }
  .admin-detail { max-height: none; overflow: visible; }
}
.account-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 45%, rgba(30, 18, 10, .55), rgba(4, 2, 1, .94) 72%), url('../assets/textures/planks_dark.jpg') center / 48vmin, #070402;
  font-family: var(--f-body); font-size: calc(var(--u) * 19); color: #ead4a8; }
.account-decor { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.account-cover > .ln-clasp { z-index: 3; }
.account-heading { position: absolute; top: calc(var(--u) * 63); left: 0; right: 0; text-align: center; }
.account-brand { font-family: var(--f-display); font-size: calc(var(--u) * 80); line-height: 1; }
.account-heading .ln-knot { top: calc(var(--u) * 89); }
.account-tagline { font-style: italic; font-size: calc(var(--u) * 19); margin: calc(var(--u) * 32) 0 0; }
.account-content { position: absolute; inset: calc(var(--u) * 216) calc(var(--u) * 94) calc(var(--u) * 66); display: grid; grid-template-columns: 1fr 1.05fr; gap: calc(var(--u) * 48); align-items: center; z-index: 1; }
.account-welcome { text-align: center; }
.account-emblem { position: relative; width: 94%; margin: auto; aspect-ratio: 1200 / 1328; }
.account-emblem::before { content: ''; position: absolute; inset: 14% 10%; border-radius: 50%; background: radial-gradient(ellipse, #51321b, #211209 80%); box-shadow: inset 0 0 25px #0008; }
.account-ring { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 5px 6px #0009); }
.account-gate-art { position: absolute; width: 84%; height: auto; left: 8%; top: 12%; }
.account-crest-gem { position: absolute; width: 6.4%; height: auto; transform: translate(-50%, -50%); }
.account-motto { margin: calc(var(--u) * 9) 0; font-family: var(--f-display); font-size: calc(var(--u) * 29); }
.account-welcome-copy { margin: 0; font-size: calc(var(--u) * 18); line-height: 1.4; color: #cbb38a; font-style: italic; text-shadow: 0 2px 2px #000; }
.account-card { min-width: 0; max-height: 100%; overflow-y: auto; padding: calc(var(--u) * 16) calc(var(--u) * 20); scrollbar-width: thin; scrollbar-color: #927245 #24170d;
  border: 1px solid #a17d484d; border-radius: calc(var(--u) * 5); background: #10090455; box-shadow: inset 0 2px 12px #0007, 0 1px 0 #efc88f19; }
.account-card h1 { margin: 0 0 calc(var(--u) * 8); font-family: var(--f-display); font-weight: normal; font-size: calc(var(--u) * 34); line-height: 1.1; }
.account-intro { margin: 0 0 calc(var(--u) * 10); font-size: calc(var(--u) * 18); line-height: 1.35; color: #d4bf9c; }
.account-tabs { display: flex; gap: calc(var(--u) * 21); margin: calc(var(--u) * 12) 0; }
.account-tabs > .cv-plate { flex: 1; min-width: 0; }
.account-gate .cv-plate { height: calc(var(--u) * 43); margin-left: calc(var(--u) * 13); }
.account-gate .cv-plate > .plaque { font-size: calc(var(--u) * 22); padding: 0 calc(var(--u) * 12); }
.account-gate .cv-mount { width: calc(var(--u) * 40); left: calc(var(--u) * -16); }
.account-gate .cv-mount i { width: calc(var(--u) * 15); height: calc(var(--u) * 15); }
.account-gate .cv-plate:has(:focus-visible) { filter: drop-shadow(0 0 4px #ffd891); }
.account-field { display: flex; flex-direction: column; gap: calc(var(--u) * 5); margin: calc(var(--u) * 10) 0; }
.account-field span { font-family: var(--f-display); font-size: calc(var(--u) * 21); color: #e0c692; text-shadow: 0 1px 2px #000; }
.account-field input { padding: calc(var(--u) * 6) calc(var(--u) * 12); border: 1px solid #a48349; border-radius: 2px;
  background: linear-gradient(#0e080524, #0e080508), var(--parch) center / 300px; color: #302013; min-width: 0; width: 100%; font-size: calc(var(--u) * 20); box-shadow: inset 0 1px 5px #341c0c66; color-scheme: light; }
.account-field input:focus-visible { outline: 2px solid #e4c783; outline-offset: 2px; }
.account-identity { margin: calc(var(--u) * 10) 0; color: #f0d7a4; }
.account-hint { font-size: calc(var(--u) * 16); line-height: 1.35; font-style: italic; color: #cbb38a; margin: calc(var(--u) * 8) 0; }
.account-error { margin: calc(var(--u) * 10) 0; color: #ffc0a5; font-size: calc(var(--u) * 17); line-height: 1.3; }
.account-error:empty { margin: 0; }
.account-card form > .cv-plate { margin-top: calc(var(--u) * 12); }
.account-link { display: block; margin: calc(var(--u) * 12) auto 0; padding: calc(var(--u) * 3) calc(var(--u) * 10); color: #dbc18a; font-size: calc(var(--u) * 18); text-decoration: underline; text-underline-offset: 3px; }
.account-link:hover { color: #fff0ba; }
.account-link:focus-visible { outline: 2px solid #e4c783; outline-offset: 2px; }
/* Keep forms readable in narrow windows; the cover can scroll instead of shrinking its text. */
@media (max-width: 680px) {
  .account-gate { --u: 1px; place-items: start center; }
  .account-gate .account-cover { width: 100%; height: auto; min-height: 100vh; padding: 40px 24px; }
  .account-heading { position: relative; top: auto; }
  .account-brand { font-size: 52px; }
  .account-heading .ln-knot { position: relative; inset: auto; margin: 14px auto 0; width: 220px; height: 12px; }
  .account-tagline { font-size: 16px; margin-top: 12px; }
  .account-content { position: relative; inset: auto; display: flex; flex-direction: column; gap: 18px; margin: 24px auto 0; max-width: 390px; }
  .account-welcome { display: none; }
  .account-card { width: 100%; max-height: none; overflow: visible; }
  .account-card h1 { font-size: 30px; }
  .account-decor { object-fit: cover; }
  .account-cover > .ln-clasp { width: 70px; }
}
