:root {
  --ink: #dde6e7; --ink2: #eaf1f0; --panel: #f4f8f7; --panel2: #ffffff; --line: #b9cccd;
  --gold: #e0951f; --gold2: #1e3f45; --parch: #1e3f45; --text: #1e3f45; --mute: #5d7b80;
  --red: #a8321f; --green: #3f8a45; --blue: #3d6fa8;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink);
  color: var(--text); font: 16px/1.5 var(--sans); min-height: 100vh;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--gold2); margin: 0 0 .5rem; letter-spacing: .01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
a { color: #1b6a73; }
p { margin: 0 0 .75rem; }
.mute { color: var(--mute); } .small { font-size: .85rem; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .7rem 1.25rem; background: #f4f8f7; border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-family: var(--serif); font-size: 1.2rem; color: var(--gold2); text-decoration: none; margin-right: .5rem; }
.brand-mark { color: #e0951f; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.topbar nav a { color: var(--parch); text-decoration: none; padding: .2rem .1rem; border-bottom: 2px solid transparent; font-weight:600; }
.topbar nav a:hover, .topbar nav a.active { border-color: var(--gold); color: var(--gold2); }
.topbar .soon { color: #8fa5a8; cursor: default; font-size: .92rem; padding: .2rem 0; }
.banner { padding: .6rem 1.25rem; font-size: .92rem; }
.banner.warn { background: #fbe3d6; color: #7a2e12; border-bottom: 1px solid #e2b79f; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.wrap.narrow { max-width: 860px; }

.card { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 1rem 1.2rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 860px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.btn { font: inherit; cursor: pointer; border: 2px solid #1e3f45; background: #1e3f45; border-color:#1e3f45; color: #fff; font-weight: 700; padding: .5rem 1.1rem; border-radius: 99px; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.25); }
.btn.ghost { background: transparent; color: #1e3f45; border-color:#b9cccd; font-weight: 600; }
.btn.ghost:hover { background: #fff; border-color:#1e3f45; }
.btn.danger { background: transparent; border-color: #d49a8f; color: #a8321f; font-weight: 600; }
.btn.danger:hover { background: #fbe6e0; }
.btn.sm { padding: .25rem .6rem; font-size: .85rem; border-radius: 6px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; filter: none; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

label.f { display: block; font-size: .85rem; color: var(--mute); margin-bottom: .2rem; }
input[type=text], input[type=number], input[type=search], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #ffffff; border: 2px solid var(--line); border-radius: 10px; padding: .5rem .6rem;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.field { margin-bottom: .9rem; }

.pill { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--line); color: var(--parch); background: #eaf1f0; margin: 0 .25rem .25rem 0; }
.pill.gold { border-color: var(--gold); color: var(--gold2); }
.pill.green { border-color: #7fb27a; color: #2f6b2b; }
.pill.red { border-color: #d49a8f; color: #a8321f; }

/* Home hub */
.hero { text-align: center; padding: 2rem 0 1.25rem; }
.hero h1 { font-size: 2.6rem; }
.module { display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: inherit; min-height: 150px; }
.module .tag { align-self: flex-start; }
.module.locked { opacity: .55; }
.module.live:hover { border-color: var(--gold); transform: translateY(-1px); transition: .12s; }

/* Builder */
.steps { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.step { font-size: .85rem; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 99px; color: var(--mute); background: #eaf1f0; font-family: inherit; }
.step.done { color: var(--parch); cursor: pointer; border-color: #8fb0b3; }
.step.cur { color: #2a1a05; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.builder-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .builder-layout { grid-template-columns: 1fr; } }
.preview { position: sticky; top: 70px; }
@media (max-width: 900px) { .preview { position: static; } }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.choice { text-align: left; font: inherit; color: var(--text); background: #eaf1f0; border: 1px solid var(--line); border-radius: 9px; padding: .7rem .8rem; cursor: pointer; }
.choice:hover { border-color: var(--gold); }
.choice.sel { border-color: var(--gold); background: #fbeed3; box-shadow: 0 0 0 1px var(--gold) inset; }
.choice b { font-family: var(--serif); color: var(--gold2); display: block; }
.detail { border-left: 3px solid var(--gold); padding: .6rem .9rem; background: #eaf1f0; border-radius: 0 8px 8px 0; margin-top: .9rem; }
.err { color: #a8321f; background: #fbe6e0; border: 1px solid #e2a79b; padding: .5rem .7rem; border-radius: 7px; margin-top: .8rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .3rem .8rem; }
.checks label { display: flex; gap: .45rem; align-items: center; cursor: pointer; padding: .15rem 0; }
.checks label.off { opacity: .4; cursor: not-allowed; }
.checks input { accent-color: var(--gold); width: 1rem; height: 1rem; }
.ability-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.ab-box { background: #eaf1f0; border: 1px solid var(--line); border-radius: 9px; padding: .55rem .6rem; text-align: center; }
.ab-box .nm { font-size: .72rem; letter-spacing: .12em; color: var(--mute); }
.ab-box .big { font-family: var(--serif); font-size: 1.7rem; color: var(--gold2); line-height: 1.1; }
.ab-box .md { font-size: .85rem; color: var(--parch); }
.pb-ctl { display: flex; justify-content: center; align-items: center; gap: .5rem; margin: .3rem 0; }
.pb-ctl button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gold); background: transparent; color: var(--gold2); font-size: 1.1rem; cursor: pointer; }
.pb-ctl button:disabled { opacity: .3; cursor: not-allowed; }
.statline { display: flex; justify-content: space-between; border-bottom: 1px dashed #cfdcdc; padding: .2rem 0; font-size: .92rem; }

/* Character sheet */
.sheet-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.name-input { font-family: var(--serif); font-size: 2rem; color: var(--gold2); background: transparent; border: 0; border-bottom: 1px dashed transparent; padding: 0; width: 100%; max-width: 560px; }
.name-input:hover, .name-input:focus { border-bottom-color: var(--line); outline: none; }
.xpbar { height: 10px; border-radius: 99px; background: #ffffff; border: 1px solid var(--line); overflow: hidden; margin: .35rem 0; }
.xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, #b9781a, var(--gold)); }
.sheet-grid { display: grid; grid-template-columns: 280px 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1050px) { .sheet-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .sheet-grid { grid-template-columns: 1fr; } }
.abs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.skill-row { display: flex; align-items: center; gap: .5rem; padding: .12rem 0; font-size: .92rem; }
.dot { width: .75rem; height: .75rem; border-radius: 50%; border: 1px solid var(--gold); display: inline-block; flex: none; }
.dot.on { background: var(--gold); } .dot.exp { background: var(--gold); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--gold); }
.skill-row .v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--parch); }
.skill-row .ab { color: var(--mute); font-size: .72rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; margin-bottom: .9rem; }
.tile { background: #eaf1f0; border: 1px solid var(--line); border-radius: 9px; text-align: center; padding: .4rem .3rem; }
.tile .k { font-size: .68rem; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; }
.tile .v { font-family: var(--serif); font-size: 1.4rem; color: var(--gold2); }
.tile input { text-align: center; font-family: var(--serif); font-size: 1.4rem; color: var(--gold2); background: transparent; border: 0; padding: 0; width: 100%; }
.hp-big { font-family: var(--serif); font-size: 2.2rem; color: var(--gold2); }
.hp-bar { height: 12px; border-radius: 99px; background: #ffffff; border: 1px solid var(--line); overflow: hidden; margin: .3rem 0 .6rem; }
.hp-bar > i { display: block; height: 100%; background: var(--green); transition: width .2s; }
.hp-bar.low > i { background: var(--red); } .hp-bar.mid > i { background: #d4a84b; }
.slot-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .3rem 0; }
.slot-row .lbl { width: 4.2rem; font-size: .85rem; color: var(--mute); }
.slot { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--gold); background: var(--gold); cursor: pointer; padding: 0; }
.slot.used { background: transparent; }
.feat { padding: .3rem 0; border-bottom: 1px dashed #cfdcdc; display: flex; gap: .6rem; font-size: .93rem; }
.feat .lv { color: var(--mute); width: 3.2rem; flex: none; font-size: .8rem; padding-top: .1rem; }
.feat .src { color: var(--mute); font-size: .78rem; margin-left: auto; text-align: right; }
.log-item { font-size: .88rem; padding: .3rem 0; border-bottom: 1px dashed #cfdcdc; }

dialog { background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 18px; padding: 1.2rem 1.3rem; max-width: 560px; width: calc(100% - 2rem); }
dialog::backdrop { background: rgba(20,50,55,.55); }
.up-ab { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }

#toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 20px); background: #1e3f45; border: 0; color: #fff; padding: .55rem 1rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media print {
  body { background: #fff; color: #000; }
  .topbar, .no-print, .banner, #toast { display: none !important; }
  .card { background: #fff; border-color: #888; box-shadow: none; }
  h1, h2, h3, .name-input, .tile .v, .tile input, .ab-box .big, .hp-big { color: #000; }
  .mute, .tile .k, .skill-row .ab { color: #444; }
  .sheet-grid { grid-template-columns: 1fr 1fr; }
  textarea { border: 1px solid #aaa; background: #fff; color: #000; }
  .dot { border-color: #000; } .dot.on, .dot.exp { background: #000; }
}

/* ---- Beginner help ---- */
.howto { background: #fdf3df; border: 1px solid #e3c88e; border-left: 4px solid var(--gold); border-radius: 8px; padding: .55rem .85rem; margin: 0 0 1rem; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--gold2); list-style-position: inside; }
.howto p { margin: .5rem 0 0; font-size: .95rem; color: var(--parch); }
.term { font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px dotted var(--gold); padding: 0; cursor: help; }
.term:hover { color: var(--gold2); }
.termpop { position: absolute; z-index: 60; max-width: 300px; background: #f4f8f7; color: var(--text); border: 1px solid var(--gold); border-radius: 8px; padding: .6rem .75rem; font-size: .88rem; line-height: 1.4; box-shadow: 0 8px 24px rgba(30,63,69,.25); }
.termpop b { color: var(--gold2); }
.linkbtn { font: inherit; font-size: .92rem; color: var(--gold); background: none; border: 1px solid var(--line); border-radius: 99px; padding: .1rem .7rem; cursor: pointer; margin-left: auto; }
.linkbtn:hover { border-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.chip { font: inherit; font-size: .88rem; color: var(--parch); background: #eaf1f0; border: 1px solid var(--line); border-radius: 99px; padding: .3rem .8rem; cursor: pointer; }
.chip:hover { border-color: var(--gold); }
.chip.on { background: var(--gold); color: #2a1a05; border-color: var(--gold); font-weight: 700; }
.choice .role { display: block; font-size: .82rem; color: var(--parch); margin: .15rem 0 .35rem; }
.choice .badges { margin-top: .35rem; }
.badge { display: inline-block; font-size: .72rem; padding: .08rem .5rem; border-radius: 99px; margin: 0 .25rem .25rem 0; border: 1px solid; }
.badge.fit { color: #2f6b2b; border-color: #7fb27a; background: #e3f1df; }
.badge.match { color: #2a1a05; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.badge.easy { color: #2f6b2b; border-color: #7fb27a; }
.badge.mid { color: var(--gold2); border-color: #b9781a; }
.badge.hard { color: #a8321f; border-color: #d49a8f; }
.plain { background: #eaf1f0; border: 1px solid var(--line); border-radius: 9px; padding: .7rem .9rem; margin: .7rem 0; }
.plain h3 { margin: 0 0 .3rem; }
.plain ul { margin: .2rem 0 0; padding-left: 1.15rem; }
.plain li { margin: .25rem 0; font-size: .93rem; }
.tip { border-left: 3px solid var(--blue); background: #e6eef7; padding: .5rem .8rem; border-radius: 0 8px 8px 0; font-size: .92rem; margin: .7rem 0; }
.ab-help { display: grid; gap: .3rem; margin: .6rem 0 1rem; }
.ab-help div { display: flex; flex-wrap: wrap; gap: .1rem .6rem; font-size: .9rem; padding: .25rem 0; border-bottom: 1px dashed #cfdcdc; }
.ab-help b { min-width: 6.5rem; color: var(--gold2); font-family: var(--serif); }
.checks.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.checks.wide label { align-items: flex-start; }
.checks.wide small { display: block; color: var(--mute); font-size: .8rem; }
.method { text-align: left; font: inherit; color: var(--text); background: #eaf1f0; border: 1px solid var(--line); border-radius: 9px; padding: .55rem .75rem; cursor: pointer; }
.method.sel { border-color: var(--gold); background: #fbeed3; box-shadow: 0 0 0 1px var(--gold) inset; }
.method b { display: block; color: var(--gold2); font-family: var(--serif); }
.method span { font-size: .82rem; color: var(--mute); }
.trait-list div { padding: .25rem 0; border-bottom: 1px dashed #cfdcdc; font-size: .92rem; }
.trait-list b { color: var(--gold2); }
.progress { font-size: .85rem; color: var(--mute); margin: -.2rem 0 .8rem; }
.feat small.d { display: block; color: var(--mute); font-size: .8rem; line-height: 1.3; }

/* ---- Level-up window & roadmap ---- */
dialog { max-height: 92vh; overflow: auto; }
dialog.wide { max-width: 700px; }
.lv-sec { background: #eaf1f0; border: 1px solid var(--line); border-radius: 9px; padding: .7rem .9rem; margin: .8rem 0; }
.lv-sec h3 { margin: 0 0 .3rem; }
.lv-sec ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.lv-sec li { margin: .3rem 0; font-size: .92rem; }
.lv-sec li small { display: block; color: var(--mute); font-size: .82rem; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .5rem; margin: .5rem 0; }
.cardopt { text-align: left; font: inherit; color: var(--text); background: #ffffff; border: 1px solid var(--line); border-radius: 9px; padding: .55rem .75rem; cursor: pointer; }
.cardopt:hover { border-color: var(--gold); }
.cardopt.sel { border-color: var(--gold); background: #fbeed3; box-shadow: 0 0 0 1px var(--gold) inset; }
.cardopt b { display: block; color: var(--gold2); font-family: var(--serif); }
.cardopt span { font-size: .82rem; color: var(--mute); }
.star { color: var(--gold); }
.asi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-top: .5rem; }
.asi-card { background: #ffffff; border: 1px solid var(--line); border-radius: 9px; padding: .45rem .5rem; text-align: center; }
.asi-card.on { border-color: var(--gold); }
.asi-card .nm { font-size: .72rem; letter-spacing: .1em; color: var(--mute); }
.asi-card .sc { font-family: var(--serif); font-size: 1.3rem; color: var(--gold2); }
.asi-card .mdl { font-size: .8rem; color: var(--parch); }
.rm-row { display: flex; gap: .8rem; padding: .5rem .4rem; border-bottom: 1px dashed #cfdcdc; }
.rm-row.past { opacity: .55; }
.rm-row.cur { background: #fbeed3; border-left: 3px solid var(--gold); }
.rm-lv { width: 3.6rem; flex: none; font-family: var(--serif); color: var(--gold2); }
.rm-body { flex: 1; font-size: .92rem; }
.rm-body > div { margin: .2rem 0; }
.rm-body small.d { display: block; color: var(--mute); font-size: .8rem; line-height: 1.3; }
.roadmap { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #ffffff; }

/* ---- Alignment grid & kit ---- */
.align-grid { display: grid; grid-template-columns: 5.2rem repeat(3, 1fr); gap: .4rem; margin: .6rem 0; align-items: stretch; }
.ag-h { text-align: center; font-size: .85rem; align-self: center; line-height: 1.2; }
.ag-h b { display: block; color: var(--gold2); font-family: var(--serif); }
.ag-h small { color: var(--mute); font-size: .72rem; }
.ag-h.side { text-align: left; }
.ag-cell { font: inherit; text-align: center; color: var(--text); background: #eaf1f0; border: 1px solid var(--line); border-radius: 9px; padding: .55rem .3rem; cursor: pointer; min-height: 64px; }
.ag-cell b { display: block; font-size: .88rem; font-family: var(--serif); color: var(--parch); }
.ag-cell small { color: var(--mute); font-size: .74rem; }
.ag-cell:hover { border-color: var(--gold); }
.ag-cell.sel { border-color: var(--gold); background: #fbeed3; box-shadow: 0 0 0 1px var(--gold) inset; }
.ag-cell.sel b { color: var(--gold2); }
.ag-cell.evil { border-style: dashed; opacity: .85; }
@media (max-width: 560px) { .align-grid { grid-template-columns: 3.4rem repeat(3, 1fr); } .ag-cell b { font-size: .74rem; } .ag-cell small { display: none; } .ag-cell { min-height: 52px; padding: .4rem .15rem; } }
.cardopt[disabled] { opacity: .45; cursor: not-allowed; }
.cardopt span.ln { display: block; margin-top: .15rem; }
.kitbox ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.kitbox li { margin: .25rem 0; font-size: .92rem; }
.warnline { color: #a8321f; font-size: .85rem; }
.inv-row { display: flex; gap: .6rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px dashed #cfdcdc; font-size: .92rem; flex-wrap: wrap; }
.inv-row .nm { font-weight: 600; color: var(--parch); }
.inv-row .ds { color: var(--mute); font-size: .82rem; flex-basis: 100%; }
.atk-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.atk-table th { text-align: left; color: var(--mute); font-weight: 500; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .3rem; }
.atk-table td { padding: .3rem; border-top: 1px dashed #cfdcdc; vertical-align: top; }
.atk-table .num { font-family: var(--serif); color: var(--gold2); white-space: nowrap; }
.mini-btn { font: inherit; font-size: .78rem; color: var(--mute); background: none; border: 1px solid var(--line); border-radius: 6px; padding: .05rem .4rem; cursor: pointer; }
.mini-btn:hover { color: var(--gold2); border-color: var(--gold); }

/* ---- Monsters ---- */
.statblock { background: #fdf6e3; color: #2b1d0e; border: 1px solid #b89c62; border-top: 5px solid #8a2a1c; border-bottom: 5px solid #8a2a1c; padding: .9rem 1rem 1rem; border-radius: 4px; font-family: Georgia, serif; font-size: .95rem; line-height: 1.4; box-shadow: 0 2px 8px rgba(30,63,69,.15); }
.statblock .sb-name { font-family: var(--serif); font-size: 1.55rem; color: #7a1f12; margin: 0; font-variant: small-caps; letter-spacing: .02em; }
.statblock .sb-kind { font-style: italic; margin-bottom: .2rem; }
.statblock hr { border: 0; height: 2px; margin: .45rem 0; background: linear-gradient(90deg, #8a2a1c, #d4b26a 50%, #8a2a1c); }
.statblock .sb-line { margin: .1rem 0; } .statblock .sb-line b, .statblock .sb-abil b { color: #7a1f12; }
.statblock .sb-abil { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; font-size: .85rem; gap: .2rem; }
.statblock .sb-h { font-family: var(--serif); font-size: 1.25rem; color: #7a1f12; margin: .8rem 0 .3rem; border-bottom: 1px solid #8a2a1c; font-variant: small-caps; }
.statblock .sb-p { margin: .35rem 0; } .statblock .sb-intro { margin: .3rem 0; font-size: .88rem; }
.statblock .term { color: #7a1f12; border-bottom: 1px dotted #7a1f12; background: none; }
.mrow { display: grid; grid-template-columns: minmax(0,1fr) 3.5rem 8rem 3.5rem 3rem 7.6rem; gap: .5rem; align-items: center; padding: .45rem .3rem; border-top: 1px solid #cfdcdc; font-size: .92rem; }
.mrow:first-child { border-top: 0; } .mrow .nm { font-weight: 600; color: var(--parch); } .mrow .nm a { color: inherit; text-decoration: none; } .mrow .nm a:hover { color: var(--gold2); }
.mrow .num { text-align: center; } .mrow.head { color: var(--mute); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.mrow .acts { display: flex; gap: .3rem; justify-content: flex-end; }
@media (max-width: 720px) { .mrow { grid-template-columns: minmax(0,1fr) 3rem 2.6rem 7.6rem; } .mrow .ty, .mrow .hp { display: none; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.split.wide-right { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); }
.sticky { position: sticky; top: .8rem; }
@media (max-width: 980px) { .split, .split.wide-right { grid-template-columns: 1fr; } .sticky { position: static; } }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 .8rem; } .filters > * { flex: 1 1 130px; min-width: 0; } .filters input[type=search] { flex: 3 1 260px; }
.tabs { display: flex; gap: .4rem; margin: .4rem 0; } .tabs button { font: inherit; color: var(--mute); background: none; border: 1px solid var(--line); border-radius: 8px 8px 0 0; padding: .35rem .8rem; cursor: pointer; } .tabs button.on { color: var(--gold2); border-color: var(--gold); background: #fbeed3; }
.meter { position: relative; height: 14px; background: #eaf1f0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: .4rem 0; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); } .meter u { position: absolute; top: 0; bottom: 0; width: 2px; background: #1e3f45; }
.rate-Trivial, .rate-Easy { color: var(--green); } .rate-Medium { color: var(--gold2); } .rate-Hard { color: #e0894a; } .rate-Deadly { color: var(--red); }
.bal-row { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; font-size: .88rem; padding: .2rem 0; border-top: 1px dashed #cfdcdc; }
.bal-row .ok { color: var(--green); } .bal-row .low { color: var(--blue); } .bal-row .high { color: #e0894a; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; } .fgrid .field { margin: 0; }
.abgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; } .abgrid label { text-align: center; font-size: .75rem; color: var(--mute); } .abgrid input { text-align: center; padding: .35rem .1rem; } .abgrid .md { display: block; color: var(--gold2); font-family: var(--serif); }
@media (max-width: 560px) { .abgrid { grid-template-columns: repeat(3, 1fr); } }
.chk { display: flex; flex-wrap: wrap; gap: .3rem .8rem; } .chk label { font-size: .88rem; display: flex; gap: .3rem; align-items: center; cursor: pointer; }
.entry { background: #eaf1f0; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; margin: .5rem 0; } .entry textarea { min-height: 5rem; }
.entry .top { display: flex; gap: .5rem; } .entry .top input { flex: 1; }
.quick { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.encrow { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; border-top: 1px dashed #cfdcdc; font-size: .9rem; } .encrow .nm { flex: 1; min-width: 0; } .encrow .qty { min-width: 1.4rem; text-align: center; }

/* phone: keep the top bar to one tidy scrolling row */
@media (max-width: 640px) {
  .topbar { padding: .5rem .8rem; flex-wrap: nowrap; overflow-x: auto; gap: .8rem; }
  .topbar nav { flex-wrap: nowrap; gap: .9rem; white-space: nowrap; }
  .topbar .linkbtn { margin-left: 0; flex: none; }
  .brand { white-space: nowrap; margin-right: 0; }
}

/* ---- Emberfall-style builder: lanterns, icon cards, sticky bar ---- */
.steps { gap: .2rem; justify-content: space-between; margin-bottom: 1.1rem; flex-wrap: nowrap; overflow-x: auto; }
.lan { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: .15rem; background: none; border: 0; padding: .2rem .1rem; font: inherit; font-size: .75rem; color: var(--mute); cursor: pointer; border-radius: 12px; }
.lan svg { width: 26px; height: 36px; color: #8fa5a8; }
.lan .halo { fill: transparent; } .lan .body { fill: #c4d3d4; stroke: currentColor; stroke-width: 1.6; }
.lan.done svg { color: var(--gold2); } .lan.done .body { fill: #9fb9bb; }
.lan.cur { color: var(--gold2); font-weight: 700; }
.lan.cur svg { color: #1e3f45; } .lan.cur .body { fill: var(--gold); } .lan.cur .halo { fill: rgba(224,149,31,.28); }
.lan:disabled { cursor: default; opacity: .55; }
.lan:not(:disabled):hover svg { transform: translateY(-1px); }
.progress { display: none; }
.choice-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.choice { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: .9rem 1rem; transition: border-color .15s, transform .15s, box-shadow .15s; }
.choice:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(30,63,69,.12); }
.choice.sel { background: #fdf3df; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(224,149,31,.25); }
.choice b { font-size: 1.15rem; }
.choice .emb { width: 34px; height: 34px; color: var(--gold2); margin-bottom: .35rem; display: block; }
.choice.sel .emb { color: #b9781a; }
.detail { border-left: 5px solid var(--gold); border-radius: 0 16px 16px 0; background: var(--panel); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 1.2rem; }
.actbar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin: 1.2rem -1rem -1rem; padding: .8rem 1rem; background: rgba(244,248,247,.96); border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; backdrop-filter: blur(4px); }
.actbar .btn { min-width: 120px; }
.story-q { margin: 0 0 1.1rem; padding: .9rem 1rem; background: var(--ink2); border: 1px solid var(--line); border-radius: 16px; }
.story-q h3 { margin-bottom: .1rem; }
.story-q input[type=text] { width: 100%; margin-top: .2rem; }
.story-q .chips { margin: .5rem 0; }
.chip.fit { border-color: var(--gold); }
.chip.fit:not(.on)::before { content: "\2605 "; color: var(--gold); }
.hico { display: flex; align-items: center; gap: .6rem; }
.hico .emb { width: 34px; height: 34px; flex: none; color: #b9781a; }
.mini-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-bottom: 1rem; }
.choice.mini { padding: .6rem .7rem; }
.choice.mini .emb { width: 28px; height: 28px; margin-bottom: .2rem; }
.choice.mini b { font-size: 1rem; }
.choice.mini .role { font-size: .75rem; margin: 0; }
.btn .emb { width: 18px; height: 18px; vertical-align: -4px; margin-right: .4rem; }
.ab-help > div { position: relative; padding-left: 3.1rem; }
.ab-help > div .emb { position: absolute; left: .5rem; top: .55rem; width: 28px; height: 28px; color: #b9781a; }
.story-q h3 .emb { width: 26px; height: 26px; }
.choice { display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; }
.choice .badges { margin-top: auto; padding-top: .3rem; }
