/* ============================================================
   暮光岩馆 · Twilight Gym
   Shogun Showdown-inspired Dusk Pixel / Ink Tactical UI
   ============================================================ */

:root {
  color-scheme: dark;
  --bg-void: #140c1f;
  --bg-deep: #1b1129;
  --bg-panel: #221733;
  --bg-card: #2b1e3f;
  --bg-card-hi: #35254d;
  --parchment: #f4e6ca;
  --parchment-mid: #e5d2ae;
  --parchment-border: #b8986b;

  --ink: #0f0818;
  --border-soft: #43315e;
  --text-main: #f6ecd7;
  --text-muted: #b5a4c7;
  --text-dim: #867699;
  --text-ink: #1c112a;

  --sun: #f2902e;
  --sun-bright: #ffb347;
  --gold: #ffd152;
  --crimson: #d94b3d;
  --crimson-dark: #9c2b26;
  --teal: #6cc2b2;
  --teal-dark: #327268;
  --plum-accent: #8e64b8;

  --shadow-hard: 3px 3px 0 #0b0612;
  --shadow-hard-sm: 2px 2px 0 #0b0612;
  --radius: 3px;

  --font-ui: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(217, 75, 61, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(70, 116, 123, 0.12) 0%, transparent 50%);
}

button, select, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  transition: transform 0.08s ease, background-color 0.12s ease, filter 0.12s ease;
}

button:hover:not(:disabled) {
  background: var(--bg-card-hi);
  filter: brightness(1.06);
}

button:active:not(:disabled) {
  transform: translate(1.5px, 1.5px);
  box-shadow: 0.5px 0.5px 0 #0b0612;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ======================== TOP BAR ======================== */
.topbar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: var(--bg-deep);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(9, 5, 16, 0.7);
  z-index: 20;
}

.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-crest {
  width: 30px;
  height: 30px;
  background: var(--crimson);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: 2px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-crest::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  top: 3px;
  left: 6px;
}

.brand-crest::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
  clip-path: polygon(0 100%, 34% 44%, 52% 66%, 72% 32%, 100% 100%);
}

.brand-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--parchment);
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sun);
  font-family: var(--font-mono);
}

.day-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--parchment);
  color: var(--text-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: 2px;
  font-weight: 800;
  font-size: 13px;
}

.phase-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.phase-stamp[data-phase="prep"] {
  background: #3d5c7a;
  color: #f6ecd7;
}

.phase-stamp[data-phase="open"] {
  background: var(--crimson);
  color: #fff3da;
}

.phase-stamp[data-phase="settlement"] {
  background: var(--sun);
  color: var(--text-ink);
}

.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: currentColor;
  display: inline-block;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 700;
}

.stat-chip .icon-coin {
  color: var(--gold);
  font-weight: 900;
}

.stat-chip .icon-star {
  color: var(--sun-bright);
}

.top-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
}

.top-btn.shop-btn {
  background: #46325e;
  border-color: var(--ink);
  color: var(--parchment);
}

.top-btn .badge-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  background: var(--sun);
  border: 1.5px solid var(--ink);
  border-radius: 1px;
}

.top-btn.icon-only {
  padding: 5px 8px;
}

/* ======================== MAIN WORKSPACE ======================== */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  gap: 12px;
  padding: 10px 14px 12px;
}

/* ======================== CENTER WALL STAGE ======================== */
.stage-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  gap: 8px;
}

.wall-frame {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #12091d;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius);
  padding: 6px;
  overflow: hidden;
}

.wall-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(244, 230, 202, 0.12);
  pointer-events: none;
  z-index: 2;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
}

#wallCanvas {
  display: block;
  width: min(100cqw, calc(100cqh * 224 / 146));
  height: min(100cqh, calc(100cqw * 146 / 224));
  background: #1c112a;
  border: 2px solid var(--ink);
  touch-action: none;
  cursor: grab;
}

#wallCanvas:active {
  cursor: grabbing;
}

body[data-edit-mode="hand"] #wallCanvas,
body[data-edit-mode="foot"] #wallCanvas,
body[data-edit-mode="remove"] #wallCanvas {
  cursor: crosshair;
}

body[data-phase="open"] #wallCanvas {
  cursor: default;
}

/* Overlays perched cleanly in corners of the wall frame */
.wall-hud-tl {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
}

.wall-hud-tr {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 5;
}

