/* VentureRealm — full-viewport shell + fantasy-legible HUD. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0a0d14; color: #e8e2d4; font-family: Inter, system-ui, sans-serif; overflow: hidden; }
#realm-app, #realm-canvas { position: fixed; inset: 0; width: 100%; height: 100%; }

/* connect screen */
.rc-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, #1d2b45 0%, #0a0d14 62%); }
.rc-card { max-width: 460px; width: 100%; background: rgba(13, 18, 30, 0.92); border: 1px solid #33415c;
  border-radius: 14px; padding: 30px 30px 24px; box-shadow: 0 30px 90px rgba(0,0,0,0.65); }
.rc-kicker { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.3em; color: #d9955c; font-family: ui-monospace, monospace; }
.rc-title { margin: 0 0 10px; font: 900 34px/1.02 "Barlow Condensed", "Arial Narrow", sans-serif; text-transform: uppercase; color: #f4ead7; }
.rc-dot { color: #d9955c; }
.rc-sub { margin: 0 0 18px; font-size: 13.5px; line-height: 1.6; color: #9aa7bd; }
.rc-l { display: block; margin: 0 0 12px; font-size: 11px; letter-spacing: 0.14em; color: #8a97a8; font-family: ui-monospace, monospace; }
.rc-l input { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; font-size: 14px; color: #e8e2d4;
  background: #0c1017; border: 1px solid #33415c; border-radius: 9px; outline: none; }
.rc-l input:focus { border-color: #d9955c; }
.rc-btn { width: 100%; margin-top: 6px; padding: 13px; font: 700 15px "Barlow Condensed", sans-serif; letter-spacing: 0.12em;
  text-transform: uppercase; color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c); border: 0; border-radius: 9px; cursor: pointer; }
.rc-btn:disabled { opacity: 0.55; cursor: wait; }
.rc-msg { min-height: 18px; margin: 12px 0 0; font-size: 12.5px; color: #d9955c; }
.rc-fine { margin: 14px 0 0; font-size: 11px; color: #5c6979; }

/* HUD */
.rh-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.9), rgba(8, 10, 16, 0)); pointer-events: none; z-index: 5; flex-wrap: wrap; }
.rh-ws { font: 900 18px "Barlow Condensed", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: #f4ead7;
  border-right: 1px solid rgba(217, 149, 92, 0.4); padding-right: 14px; }
.rh-tile { display: inline-flex; flex-direction: column; line-height: 1.15; }
.rh-tile b { font: 700 15px ui-monospace, monospace; color: #ffd9a0; font-variant-numeric: tabular-nums; }
.rh-tile i { font: 400 8.5px ui-monospace, monospace; letter-spacing: 0.18em; color: #7d8aa0; font-style: normal; }
.rh-banner { position: fixed; left: 50%; top: 58px; transform: translateX(-50%); max-width: 640px; width: calc(100% - 40px);
  padding: 11px 18px; text-align: center; font-size: 13px; color: #e8e2d4; background: rgba(16, 20, 32, 0.92);
  border: 1px solid #33415c; border-radius: 999px; z-index: 6; }
.rh-banner i { color: #8a97a8; font-style: normal; font-size: 11px; display: block; margin-top: 2px; }
.rh-banner b { color: #ffd9a0; }
.rh-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d9955c; margin-right: 6px;
  animation: rhPulse 1.6s ease-in-out infinite; }
@keyframes rhPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.rh-panel { position: fixed; right: 16px; top: 70px; width: 300px; padding: 18px 18px 16px; z-index: 6;
  background: rgba(13, 18, 30, 0.94); border: 1px solid #33415c; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.55); }
.rh-panel h3 { margin: 2px 0 6px; font: 900 22px "Barlow Condensed", sans-serif; text-transform: uppercase; color: #f4ead7; }
.rh-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: #7d8aa0; cursor: pointer; font-size: 13px; }
.rh-band { margin: 0; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.22em; color: #8a97a8; }
.rh-band-elite { color: #ffb224; } .rh-band-strong { color: #9f7bff; } .rh-band-promising { color: #1fbaed; }
.rh-band-marginal { color: #64d98c; } .rh-band-weak { color: #8a97a8; }
.rh-loc { margin: 0 0 6px; font-size: 12.5px; color: #9aa7bd; }
.rh-loc b { color: #ffd9a0; }
.rh-dead { color: #e0574f; font-size: 12.5px; margin: 6px 0; }
.rh-note { margin: 6px 0 0; font-size: 12px; line-height: 1.55; color: #7d8aa0; }
.rh-brand { position: fixed; left: 16px; bottom: 12px; font: 400 10px ui-monospace, monospace; letter-spacing: 0.16em;
  color: rgba(217, 149, 92, 0.7); z-index: 5; pointer-events: none; }
.rh-brand span { color: #55607a; }
.rh-leave { position: fixed; top: 12px; right: 14px; z-index: 7; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid #33415c; background: rgba(13, 18, 30, 0.8); color: #9aa7bd; cursor: pointer; }
.rh-leave:hover { color: #f4ead7; border-color: #d9955c; }
@media (max-width: 640px) { .rh-panel { left: 16px; width: auto; } .rh-ws { display: none; } }

/* the pulse: ticker + quest log + forge counters */
.rt-feed { position: fixed; left: 16px; right: 16px; bottom: 34px; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column-reverse; gap: 4px; max-height: 30vh; overflow: hidden; }
.rt-line { align-self: flex-start; max-width: 560px; padding: 6px 12px; font-size: 12.5px; color: #e8e2d4;
  background: rgba(13, 18, 30, 0.85); border: 1px solid rgba(51, 65, 92, 0.8); border-radius: 999px;
  transition: opacity 1.2s ease; }
.rt-line.rt-hist, .rt-line.rt-old { opacity: 0.38; }
.rt-rune { display: inline-block; margin-right: 7px; font-style: normal; color: #d9955c; opacity: 0.9; }

/* the realm's clock */
.rk-clock { position: fixed; right: 16px; top: 48px; z-index: 5; padding: 4px 11px;
  font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.2em; color: #cbb389;
  background: rgba(13, 18, 30, 0.7); border: 1px solid rgba(51, 65, 92, 0.6); border-radius: 999px;
  pointer-events: none; }
body.photo .rk-clock { display: none !important; }
@media (max-width: 760px) { .rk-clock { display: none; } }
.rq-log { position: fixed; right: 16px; bottom: 34px; width: 264px; z-index: 5; padding: 12px 14px;
  background: rgba(13, 18, 30, 0.9); border: 1px solid #33415c; border-radius: 12px; }
.rq-h { margin: 0 0 8px; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.24em; color: #d9955c; }
.rq-q { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; color: #cfd6e4; }
.rq-spin { width: 9px; height: 9px; border: 2px solid rgba(217, 149, 92, 0.35); border-top-color: #d9955c;
  border-radius: 50%; animation: rqSpin 1s linear infinite; flex: none; }
@keyframes rqSpin { to { transform: rotate(360deg); } }
.rq-ok { color: #64d98c; } .rq-fail { color: #e0574f; }
.rh-run { position: fixed; left: 16px; top: 64px; z-index: 6; padding: 8px 14px; font: 400 12px ui-monospace, monospace;
  color: #ffd9a0; background: rgba(24, 14, 8, 0.9); border: 1px solid rgba(255, 106, 26, 0.5); border-radius: 999px; }
.rh-run b { letter-spacing: 0.14em; margin-right: 8px; color: #ff9a52; }
@media (max-width: 640px) { .rq-log { display: none; } }
.rq-log { max-height: 42vh; overflow: hidden; }
#rq-list { max-height: calc(42vh - 30px); overflow-y: auto; scrollbar-width: thin; }

/* the Idea Inspector */
.ri-panel { position: fixed; right: 16px; top: 64px; width: 316px; max-height: calc(100vh - 120px); overflow-y: auto;
  padding: 18px 18px 16px; z-index: 7; background: rgba(13, 18, 30, 0.95); border: 1px solid #33415c;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); scrollbar-width: thin; }
.ri-panel h3 { margin: 2px 0 2px; font: 900 22px "Barlow Condensed", sans-serif; text-transform: uppercase; color: #f4ead7; }
.ri-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: #7d8aa0; cursor: pointer; font-size: 13px; }
.ri-band { margin: 0; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.22em; }
.ri-dead { color: #e0574f; }
.ri-loc { margin: 0 0 8px; font-size: 12px; color: #9aa7bd; }
.ri-loc b { color: #ffd9a0; }
.ri-radar-wrap { display: grid; place-items: center; min-height: 40px; }
.ri-wait { font-size: 11.5px; color: #7d8aa0; text-align: center; padding: 8px 4px; }
.ri-final { margin: 6px 0; text-align: center; font: 400 13px ui-monospace, monospace; color: #8a97a8; }
.ri-final b { font-size: 26px; color: #ffd9a0; }
.ri-win { margin: 6px 0 0; font-size: 12px; color: #64d98c; line-height: 1.5; }
.ri-fail { margin: 4px 0 0; font-size: 12px; color: #e0574f; line-height: 1.5; }
.ri-flags { margin: 6px 0 0; font-size: 11.5px; color: #ffb224; }
.ri-note { margin: 10px 0 0; font-size: 11px; color: #5c6979; }
.ri-journey { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; border-top: 1px solid rgba(51,65,92,0.6); padding-top: 10px; }
.ri-step { font: 400 10px ui-monospace, monospace; color: #7d8aa0; border: 1px solid rgba(51,65,92,0.8);
  border-radius: 999px; padding: 3px 8px; }
.ri-step.ok { color: #64d98c; border-color: rgba(100, 217, 140, 0.4); }
.ri-step.fail { color: #e0574f; border-color: rgba(224, 87, 79, 0.4); }
.ri-step.run { color: #ffd9a0; border-color: rgba(255, 217, 160, 0.4); }

/* the Founder: character creator */
.rk-panel { position: fixed; left: 16px; top: 60px; bottom: 16px; width: 306px; z-index: 9; overflow-y: auto;
  padding: 20px 20px 18px; background: rgba(13, 18, 30, 0.95); border: 1px solid #33415c; border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6); scrollbar-width: thin; }
.rk-kicker { margin: 0 0 6px; font: 700 10px ui-monospace, monospace; letter-spacing: 0.28em; color: #d9955c; }
.rk-title { margin: 0 0 14px; font: 900 28px/1 "Barlow Condensed", "Arial Narrow", sans-serif; text-transform: uppercase; color: #f4ead7; }
.rk-l { display: block; margin: 0 0 12px; font-size: 11px; letter-spacing: 0.12em; color: #8a97a8; font-family: ui-monospace, monospace; }
.rk-l i { float: right; color: #ffd9a0; font-style: normal; }
.rk-l input[type=text] { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font-size: 14px; color: #e8e2d4;
  background: #0c1017; border: 1px solid #33415c; border-radius: 8px; outline: none; }
.rk-l input[type=text]:focus { border-color: #d9955c; }
.rk-l input[type=range] { display: block; width: 100%; margin-top: 7px; accent-color: #d9955c; }
.rk-h { margin: 14px 0 6px; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.24em; color: #d9955c; }
.rk-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rk-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.12); cursor: pointer; padding: 0; }
.rk-sw.on { border-color: #ffd9a0; box-shadow: 0 0 0 2px rgba(255, 217, 160, 0.35); }
.rk-chip { padding: 6px 11px; font: 600 11.5px Inter, sans-serif; color: #cfd6e4; background: #0c1017;
  border: 1px solid #33415c; border-radius: 999px; cursor: pointer; text-transform: capitalize; }
.rk-chip.on { color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c); border-color: #d9955c; }
.rk-colors { gap: 14px; margin-top: 8px; }
.rk-colors label { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 0.1em;
  color: #8a97a8; font-family: ui-monospace, monospace; }
.rk-colors input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid #33415c; border-radius: 6px;
  background: #0c1017; cursor: pointer; }
.rk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rk-cta { flex: 1; padding: 11px 14px; font: 700 13.5px "Barlow Condensed", sans-serif; letter-spacing: 0.1em;
  text-transform: uppercase; color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c); border: 0;
  border-radius: 9px; cursor: pointer; }
.rk-ghost { padding: 10px 13px; font-size: 12px; color: #9aa7bd; background: none; border: 1px solid #33415c;
  border-radius: 9px; cursor: pointer; }
.rk-ghost:hover { color: #f4ead7; border-color: #d9955c; }
@media (max-width: 640px) { .rk-panel { left: 10px; right: 10px; width: auto; top: 52px; } }

/* walk-mode prompt + controls hint */
.rk-prompt { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 6; padding: 9px 18px;
  font-size: 13.5px; color: #f4ead7; background: rgba(13, 18, 30, 0.92); border: 1px solid rgba(217, 149, 92, 0.55);
  border-radius: 999px; pointer-events: none; }
.rk-prompt b { display: inline-block; min-width: 20px; margin-right: 7px; padding: 1px 6px; text-align: center;
  font: 700 12px ui-monospace, monospace; color: #1c1206; background: #ffd9a0; border-radius: 5px; }
.rk-hint { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 5; padding: 6px 14px;
  font: 400 10.5px ui-monospace, monospace; letter-spacing: 0.08em; color: #7d8aa0; background: rgba(10, 13, 20, 0.75);
  border: 1px solid rgba(51, 65, 92, 0.6); border-radius: 999px; pointer-events: none; white-space: nowrap; }
.rk-hint b { color: #ffd9a0; }
@media (max-width: 760px) { .rk-hint { display: none; } }

/* the opening title card */
.rl-title { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 12; text-align: center;
  opacity: 0; transition: opacity 0.9s ease; pointer-events: none; }
.rl-title-on { opacity: 1; }
.rl-title i { display: block; font: 700 12px ui-monospace, monospace; letter-spacing: 0.5em; color: #d9955c; font-style: normal; }
.rl-title b { display: block; margin-top: 10px; font: 900 clamp(34px, 6vw, 64px)/1 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.06em; text-transform: uppercase; color: #f4ead7; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8); }
.rl-title span { display: block; margin-top: 14px; font: 400 10px ui-monospace, monospace; letter-spacing: 0.24em; color: #7d8aa0; }

/* boot veil + cinematic vignette */
.rl-boot { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 26px; background: radial-gradient(120% 90% at 50% 0%, #141d30 0%, #07090f 64%);
  transition: opacity 0.85s ease; }
.rl-boot.rl-done { opacity: 0; pointer-events: none; }
.rl-boot p { margin: 0; font: 400 13px ui-monospace, monospace; letter-spacing: 0.3em; color: #d9955c; }
.rl-sigil { position: relative; width: 84px; height: 84px; }
.rl-sigil span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(217, 149, 92, 0.65);
  animation: rlSigil 2.2s ease-in-out infinite; }
.rl-sigil span:nth-child(2) { animation-delay: 1.1s; }
@keyframes rlSigil { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(1.45); opacity: 0; } }
.rl-vig { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 45%, transparent 58%, rgba(4, 6, 10, 0.36) 100%); }

/* the compass — a bearing ribbon under the totals bar */
.rw-compass { position: fixed; top: 44px; left: 50%; transform: translateX(-50%); width: min(560px, 72vw); height: 30px;
  z-index: 5; border-bottom: 1px solid rgba(217, 149, 92, 0.25); pointer-events: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.rw-tick { position: absolute; left: 50%; top: 2px; width: 1px; height: 10px; background: #ffd9a0; opacity: 0.8; }
.rw-mark { position: absolute; top: 4px; transform: translateX(-50%); background: none; border: 0; padding: 2px 4px;
  font-size: 14px; line-height: 1; color: #cbb389; cursor: pointer; text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  transition: color 0.2s ease; }
.rw-mark:hover { color: #ffd9a0; transform: translateX(-50%) scale(1.25); }
.rw-near { color: #ffd9a0; text-shadow: 0 0 10px rgba(255, 217, 160, 0.7); }
@media (max-width: 760px) { .rw-compass { display: none; } }

/* photo mode: P strips every panel — only the realm remains */
body.photo .rh-bar, body.photo .rh-banner, body.photo .rh-brand, body.photo .rh-run,
body.photo .rt-feed, body.photo .rq-log, body.photo .rk-hint, body.photo .rk-prompt,
body.photo .rw-compass, body.photo .rs-gear, body.photo .rs-panel, body.photo .ra-sage,
body.photo .rh-panel, body.photo .ri-panel, body.photo .ra-hall, body.photo .ra-hallveil { display: none !important; }

/* the Powers of Command — rite confirms + toasts */
.rr-veil { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(6, 8, 13, 0.72); }
.rr-card { max-width: 400px; width: calc(100% - 48px); padding: 24px 26px 20px; background: rgba(13, 18, 30, 0.98);
  border: 1px solid #33415c; border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,0.7); }
.rr-kicker { margin: 0 0 6px; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.28em; color: #d9955c; }
.rr-title { margin: 0 0 8px; font: 900 24px/1.05 "Barlow Condensed", sans-serif; text-transform: uppercase; color: #f4ead7; }
.rr-body { margin: 0 0 10px; font-size: 13px; line-height: 1.55; color: #9aa7bd; }
.rr-cost { margin: 0 0 4px; font-size: 12.5px; color: #ffb224; }
.rr-actions { display: flex; gap: 8px; margin-top: 14px; }
.rr-no { flex: 1; padding: 10px; font-size: 12.5px; color: #9aa7bd; background: none; border: 1px solid #33415c; border-radius: 9px; cursor: pointer; }
.rr-yes { flex: 2; padding: 10px; font: 700 13px "Barlow Condensed", sans-serif; letter-spacing: 0.1em; text-transform: uppercase;
  color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c); border: 0; border-radius: 9px; cursor: pointer; }
.rr-toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%) translateY(-8px); z-index: 21; padding: 9px 18px;
  font-size: 13px; color: #e8e2d4; background: rgba(13, 18, 30, 0.95); border: 1px solid #33415c; border-radius: 999px;
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none; max-width: 70vw; }
.rr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.rr-toast[data-kind=ok] { border-color: rgba(100, 217, 140, 0.5); }
.rr-toast[data-kind=err] { border-color: rgba(224, 87, 79, 0.6); color: #f0c4c1; }

/* inside a hall */
.ra-hallveil { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.ra-hall { position: fixed; left: 16px; top: 60px; bottom: 16px; width: 336px; z-index: 8; overflow-y: auto;
  padding: 20px 20px 16px; background: rgba(11, 15, 25, 0.94); border: 1px solid #33415c; border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.65); scrollbar-width: thin; }
.ra-hall h3 { margin: 2px 0 4px; font: 900 26px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; color: #f4ead7; }
.ra-blurb { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: #9aa7bd; }
.ra-lore { margin: -4px 0 8px; font-size: 11px; font-style: italic; line-height: 1.45; color: #6d7890; }
.ra-sync { margin: 0 0 10px; font-size: 11px; line-height: 1.45; color: #7fc4a0; }
.ra-sync-off { color: #d9955c; }
.ra-empty { margin: 0 0 10px; font-size: 12px; color: #7d8aa0; font-style: italic; }
.rh-lore { margin: 6px 0 0; font-size: 10.5px; font-style: italic; color: #6d7890; }
.ra-cmprow select { flex: 1; min-width: 0; background: #10182a; color: #dce6f5; border: 1px solid #2a3a55; border-radius: 8px; padding: 7px; font-size: 12px; }
.ra-cmp { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.ra-cmp th { font-weight: 600; color: #8ea0bd; padding: 4px 6px; text-align: center; }
.ra-cmp td { padding: 4px 6px; text-align: center; color: #dce6f5; border-top: 1px solid #ffffff12; }
.ra-cmp td.ra-win { color: #7fe0a8; font-weight: 700; }
.ra-towerlink { text-decoration: none; display: block; }
/* ---------- the Stage Dashboard: the BizMax page, mirrored ----------
   The --bd-* custom properties are set from GET /ui/engine (BizMax's own
   design tokens) when the Bridge serves it; the fallbacks are the game's
   matching skin. */
.bd-dash { position: fixed; inset: 3vh 4vw; z-index: 70; background: var(--bd-page, #0b101c);
  border: 1px solid var(--bd-border, #24304a);
  border-radius: 16px; box-shadow: 0 30px 90px #000c; padding: 20px 24px; overflow-y: auto;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; }
.bd-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.bd-kick { font-size: 9.5px; letter-spacing: 0.16em; color: #5f7396; margin: 0 0 4px; }
.bd-top h2 { margin: 0; font-size: 22px; color: var(--bd-text, #e8eefb); font-weight: 800; }
.bd-x { background: #16203a; color: #9fb0cd; border: 1px solid #2a3a55; border-radius: 8px;
  padding: 7px 12px; font-size: 12px; cursor: pointer; }
.bd-x:hover { color: #e8eefb; }
.bd-note { font-size: 12px; color: var(--bd-muted, #7d8aa0); margin: 10px 0; line-height: 1.55; }
.bd-card { background: var(--bd-card, #101827); border: 1px solid var(--bd-border, #24304a); border-radius: var(--bd-rcard, 12px); padding: 12px 14px; margin-bottom: 12px; }
.bd-cardhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bd-cardhead b { color: var(--bd-text, #dce6f5); font-size: 13px; }
.bd-chip { font-style: normal; font-size: 10px; padding: 2px 9px; border-radius: 999px; letter-spacing: 0.05em;
  background: #1c2840; color: #9fb0cd; border: 1px solid #2a3a55; }
.bd-running, .bd-live { color: #7fe0a8; border-color: #2c5a40; background: #12281c; }
.bd-error, .bd-cancelled { color: #ff8a8a; border-color: #5a2c2c; background: #281212; }
.bd-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-stats span { background: var(--bd-card, #101827); border: 1px solid var(--bd-border, #24304a); border-radius: 10px; padding: 8px 14px;
  display: flex; flex-direction: column; }
.bd-stats b { color: var(--bd-text, #e8eefb); font-size: 16px; font-variant-numeric: tabular-nums; }
.bd-stats i { font-style: normal; font-size: 8.5px; letter-spacing: 0.1em; color: #5f7396; }
.bd-totals { margin-bottom: 14px; }
.bd-filter { display: flex; gap: 8px; align-items: center; margin: 6px 0 10px; }
.bd-filter input, .bd-filter select { background: var(--bd-card, #101827); color: var(--bd-text, #dce6f5); border: 1px solid var(--bd-border, #2a3a55);
  border-radius: 8px; padding: 8px 11px; font-size: 12px; }
.bd-filter input { flex: 1; min-width: 0; }
.bd-count { font-size: 11px; color: #7d8aa0; white-space: nowrap; }
.bd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bd-table th { text-align: left; font-size: 10px; letter-spacing: 0.1em; color: var(--bd-faint, #5f7396); padding: 8px 10px;
  border-bottom: 1px solid var(--bd-border, #24304a); position: sticky; top: 0; background: var(--bd-page, #0b101c); }
.bd-table td { padding: 9px 10px; border-bottom: 1px solid #18223a; color: #b8c6de; vertical-align: top; }
.bd-table td b { color: var(--bd-text, #dce6f5); }
.bd-table td span { display: block; font-size: 11px; color: #6d7f9c; margin-top: 2px; }
.bd-table a { color: var(--bd-accent, #6db3f2); text-decoration: none; }
.bd-click { cursor: pointer; }
.bd-click:hover td { background: #101a30; }
.bd-band-elite { color: #ffd24a; border-color: #5a4a1c; background: #282012; }
.bd-band-strong { color: #7fe0a8; border-color: #2c5a40; background: #12281c; }
.bd-band-promising { color: #6db3f2; border-color: #2c445a; background: #121e28; }
.bd-band-marginal { color: #d9b25c; border-color: #4a3a1c; background: #221c10; }
.bd-band-weak { color: #ff8a8a; border-color: #5a2c2c; background: #281212; }
.bd-bar { display: inline-block; width: 54px; height: 5px; background: #1c2840; border-radius: 3px;
  vertical-align: middle; overflow: hidden; }
.bd-fill { display: block; height: 100%; background: var(--bd-accent, #6db3f2); border-radius: 3px; }
.bd-w0 { width: 0; } .bd-w1 { width: 14%; } .bd-w2 { width: 29%; } .bd-w3 { width: 43%; }
.bd-w4 { width: 57%; } .bd-w5 { width: 71%; } .bd-w6 { width: 86%; } .bd-w7 { width: 100%; }
.bd-grid2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; }
@media (max-width: 860px) { .bd-grid2 { grid-template-columns: 1fr; } }
.bd-sec { font-size: 9.5px; letter-spacing: 0.16em; color: var(--bd-faint, #5f7396); margin: 0 0 10px; font-weight: 700; }
.bd-secgap { margin-top: 18px; }
.bd-runid { font-family: ui-monospace, monospace; font-size: 13px; color: #dce6f5; white-space: nowrap; }
.bd-btn { background: #16203a; color: #9fc0f0; border: 1px solid #2a3a55; border-radius: 8px;
  padding: 6px 12px; font-size: 11.5px; font-weight: 600; cursor: pointer; margin-left: 6px; }
.bd-btn:hover { background: #1a2746; color: #cfe2ff; }
.bd-btn-red { color: #ff9a9a; border-color: #5a2c2c; }
.bd-btn-red:hover { background: #2a1616; }
.bd-btn-gold { color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c); border-color: #d9955c; }
.bd-btn-gold:hover { background: linear-gradient(180deg, #f6c67e, #e2a06a); color: #1c1206; }
.bd-check { margin: 10px 0 8px; }
.bd-checkrow { display: grid; grid-template-columns: 22px 92px 1fr; align-items: baseline; gap: 8px;
  padding: 8px 6px; border-top: 1px solid #18223a; font-size: 13px; }
.bd-checkrow:first-child { border-top: 0; }
.bd-checkrow i { font-style: normal; text-align: center; }
.bd-checkrow b { color: #dce6f5; font-weight: 700; }
.bd-checkrow span { color: #6d7f9c; font-size: 12px; }
.bd-ck-done i { color: #7fe0a8; }
.bd-ck-now i { color: #6db3f2; animation: bd-pulse 1.6s infinite; }
.bd-ck-todo i { color: #3a4a68; }
.bd-ck-todo b { color: #7d8aa0; }
@keyframes bd-pulse { 50% { opacity: 0.35; } }
.bd-runmeta { margin: -2px 0 8px; font-size: 10.5px; color: #5f7396; font-family: ui-monospace, monospace; }
.bd-directive { border: 1px solid #24406a; background: #0e1830; border-radius: 10px; padding: 9px 12px; margin: 4px 0 8px; }
.bd-directive b { display: block; font-size: 9px; letter-spacing: 0.1em; color: #5b8ada; margin-bottom: 3px; }
.bd-directive p { margin: 0; font-size: 11.5px; line-height: 1.5; color: #9fb6dd; }
.bd-runfoot { margin: 8px 2px 0; font-size: 11.5px; color: #6d7f9c; }
.bd-runfoot b { color: #b8c6de; }
.bd-frow { display: grid; grid-template-columns: 120px 1fr 74px; gap: 10px; align-items: center; padding: 7px 0; }
.bd-flabel { font-size: 12px; color: #8ea0bd; }
.bd-ftrack { height: 14px; background: #101827; border: 1px solid #24304a; border-radius: 7px; overflow: hidden; }
.bd-ffill { display: block; height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, #2b6cb0, #6db3f2); }
.bd-fval { font-size: 13px; color: #e8eefb; text-align: right; font-variant-numeric: tabular-nums; }
.bd-empty { border: 1px dashed #2a3a55; border-radius: 14px; padding: 26px 30px; max-width: 640px;
  margin: 8px auto; text-align: center; color: #8ea0bd; font-size: 13px; line-height: 1.6; }
.bd-emptyhead { font-size: 16px; font-weight: 800; color: #dce6f5; margin-bottom: 8px; }
.bd-code { font-family: ui-monospace, monospace; font-size: 11.5px; color: #9fc0f0; background: #101827;
  border: 1px solid #24304a; border-radius: 8px; padding: 9px 12px; margin: 12px 0; word-break: break-all; }

/* hall mode: the panel docks right so the 3D hall interior stays visible */
.bd-dash.bd-dock { inset: 3vh 2vw 3vh auto; width: min(920px, 62vw); }
@media (max-width: 979px) { .bd-dash.bd-dock { inset: 3vh 4vw; width: auto; } }

/* run action header (Mock/Quick/Real/Re-Score) — manifest-driven */
.bd-acthead { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 0 0 6px; }
.bd-scorer { font-size: 12px; color: var(--bd-muted, #7d8aa0); }
.bd-scorer b { color: var(--bd-text, #dce6f5); }
.bd-actbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-abtn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; cursor: pointer;
  background: var(--bd-card, #16203a); color: var(--bd-text, #cfe2ff); border: 1px solid var(--bd-border, #2a3a55);
  border-radius: 999px; padding: 7px 16px; }
.bd-abtn b { font-size: 12px; font-weight: 700; }
.bd-abtn span { font-size: 9px; color: var(--bd-faint, #5f7396); }
.bd-abtn:hover { border-color: var(--bd-accent, #6db3f2); }
.bd-tone-primary, .bd-tone-accent { background: var(--bd-accent, #2b6cb0); border-color: var(--bd-accent, #2b6cb0); }
.bd-tone-primary span, .bd-tone-accent span { color: #ffffffb0; }
.bd-tone-success { background: #157a4a; border-color: #157a4a; }
.bd-tone-success span { color: #ffffffb0; }
.bd-costline { margin: 0 0 10px; font-size: 10.5px; color: var(--bd-faint, #5f7396); }

/* View run history dropdown */
.bd-viewrun { display: flex; align-items: center; gap: 10px; background: var(--bd-card, #101827);
  border: 1px solid var(--bd-border, #24304a); border-radius: var(--bd-rcard, 12px); padding: 9px 14px; margin: 0 0 12px; }
.bd-viewrun label { font-size: 11px; color: var(--bd-muted, #7d8aa0); white-space: nowrap; }
.bd-viewrun select { flex: 1; background: var(--bd-page, #0b101c); color: var(--bd-text, #dce6f5);
  border: 1px solid var(--bd-border, #2a3a55); border-radius: 8px; padding: 7px 10px; font-size: 12px; }

/* band summary strip */
.bd-bandstrip { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0 0; }
.bd-bandpill { font-weight: 700; }

/* small chips + absent cells */
.bd-flagchip { font-style: normal; display: inline-block; font-size: 9px; padding: 1px 7px; margin: 1px 2px 1px 0;
  border-radius: 999px; background: #2a2136; color: #c9a9f0; border: 1px solid #4a3a6a; letter-spacing: 0.04em; }
.bd-absent { color: #3a4a68; }
.bd-archlbl { font-size: 11px; color: var(--bd-muted, #7d8aa0); display: flex; align-items: center; gap: 4px; white-space: nowrap; }

/* live module panels */
.bd-path { font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: 0; color: var(--bd-faint, #46587a);
  background: var(--bd-card, #101827); border: 1px solid var(--bd-border, #24304a); border-radius: 6px;
  padding: 2px 7px; margin-left: 8px; text-transform: none; }
.bd-miss { border: 1px dashed var(--bd-border, #2a3a55); border-radius: var(--bd-rcard, 12px); padding: 13px 16px;
  color: var(--bd-muted, #8ea0bd); font-size: 12px; line-height: 1.55; margin-bottom: 12px; }
.bd-miss b { color: var(--bd-text, #dce6f5); }
.bd-miss code { font-family: ui-monospace, monospace; color: #9fc0f0; }
.bd-sub { font-size: 9px; letter-spacing: 0.14em; color: var(--bd-faint, #5f7396); margin: 12px 0 6px; font-weight: 700; }
.bd-scroll { overflow-x: auto; }
.bd-stats { margin-bottom: 4px; }

.ra-dashbtn { display: block; width: 100%; margin: 0 0 10px; padding: 9px 12px; background: #16203a;
  color: #9fc0f0; border: 1px solid #2a3a55; border-radius: 10px; font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: left; }
.ra-dashbtn:hover { background: #1a2746; color: #cfe2ff; }

.ra-ledgerq { width: 100%; margin: 0 0 6px; padding: 7px 10px; background: #10182a; color: #dce6f5;
  border: 1px solid #2a3a55; border-radius: 8px; font-size: 12px; }
.ra-ledger { max-height: 210px; overflow-y: auto; border: 1px solid #ffffff12; border-radius: 10px;
  padding: 6px 8px; margin-bottom: 10px; background: #0c1322; }
.ra-ledgercount { margin: 2px 0 6px; font-size: 10px; letter-spacing: 0.08em; color: #7d8aa0; }
.ra-lrow { padding: 5px 2px; border-top: 1px solid #ffffff0d; font-size: 12px; line-height: 1.45; }
.ra-lrow:first-of-type { border-top: 0; }
.ra-lrow b { color: #dce6f5; }
.ra-lrow span { display: block; color: #8ea0bd; font-size: 11px; }
.ra-lband { font-style: normal; font-size: 9px; letter-spacing: 0.08em; color: #d9b25c; margin-left: 6px; }
.ra-lscore { font-style: normal; font-size: 10px; color: #7fe0a8; margin-left: 6px; font-weight: 700; }
.ra-h { margin: 14px 0 6px; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.24em; color: #d9955c; }
.ra-signs { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 10px 0 2px; }
.ra-signs span { display: inline-flex; flex-direction: column; line-height: 1.15; }
.ra-signs b { font: 700 16px ui-monospace, monospace; color: #ffd9a0; font-variant-numeric: tabular-nums; }
.ra-signs i { font: 400 8.5px ui-monospace, monospace; letter-spacing: 0.18em; color: #7d8aa0; font-style: normal; }
.ra-resList { display: flex; flex-direction: column; gap: 4px; }
.ra-res { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12.5px; text-align: left; color: #cfd6e4;
  background: rgba(12, 16, 23, 0.8); border: 1px solid rgba(51, 65, 92, 0.7); border-radius: 9px; cursor: pointer; }
.ra-res:hover { border-color: #d9955c; color: #f4ead7; }
.ra-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #8a97a8; }
.ra-band-elite { background: #ffb224; } .ra-band-strong { background: #9f7bff; }
.ra-band-promising { background: #1fbaed; } .ra-band-marginal { background: #64d98c; }
.ra-working { margin-left: auto; font-size: 9.5px; letter-spacing: 0.14em; color: #ffd9a0; font-style: normal;
  animation: rhPulse 1.6s ease-in-out infinite; }
/* hall quest board */
.ra-quest { align-items: flex-start; }
.ra-qbox { flex: none; font-size: 12px; color: #8a97a8; line-height: 1.3; }
.ra-qspin { margin-top: 3px; }
.ra-qtext { display: flex; flex-direction: column; line-height: 1.3; }
.ra-qtext i { font-size: 10px; color: #7d8aa0; font-style: normal; }
.ra-quest .ra-dot { margin-top: 4px; }
/* the inspector questline */
.ri-qhead { margin: 12px 0 0; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.24em; color: #d9955c; }
.ri-quest { display: inline-flex; align-items: center; gap: 5px; }
.ri-qspin { width: 8px; height: 8px; }
.ra-list { display: flex; flex-direction: column; gap: 6px; }
.ra-btn { position: relative; padding: 9px 12px; text-align: left; background: rgba(20, 15, 8, 0.65);
  border: 1px solid rgba(217, 149, 92, 0.45); border-radius: 10px; cursor: pointer; color: #f4ead7; }
.ra-btn:hover:not(:disabled) { border-color: #f0b96a; background: rgba(28, 20, 10, 0.85); }
.ra-btn:disabled { opacity: 0.45; cursor: default; }
.ra-btn b { display: block; font: 700 13.5px "Barlow Condensed", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
.ra-btn i { display: block; font-size: 11px; color: #9aa7bd; font-style: normal; margin-top: 1px; }
.ra-btn em { position: absolute; top: 8px; right: 10px; font: 700 8.5px ui-monospace, monospace; letter-spacing: 0.12em;
  color: #ffb224; font-style: normal; }
.ra-sealed { margin: 10px 0 0; font-size: 12px; color: #7d8aa0; }
.ra-leaveHall { width: 100%; margin-top: 16px; padding: 10px; font-size: 12.5px; color: #9aa7bd; background: none;
  border: 1px solid #33415c; border-radius: 9px; cursor: pointer; }
.ra-leaveHall:hover { color: #f4ead7; border-color: #d9955c; }
.ra-leaveHall span { color: #55607a; font-size: 10.5px; }
@media (max-width: 640px) { .ra-hall { left: 10px; right: 10px; width: auto; } }

/* builder chat */
.ra-chat select { width: 100%; margin: 4px 0 8px; padding: 7px 9px; background: #0c1017; color: #e8e2d4;
  border: 1px solid #33415c; border-radius: 8px; }
.ra-log { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px;
  scrollbar-width: thin; }
.ra-m { margin: 0; padding: 6px 10px; font-size: 12px; line-height: 1.45; border-radius: 9px; max-width: 92%; }
.ra-you { align-self: flex-end; color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c); }
.ra-wright { align-self: flex-start; color: #e8e2d4; background: rgba(51, 65, 92, 0.45); border: 1px solid rgba(51, 65, 92, 0.8); }
.ra-sys { align-self: center; color: #7d8aa0; font-size: 11px; background: none; }
.ra-row { display: flex; gap: 6px; }
.ra-row input { flex: 1; padding: 9px 11px; font-size: 13px; color: #e8e2d4; background: #0c1017;
  border: 1px solid #33415c; border-radius: 9px; outline: none; }
.ra-row input:focus { border-color: #d9955c; }
.ra-row button { width: 40px; border: 0; border-radius: 9px; background: linear-gradient(180deg, #f0b96a, #d9955c);
  color: #1c1206; font-size: 15px; cursor: pointer; }
.ra-row button:disabled { opacity: 0.5; }

/* the Realm Sage */
.ra-sage { position: fixed; left: 16px; bottom: 34px; z-index: 7; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(159, 123, 255, 0.55); background: rgba(13, 18, 30, 0.9); font-size: 19px; cursor: pointer;
  box-shadow: 0 0 18px rgba(159, 123, 255, 0.25); }
.ra-sage:hover { border-color: #9f7bff; box-shadow: 0 0 26px rgba(159, 123, 255, 0.45); }
.ra-sagewait { flex-direction: column; display: flex; align-items: center; justify-content: center; gap: 22px; }
.ra-orb { position: relative; width: 74px; height: 74px; }
.ra-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(159, 123, 255, 0.7);
  animation: raOrb 2.6s ease-in-out infinite; }
.ra-orb span:nth-child(2) { animation-delay: 0.85s; }
.ra-orb span:nth-child(3) { animation-delay: 1.7s; }
@keyframes raOrb { 0% { transform: scale(0.35); opacity: 0.9; } 100% { transform: scale(1.5); opacity: 0; } }
.ra-sagetext { font: 400 13px ui-monospace, monospace; letter-spacing: 0.12em; color: #b9a8e8; }
.ra-reading p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: #cfd6e4; }
.ra-raw { font-size: 10.5px; color: #8a97a8; white-space: pre-wrap; word-break: break-word; }
.ri-rites { margin-top: 12px; }

/* run controls in the forge banner */
.rh-runbtn { margin-left: 8px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255, 154, 82, 0.5);
  background: none; color: #ff9a52; cursor: pointer; font-size: 11px; }
.rh-runbtn:hover { border-color: #ff9a52; background: rgba(255, 106, 26, 0.15); }

/* the map (M) */
.rm-veil { position: fixed; inset: 0; z-index: 18; display: grid; place-items: center; background: rgba(6, 8, 13, 0.78); }
.rm-veil[hidden] { display: none; }
.rm-card { padding: 16px 18px 18px; background: rgba(13, 18, 30, 0.97); border: 1px solid #33415c; border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7); }
.rm-h { margin: 0 0 10px; font: 700 10px ui-monospace, monospace; letter-spacing: 0.24em; color: #d9955c; }
.rm-h i { color: #55607a; font-style: normal; letter-spacing: 0.1em; }
#rm-canvas { display: block; border-radius: 9px; }
.rm-legend { margin: 9px 0 0; font: 400 10px ui-monospace, monospace; letter-spacing: 0.08em; color: #7d8aa0; text-align: center; }

/* demo realm banner */
.rh-demobar { position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 7; padding: 7px 16px;
  font: 700 11px ui-monospace, monospace; letter-spacing: 0.12em; color: #1c1206;
  background: linear-gradient(180deg, #ffd24a, #e8a93a); border-radius: 999px; white-space: nowrap; }
.rh-demobar a { color: #1c1206; text-decoration: underline; }
@media (max-width: 760px) { .rh-demobar { font-size: 9.5px; bottom: 8px; max-width: 94vw; white-space: normal; text-align: center; } }

/* connect screen: the demo door */
.rc-demolink { display: block; width: 100%; margin-top: 14px; padding: 10px 12px; font-size: 12px; line-height: 1.5;
  color: #9aa7bd; background: rgba(12, 16, 23, 0.7); border: 1px dashed #33415c; border-radius: 9px; cursor: pointer; text-align: left; }
.rc-demolink b { color: #ffd24a; }
.rc-demolink:hover { border-color: #ffd24a; color: #cfd6e4; }

/* the Founder's ledger (TAB) */
.rk-sheetveil { position: fixed; inset: 0; z-index: 18; display: grid; place-items: center; background: rgba(6, 8, 13, 0.78); }
.rk-sheetveil[hidden] { display: none; }
.rk-sheet { width: min(460px, calc(100vw - 40px)); max-height: calc(100vh - 80px); overflow-y: auto;
  padding: 22px 24px 20px; background: rgba(13, 18, 30, 0.97); border: 1px solid #33415c; border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7); scrollbar-width: thin; }
.rk-flvl { font: 700 11px ui-monospace, monospace; letter-spacing: 0.2em; color: #ffd24a; margin-left: 10px; }
.rk-skills { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.rk-skill { display: grid; grid-template-columns: 110px 26px 1fr; align-items: center; gap: 8px; }
.rk-sname { font: 700 12px "Barlow Condensed", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: #f4ead7; }
.rk-slvl { font: 700 13px ui-monospace, monospace; color: #ffd24a; text-align: center; }
.rk-strack { height: 7px; border-radius: 999px; background: rgba(51, 65, 92, 0.55); overflow: hidden; }
.rk-sfill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #d9955c, #f0b96a); }
.rk-sblurb { grid-column: 1 / -1; font-size: 10.5px; color: #5c6979; font-style: normal; margin-top: -3px; }
.rk-deeds { margin-top: 4px; }
.rk-notecount { font: 700 10px ui-monospace, monospace; color: #ffd24a; letter-spacing: 0.1em; margin-left: 8px; }
.rk-nonotes { margin: 4px 0 0; font-size: 11.5px; color: #7d8aa0; }
.rk-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.rk-note { background: rgba(20, 16, 10, 0.55); border: 1px solid rgba(217, 178, 92, 0.3); border-radius: 9px; padding: 8px 12px; }
.rk-note summary { cursor: pointer; font: 700 12px "Barlow Condensed", sans-serif; letter-spacing: 0.06em;
  text-transform: uppercase; color: #e8d9b0; }
.rk-note summary i { font: 400 10px ui-monospace, monospace; color: #7d8aa0; text-transform: none; font-style: normal; }
.rk-note p { margin: 8px 0 2px; font-size: 12px; line-height: 1.6; color: #b9c2d2; }

/* skill level-up banner — the Oblivion moment */
.rk-levelup { position: fixed; left: 50%; top: 26%; transform: translateX(-50%); z-index: 22; text-align: center;
  padding: 16px 34px; background: rgba(10, 13, 20, 0.9); border: 1px solid rgba(255, 210, 74, 0.6); border-radius: 12px;
  box-shadow: 0 0 40px rgba(255, 210, 74, 0.25); animation: rkLvlIn 0.5s ease; pointer-events: none; }
.rk-levelup i { display: block; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.34em; color: #d9955c; font-style: normal; }
.rk-levelup b { display: block; margin-top: 5px; font: 900 26px "Barlow Condensed", sans-serif; letter-spacing: 0.1em;
  text-transform: uppercase; color: #ffd24a; }
.rk-lvl-out { transition: opacity 0.8s ease; opacity: 0; }
@keyframes rkLvlIn { 0% { transform: translateX(-50%) translateY(-14px); opacity: 0; } 100% { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* +XP chips + the ledger door + keeper button */
.rk-xpchip { position: fixed; right: 24px; bottom: 150px; z-index: 6; padding: 5px 12px;
  font: 700 10.5px ui-monospace, monospace; letter-spacing: 0.18em; color: #ffd24a;
  background: rgba(13, 18, 30, 0.85); border: 1px solid rgba(255, 210, 74, 0.4); border-radius: 999px;
  animation: rkChip 1.5s ease forwards; pointer-events: none; }
@keyframes rkChip { 0% { opacity: 0; transform: translateY(10px); } 18% { opacity: 1; transform: translateY(0); }
  74% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
.rk-ledgerbtn { position: fixed; left: 16px; bottom: 88px; z-index: 7; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(217, 178, 92, 0.55); background: rgba(13, 18, 30, 0.9); font-size: 18px; cursor: pointer;
  box-shadow: 0 0 14px rgba(217, 178, 92, 0.2); }
.rk-ledgerbtn:hover { border-color: #d9b25c; box-shadow: 0 0 22px rgba(217, 178, 92, 0.4); }
body.photo .rk-ledgerbtn, body.photo .rk-xpchip, body.photo .rd-veil, body.photo .rk-sheetveil, body.photo .rm-veil { display: none !important; }
.ra-keeper { width: 100%; margin-top: 14px; padding: 10px; font-size: 12.5px; color: #e8d9b0; background: rgba(30, 24, 12, 0.6);
  border: 1px solid rgba(217, 178, 92, 0.45); border-radius: 9px; cursor: pointer; }
.ra-keeper:hover { border-color: #d9b25c; color: #f4ead7; }
.rw-npc { color: #d9b25c; }
/* touch layouts: the joystick owns bottom-left — move the ledger door to
   the right-hand button column so nothing overlaps a thumb zone */
@media (pointer: coarse) { .rk-ledgerbtn { left: auto; right: 27px; bottom: 372px; width: 42px; height: 42px; } }

/* the Herald's dialogue */
.rd-veil { position: fixed; inset: 0; z-index: 17; display: grid; place-items: end center; padding-bottom: 60px;
  background: linear-gradient(180deg, transparent 40%, rgba(6, 8, 13, 0.72) 100%); }
.rd-veil[hidden] { display: none; }
.rd-card { display: grid; grid-template-columns: 96px 1fr; gap: 18px; width: min(620px, calc(100vw - 36px));
  padding: 18px 20px; background: rgba(13, 18, 30, 0.97); border: 1px solid #33415c; border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.7); }
.rd-portrait { position: relative; width: 96px; height: 110px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(90% 70% at 50% 30%, #2e3a55 0%, #141c2d 80%); border: 1px solid rgba(217, 178, 92, 0.35); }
.rd-hood { position: absolute; left: 50%; top: 16px; width: 58px; height: 64px; margin-left: -29px; border-radius: 50% 50% 42% 42%;
  background: #26314a; box-shadow: inset 0 -18px 22px rgba(0, 0, 0, 0.85); }
.rd-orbdot { position: absolute; right: 12px; bottom: 14px; width: 12px; height: 12px; border-radius: 50%;
  background: #ff9a52; box-shadow: 0 0 14px 4px rgba(255, 154, 82, 0.65); animation: rhPulse 2.4s ease-in-out infinite; }
.rd-name { margin: 0 0 6px; font: 700 10px ui-monospace, monospace; letter-spacing: 0.3em; color: #d9b25c; }
.rd-text { margin: 0 0 12px; font-size: 13.5px; line-height: 1.65; color: #e8e2d4; min-height: 44px; }
.rd-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-t { padding: 6px 12px; font: 600 11.5px Inter, sans-serif; color: #cfd6e4; background: #0c1017;
  border: 1px solid #33415c; border-radius: 999px; cursor: pointer; }
.rd-t:hover { border-color: #d9b25c; color: #f4ead7; }
.rd-t.on { color: #1c1206; background: linear-gradient(180deg, #f0d98a, #d9b25c); border-color: #d9b25c; }
.rd-bye { margin-left: auto; color: #7d8aa0; }
@media (max-width: 560px) { .rd-card { grid-template-columns: 1fr; } .rd-portrait { display: none; } }

/* touch controls (mounted only on coarse-pointer devices) */
.rt-stick { position: fixed; left: 22px; bottom: 88px; width: 118px; height: 118px; z-index: 9; border-radius: 50%;
  background: rgba(13, 18, 30, 0.45); border: 1px solid rgba(217, 149, 92, 0.4); touch-action: none; }
.rt-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(217, 149, 92, 0.55); border: 1px solid #f0b96a; pointer-events: none; }
.rt-btns { position: fixed; right: 20px; bottom: 92px; z-index: 9; display: flex; flex-direction: column; gap: 12px; }
.rt-b { width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(217, 149, 92, 0.5);
  background: rgba(13, 18, 30, 0.6); color: #f4ead7; font-size: 20px; touch-action: none; }
.rt-e { font: 800 22px "Barlow Condensed", sans-serif; color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c); }

/* settings */
.rs-gear { position: fixed; top: 12px; right: 14px; z-index: 8; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid #33415c; background: rgba(13, 18, 30, 0.85); color: #9aa7bd; cursor: pointer; font-size: 15px; }
.rs-gear:hover { color: #f4ead7; border-color: #d9955c; }
.rs-panel { position: fixed; top: 54px; right: 14px; z-index: 8; width: 250px; padding: 14px 16px;
  background: rgba(13, 18, 30, 0.96); border: 1px solid #33415c; border-radius: 12px; }
.rs-h { margin: 0 0 10px; font: 700 9.5px ui-monospace, monospace; letter-spacing: 0.24em; color: #d9955c; }
.rs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px;
  font-size: 12.5px; color: #cfd6e4; }
.rs-row select { background: #0c1017; color: #e8e2d4; border: 1px solid #33415c; border-radius: 7px; padding: 5px 8px; }
.rs-streamer { flex-wrap: wrap; justify-content: flex-start; }
.rs-streamer i { flex-basis: 100%; font-size: 10.5px; color: #7d8aa0; font-style: normal; margin-left: 22px; }
.rs-leave { width: 100%; margin-top: 4px; padding: 8px; font-size: 12px; color: #9aa7bd; background: none;
  border: 1px solid #33415c; border-radius: 8px; cursor: pointer; }
.rs-leave:hover { color: #e0574f; border-color: rgba(224, 87, 79, 0.5); }

/* ---------- gem chests: reveal card + satchel ---------- */
.rg-veil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: radial-gradient(80% 80% at 50% 45%, rgba(20, 14, 4, 0.55), rgba(6, 8, 13, 0.85)); }
.rg-card { width: min(360px, calc(100vw - 40px)); text-align: center; padding: 26px 26px 22px;
  background: rgba(13, 18, 30, 0.97); border: 1px solid rgba(217, 169, 74, 0.55); border-radius: 16px;
  box-shadow: 0 0 60px rgba(255, 200, 74, 0.18), 0 30px 90px rgba(0, 0, 0, 0.7); }
.rg-kick { margin: 0 0 8px; font: 700 10px ui-monospace, monospace; letter-spacing: 0.3em; color: #d9a94a; }
.rg-name { margin: 0 0 4px; font: 900 30px/1.05 "Barlow Condensed", "Arial Narrow", sans-serif; text-transform: uppercase; }
.rg-tier { margin: 0 0 14px; font: 700 11px ui-monospace, monospace; letter-spacing: 0.24em; }
.rg-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rg-rows span { display: flex; justify-content: space-between; padding: 7px 12px; background: #0c1017;
  border: 1px solid #33415c; border-radius: 9px; font-size: 12.5px; }
.rg-rows i { font-style: normal; color: #8a97a8; letter-spacing: 0.14em; font-size: 10px; align-self: center; }
.rg-rows b { color: #e8e2d4; }
.rg-note { margin: 0 0 14px; font-size: 11.5px; line-height: 1.55; color: #7d8aa0; }
.rg-take { width: 100%; padding: 12px; font: 700 14px "Barlow Condensed", sans-serif; letter-spacing: 0.12em;
  text-transform: uppercase; color: #1c1206; background: linear-gradient(180deg, #f0b96a, #d9955c);
  border: 0; border-radius: 9px; cursor: pointer; }
.rk-gems { display: flex; flex-direction: column; gap: 6px; }
.rk-gem { display: grid; grid-template-columns: 16px 1fr; grid-template-rows: auto auto; gap: 1px 9px;
  align-items: center; padding: 6px 9px; background: rgba(12, 16, 23, 0.8); border: 1px solid #2a3a5c;
  border-radius: 9px; }
.rk-gem b { font-size: 12px; color: #e8e2d4; }
.rk-gem em { grid-column: 2; font-style: normal; font-size: 10.5px; color: #7d8aa0; }
.rk-gemchip { grid-row: 1 / span 2; width: 13px; height: 13px; border-radius: 3px; transform: rotate(45deg);
  box-shadow: 0 0 8px currentColor; }
