/* ============================================================
   v3 — the RPG look: the Road (journey strip, heralds, the character sheet with gear and companions,
   today's charge as a quest log), the card view, the gear picker, the Old Wound, full-bleed pages.
   Loads last. Panels size themselves with container queries, so they fit whatever width they get.
   ============================================================ */
:root { --oak: var(--tex-oak, linear-gradient(#3b2718, #20140b)); --parch: var(--tex-parchment, none); --gold-hi: #d9b45a; --gold-line: #c9a24a; }

/* ---------- the Road: scene ---------- */
.road3 { position: relative; }
.road3 .road-stage { position: relative; grid-column: auto; grid-row: auto; height: clamp(340px, 56svh, 640px); min-height: 0; overflow: hidden; background: #15100b; }
@media (min-width: 1024px) { .road3 .road-stage { height: clamp(420px, 62vh, 720px); } }
.road3 .road-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; z-index: 2; pointer-events: none; background: linear-gradient(transparent, rgba(12, 8, 5, .45)); }

/* ---------- the journey strip (was the number slab + path bar + hint) ---------- */
.rb-journey { appearance: none; border: 0; font: inherit; width: 100%; position: relative; z-index: 3; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center;
  padding: 10px 26px; text-align: left; cursor: pointer; color: #f3e6c6;
  background: linear-gradient(rgba(16, 11, 7, .84), rgba(16, 11, 7, .92)), var(--oak); background-size: auto, 600px;
  border-top: 1px solid rgba(217, 180, 90, .75); border-bottom: 1px solid rgba(217, 180, 90, .45); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .7); }
.rb-journey:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: -4px; }
.rb-j-num { display: grid; font: 600 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: #cdb88f; white-space: nowrap; }
.rb-j-num b { font-size: 26px; line-height: 1; letter-spacing: .02em; color: #fff3d6; margin-bottom: 4px; }
.rb-j-num.r { text-align: right; }
.rb-track { position: relative; display: block; height: 66px; }
.rb-all { position: absolute; left: 0; right: 0; top: 24px; border-top: 2px dotted rgba(243, 230, 198, .45); }
.rb-done { position: absolute; left: 0; top: 23px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #a87a2a, #f0cf7a); box-shadow: 0 0 10px rgba(240, 200, 110, .55); transition: box-shadow .25s; }
.rb-journey:hover .rb-done { box-shadow: 0 0 16px rgba(240, 200, 110, .9); }
.rb-medal { position: absolute; top: 25px; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: #2a1d12 center / cover;
  box-shadow: 0 0 0 2px var(--gold-hi), 0 0 0 4px rgba(0, 0, 0, .55), 0 4px 10px rgba(0, 0, 0, .5); }
.rb-medal.ahead { filter: grayscale(.45) brightness(.8); box-shadow: 0 0 0 2px rgba(217, 180, 90, .55), 0 0 0 4px rgba(0, 0, 0, .55); }
.rb-medal.dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #f0cf7a; }
.rb-next { position: absolute; top: 25px; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #16100a; box-shadow: 0 0 0 2px #f0cf7a; }
.rb-walker { position: absolute; z-index: 2; top: 25px; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: #3a2a1a center 18% / cover;
  box-shadow: 0 0 0 2px #f6d98a, 0 0 0 5px rgba(0, 0, 0, .5), 0 0 22px rgba(246, 205, 110, .75); }
.rb-cap { position: absolute; left: 0; right: 0; bottom: -1px; text-align: center; font: italic 14px var(--font-body); color: #e9dcbc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-cap b { font-weight: normal; color: #f6d98a; }
@media (max-width: 700px) {
  .rb-journey { grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 10px 16px 6px; }
  .rb-track { grid-column: 1 / -1; grid-row: 2; margin: 4px 18px 0; }
  .rb-j-num b { font-size: 21px; }
  .rb-medal.wide { display: none; }
  .rb-cap { font-size: 13px; }
}

/* ---------- content ---------- */
.rb-content { max-width: 1180px; margin: 0 auto; padding: 22px 26px 40px; display: grid; gap: 28px; }
.rb-content > .hint { margin: 0 auto; }
@media (max-width: 700px) { .rb-content { padding: 16px 10px 30px; gap: 24px; } }

/* heralds: an ambush, a foe at a gate, a haven */
.rb-heralds { display: grid; gap: 12px; }
.rb-heralds:empty { display: none; }
.rb-herald { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 12px; color: #f8ead0;
  background: linear-gradient(90deg, rgba(40, 6, 4, .8), rgba(40, 6, 4, .5)), var(--tex-leather, #4a1410); background-size: auto, 500px;
  box-shadow: inset 0 0 0 1px rgba(240, 200, 120, .8), inset 0 0 0 4px rgba(0, 0, 0, .25), 0 14px 30px -16px rgba(80, 10, 0, .75); }
.rb-herald[data-act] { cursor: pointer; }
.rb-herald[data-act]:hover .rb-btn-gold { filter: brightness(1.08); }
.rb-herald.gate { background: linear-gradient(90deg, rgba(10, 10, 12, .88), rgba(10, 10, 12, .6)), var(--oak); background-size: auto, 500px; }
.rb-herald.haven { background: linear-gradient(90deg, rgba(14, 40, 20, .88), rgba(14, 40, 20, .6)), var(--oak); background-size: auto, 500px; }
.rb-h-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #ffd27a; background: rgba(0, 0, 0, .35); box-shadow: 0 0 0 1px rgba(255, 210, 122, .8), 0 0 18px rgba(255, 140, 60, .45); }
.rb-h-ic svg { width: 24px; height: 24px; }
.rb-h-tx { display: grid; gap: 2px; min-width: 0; }
.rb-h-tx b { font: 700 14px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: #ffd98c; }
.rb-h-tx span { font-size: 16.5px; line-height: 1.35; }
.rb-h-act { display: flex; gap: 10px; align-items: center; }
.rb-chip { padding: 4px 10px; border-radius: 99px; font: 600 11px var(--font-display); letter-spacing: .08em; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(255, 210, 122, .5); white-space: nowrap; }
.rb-btn-gold { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 9px; font: 700 12px var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: #2a1a08;
  background: linear-gradient(#f6d98a, #c9962f); box-shadow: 0 2px 0 #7a5214, 0 8px 18px -8px rgba(0, 0, 0, .6); white-space: nowrap; }
.rb-btn-gold svg { width: 15px; height: 15px; }
@media (max-width: 700px) {
  .rb-herald { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px; gap: 12px; }
  .rb-h-ic { width: 40px; height: 40px; }
  .rb-h-act { grid-column: 1 / -1; justify-content: space-between; }
  .rb-h-tx span { font-size: 15.5px; }
}

/* framed panels: dark oak frame, parchment inside, a plaque on the top edge */
.rb-frame { position: relative; padding: 11px; border-radius: 16px; background: var(--oak); background-size: 700px; box-shadow: 0 22px 44px -22px rgba(30, 15, 5, .8), inset 0 0 0 1px rgba(0, 0, 0, .5); }
.rb-frame-in { container: sheet / inline-size; position: relative; border-radius: 9px; padding: 36px 24px 22px;
  background-color: var(--paper); background-image: var(--parch); background-size: 700px; background-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px var(--gold-line), inset 0 0 0 5px color-mix(in srgb, var(--paper) 88%, transparent), inset 0 0 0 6px rgba(169, 120, 31, .45), inset 0 0 50px rgba(120, 80, 30, .22); }
.rb-plaque { position: absolute; z-index: 2; top: 0; left: 50%; transform: translate(-50%, -48%); max-width: calc(100% - 40px); overflow: hidden; text-overflow: ellipsis;
  padding: 8px 30px; font: 700 12.5px var(--font-display); letter-spacing: .22em; text-transform: uppercase; white-space: nowrap; color: #f3d690;
  background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .45)), var(--oak); background-size: auto, 400px; border: 1px solid var(--gold-line);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%); }
.rb-corner { position: absolute; width: 34px; height: 34px; fill: none; stroke: #b8892e; stroke-width: 1.3; opacity: .9; pointer-events: none; }
.rb-corner circle { fill: #b8892e; stroke: none; }
.rb-corner.tl { top: 9px; left: 9px; } .rb-corner.tr { top: 9px; right: 9px; transform: scaleX(-1); }
.rb-corner.bl { bottom: 9px; left: 9px; transform: scaleY(-1); } .rb-corner.br { bottom: 9px; right: 9px; transform: scale(-1); }
@media (max-width: 700px) { .rb-frame { padding: 7px; border-radius: 14px; } .rb-frame-in { padding: 30px 12px 16px; } .rb-corner { display: none; } .rb-plaque { padding: 7px 24px; font-size: 11.5px; letter-spacing: .18em; } }

/* the character sheet: stats 60%, you + gear + companions 40% (stacked when there is no room) */
.rb-sheet { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 26px; align-items: start; }
@container sheet (max-width: 880px) { .rb-sheet { grid-template-columns: minmax(0, 1fr); gap: 22px; } }
.rb-main { container: main / inline-size; min-width: 0; }

.rb-ring { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 18px; align-items: center; padding: 0 4px 18px; border-bottom: 1px solid rgba(169, 120, 31, .35); }
@container main (max-width: 600px) { .rb-ring { gap: 14px; } }
.rb-gauge { appearance: none; border: 0; padding: 0; background: none; position: relative; width: 104px; height: 104px; cursor: pointer; }
.rb-gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rb-g-plate { fill: #1a110a; stroke: var(--gold-line); stroke-width: 1.2; }
.rb-g-track { fill: none; stroke: rgba(255, 220, 150, .12); stroke-width: 7; }
.rb-g-ticks line { stroke: #1d140b; stroke-width: 2; }
.rb-gauge-face { position: absolute; inset: 17px; border-radius: 50%; background: #120b06 52% 58% / 330% auto no-repeat; box-shadow: inset 0 0 14px rgba(0, 0, 0, .85); }
@container main (max-width: 440px) { .rb-gauge { width: 84px; height: 84px; } .rb-gauge-face { inset: 14px; } }
.rb-r-label { appearance: none; border: 0; background: none; padding: 0; display: inline-flex; gap: 6px; align-items: center; font: 600 11px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); cursor: pointer; white-space: nowrap; }
.rb-r-label svg { width: 13px; height: 13px; }
.rb-r-num { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.rb-r-num b { font-size: 34px; line-height: 1; }
.rb-r-num small { font: 14px var(--font-display); color: var(--mute); }
.rb-r-num em { font: italic 18px var(--font-body); color: #a35a12; margin-left: 4px; }
[data-mode="dark"] .rb-r-num em { color: #f0a050; }
.rb-r-eff { appearance: none; border: 0; background: none; padding: 0; text-align: left; font: 15px/1.35 var(--font-body); color: var(--mute); cursor: pointer; }
.rb-r-eff b { color: var(--ink); font-weight: normal; }
.rb-r-eff span { white-space: nowrap; }
/* blessings: always one row under the ring, spread evenly; a slider when there are too many to fit */
.rb-buffs { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; overflow-x: auto; scrollbar-width: none; padding: 2px 4px 2px 0; }
.rb-buffs::-webkit-scrollbar { display: none; }
.rb-buffs .rb-note { flex: 1; }
.rb-buff { appearance: none; border: 0; background: none; padding: 0; flex: 1 0 58px; min-width: 58px; max-width: 80px; scroll-snap-align: start; text-align: center; cursor: pointer; color: inherit; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.rb-buff i { position: relative; display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; color: #f3e6c4; background: radial-gradient(circle at 50% 35%, #3a2c1c, #1c140c); box-shadow: 0 3px 8px -4px rgba(0, 0, 0, .55); }
.rb-buff i > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rb-buff i .trk { fill: none; stroke: rgba(0, 0, 0, .35); stroke-width: 3.5; }
.rb-buff i .val { fill: none; stroke-width: 3.5; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.rb-buff i .ic { position: relative; display: grid; place-items: center; }
.rb-buff.on i .val { stroke: #6fbf4a; } .rb-buff.on i .ic { color: #cfeab8; }
.rb-buff.on i { background: radial-gradient(circle at 50% 35%, #456a2c, #1f3314); }
.rb-buff.build i .val { stroke: #e0b54e; } .rb-buff.build i .ic { color: #e9d6a6; opacity: .85; }
.rb-buff i .ic svg { width: 21px; height: 21px; }
.rb-buff i b { position: absolute; right: -7px; bottom: -6px; padding: 1px 5px; border-radius: 8px; font: 700 10px var(--font-display); background: #1e150c; color: #f3d690; box-shadow: 0 0 0 1px var(--gold-line); }
.rb-buff.wait i { background: radial-gradient(circle at 50% 35%, #6a655b, #33302a); opacity: .85; } .rb-buff.wait i .val { stroke: #a9a395; }
.rb-buff > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font: 600 9.5px/1.15 var(--font-display); letter-spacing: .02em; color: var(--mute); }
@container main (max-width: 420px) { .rb-buffs { gap: 8px; scroll-snap-type: x proximity; } .rb-buff { flex-basis: 54px; min-width: 54px; } .rb-buff i { width: 40px; height: 40px; } .rb-buff i .ic svg { width: 18px; height: 18px; } .rb-buff > span { font-size: 8.5px; letter-spacing: 0; } .rb-buff i b { font-size: 9px; right: -6px; } }
.rb-note { font-size: 14px; color: var(--mute); font-style: italic; }
.rb-hero .rb-note { color: #cdb88f; }

.rb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; margin-top: 4px; }
.rb-stat { appearance: none; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px dashed rgba(169, 120, 31, .35); }
.rb-stat:nth-last-child(-n+2) { border-bottom: 0; }
.rb-stat:hover { background: rgba(169, 120, 31, .07); }
.rb-gem { width: 44px; height: 44px; filter: drop-shadow(0 3px 4px rgba(60, 35, 10, .35)); }
.rb-gem .g-edge { stroke: var(--gold-hi); stroke-width: 1.6; }
.rb-gem .g1 { stop-color: var(--g1); } .rb-gem .g2 { stop-color: var(--g2); }
.rb-gem .g-ic { fill: none; stroke: #fffaf0; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-END { --g1: #8fc46a; --g2: #3f7a35; } .g-STR { --g1: #e0705a; --g2: #8a2a20; } .g-VIT { --g1: #f3c45a; --g2: #9a6a12; }
.g-WIS { --g1: #7aa6e0; --g2: #24477a; } .g-SPD { --g1: #86d0d0; --g2: #2d6a70; } .g-WILL { --g1: #b597e6; --g2: #4f3478; }
.rb-s-mid { display: grid; min-width: 0; }
.rb-s-nm { font: 600 12px var(--font-display); letter-spacing: .15em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-s-bar { position: relative; display: block; width: min(130px, 100%); height: 7px; margin-top: 8px; border-radius: 4px; background: rgba(var(--line-rgb), .12); box-shadow: inset 0 0 0 1px rgba(169, 120, 31, .4); }
.rb-s-bar i { position: absolute; left: 1px; top: 1px; bottom: 1px; max-width: calc(100% - 2px); border-radius: 3px; background: linear-gradient(90deg, var(--g2), var(--g1)); }
.rb-s-sub { margin-top: 5px; font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-s-val { display: grid; justify-items: end; }
.rb-s-num { display: flex; align-items: flex-start; gap: 3px; }
.rb-s-num b { font-size: 34px; line-height: 1; }
.rb-s-num em { font: 700 14px var(--font-display); font-style: normal; color: var(--gold); margin-top: 0; }
.rb-s-val small { margin-top: 4px; font: 600 11px var(--font-display); letter-spacing: .06em; }
.rb-stat .flat { color: var(--mute); }
.rb-stat.low .rb-s-num b, .rb-stat.low .rb-s-nm { color: var(--danger); }
@container main (max-width: 600px) { .rb-s-sub { display: none; } }
@container main (max-width: 440px) {
  .rb-stats { gap: 0 14px; }
  .rb-stat { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 11px 0; }
  .rb-gem { width: 30px; height: 30px; }
  .rb-s-nm { font-size: 9.5px; letter-spacing: .05em; }
  .rb-s-num b { font-size: 24px; }
  .rb-s-num em { font-size: 11px; }
}
.rb-foot { margin: 14px 4px 0; font-size: 14.5px; color: var(--mute); }
.rb-foot b { color: var(--danger); font-weight: normal; }
.rb-i { appearance: none; border: 0; background: none; padding: 0 2px; color: var(--mute); cursor: pointer; display: inline-block; vertical-align: -2px; }
.rb-i svg { width: 14px; height: 14px; }

/* you, your gear, your companions */
.rb-hero { container: hero / inline-size; padding: 16px 14px 14px; border-radius: 12px; color: #f0e2c2;
  background: radial-gradient(ellipse 70% 55% at 50% 40%, #5a4128 0%, #2a1d12 55%, #150e08 100%);
  box-shadow: inset 0 0 0 1px var(--gold-line), inset 0 0 0 4px rgba(0, 0, 0, .35), inset 0 0 40px rgba(0, 0, 0, .55); }
.rb-hero-in { display: grid; gap: 14px; }
@container hero (min-width: 600px) { .rb-hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; } }
.rb-doll { display: grid; grid-template-columns: 60px minmax(0, 1fr) 60px; gap: 6px; align-items: center; }
.rb-slots { display: flex; flex-direction: column; gap: 19px; align-items: center; }
.rb-slot { appearance: none; border: 0; padding: 0; position: relative; width: 60px; height: 60px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: rgba(217, 180, 90, .45);
  background: radial-gradient(circle at 50% 40%, rgba(255, 220, 160, .08), rgba(0, 0, 0, .45)); box-shadow: inset 0 0 0 1px rgba(217, 180, 90, .75), inset 0 0 0 3px rgba(0, 0, 0, .45); transition: box-shadow .2s; }
.rb-slot svg { width: 20px; height: 20px; }
.rb-slot.on { box-shadow: inset 0 0 0 1px #f0cf7a, inset 0 0 0 3px rgba(0, 0, 0, .45), 0 0 14px rgba(240, 200, 110, .35); }
.rb-slot:hover { box-shadow: inset 0 0 0 1px #f6d98a, inset 0 0 0 3px rgba(0, 0, 0, .45), 0 0 18px rgba(240, 200, 110, .55); }
.rb-slot-art { position: absolute; inset: 4px; border-radius: 6px; background-repeat: no-repeat; }
.rb-slot em { position: absolute; z-index: 1; top: -7px; right: -9px; padding: 1px 5px; border-radius: 8px; font: 700 9px var(--font-display); font-style: normal; white-space: nowrap; background: #1e150c; color: #9fd27e; box-shadow: 0 0 0 1px var(--gold-line); }
.rb-slot > span { position: absolute; top: 63px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 600 8.5px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: #bfa77a; }
.rb-figure { position: relative; display: grid; place-items: end center; height: 330px; min-width: 0; }
.rb-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .7)); }
.rb-figure::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 60%; height: 14px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .55), transparent 70%); z-index: -1; }
@container hero (max-width: 320px) {
  .rb-doll { grid-template-columns: 50px minmax(0, 1fr) 50px; }
  .rb-slot { width: 50px; height: 50px; } .rb-slot > span { top: 52px; font-size: 7.5px; } .rb-slots { gap: 17px; }
  .rb-figure { height: 280px; }
}
.rb-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.rb-worn h4, .rb-party h4 { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 8px; font: 600 11px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: #e0c27a; }
.rb-party h4 span { color: #bfa77a; letter-spacing: .06em; white-space: nowrap; }
.rb-worn { border-top: 1px solid rgba(217, 180, 90, .3); padding-top: 12px; }
@container hero (min-width: 600px) { .rb-worn { border-top: 0; padding-top: 0; } }
.rb-worn-row { appearance: none; border: 0; width: 100%; text-align: left; color: inherit; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; cursor: pointer;
  background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(217, 180, 90, .25); }
.rb-worn-row:hover { box-shadow: inset 0 0 0 1px rgba(240, 207, 122, .6); }
.rb-worn-row b { font: 600 12px var(--font-display); letter-spacing: .06em; color: #f3d690; }
.rb-worn-row em { font: 700 11px var(--font-display); font-style: normal; color: #9fd27e; }
.rb-worn-row span { flex-basis: 100%; font-size: 13.5px; color: #d9c9a6; line-height: 1.3; }
.rb-faces { display: flex; flex-wrap: nowrap; gap: 10px 14px; align-items: flex-start; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding: 6px 4px 2px; }
.rb-faces::-webkit-scrollbar { display: none; }
.rb-party.light { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(169, 120, 31, .35); }
.rb-party.light h4 { color: var(--mute); }
.rb-party.light h4 span { color: var(--mute); }
.rb-party.light .rb-faces { gap: 12px 10px; }
.rb-party.light .rb-face { width: auto; min-width: 64px; }
.rb-party.light .rb-face i { width: 52px; height: 52px; }
.rb-party.light .rb-face span { color: var(--ink); font-size: 10.5px; }
.rb-party.light .rb-face em { color: var(--good); font-size: 11.5px; }
.rb-face { appearance: none; border: 0; background: none; padding: 0; color: inherit; width: 56px; flex: 0 0 auto; scroll-snap-align: start; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.rb-face i { display: block; width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; background: #3a2a1a center / cover; box-shadow: 0 0 0 2px var(--gold-line), 0 0 0 4px rgba(0, 0, 0, .45); transition: box-shadow .2s; }
.rb-face:hover i { box-shadow: 0 0 0 2px #f6d98a, 0 0 0 4px rgba(0, 0, 0, .45), 0 0 14px rgba(240, 200, 110, .5); }
.rb-face span { display: block; margin-top: 7px; font: 600 9.5px var(--font-display); letter-spacing: .04em; color: #e9d9b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-face em { display: block; font: normal 10.5px/1.2 var(--font-body); font-style: normal; color: #9fc27e; white-space: nowrap; }

/* today's charge, a quest log */
.rb-duties { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@container sheet (max-width: 620px) { .rb-duties { grid-template-columns: 1fr; } }
.rb-duties .duty { appearance: none; border: 0; background: none; color: inherit; font: inherit; width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 4px; text-align: left; border-bottom: 1px dashed rgba(169, 120, 31, .3); border-radius: 0; cursor: pointer; }
.rb-duties .duty:hover { background: rgba(169, 120, 31, .07); }
.rb-duties .duty.auto { cursor: default; } .rb-duties .duty.auto:hover { background: none; }
.rb-seal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: transparent; box-shadow: inset 0 0 0 1.5px #b8892e, inset 0 0 0 4px color-mix(in srgb, var(--paper) 90%, transparent); }
.rb-seal svg { width: 15px; height: 15px; }
.rb-duties .duty.done .rb-seal { background: radial-gradient(circle at 40% 35%, #c0453a, #7d1a12); box-shadow: 0 0 0 1px #5a120c, inset 0 -2px 3px rgba(0, 0, 0, .35); color: #ffe7c7; }
.rb-duties .t { display: block; font-size: 17.5px; line-height: 1.15; }
.rb-duties .s { display: block; font-size: 13.5px; color: var(--mute); }
.rb-duties .duty.done .t { color: var(--mute); text-decoration: line-through; text-decoration-color: rgba(122, 98, 72, .5); }
.rb-tag { font: 600 10px var(--font-display); letter-spacing: .1em; color: var(--gold); }
.rb-tag svg { width: 16px; height: 16px; }
.rb-charge-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 16px; font-size: 14.5px; color: var(--mute); }
@container sheet (max-width: 620px) { .rb-charge-foot { flex-direction: column; align-items: stretch; } }
.rb-btn-green { appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; white-space: nowrap; cursor: pointer;
  font: 700 12.5px var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: #fff4dc; background: linear-gradient(#5d8d43, #3c6a2a);
  box-shadow: inset 0 0 0 1px #9cc27a, 0 2px 0 #24461a, 0 10px 20px -10px rgba(0, 0, 0, .5); }
.rb-btn-green svg { width: 16px; height: 16px; }

/* ---------- the gear picker ---------- */
.rb-pick { display: grid; gap: 8px; }
.rb-pick-row { appearance: none; border: 0; width: 100%; text-align: left; color: inherit; display: grid; grid-template-columns: 56px minmax(0, 1fr) 24px; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  background: var(--wash); box-shadow: inset 0 0 0 1px var(--line); }
.rb-pick-row.on { box-shadow: inset 0 0 0 2px var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--paper)); }
.rb-pick-art { width: 56px; height: 56px; border-radius: 9px; background: #2a1d12 center / contain no-repeat; box-shadow: inset 0 0 0 1px rgba(217, 180, 90, .6); }
.rb-pick-row.none .rb-pick-art { background: repeating-linear-gradient(45deg, rgba(var(--line-rgb), .08) 0 6px, transparent 6px 12px); }
.rb-pick-tx { display: grid; gap: 2px; }
.rb-pick-tx b { font-family: var(--font-display); letter-spacing: .04em; }
.rb-pick-tx em { font: 700 12px var(--font-display); font-style: normal; color: var(--good); }
.rb-pick-tx span { font-size: 14px; color: var(--mute); }
.rb-pick-on { color: var(--good); } .rb-pick-on svg { width: 20px; height: 20px; }

/* ---------- the card view: just the card, over a dimmed room ---------- */
.cardov { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; outline: none;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(ellipse at 50% 45%, rgba(30, 20, 10, .6), rgba(8, 5, 2, .9)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s var(--ease); }
.cardov.show { opacity: 1; }
.cardov-x { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 240, 210, .35); background: rgba(20, 14, 8, .55); color: #fff3d8; display: grid; place-items: center; cursor: pointer; }
.cardov-x svg { width: 20px; height: 20px; }
.cardov-stage { perspective: 1100px; display: grid; place-items: center; }
.cardov-tilt { transform: rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transform-style: preserve-3d; }
.cardov-flip { position: relative; transform-style: preserve-3d; scale: .92; transition: transform .7s var(--ease), scale .45s var(--ease); }
.cardov.show .cardov-flip { scale: 1; }
.cardov-flip.turned { transform: rotateY(180deg); }
.cardov-face { position: relative; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cardov-back { position: absolute; inset: 0; transform: rotateY(180deg); }
.cardov-back .tcg2 { width: 100%; height: 100%; }
.cardov .tcg2.big { width: min(360px, 84vw, calc((100svh - 210px) * 63 / 88)); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 230, 180, .15); }
.cardov-shine { position: absolute; inset: 0; border-radius: 18px; pointer-events: none; mix-blend-mode: soft-light; opacity: calc(.3 + var(--shine, 0) * .7);
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 45%),
    linear-gradient(115deg, transparent 25%, rgba(255, 240, 200, .4) var(--mx, 50%), transparent calc(var(--mx, 50%) + 22%)); }
.cardov-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cardov-acts:empty { display: none; }
.cardov-btn { appearance: none; border: 1px solid rgba(255, 230, 180, .4); display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  background: rgba(20, 14, 8, .6); color: #f6e8c8; font: 600 12.5px var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.cardov-btn.primary { border: 0; color: #2a1a08; background: linear-gradient(#f6d98a, #c9962f); box-shadow: 0 2px 0 #7a5214; }
.cardov-btn svg { width: 16px; height: 16px; }
.cardov-note { margin: 0; max-width: 380px; text-align: center; font-size: 14px; color: rgba(246, 232, 200, .75); }
/* cards in the binder lean toward the pointer too */
.cardbtn .tcg2 { transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform .08s linear; }

/* ---------- the Old Wound (Camp) ---------- */
.yn.three { grid-template-columns: repeat(3, 1fr); }
.yn.three button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.wd-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .wd-figs { grid-template-columns: 1fr; gap: 8px; } }
.wd-fig { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--line); }
.wd-fig .q { font: 600 10.5px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.wd-fig b { font-size: 28px; line-height: 1.1; margin-top: 4px; }
.wd-fig b small { font-size: 14px; color: var(--mute); font-family: var(--font-body); letter-spacing: 0; }
.wd-fig .then { font-size: 14px; color: var(--mute); }
.wd-fig .then b { font-size: inherit; font-family: inherit; color: var(--good); font-weight: normal; margin: 0; }
.wd-knees { margin: 10px 0 0; font-size: 14px; color: var(--mute); }
.wound3 .chart { margin-top: 12px; }
.wd-chart { display: block; overflow: visible; }
.wd-grid { stroke: rgba(var(--line-rgb), .14); }
.wd-sep { stroke: rgba(var(--line-rgb), .14); stroke-dasharray: 3 4; }
.wd-ax { font: 600 10.5px var(--font-display); fill: var(--mute); }
.wd-m { letter-spacing: .08em; }
.wd-clean { fill: #4f8a3a; }
.wd-pre { fill: #7aa262; opacity: .85; }
.wd-post { fill: #e7b3ab; }
.wd-line { fill: none; stroke: rgba(var(--line-rgb), .55); stroke-width: 1.6; stroke-dasharray: 5 5; }
.wd-dot { stroke: #fff6e6; stroke-width: 2; } .wd-dot.k-left { fill: #2a78d6; } .wd-dot.k-right { fill: #9b2c6f; } .wd-dot.k-both { fill: url(#wd-both); }
.wd-dot-t { font: 700 10px var(--font-display); fill: #fff; pointer-events: none; }
.wd-run:hover rect:first-child { fill: rgba(var(--line-rgb), .06); }
.wd-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13.5px; color: var(--mute); }
.wd-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.wd-legend .lg-clean { background: #4f8a3a; } .wd-legend .lg-on { background: #e7b3ab; }
.wd-legend .lg-k { border-radius: 50%; } .wd-legend .lg-left { background: #2a78d6; } .wd-legend .lg-right { background: #9b2c6f; } .wd-legend .lg-both { background: linear-gradient(90deg, #2a78d6 50%, #9b2c6f 50%); }
.wd-legend .lg-line { height: 0; border-top: 2px dashed rgba(var(--line-rgb), .55); border-radius: 0; vertical-align: 3px; }
.wd-months { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
.wd-months th { text-align: left; font: 600 10px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); padding: 6px 6px; border-bottom: 1px solid var(--line); }
.wd-months td { padding: 8px 6px; border-bottom: 1px dashed var(--line); }
.wd-months td.num { font-family: var(--font-display); }
.wd-months .mute { font-family: var(--font-body); font-size: 13px; }
@media (max-width: 520px) { .wd-months { font-size: 13.5px; } .wd-months th { font-size: 9px; letter-spacing: .04em; } }

/* ---------- full-bleed pages (the Archives' bookcase, the Council's terrace): the painting is the header ---------- */
body.bleed .view { max-width: none; padding: 0 0 24px; }
body.bleed .topbar { position: absolute; z-index: 4; top: 0; left: 0; right: 0; max-width: none; margin: 0; padding: 16px 16px 48px; color: #fbf3e2; pointer-events: none;
  background: linear-gradient(180deg, rgba(12, 8, 4, .74) 0%, rgba(12, 8, 4, .4) 58%, transparent 100%); }
body.bleed .topbar > * { pointer-events: auto; }
@media (min-width: 1024px) { body.bleed .topbar { padding: 26px 30px 64px; } }
body.bleed .topbar h1 { text-shadow: 0 2px 14px rgba(0, 0, 0, .75), 0 1px 2px rgba(0, 0, 0, .6); }
body.bleed .topbar .sub { color: rgba(255, 246, 228, .92); text-shadow: 0 1px 8px rgba(0, 0, 0, .85); }
body.bleed .topbar .iconbtn { background: rgba(20, 14, 10, .45); color: #fff; border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bleed-hero { position: relative; }
.bleed-in { max-width: 1180px; margin: 0 auto; padding: 16px 16px 0; display: grid; gap: 16px; }
@media (min-width: 1024px) { .bleed-in { padding: 20px 26px 0; } }
/* the Journal's tabs live in the header */
.topbar .jtabs { margin: 12px 0 0; }
body.bleed .topbar .jtab, body.has-band .topbar .jtab { background: rgba(20, 14, 10, .5); color: #fbf3e2; box-shadow: inset 0 0 0 1px rgba(255, 240, 210, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body.bleed .topbar .jtab[aria-selected="true"], body.has-band .topbar .jtab[aria-selected="true"] { background: #fbf3e2; color: #2a1d12; box-shadow: none; }
/* the Archives' bookcase */
body.bleed .bleed-hero .bookcase.painted { border-radius: 0; box-shadow: none; }
@media (max-width: 720px) { body.bleed .archives2 .bleed-hero { padding-top: 96px; background: var(--oak); background-size: 500px; } }
/* the Council's terrace */
body.bleed .bleed-hero .pano2.painted { height: clamp(380px, 66vh, 720px); border-radius: 0; }
@media (max-width: 720px) { body.bleed .bleed-hero .pano2.painted { height: 62svh; } }
.council2 { gap: 0; }
.council2 > .bleed-in > .pano-cap { margin: 0; }
/* pages read */
.pg-chart { display: block; overflow: visible; margin-top: 12px; }
.pg-ok { fill: #4f8a3a; } .pg-some { fill: #c9a24a; }
.pg-goal { stroke: #b0342a; stroke-width: 1.4; stroke-dasharray: 5 5; opacity: .7; }
.readfigs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 420px) { .readfigs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gear-moved { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.gear-moved svg { width: 18px; height: 18px; color: var(--gold); }
@media (max-width: 520px) { .topbar .jtab { padding: 7px 12px; font-size: 11.5px; white-space: nowrap; } }
.camp2 > .wound3 { margin: 0; }

/* ---------- Settings: data connections ---------- */
.conn + .conn { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.conn h5 { margin: 0 0 6px; font: 600 12px var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.conn-t { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13.5px; }
.conn-t th { text-align: left; font: 600 9.5px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 4px 4px; border-bottom: 1px solid var(--line); }
.conn-t td { padding: 5px 4px; border-bottom: 1px dashed var(--line); font-family: var(--font-display); font-size: 12.5px; }
.conn code { font-size: 12.5px; }

/* shoes (Camp) */
.shoe-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.shoe-row .mbar { grid-column: 1 / -1; }
.shoe-row b { font-weight: normal; }
.shoe-row .tagm { font: 600 9.5px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--good); margin-left: 6px; }
.shoe-row .tagr { font: 600 9.5px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-left: 6px; }
.shoe-row button.lnk { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.shoe-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* binder cards: name, picture and the bottom line only (the full text is on the big card) */
.tcg2.slim .tc-art { flex: 1 1 auto; }
.tcg2.slim .tc-foot { margin-top: auto; }

/* the timer: counted sets */
.reps-in { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 14px 0 0; }
.reps-in b { font-size: 68px; line-height: 1; min-width: 2ch; text-align: center; }
.reps-in .rp { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); font-size: 30px; line-height: 1; cursor: pointer; }
.rite-steps.sum li { opacity: 1; }
/* quick log */
.ql { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ql-h { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.ql-h .mute { font-size: 13.5px; }
.ql-sets { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.ql-set { display: grid; grid-template-columns: auto 64px auto; gap: 6px; align-items: center; font-size: 13.5px; color: var(--mute); }
.ql-set .input { padding: 6px 8px; }
.pr .pn small { font-size: 12px; margin-left: 4px; }

/* the journey's phase on the Road (not started / the Party) */
.rb-phase { margin: 0 0 16px; padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, var(--paper)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.rb-phase h3 { margin: 4px 0 6px; font-family: var(--font-display); letter-spacing: .04em; }
.rb-phase p { margin: 0 0 10px; color: var(--mute); }
.rb-phase p:last-child { margin-bottom: 0; }

/* the password page (online) */
body.login-page { background: var(--bg); }
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(360px, 100%); display: grid; gap: 10px; justify-items: center; padding: 28px 24px; border-radius: 18px; background: var(--paper); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--line); text-align: center; }
.login-card h1 { margin: 6px 0 8px; font-family: var(--font-display); letter-spacing: .06em; font-size: 26px; }
.login-card label { justify-self: start; font-size: 14px; color: var(--mute); }
.login-card input { width: 100%; padding: 12px 14px; font-size: 17px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-msg { min-height: 1.3em; margin: 4px 0 0; color: var(--danger); font-size: 14.5px; }