.hud-pill {
  background: rgba(20, 11, 30, 0.86);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  color: var(--parchment);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-pill.preview-banner {
  background: var(--sun);
  color: var(--text-ink);
  pointer-events: auto;
}

.hud-pill.preview-banner button {
  padding: 1px 6px;
  font-size: 11px;
  background: var(--text-ink);
  color: var(--parchment);
  box-shadow: none;
  border-width: 1px;
}

.hud-toggle {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(28, 17, 42, 0.9);
  color: var(--text-main);
}

.hud-toggle[aria-pressed="true"] {
  background: var(--teal-dark);
  color: #ecfffb;
  border-color: var(--ink);
}

/* ======================== STAGE CONTROL STRIP ======================== */
.stage-controls {
  flex-shrink: 0;
  background: var(--bg-panel);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
}

.tool-btn[aria-pressed="true"] {
  background: var(--parchment);
  color: var(--text-ink);
}

.tool-btn.danger[aria-pressed="true"] {
  background: var(--crimson);
  color: #fff3da;
}

.hold-swatch {
  width: 10px;
  height: 7px;
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 1px;
}

.hold-swatch.hand {
  background: var(--sun);
}

.hold-swatch.foot {
  background: var(--teal);
  width: 8px;
  height: 5px;
}

.select-box {
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.budget-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: var(--bg-deep);
  border: 2px solid var(--ink);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
}

.budget-badge.full {
  border-color: var(--sun);
  color: var(--sun-bright);
}

/* Open-day playback transport bar */
.transport-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.transport-row input[type="range"] {
  flex: 1;
  min-width: 80px;
  accent-color: var(--sun);
  cursor: pointer;
  height: 6px;
}

.speed-group {
  display: inline-flex;
  gap: 3px;
}

.speed-btn {
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.speed-btn[aria-pressed="true"] {
  background: var(--sun);
  color: var(--text-ink);
}

/* ======================== RIGHT TACTICAL SIDEBAR ======================== */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-panel);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius);
  overflow: hidden;
}

.sidebar-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-body::-webkit-scrollbar {
  width: 6px;
}

.sidebar-body::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 2px;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 10px;
  background: var(--bg-deep);
  border-top: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Shogun Tactical Cards */
.tac-card {
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: var(--radius);
  padding: 9px 10px;
}

.tac-card.parchment {
  background: var(--parchment);
  color: var(--text-ink);
  border-color: var(--ink);
}

.tac-card.parchment .muted {
  color: #5b4938;
}

.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.tac-card.parchment .card-kicker {
  color: var(--crimson-dark);
}

.tac-card:not(.parchment) .card-kicker {
  color: var(--sun);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.card-desc {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.tac-card.parchment .card-desc {
  color: #3f3027;
}

.goal-strip {
  margin-top: 6px;
  padding: 5px 7px;
  background: rgba(28, 17, 42, 0.1);
  border: 1.5px solid rgba(28, 17, 42, 0.25);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.reward-pill {
  background: var(--crimson);
  color: #fff4d8;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* Route Analysis Strip */
.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.grade-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  padding: 0 8px;
  background: var(--sun);
  color: var(--text-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 900;
  border-radius: 2px;
}

.grade-seal.impossible {
  background: var(--crimson);
  color: #fff3da;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.tag-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-soft);
  color: var(--parchment);
  border-radius: 2px;
}

.tag-pill.teal {
  border-color: var(--teal-dark);
  color: #b4f0e4;
}

.warn-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.warn-item {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 2px;
  border-left: 3px solid var(--sun);
  background: rgba(242, 144, 46, 0.14);
  color: #ffd8a8;
}

.warn-item.error {
  border-left-color: var(--crimson);
  background: rgba(217, 75, 61, 0.2);
  color: #ffc8c2;
}

/* Visitor Cards */
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--parchment);
  letter-spacing: 0.04em;
}

.visitor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.visitor-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: var(--radius);
}

.visitor-card.active {
  border-color: var(--gold);
  background: #362552;
}

.visitor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 2px;
  border: 2px solid var(--ink);
  background: var(--bg-deep);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 15px;
  color: #fff6e6;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.visitor-avatar.has-sprite {
  background-image: url("engine/climbers.png");
  background-repeat: no-repeat;
  background-size: 400% auto;
  background-position-y: 12%;
  color: transparent;
}

.visitor-meta {
  min-width: 0;
}

.visitor-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.visitor-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--parchment);
}

.visitor-trait {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.visitor-stats {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-mini-btn {
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 700;
  background: #3d2c59;
  color: var(--parchment);
  white-space: nowrap;
}

.preview-mini-btn.active {
  background: var(--sun);
  color: var(--text-ink);
}

/* Primary Shogun CTA */
.cta-primary {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: var(--crimson);
  color: #fff6e0;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cta-primary:hover:not(:disabled) {
  background: #e65546;
}

.cta-secondary {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  background: var(--parchment);
  color: var(--text-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
}

.cta-secondary:hover:not(:disabled) {
  background: #fff3da;
}

.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

/* Open Day Queue & Live Feed */
.queue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.queue-chip {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-deep);
}

.queue-chip[data-state="climbing"] {
  background: var(--sun);
  color: var(--text-ink);
}

.queue-chip[data-state="done"] {
  background: var(--teal-dark);
  color: #eafffa;
}

.queue-chip[data-state="failed"] {
  background: #5c3348;
  color: #ffd9e6;
}

.live-stage-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding: 6px 8px;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-soft);
  border-radius: 2px;
  font-size: 12px;
}

.live-stage-pill {
  color: var(--sun-bright);
  font-weight: 800;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.feed-entry {
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 8px;
  background: var(--bg-deep);
  border-left: 3px solid var(--border-soft);
  border-radius: 2px;
}

.feed-entry.top {
  border-left-color: var(--gold);
}

.feed-entry.crux {
  border-left-color: var(--crimson);
}

.feed-entry.review {
  border-left-color: var(--teal);
  background: rgba(108, 194, 178, 0.1);
}

/* ======================== MODALS ======================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 6, 18, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(860px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 #090510;
  border-radius: var(--radius);
  overflow: hidden;
}

.modal-card.wide {
  width: min(1160px, 96vw);
}

.modal-header {
  padding: 12px 16px;
  background: var(--parchment);
  color: var(--text-ink);
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.modal-header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #544234;
}

.modal-close {
  width: 30px;
  height: 30px;
  background: var(--text-ink);
  color: var(--parchment);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
}

.modal-footer {
  padding: 11px 16px;
  background: var(--bg-deep);
  border-top: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Dual-Window Comparison Modal (Ref #3) */
.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dual-pane {
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dual-pane-head {
  padding: 8px 10px;
  background: var(--bg-deep);
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dual-pane canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 224 / 146;
  background: #1c112a;
}

.dual-pane-foot {
  padding: 7px 10px;
  font-size: 12px;
  border-top: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dual-diff-banner {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--parchment);
  color: var(--text-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Settlement Ledger */
.settlement-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.summary-tile {
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  padding: 9px 10px;
  border-radius: var(--radius);
}

.summary-tile .label {
  font-size: 11px;
  color: var(--text-muted);
}

.summary-tile .value {
  font-size: 20px;
  font-weight: 900;
  margin-top: 2px;
  color: var(--gold);
  font-family: var(--font-mono);
}

.summary-tile.teal .value {
  color: var(--teal);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.review-card {
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  padding: 10px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.review-stars {
  color: var(--gold);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
}

.review-quote {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--parchment);
  background: var(--bg-deep);
  padding: 7px 8px;
  border-left: 3px solid var(--sun);
  border-radius: 2px;
}

.review-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Shop Modal */
.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.shop-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

.shop-tab[aria-pressed="true"] {
  background: var(--parchment);
  color: var(--text-ink);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shop-item {
  background: var(--bg-card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  padding: 10px 11px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.shop-item.owned {
  border-color: var(--teal-dark);
  background: #232d3d;
}

.shop-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.shop-item-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--parchment);
}

.shop-item-price {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 13px;
  color: var(--gold);
  white-space: nowrap;
}

.shop-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.shop-buy-btn {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  background: var(--sun);
  color: var(--text-ink);
}

.shop-buy-btn.owned-btn {
  background: var(--teal-dark);
  color: #ecfffb;
}

/* Toast Banner */
.toast-container {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: var(--parchment);
  color: var(--text-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 2px;
  animation: toastIn 0.18s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive fallback for smaller viewports */
@media (max-width: 980px) {
  body {
    height: auto;
    overflow: auto;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .canvas-wrap {
    container-type: normal;
  }
  #wallCanvas {
    width: 100%;
    height: auto;
    aspect-ratio: 224 / 146;
  }
  .sidebar {
    max-height: none;
  }
  .dual-grid, .review-grid, .shop-grid {
    grid-template-columns: 1fr;
  }
  .settlement-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}
