/* =============================================
   Đường Thương Huyền Sử Việt – Game Styles
   Vietnamese Folklore Trading RPG
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400&family=Be+Vietnam+Pro:wght@300;400;500;600&display=swap');

:root {
  --bg-dark: #1a1612;
  --bg-panel: #241f1a;
  --bg-card: #2d2722;
  --bg-hover: #3a322a;
  --text-primary: #e8dcc8;
  --text-secondary: #b5a48e;
  --text-muted: #7d6e5c;
  --accent-gold: #c9a84c;
  --accent-warm: #d48a3c;
  --accent-red: #b85450;
  --accent-green: #6b8f5e;
  --accent-blue: #5b7b9e;
  --accent-purple: #8b6b8f;
  --accent-teal: #5e8f8a;
  --border: #3d352c;
  --border-light: #4d4538;
  --shadow: rgba(0,0,0,0.4);
  --font-body: 'Be Vietnam Pro', sans-serif;
  --font-story: 'Noto Serif', serif;
  --radius: 6px;
  --radius-lg: 10px;
  --title-background-image: url('assets/title_bg.png');
  --map-background-image: url('assets/map_bg.png');
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: flex; width: 100%; }

/* ============ TITLE SCREEN ============ */
.title-bg {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--title-background-image) center center / cover no-repeat,
              linear-gradient(135deg, #1a1612 0%, #2d2318 30%, #1a1612 60%, #241f1a 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.title-bg::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom,
    rgba(26,22,18,0.3) 0%,
    rgba(26,22,18,0.1) 30%,
    rgba(26,22,18,0.2) 60%,
    rgba(26,22,18,0.6) 100%);
  pointer-events: none;
}

.title-bg::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 5 L35 15 L30 25 L25 15 Z' fill='none' stroke='%23c9a84c' stroke-width='0.3' opacity='0.08'/%3E%3Cpath d='M10 35 L15 45 L10 55 L5 45 Z' fill='none' stroke='%23c9a84c' stroke-width='0.3' opacity='0.06'/%3E%3Cpath d='M50 35 L55 45 L50 55 L45 45 Z' fill='none' stroke='%23c9a84c' stroke-width='0.3' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  animation: driftPattern 60s linear infinite;
}

@keyframes driftPattern {
  from { background-position: 0 0; }
  to { background-position: 60px 60px; }
}

.title-content {
  text-align: center; z-index: 1;
  background: rgba(26,22,18,0.55);
  padding: 2.5rem 3rem;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(201,168,76,0.15);
  width: min(100%, 760px);
  margin: auto;
}

.game-title {
  font-family: var(--font-story);
  font-size: 3.5rem; line-height: 1.2;
  color: var(--accent-gold);
  text-shadow: 0 2px 20px rgba(201,168,76,0.3);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 2px 20px rgba(201,168,76,0.3); }
  50% { text-shadow: 0 2px 30px rgba(201,168,76,0.5), 0 0 60px rgba(201,168,76,0.1); }
}

.subtitle {
  font-size: 2.2rem;
  color: var(--text-primary);
  font-weight: 400;
}

.tagline {
  font-family: var(--font-story);
  font-style: italic;
  color: var(--text-secondary);
  max-width: 480px; margin: 0 auto 2.5rem;
  font-size: 1rem; line-height: 1.7;
}

.title-pill-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 auto 1.4rem;
  max-width: 720px;
}

.title-pill {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 0.95rem;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid rgba(201,168,76,0.18);
  background: rgba(20, 16, 13, 0.62);
}

.pill-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.pill-value {
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.title-note {
  margin: 0 auto 1rem;
  max-width: 560px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.title-buttons { display: flex; gap: 1rem; justify-content: center; margin-bottom: 2rem; }

.version-tag {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ============ BUTTONS ============ */
.btn {
  font-family: var(--font-body);
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn:hover { background: var(--bg-hover); border-color: var(--accent-gold); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-warm));
  color: var(--bg-dark);
  border-color: var(--accent-gold);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary { border-color: var(--text-muted); }

.btn-action {
  flex: 1;
  min-width: 104px;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(180deg, rgba(56,48,39,0.96), rgba(33,28,23,0.98));
  border-color: rgba(201,168,76,0.18);
  box-shadow: 0 10px 18px rgba(0,0,0,0.16);
}

.action-btn-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35));
}

.btn-action span {
  display: inline-flex;
  align-items: center;
}

.btn-lane {
  min-height: 104px;
  padding: 0.95rem 1rem;
  border-radius: 22px;
  justify-content: flex-start;
  text-align: left;
}

.btn-lane-primary {
  border-color: rgba(201,168,76,0.38);
  box-shadow: 0 14px 30px rgba(0,0,0,0.24), 0 0 0 1px rgba(201,168,76,0.14);
}

.lane-btn-icon-shell {
  width: 54px;
  min-width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,244,218,0.96), rgba(196,149,67,0.82));
  border: 2px solid rgba(201,168,76,0.38);
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.lane-btn-copy {
  display: grid;
  gap: 0.18rem;
}

.lane-btn-label {
  font-family: var(--font-story);
  font-size: 1.05rem;
  color: var(--text-primary);
}

.lane-btn-meta {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.btn-utility {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(17,14,12,0.62);
  border: 1px solid rgba(201,168,76,0.14);
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.btn-utility:hover {
  color: var(--text-primary);
}

.btn-back {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-small { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

.btn-choice {
  width: 100%;
  text-align: left;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  position: relative;
}
.btn-choice:hover { border-left-color: var(--accent-gold); }
.btn-choice.tone-safe { border-left-color: var(--accent-green); }
.btn-choice.tone-risky { border-left-color: var(--accent-warm); }
.btn-choice.tone-desperate { border-left-color: var(--accent-red); }
.btn-choice.tone-mysterious { border-left-color: var(--accent-purple); }

.btn-choice .badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge-risky { background: rgba(184,84,80,0.2); color: var(--accent-red); }
.badge-need-item { background: rgba(91,123,158,0.2); color: var(--accent-blue); }
.badge-companion { background: rgba(94,143,138,0.2); color: var(--accent-teal); }
.badge-locked { background: rgba(125,110,92,0.3); color: var(--text-muted); }

.btn-choice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-left-color: var(--text-muted);
}

/* ============ GAME LAYOUT ============ */
.game-layout {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  flex: 1 1 auto;
  overflow: visible;
}

.panel {
  overflow: visible;
}

.panel-center {
  background: var(--bg-dark);
  width: 100%;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.panel-title {
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============ MAP ============ */
#map-canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(255,244,214,0.06), transparent 48%), var(--bg-card);
  border: 1px solid rgba(201,168,76,0.22);
  cursor: pointer;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 16px 28px rgba(0,0,0,0.26);
}

.map-legend {
  margin-top: 0.65rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 0.7rem 0.8rem 0;
  border-top: 1px solid rgba(201,168,76,0.12);
}

.map-node-info {
  margin-top: 0.8rem;
  padding: 0.8rem 0.85rem;
  background: linear-gradient(180deg, rgba(35,30,25,0.92), rgba(22,19,16,0.96));
  border: 1px solid rgba(201,168,76,0.14);
  border-radius: 16px;
  font-size: 0.8rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.map-node-info .node-name {
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.map-node-info .node-desc {
  color: var(--text-secondary);
  font-family: var(--font-story);
  font-size: 0.78rem;
  line-height: 1.5;
}

.map-route-focus {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.map-route-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.16);
  background: linear-gradient(180deg, rgba(38,31,25,0.92), rgba(19,16,13,0.96));
}

.map-route-selection-copy {
  display: grid;
  gap: 0.18rem;
}

.map-route-selection-kicker {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.map-route-selection-title {
  font-size: 0.94rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.map-route-selection-detail {
  font-size: 0.76rem;
  line-height: 1.42;
  color: var(--text-secondary);
}

.map-route-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
}

.map-route-branch {
  display: grid;
  gap: 0.18rem;
  padding: 0.65rem 0.72rem;
  border-radius: 14px;
  border: 1px solid rgba(201,168,76,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.map-route-branch:hover,
.map-route-branch.is-selected {
  border-color: rgba(201,168,76,0.42);
  transform: translateY(-1px);
  background: rgba(201,168,76,0.08);
  box-shadow: 0 10px 18px rgba(0,0,0,0.18);
}

.map-route-branch[data-tone="safe"] .map-route-branch-meta {
  color: #d0e2c7;
}

.map-route-branch[data-tone="warn"] .map-route-branch-meta {
  color: #e6c690;
}

.map-route-branch[data-tone="risk"] .map-route-branch-meta {
  color: #e5b0ab;
}

.map-route-branch-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.map-route-branch-meta {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.map-route-empty {
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px dashed rgba(201,168,76,0.18);
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.map-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  font-size: 0.75rem;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 2px 8px var(--shadow);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.map-tooltip.visible {
  opacity: 1;
}

/* ============ SCENE ============ */
.scene-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.25rem 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}

.scene-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  position: absolute;
  top: 1.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1160px, calc(100% - 2.7rem));
  min-width: 0;
  z-index: 7;
}

.scene-header-main {
  flex: 1 1 620px;
  min-width: 0;
  display: grid;
  gap: 0.75rem;
}

.scene-header-tools {
  flex: 0 0 min(390px, 38vw);
  min-width: 280px;
  display: grid;
  gap: 0.65rem;
  justify-items: end;
}

.scene-badges {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.location-badge {
  background: rgba(13, 11, 10, 0.72);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.5);
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
}

.time-badge {
  background: rgba(13, 11, 10, 0.62);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(125,110,92,0.45);
  color: var(--text-secondary);
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
}

.tone-badge {
  background: rgba(13, 11, 10, 0.62);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(94,143,138,0.35);
  color: #d2c5aa;
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
}

.scene-top-copy {
  flex: 1;
  max-width: 420px;
  display: grid;
  gap: 0.45rem;
}

.route-note,
.flow-status-banner {
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.16);
  background: linear-gradient(180deg, rgba(16,14,12,0.76), rgba(29,24,20,0.76));
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

.flow-status-banner[data-tone="event"] {
  border-color: rgba(201,168,76,0.36);
  color: var(--text-primary);
}

.flow-status-banner[data-tone="warn"] {
  border-color: rgba(184,84,80,0.34);
  color: #eac7c4;
}

.flow-status-banner[data-tone="route"] {
  border-color: rgba(107,143,94,0.3);
  color: #d6e3cf;
}

.hud-resource-strip {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.scene-support-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  width: min(100%, 390px);
}

.support-toggle {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.18rem;
  padding: 0.72rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(201,168,76,0.18);
  background: linear-gradient(180deg, rgba(16,14,12,0.82), rgba(29,24,20,0.84));
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.support-toggle:hover,
.support-toggle[aria-expanded="true"] {
  border-color: rgba(201,168,76,0.4);
  background: linear-gradient(180deg, rgba(24,20,16,0.92), rgba(35,29,24,0.94));
}

.support-toggle:active {
  transform: scale(0.988);
}

.support-toggle-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.support-toggle-value {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.support-overlay-dismiss {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 11;
}

.game-layout.support-open .support-overlay-dismiss {
  opacity: 1;
  pointer-events: auto;
}

.support-drawer {
  position: fixed;
  top: 1.15rem;
  bottom: 1.15rem;
  z-index: 12;
  width: min(420px, calc(100vw - 2rem));
  opacity: 0;
  pointer-events: none;
  transform: translateX(22px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.support-drawer[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.support-drawer-status {
  right: 1.15rem;
}

.support-drawer-map {
  left: 1.15rem;
  transform: translateX(-22px);
}

.support-drawer-map[aria-hidden="false"] {
  transform: translateX(0);
}

.support-drawer-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.7rem;
}

.support-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(201,168,76,0.16);
  background: linear-gradient(180deg, rgba(21,18,15,0.92), rgba(30,25,21,0.94));
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 30px rgba(0,0,0,0.24);
}

.support-drawer-title {
  font-family: var(--font-story);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.btn-drawer-close {
  margin-top: 0;
  flex-shrink: 0;
}

.support-map-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
  background:
    radial-gradient(circle at top, rgba(201,168,76,0.08), transparent 34%),
    linear-gradient(180deg, rgba(18,15,12,0.94), rgba(11,10,8,0.97));
}

.hud-resource-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.16);
  background: rgba(13,11,10,0.7);
  color: var(--text-primary);
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
}

.view { display: none; }
.view.active { display: flex; flex-direction: column; animation: fadeIn 0.4s ease; flex: 1; }
#view-overworld.active { animation: fadeInStatic 0.24s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInStatic { from { opacity: 0; } to { opacity: 1; } }

.scene-text {
  font-family: var(--font-story);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.view-focus {
  --focus-art: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201,168,76,0.18);
  background:
    linear-gradient(135deg, rgba(24,20,16,0.88), rgba(36,31,26,0.88)),
    var(--focus-art) center center / cover no-repeat;
}

.view-focus-event {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-chip {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid rgba(201,168,76,0.12);
  background: rgba(12, 10, 8, 0.38);
  min-height: 96px;
}

.focus-chip-kicker {
  color: var(--accent-gold);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focus-chip-title {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.focus-chip-detail {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.action-bar {
  display: flex; gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(201,168,76,0.12);
  padding-top: 1rem;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(18,15,13,0), rgba(18,15,13,0.16));
}

.action-bar-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.scene-utility-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.quest-tracker-card {
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid rgba(201,168,76,0.22);
  background:
    radial-gradient(circle at top left, rgba(201,168,76,0.10), transparent 42%),
    linear-gradient(180deg, rgba(29,24,20,0.94), rgba(17,14,12,0.97));
  box-shadow: 0 16px 28px rgba(0,0,0,0.2);
}

.quest-tracker-card-compact {
  margin-bottom: 1rem;
}

.quest-tracker-card-sheet {
  margin: 0 0 1rem;
}

.quest-tracker-kicker,
.work-log-header,
.choice-effects-label,
.ending-summary-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.quest-tracker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
}

.quest-tracker-head h3 {
  font-family: var(--font-story);
  font-size: 1.18rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.quest-tracker-progress,
.quest-tracker-pending {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.quest-tracker-pending {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(201,168,76,0.12);
  color: var(--accent-gold);
  white-space: nowrap;
}

.quest-tracker-next {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.quest-tracker-detail,
.quest-tracker-side-note,
.ending-summary-copy,
.work-card-summary,
.work-card-meta {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.quest-tracker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.work-list {
  display: grid;
  gap: 0.8rem;
}

.work-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.14);
  background: linear-gradient(180deg, rgba(24,20,17,0.92), rgba(17,14,12,0.96));
}

.work-card.is-live {
  border-color: rgba(201,168,76,0.26);
}

.work-card.is-locked {
  opacity: 0.72;
}

.work-card-copy {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.work-card-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.work-card-title {
  font-size: 1rem;
  color: var(--text-primary);
}

.work-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.work-card-actions {
  flex-shrink: 0;
}

.work-log-shell {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(201,168,76,0.12);
}

.journal-entries-compact {
  margin-top: 0.65rem;
}

/* ============ MARKET ============ */
.goods-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  align-content: start;
}

.market-zone-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
}

.market-zone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.18);
  background: rgba(17, 14, 12, 0.6);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.market-zone-chip:hover,
.market-zone-chip.active {
  border-color: rgba(201,168,76,0.42);
  background: rgba(35, 29, 24, 0.92);
  color: var(--text-primary);
}

.market-zone-chip-count {
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.12);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
}

.market-foyer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.market-zone-card {
  width: 100%;
  padding: 1.05rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(201,168,76,0.18);
  background:
    radial-gradient(circle at top left, rgba(201,168,76,0.08), transparent 48%),
    linear-gradient(180deg, rgba(32,27,23,0.96), rgba(20,17,14,0.98));
  color: var(--text-primary);
  display: grid;
  gap: 0.65rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}

.market-zone-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201,168,76,0.42);
  box-shadow: 0 18px 34px rgba(0,0,0,0.24);
}

.market-zone-card-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.market-zone-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.market-zone-card-title {
  font-family: var(--font-story);
  font-size: 1.12rem;
  line-height: 1.35;
}

.market-zone-card-count {
  flex-shrink: 0;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  background: rgba(201,168,76,0.12);
  color: var(--accent-gold);
  font-size: 0.74rem;
  font-weight: 700;
}

.market-zone-card-copy {
  font-size: 0.82rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.market-zone-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
}

.market-zone-card-cta::after {
  content: '→';
  color: var(--accent-gold);
}

.market-lane {
  min-width: 0;
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.12);
  background: linear-gradient(180deg, rgba(250,242,219,0.96), rgba(222,205,171,0.94));
  color: #352a1f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 22px rgba(0,0,0,0.18);
}

.market-lane-stall,
.market-lane-ledger,
.market-lane-services {
  position: relative;
}

.market-lane-stall::before,
.market-lane-ledger::before,
.market-lane-services::before {
  content: '';
  position: absolute;
  inset: 10px 12px auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(91,64,34,0), rgba(91,64,34,0.12), rgba(91,64,34,0));
  pointer-events: none;
}

.market-lane-shadow {
  background: linear-gradient(180deg, rgba(44,36,31,0.98), rgba(27,22,19,0.98));
  color: var(--text-primary);
  border-color: rgba(184,84,80,0.28);
}

.market-lane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.market-lane-title {
  font-family: var(--font-story);
  font-size: 1rem;
  color: #5b4022;
}

.market-lane-header.shadow .market-lane-title,
.market-lane-shadow .market-lane-title {
  color: #e7d6b8;
}

.market-lane-copy {
  font-size: 0.76rem;
  line-height: 1.45;
  color: rgba(53,42,31,0.78);
}

.market-lane-shadow .market-lane-copy {
  color: rgba(232,220,200,0.78);
}

.market-lane-count {
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(91,64,34,0.12);
  color: #5b4022;
  font-size: 0.78rem;
  font-weight: 600;
}

.market-lane-shadow .market-lane-count {
  background: rgba(184,84,80,0.18);
  color: #f1d2d0;
}

.market-lane-grid,
.market-shadow-list,
.market-service-list {
  display: grid;
  gap: 0.65rem;
}

.ledger-grid {
  grid-template-columns: 1fr;
}

.market-service-card,
.market-shadow-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(91,64,34,0.16);
  background: rgba(255,251,240,0.76);
}

.market-shadow-card {
  border-color: rgba(184,84,80,0.24);
  background: rgba(255,255,255,0.03);
}

.market-service-card.featured {
  border-color: rgba(201,168,76,0.34);
  background: linear-gradient(180deg, rgba(255,247,226,0.96), rgba(241,229,202,0.92));
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.market-service-card.disabled {
  opacity: 0.56;
}

.market-service-copy,
.market-shadow-copy {
  display: grid;
  gap: 0.18rem;
  line-height: 1.45;
}

.market-service-copy strong,
.market-shadow-copy strong {
  font-size: 0.92rem;
}

.market-service-copy span,
.market-shadow-copy span,
.market-service-copy small {
  font-size: 0.76rem;
  color: inherit;
}

.market-shadow-meta {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
}

.market-empty-copy {
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(56,48,39,0.06);
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.good-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.good-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-3px);
  box-shadow: 0 14px 24px rgba(0,0,0,0.22);
}

.good-card.selected,
.route-card.selected,
.btn-choice.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.18), 0 10px 22px rgba(0,0,0,0.22);
}

.good-name { font-weight: 500; }
.good-price { color: var(--accent-gold); font-weight: 600; }
.good-tags { display: flex; gap: 0.3rem; }
.good-tags .tag {
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgba(201,168,76,0.1);
  color: var(--text-muted);
}
.tag-restricted { background: rgba(184,84,80,0.15); color: var(--accent-red); }
.tag-ritual { background: rgba(139,107,143,0.15); color: var(--accent-purple); }

.good-helper {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  line-height: 1.45;
}

.sell-penalty-helper {
  color: var(--accent-warm);
}

.trade-preview {
  background: linear-gradient(180deg, rgba(250,242,219,0.96), rgba(230,215,183,0.94));
  border: 1px solid rgba(201,168,76,0.16);
  border-radius: 16px;
  padding: 0.9rem;
  margin-top: 0.65rem;
  color: #352a1f;
  box-shadow: 0 14px 28px rgba(0,0,0,0.14);
}

.trade-preview h4 { color: #5b4022; margin-bottom: 0.2rem; }

.market-preview-card {
  margin-top: 0.65rem;
  padding: 0.68rem 0.74rem;
  border-radius: 12px;
  border: 1px solid rgba(91,64,34,0.14);
  background: rgba(255,251,240,0.72);
}

.market-preview-head {
  display: grid;
  gap: 0.18rem;
}

.market-preview-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7b5a2e;
}

.market-preview-summary {
  font-size: 0.72rem;
  line-height: 1.38;
  color: #5f4c37;
}

.market-preview-meta {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #6a553f;
}

.market-preview-list {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.7rem;
}

.market-preview-list-item {
  padding: 0.48rem 0.58rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.32);
  border: 1px solid rgba(91,64,34,0.10);
  font-size: 0.75rem;
  line-height: 1.46;
  color: #5f4c37;
}

.upgrade-card {
  border-color: rgba(201,168,76,0.35);
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(45,39,34,0.95));
}

.upgrade-visual-card {
  grid-template-columns: 84px minmax(0, 1fr) minmax(120px, 150px);
}

.visual-good-card {
  grid-template-columns: 72px minmax(0, 1fr) minmax(112px, 132px);
  gap: 0.62rem;
  padding: 0.7rem;
  border-radius: 12px;
  border-color: rgba(91,64,34,0.12);
  background:
    radial-gradient(circle at top left, rgba(188,146,67,0.08), transparent 45%),
    linear-gradient(180deg, rgba(255,249,236,0.96), rgba(241,229,202,0.94));
}

.simple-market-card {
  align-items: flex-start;
}

.market-card-focused {
  border-color: rgba(201,168,76,0.44);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.12), 0 18px 26px rgba(0,0,0,0.18);
}

.good-card-owned-only {
  border-style: dashed;
  border-color: rgba(125,110,92,0.75);
}

.good-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.good-icon-shell {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,242,208,0.96), rgba(187,146,67,0.8));
  border: 2px solid rgba(201,168,76,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(0,0,0,0.22), 0 0 0 4px rgba(255,255,255,0.02);
}

.good-icon {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.good-stack-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  min-width: 28px;
  height: 28px;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(15,12,10,0.88);
  border: 1px solid rgba(201,168,76,0.34);
  color: var(--text-primary);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.good-main {
  min-width: 0;
}

.good-headline {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.good-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.28rem;
}

.good-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(201,168,76,0.12);
  color: var(--accent-gold);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.good-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.good-name {
  font-size: 1rem;
  font-weight: 600;
  color: #2f241b;
}

.good-price-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.mini-coin,
.inline-ui-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
}

.good-helper {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.48;
  color: #5f4c37;
  min-height: 1.2rem;
}

.good-quickline {
  margin-top: 0.24rem;
  font-size: 0.72rem;
  line-height: 1.36;
  color: #5f4c37;
}

.good-transaction-panel {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding: 0;
}

.good-transaction-row {
  display: grid;
  gap: 0.1rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(91,64,34,0.10);
  background: rgba(255,255,255,0.38);
}

.good-transaction-row strong {
  font-size: 0.73rem;
  color: #4c3a28;
}

.good-helper:empty,
.good-quickline:empty {
  display: none;
}

.good-transaction-row span {
  font-size: 0.74rem;
  line-height: 1.42;
  color: #5f4c37;
}

.good-transaction-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.good-transaction-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7b5a2e;
}

.good-transaction-hint {
  font-size: 0.72rem;
  color: #6f5a43;
}

.good-transaction-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.market-stat-pill {
  display: grid;
  gap: 0.12rem;
  padding: 0.42rem 0.45rem;
  border-radius: 10px;
  background: rgba(53,42,31,0.08);
  border: 1px solid rgba(91,64,34,0.10);
}

.market-stat-pill.tone-cost {
  background: rgba(184,84,80,0.08);
}

.market-stat-pill.tone-profit {
  background: rgba(107,143,94,0.10);
}

.market-stat-pill.tone-cargo {
  background: rgba(91,123,158,0.10);
}

.market-stat-pill.tone-bad {
  background: rgba(184,84,80,0.14);
  border-color: rgba(184,84,80,0.24);
}

.market-stat-label {
  font-size: 0.63rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a6650;
}

.market-stat-value {
  font-size: 0.8rem;
  color: #2f241b;
}

.good-transaction-note {
  font-size: 0.74rem;
  line-height: 1.5;
  color: #6a553f;
}

.good-transaction-note.tone-bad {
  color: #934c48;
}

.good-transaction-note.tone-warn {
  color: #9a6b2a;
}

.good-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
}

.btn-visual-action {
  width: 100%;
}

.good-cap-note {
  color: #6b5742;
  font-size: 0.72rem;
  line-height: 1.4;
}

.upgrade-copy,
.upgrade-status {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #5f4c37;
  margin-top: 0.35rem;
}

.upgrade-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.upgrade-state {
  color: var(--accent-green);
  font-size: 0.82rem;
  font-weight: 600;
}

.trade-controls { display: flex; gap: 0.5rem; align-items: center; margin: 0.8rem 0; }
.trade-controls input[type="number"] {
  width: 60px; padding: 0.3rem; text-align: center;
  background: var(--bg-dark); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius);
}

/* ============ TRAVEL/ROUTES ============ */
.routes-list { display: flex; flex-direction: column; gap: 0.5rem; }

.route-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}
.route-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201,168,76,0.42);
  background: linear-gradient(180deg, rgba(61,52,42,0.92), rgba(44,37,31,0.96));
  box-shadow: 0 16px 30px rgba(0,0,0,0.24), 0 0 14px rgba(201,168,76,0.16);
}

.route-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
  border-color: rgba(125,110,92,0.36);
  background: linear-gradient(180deg, rgba(44,38,34,0.9), rgba(28,24,21,0.96));
}

.route-card.is-disabled:hover {
  transform: none;
  border-color: rgba(125,110,92,0.42);
  box-shadow: none;
  background: linear-gradient(180deg, rgba(44,38,34,0.9), rgba(28,24,21,0.96));
}

.route-card-note {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.route-kicker {
  grid-column: 1 / -1;
  font-size: 0.73rem;
  color: var(--accent-gold);
}

.visual-route-card {
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: stretch;
  padding: 0.8rem;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(43,37,31,0.92), rgba(27,23,19,0.96));
  border-color: rgba(201,168,76,0.14);
}

.route-art {
  border-radius: 14px;
  overflow: hidden;
  min-height: 112px;
  background: rgba(20,17,15,0.88);
}

.route-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1) contrast(1.03) brightness(0.92);
}

.route-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
}

.route-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.route-meta-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.route-dest {
  font-family: var(--font-story);
  font-size: 1.16rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
}
.route-info {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.route-danger {
  font-size: 0.78rem;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  align-self: start;
  margin-top: 0.15rem;
}
.danger-low { background: rgba(107,143,94,0.2); color: var(--accent-green); }
.danger-med { background: rgba(212,138,60,0.2); color: var(--accent-warm); }
.danger-high { background: rgba(184,84,80,0.2); color: var(--accent-red); }

/* ============ EVENTS ============ */
.event-title {
  font-family: var(--font-story);
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.event-body {
  margin-bottom: 1.2rem;
}

.companion-aside {
  font-family: var(--font-story);
  font-style: italic;
  color: var(--accent-teal);
  font-size: 0.88rem;
  padding: 0.5rem 0.8rem;
  border-left: 2px solid var(--accent-teal);
  margin-bottom: 1rem;
  display: none;
}

.choices-list { display: flex; flex-direction: column; gap: 0; }

.visual-choice {
  display: flex;
  align-items: stretch;
  gap: 0.8rem;
  padding: 0.85rem 0.9rem;
  border-left-width: 4px;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  background: linear-gradient(180deg, rgba(46,39,33,0.96), rgba(31,26,22,0.98));
  box-shadow: 0 10px 18px rgba(0,0,0,0.16);
}

.visual-choice:hover:not(:disabled) {
  transform: translateX(4px) translateY(-1px);
  border-left-color: var(--accent-gold);
  box-shadow: 0 16px 24px rgba(0,0,0,0.22), 0 0 0 1px rgba(201,168,76,0.16);
  background: linear-gradient(180deg, rgba(56,48,39,0.98), rgba(33,28,23,0.98));
}

.visual-choice:active:not(:disabled) {
  transform: translateX(2px) scale(0.992);
}

.choice-icon-shell {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,245,220,0.96), rgba(180,136,52,0.82));
  border: 2px solid rgba(201,168,76,0.38);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

.choice-icon {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.choice-copy {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}

.choice-kicker {
  color: var(--accent-gold);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.choice-text {
  font-size: 0.9rem;
  line-height: 1.48;
  color: var(--text-primary);
}

.choice-helper {
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.choice-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.2rem;
}

.choice-effects-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.18rem;
}

.choice-effect-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(201,168,76,0.14);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.choice-effect-chip.tone-good,
.choice-effect-chip.tone-companion {
  background: rgba(107,143,94,0.16);
  color: #d8e7cf;
}

.choice-effect-chip.tone-bad {
  background: rgba(184,84,80,0.16);
  color: #f0cbc7;
}

.choice-effect-chip.tone-unlock {
  background: rgba(201,168,76,0.18);
  color: #f0ddaa;
}

.choice-effect-chip.tone-item,
.choice-effect-chip.tone-soft {
  background: rgba(91,123,158,0.16);
  color: #d1dceb;
}

/* ============ JOURNAL ============ */
.journal-entries { display: flex; flex-direction: column; gap: 0.5rem; }

.journal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}

.journal-card .j-day { color: var(--accent-gold); font-size: 0.75rem; font-weight: 600; }
.journal-card .j-node { color: var(--text-secondary); font-size: 0.78rem; }
.journal-card .j-text { font-family: var(--font-story); font-size: 0.88rem; margin-top: 0.3rem; line-height: 1.6; }

/* ============ ENDING ============ */
.ending-content {
  font-family: var(--font-story);
  font-size: 1.1rem;
  line-height: 2;
  text-align: center;
  max-width: 600px;
  margin: 3rem auto 2rem;
  color: var(--text-primary);
}

.ending-illustration {
  width: min(100%, 760px);
  aspect-ratio: 16 / 6;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(201,168,76,0.24);
  background: rgba(36,31,26,0.95);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}

.ending-echoes {
  width: min(100%, 760px);
  margin: 0 auto 1rem;
}

.ending-summary {
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 500px;
  margin: 0 auto 2rem;
  font-size: 0.88rem;
}

.ending-summary h4 { color: var(--accent-gold); margin-bottom: 0.8rem; }

.ending-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.95rem;
}

.ending-summary-card {
  display: grid;
  gap: 0.14rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.12);
}

.ending-summary-card span {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.ending-summary-card strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.ending-summary-section {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.35rem;
}

.ending-summary-copy-muted {
  margin-top: 0.85rem;
  color: var(--text-muted);
}

.ending-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ============ STATUS PANEL ============ */
.hud-card {
  background: linear-gradient(180deg, rgba(28,24,20,0.94), rgba(18,15,13,0.96));
  border: 1px solid rgba(201,168,76,0.16);
  border-radius: 22px;
  box-shadow: 0 18px 36px rgba(0,0,0,0.28);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.hud-card-primary {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  padding: 1rem 1rem 0.35rem;
}

.hud-card-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  margin-bottom: 0.7rem;
}

.tripbook-priority-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.tripbook-priority-card {
  display: grid;
  gap: 0.18rem;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.16);
  background: linear-gradient(180deg, rgba(35,30,25,0.92), rgba(22,19,16,0.96));
}

.tripbook-priority-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.tripbook-priority-value {
  font-size: 1.04rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.status-section {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.status-section-collapsible {
  padding-bottom: 0.9rem;
}

.status-section h4 {
  font-size: 0.78rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.stat-row {
  display: flex; justify-content: space-between;
  padding: 0.15rem 0;
  color: var(--text-secondary);
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-row span:last-child { color: var(--text-primary); font-weight: 500; }

.status-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(201,168,76,0.16);
  background: rgba(255,255,255,0.03);
  color: var(--accent-gold);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-align: left;
}

.status-toggle:hover {
  border-color: rgba(201,168,76,0.32);
  color: var(--text-primary);
}

.status-collapsible-body {
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
}

.status-collapsible-body.collapsed {
  max-height: 0;
  margin-top: 0;
}

.status-collapsible-body.expanded {
  max-height: 420px;
  margin-top: 0.75rem;
}

.quality-bar {
  display: grid;
  grid-template-columns: 60px 1fr 24px;
  gap: 0.4rem;
  align-items: center;
  margin: 0.3rem 0;
}

.quality-bar label { font-size: 0.75rem; color: var(--text-secondary); }

.bar {
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.bar-val { font-size: 0.72rem; color: var(--text-muted); text-align: right; }

.renown { background: var(--accent-gold); }
.heat { background: var(--accent-red); }
.trust { background: var(--accent-green); }
.forest { background: var(--accent-teal); }
.taint { background: var(--accent-purple); }
.oath { background: var(--accent-warm); }

/* Companion card */
.companion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
}
.companion-card .c-name { color: var(--accent-teal); font-weight: 600; font-size: 0.85rem; }
.companion-card .c-state { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }
.companion-card .c-bars { margin-top: 0.4rem; }

/* Inventory */
.inventory-list { display: flex; flex-direction: column; gap: 0.2rem; }
.inv-item {
  display: flex; justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.inv-item .inv-name { color: var(--text-secondary); display: inline-flex; align-items: center; gap: 0.45rem; }
.inv-item .inv-qty { color: var(--text-primary); }
.inv-item .inv-cond { font-size: 0.7rem; margin-left: 0.3rem; }
.cond-blessed { color: var(--accent-gold); }
.cond-cursed { color: var(--accent-red); }
.cond-damaged { color: var(--text-muted); }

.inventory-good-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.map-shell {
  position: relative;
  padding: 0.7rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(36,31,26,0.94), rgba(15,13,11,0.96));
  border: 1px solid rgba(201,168,76,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 16px 30px rgba(0,0,0,0.24);
}

.status-section-inventory {
  border-bottom: 0;
  padding-bottom: 0.15rem;
}

.status-section-utility {
  display: grid;
  gap: 0.6rem;
}

.tripbook-utility-stack {
  display: grid;
  gap: 0.55rem;
}

.tripbook-utility-btn {
  width: 100%;
  justify-content: center;
  gap: 0.55rem;
}

.tripbook-utility-note {
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.pending-event-inline {
  color: var(--accent-gold);
  font-style: italic;
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 7rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  width: min(92vw, 620px);
  pointer-events: none;
}

.toast {
  background: linear-gradient(180deg, rgba(37,31,26,0.96), rgba(24,20,17,0.98));
  border: 1px solid var(--accent-gold);
  border-radius: 14px;
  padding: 0.85rem 1.25rem;
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--text-primary);
  min-width: min(92vw, 320px);
  max-width: min(92vw, 620px);
  width: 100%;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 5.7s forwards;
  box-shadow: 0 10px 24px var(--shadow);
}

@media (max-width: 900px) {
  .toast-container {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8.5rem);
  }
}
.toast-warn { border-color: var(--accent-red); }
.toast-success { border-color: var(--accent-green); }

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

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center; align-items: center;
  z-index: 900;
  padding: 1.25rem 1rem;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  max-width: 620px;
  width: 90%;
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.modal h3 { color: var(--accent-gold); margin-bottom: 0; }

#modal-body {
  display: grid;
  gap: 0.75rem;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.modal-copy {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.modal-copy-empty {
  padding: 0.7rem 0.85rem;
  border: 1px dashed rgba(201,168,76,0.24);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
}

.save-slot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s;
  display: grid;
  gap: 0.7rem;
}
.save-slot:hover { border-color: var(--accent-gold); }

.save-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.save-slot-copy {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}

.save-slot .slot-name {
  font-weight: 600;
  color: var(--text-primary);
}

.slot-summary {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.slot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.slot-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.14);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.btn-danger {
  border-color: rgba(184,84,80,0.45);
  color: #f0c0bd;
}

.btn-danger:hover {
  background: rgba(184,84,80,0.12);
  border-color: rgba(184,84,80,0.75);
}

/* ============ HINT OVERLAY ============ */
.hint-overlay {
  position: fixed;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 800;
  width: min(92vw, 720px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.hint-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}

.hint-box {
  background: linear-gradient(180deg, rgba(36,30,24,0.98), rgba(20,16,13,0.99));
  border: 1px solid var(--accent-gold);
  border-radius: 18px;
  padding: 1rem 1.15rem;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: 0 10px 30px var(--shadow);
  transform: scale(0.985);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  pointer-events: auto;
}

.hint-overlay.is-visible .hint-box {
  transform: scale(1);
  box-shadow: 0 14px 34px rgba(0,0,0,0.42);
}

.hint-box p {
  font-family: var(--font-story);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--text-primary);
  line-height: 1.6;
  flex: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .game-layout {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .scene-stage {
    padding: 0.8rem;
  }

  .scene-header {
    position: static;
    transform: none;
    width: 100%;
    min-width: 0;
    flex-direction: column;
  }

  .scene-header-tools {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  .scene-support-strip {
    width: 100%;
  }

  .support-drawer {
    position: fixed;
    top: auto;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.8rem;
    width: auto;
    height: min(76vh, 780px);
    transform: translateY(24px);
  }

  .support-drawer-map,
  .support-drawer-map[aria-hidden="false"],
  .support-drawer-status,
  .support-drawer-status[aria-hidden="false"] {
    left: 0.8rem;
    right: 0.8rem;
    transform: translateY(24px);
  }

  .support-drawer[aria-hidden="false"] {
    transform: translateY(0);
  }

  .hud-card-primary {
    max-height: none;
  }

  .location-illustration {
    aspect-ratio: 4 / 5;
    max-height: none;
  }

  .scene-views {
    margin-top: auto;
  }
}

/* ============ ROOT RUNTIME READABILITY PASS ============ */
.scene-views {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
}

.view.active {
  min-height: 0;
}

.view-story-sheet {
  max-height: min(calc(100dvh - 2.4rem), 920px);
  overflow-y: auto;
}

.story-sheet-copy {
  display: grid;
  gap: 0.85rem;
}

.story-sheet-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -0.1rem;
}

.btn-event-retreat {
  margin-top: 0;
}

.story-sheet-copy-ending {
  padding-bottom: 0.4rem;
}

.sheet-header-market {
  align-items: flex-start;
}

.market-sheet-main,
.work-list,
.routes-list,
.story-sheet-copy,
.work-log-shell {
  min-width: 0;
}

.btn,
.market-assist-card,
.route-card,
.good-card,
.support-orb,
.minimap-access,
.btn-lane-orb {
  outline-offset: 3px;
}

.btn:focus-visible,
.market-assist-card:focus-visible,
.route-card:focus-visible,
.good-card:focus-visible,
.support-orb:focus-visible,
.minimap-access:focus-visible,
.btn-lane-orb:focus-visible {
  outline: 2px solid rgba(212,168,67,0.65);
}

@media (max-width: 900px) {
  .hint-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .hint-box .btn {
    align-self: flex-end;
  }

  .quest-tracker-status-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============ LOCATION ILLUSTRATION ============ */
.location-illustration {
  width: 100%;
  aspect-ratio: 3/2;
  max-height: 45vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.2rem;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.location-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.location-illustration img.loaded {
  opacity: 1;
}

.media-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.3rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(45,39,34,0.88), rgba(18,14,12,0.98));
}

.media-fallback-kicker {
  color: var(--accent-gold);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-fallback-detail {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
  word-break: break-word;
}

.location-illustration::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--bg-dark));
  pointer-events: none;
}

/* ============ COMPANION PORTRAIT ============ */
.companion-portrait {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.companion-portrait img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--accent-teal);
  opacity: 0;
  transition: opacity 0.4s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.companion-portrait img.loaded {
  opacity: 1;
}

/* ============ EVENT ILLUSTRATION ============ */
.event-illustration {
  width: 100%;
  aspect-ratio: 3/2;
  max-height: 35vh;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.event-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85) contrast(1.1);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.event-illustration img.loaded {
  opacity: 1;
}

.event-illustration::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50px;
  background: linear-gradient(transparent, var(--bg-dark));
  pointer-events: none;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* State change animation */
.flash-change {
  animation: flashGold 0.6s ease;
}
@keyframes flashGold {
  0%, 100% { color: inherit; }
  50% { color: var(--accent-gold); text-shadow: 0 0 8px rgba(201,168,76,0.4); }
}

/* ============ MOOD LINE ============ */
.mood-line {
  font-family: var(--font-story);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  opacity: 0.8;
}

/* ============ TRAVEL TRANSITION ============ */
.travel-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    linear-gradient(180deg, rgba(15,13,11,0.92), rgba(15,13,11,0.96)),
    url('assets/backgrounds/loc_ben_lua_real.png') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.travel-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.travel-text {
  font-family: var(--font-story);
  font-size: 1.1rem;
  color: var(--text-primary);
  text-align: center;
  max-width: 520px;
  line-height: 1.8;
  padding: 1.2rem 1.35rem;
  border-radius: 20px;
  border: 1px solid rgba(201,168,76,0.18);
  background: rgba(17,15,13,0.6);
  backdrop-filter: blur(10px);
  animation: travelFade 2s ease;
}

.travel-text .travel-dest {
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 1.3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.travel-text .travel-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.travel-progress {
  width: 200px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 1.5rem;
  overflow: hidden;
}

.travel-progress-bar {
  height: 100%;
  background: var(--accent-gold);
  border-radius: 1px;
  width: 0%;
  transition: width 1.5s ease;
}

@keyframes travelFade {
  0% { opacity: 0; transform: translateY(20px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* ============ TITLE SCREEN MIST ============ */
.title-bg .mist-layer {
  position: absolute;
  top: 0; left: 0; width: 200%; height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(201,168,76,0.03) 20%,
    transparent 40%,
    rgba(201,168,76,0.02) 60%,
    transparent 80%,
    rgba(201,168,76,0.03) 100%);
  animation: mistDrift 25s linear infinite;
  pointer-events: none;
}

@keyframes mistDrift {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ QUANTITY STEPPER ============ */
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(53,42,31,0.06);
}

.qty-stepper button {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.qty-stepper button:hover { border-color: var(--accent-gold); }

.qty-stepper .qty-value {
  font-size: 0.82rem;
  min-width: 36px;
  text-align: center;
  color: #2f241b;
  font-weight: 700;
}

.market-total-preview {
  margin-top: 0.5rem;
  padding: 0.7rem 0.8rem;
  background: rgba(53,42,31,0.08);
  border-radius: 12px;
  font-size: 0.8rem;
  color: #5f4c37;
  border: 1px solid rgba(91,64,34,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
}

.market-total-preview-hero {
  background: linear-gradient(180deg, rgba(255,249,236,0.76), rgba(238,225,196,0.62));
}

.market-total-preview .preview-cost {
  color: var(--accent-gold);
  font-weight: 600;
}

.market-total-preview .preview-after {
  color: var(--text-muted);
}

.market-preview-note {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.15rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #5f4c37;
  padding: 0.8rem 0.85rem 0;
  border-top: 1px dashed rgba(91,64,34,0.22);
}

.market-preview-note strong {
  color: #4f3820;
}

.market-preview-note-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7b5a2e;
}

/* ============ AMBIENT AUDIO INDICATOR ============ */
.audio-control {
  position: fixed;
  bottom: 0.8rem;
  right: 0.8rem;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 176px;
  min-height: 42px;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.audio-control:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.audio-control-btn {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
  font-family: var(--font-body);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.audio-control-btn:hover,
.audio-control-btn:focus-visible {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.audio-control-btn:active {
  transform: scale(0.97);
}

.audio-toggle {
  min-width: 112px;
  min-height: 34px;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.audio-adjust {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.audio-adjust:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.audio-control.muted {
  opacity: 0.72;
}

.audio-control.ready {
  border-color: rgba(201,168,76,0.45);
  color: var(--text-primary);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.audio-icon {
  font-size: 0.84rem;
}

.audio-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ============ LOCATION LABEL OVERLAY ============ */
.location-illustration .loc-label {
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-family: var(--font-story);
  font-size: 1rem;
  color: var(--accent-gold);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  z-index: 2;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ending-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.7s ease;
  filter: saturate(0.96) contrast(1.04);
}

.ending-illustration img.loaded {
  opacity: 1;
}

@media (max-width: 900px) {
  .goods-list {
    grid-template-columns: 1fr;
  }

  .visual-good-card,
  .visual-route-card {
    grid-template-columns: 1fr;
  }

  .market-foyer-grid {
    grid-template-columns: 1fr;
  }

  .good-transaction-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-bar-lanes,
  .ending-summary-grid {
    grid-template-columns: 1fr;
  }

  .work-card,
  .quest-tracker-head {
    flex-direction: column;
  }

  .good-actions {
    align-items: flex-start;
  }

  .title-pill-row,
  .view-focus,
  .view-focus-event {
    grid-template-columns: 1fr;
  }

  .scene-support-strip {
    grid-template-columns: 1fr;
  }

  .hud-resource-strip,
  .scene-badges {
    justify-content: flex-start;
  }

  .focus-chip {
    min-height: unset;
  }

  .audio-control {
    right: 0.55rem;
    bottom: 0.55rem;
  }

  .ending-illustration {
    aspect-ratio: 4 / 3;
  }
}

/* ============ SECOND PASS UI OVERRIDES ============ */
.panel-center {
  background: #120f0d;
}

.scene-stage {
  padding: 1rem 1rem 1.35rem;
  overflow: hidden;
}

.scene-header {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(240px, 1fr) minmax(0, 236px);
  gap: 0.9rem;
  align-items: start;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  width: auto;
  transform: none;
  z-index: 9;
}

.scene-header-left,
.scene-header-center,
.scene-header-right {
  min-width: 0;
}

.scene-header-left {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
}

.scene-header-center {
  display: grid;
  gap: 0.32rem;
  justify-items: center;
}

.scene-header-right {
  display: flex;
  justify-content: flex-end;
}

.scene-header-copy {
  grid-column: 1 / 2;
  display: grid;
  gap: 0;
  max-width: 320px;
}

.scene-header-copy .flow-status-banner {
  display: block;
}

.scene-badges {
  justify-content: center;
  gap: 0.45rem;
}

.location-badge {
  background: rgba(46,42,37,0.74);
  padding: 0.45rem 1rem;
  border: 1px solid rgba(201,168,76,0.38);
  color: #f0e3c4;
  font-family: var(--font-story);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 22px rgba(0,0,0,0.24);
}

.time-badge {
  background: rgba(46,42,37,0.66);
  padding: 0.38rem 0.75rem;
  border: 1px solid rgba(160,120,64,0.24);
  color: rgba(245,236,215,0.82);
  font-size: 0.82rem;
}

.tone-badge {
  background: rgba(46,42,37,0.6);
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(160,120,64,0.22);
  color: rgba(245,236,215,0.72);
  font-size: 0.74rem;
}

.route-note,
.flow-status-banner {
  padding: 0.62rem 0.8rem;
  font-size: 0.74rem;
  line-height: 1.42;
  color: rgba(232,220,200,0.84);
  background: linear-gradient(180deg, rgba(16,14,12,0.68), rgba(29,24,20,0.72));
}

.flow-status-banner {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.hud-resource-strip {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  background: rgba(46,42,37,0.75);
  border: 2px solid rgba(160,120,64,0.34);
  border-radius: 30px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

.hud-resource-chip {
  gap: 0.45rem;
  padding: 0.48rem 0.9rem;
  border-right: 1px solid rgba(201,168,76,0.16);
  border-radius: 0;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  background: transparent;
  font-size: 0.84rem;
  min-height: 52px;
}

.hud-resource-chip:last-child {
  border-right: 0;
}

.hud-resource-chip .inline-ui-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0.22rem;
  background: radial-gradient(circle at 35% 35%, rgba(255,244,219,0.94), rgba(195,151,69,0.86));
  border: 2px solid rgba(160,120,64,0.5);
  box-shadow: 0 0 10px rgba(201,168,76,0.16);
}

.support-orb {
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(160,120,64,0.48);
  background: radial-gradient(circle at 30% 30%, rgba(255,244,219,0.98), rgba(188,146,67,0.88));
  color: #231a13;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.22), 0 0 10px rgba(201,168,76,0.12);
}

.support-orb:hover,
.support-orb[aria-expanded="true"] {
  transform: scale(1.06);
  border-color: rgba(212,168,67,0.72);
  box-shadow: 0 14px 28px rgba(0,0,0,0.26), 0 0 20px rgba(212,168,67,0.28);
  filter: brightness(0.97);
}

.support-orb-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.support-orb-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.minimap-access {
  display: grid;
  gap: 0.3rem;
  padding: 0.28rem;
  width: 200px;
  border-radius: 18px;
  border: 2px solid rgba(160,120,64,0.38);
  background: rgba(46,42,37,0.66);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.minimap-access:hover,
.minimap-access[aria-expanded="true"] {
  transform: translateY(-2px);
  border-color: rgba(212,168,67,0.65);
  box-shadow: 0 14px 26px rgba(0,0,0,0.26), 0 0 16px rgba(201,168,76,0.18);
}

.minimap-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 200 / 140;
  overflow: hidden;
  border-radius: 12px;
  background: #dfd3b4;
}

.minimap-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.minimap-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 2px solid rgba(20,16,13,0.92);
  box-shadow: 0 0 0 0 rgba(212,168,67,0.72);
  transform: translate(-50%, -50%);
  animation: minimapPulse 2s ease-in-out infinite;
}

.minimap-compass {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 30px;
  height: 30px;
  opacity: 0.78;
}

.minimap-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.35rem 0.15rem;
}

.minimap-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.minimap-value {
  font-size: 0.76rem;
  color: rgba(245,236,215,0.8);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes minimapPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,168,67,0.7); }
  50% { box-shadow: 0 0 0 12px rgba(212,168,67,0); }
}

.scene-home-shell {
  min-height: 100%;
  display: grid;
  align-content: end;
  gap: 0.7rem;
  padding-top: clamp(13rem, 34vh, 20rem);
}

.action-bar {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  background: none;
}

.action-bar-lanes {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.9rem, 3vw, 2.2rem);
  width: 100%;
}

.scene-bottom-rail {
  width: min(100%, 880px);
  margin: 0 auto;
  padding: 0.9rem;
  border-radius: 26px;
  border: 1px solid rgba(201,168,76,0.15);
  background: linear-gradient(180deg, rgba(20,16,13,0.54), rgba(25,20,16,0.66));
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 36px rgba(0,0,0,0.28);
}

.btn-lane-orb {
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  min-width: 112px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-lane-orb:hover,
.btn-lane-orb:focus-visible {
  background: transparent;
  border: 0;
  transform: translateY(-2px);
}

.btn-lane-orb:active {
  transform: translateY(2px) scale(0.985);
}

.lane-orb-core {
  position: relative;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,244,219,0.98), rgba(188,146,67,0.82));
  border: 3px solid rgba(160,120,64,0.56);
  box-shadow: 0 12px 28px rgba(0,0,0,0.24), 0 0 14px rgba(201,168,76,0.14);
  animation: laneFloat 3.2s ease-in-out infinite;
}

.lane-orb-core::before,
.lane-orb-core::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(212,168,67,0.18);
}

.lane-orb-core::after {
  inset: -15px;
  border-color: rgba(212,168,67,0.1);
}

.btn-lane-orb-primary .lane-orb-core {
  width: 116px;
  height: 116px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28), 0 0 18px rgba(201,168,76,0.2);
}

.lane-orb-core-work { animation-delay: 0s; }
.lane-orb-core-market { animation-delay: 0.6s; }
.lane-orb-core-travel { animation-delay: 1.1s; }

.lane-orb-icon {
  width: 68%;
  height: 68%;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.26));
}

.lane-orb-label {
  font-family: var(--font-story);
  font-size: 1.08rem;
  color: #f0e3c4;
}

.lane-orb-meta {
  font-size: 0.74rem;
  color: rgba(232,220,200,0.8);
  text-align: center;
  max-width: 140px;
  line-height: 1.35;
}

@keyframes laneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.quest-tracker-card-home {
  margin-bottom: 0.65rem;
  background:
    radial-gradient(circle at top left, rgba(201,168,76,0.12), transparent 44%),
    linear-gradient(180deg, rgba(29,24,20,0.88), rgba(17,14,12,0.92));
}

.scene-home-note {
  margin: 0.2rem 0 0.45rem;
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.35;
  color: rgba(232,220,200,0.78);
}

.view-focus {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0.62rem;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(24,20,16,0.82), rgba(36,31,26,0.82)),
    var(--focus-art) center center / cover no-repeat;
}

.focus-chip {
  min-height: 72px;
  border-radius: 16px;
  background: rgba(12,10,8,0.44);
}

.focus-chip-detail {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scene-utility-bar {
  justify-content: center;
  margin-top: 0.85rem;
}

.mood-line {
  font-size: 0.88rem;
  color: rgba(245,236,215,0.92);
  text-shadow: 0 2px 8px rgba(0,0,0,0.65);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 0.1rem;
  padding: 0;
  border: 0;
  opacity: 0.92;
}

.location-illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  border-radius: 0;
  margin-bottom: 0;
  border: 0;
  box-shadow: none;
}

@media (min-width: 901px) {
  #screen-game .location-illustration {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    pointer-events: none;
    z-index: 0;
  }
}

.location-illustration img {
  filter: saturate(0.98) contrast(1.04) brightness(0.9);
}

.location-illustration::after {
  inset: 0;
  height: auto;
  background:
    radial-gradient(circle at 50% 58%, rgba(0,0,0,0.04), rgba(0,0,0,0.22) 62%, rgba(0,0,0,0.56) 100%),
    linear-gradient(to bottom, rgba(9,7,5,0.08), rgba(9,7,5,0.26) 42%, rgba(9,7,5,0.68) 100%);
}

.view-sheet {
  width: min(100%, 1040px);
  margin: auto auto 0;
  padding: 1rem;
  border-radius: 28px;
  border: 1px solid rgba(201,168,76,0.16);
  background: linear-gradient(180deg, rgba(20,16,13,0.84), rgba(18,15,13,0.9));
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 42px rgba(0,0,0,0.34);
  max-height: min(calc(100dvh - 2.4rem), 920px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
  position: sticky;
  top: 0;
  z-index: 3;
  padding-bottom: 0.65rem;
  background: linear-gradient(180deg, rgba(20,16,13,0.96), rgba(20,16,13,0.82) 78%, rgba(20,16,13,0));
}

.sheet-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.sheet-header h3 {
  font-family: var(--font-story);
  font-size: 1.45rem;
  line-height: 1.25;
  color: #f3e4c3;
}

.sheet-copy {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  line-height: 1.36;
  color: rgba(232,220,200,0.8);
}

.sheet-copy:empty {
  display: none;
}

.btn-close-circle {
  width: auto;
  min-width: 72px;
  height: 44px;
  padding: 0 0.95rem;
  border-radius: 999px;
}

.market-sheet-tools {
  display: grid;
  gap: 0.55rem;
  justify-items: end;
}

.market-sheet-economy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.market-sheet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.16);
  font-size: 0.76rem;
  color: rgba(232,220,200,0.86);
}

.market-sheet-body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.95fr);
  gap: 0.9rem;
  align-items: start;
}

.market-sheet-main {
  display: grid;
  gap: 0.85rem;
}

.market-assist-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.68rem 0.82rem;
  border-radius: 20px;
  border: 1px solid rgba(201,168,76,0.18);
  background: linear-gradient(180deg, rgba(46,39,33,0.84), rgba(31,26,22,0.88));
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(0,0,0,0.14);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.market-assist-card:hover {
  border-color: rgba(201,168,76,0.4);
  transform: translateY(-1px);
  filter: brightness(0.97);
}

.market-assist-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,244,219,0.96), rgba(190,146,67,0.82));
  border: 2px solid rgba(201,168,76,0.4);
  flex-shrink: 0;
}

.market-assist-icon .action-btn-icon {
  width: 30px;
  height: 30px;
}

.market-assist-copy {
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

.market-assist-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.market-assist-text {
  font-size: 0.74rem;
  line-height: 1.35;
  color: rgba(232,220,200,0.8);
}

.goods-list-market {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trade-preview {
  position: sticky;
  top: 0.6rem;
  border-radius: 20px;
  padding: 0.82rem;
  margin-top: 0;
}

.route-card-selected {
  border-color: rgba(201,168,76,0.4);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.1), 0 18px 28px rgba(0,0,0,0.22);
}

.route-actions-compact {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 0.1rem;
}

.upgrade-card.market-special-card {
  background: linear-gradient(135deg, rgba(201,168,76,0.14), rgba(45,39,34,0.95));
  border-width: 2px;
}

@media (max-width: 900px) {
  .scene-stage {
    padding: 0.8rem;
  }

  .scene-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .scene-header-left,
  .scene-header-center,
  .scene-header-right,
  .scene-header-copy {
    width: 100%;
    justify-items: center;
  }

  .scene-home-shell {
    padding-top: 1.25rem;
  }

  .location-illustration {
    aspect-ratio: auto;
  }

  .market-sheet-body {
    grid-template-columns: 1fr;
  }

  .goods-list-market {
    grid-template-columns: 1fr;
  }

  .action-bar-lanes {
    flex-wrap: wrap;
  }

  .lane-orb-core,
  .btn-lane-orb-primary .lane-orb-core {
    width: 92px;
    height: 92px;
  }

  .lane-orb-icon {
    width: 70%;
    height: 70%;
  }

  .minimap-access {
    width: min(200px, 100%);
  }

  .hud-resource-strip,
  .scene-badges {
    justify-content: center;
  }

  .view-sheet {
    max-height: min(calc(100dvh - 1.2rem), 100dvh);
    padding: 0.9rem;
  }

  .sheet-header {
    flex-wrap: wrap;
  }
}

/* ============ ROOT RUNTIME UI REBUILD OVERRIDES ============ */
.scene-stage {
  padding: 0.85rem 1rem 1rem;
  overflow: hidden;
}

.scene-header {
  grid-template-columns: minmax(0, 360px) minmax(260px, 1fr) minmax(0, 220px);
  top: 0.9rem;
  z-index: 9;
}

.scene-header-left {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.7rem;
}

.scene-header-center {
  gap: 0.26rem;
}

.scene-header-right {
  justify-content: flex-end;
}

.scene-header-copy {
  position: absolute;
  inset: auto auto auto -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.scene-badge-stack {
  display: grid;
  justify-items: center;
  gap: 0.22rem;
}

.scene-location-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.34);
  background: rgba(43,36,28,0.66);
  box-shadow: 0 12px 22px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
}

.scene-badge-divider {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,226,149,0.72);
}

.location-badge {
  background: transparent;
  padding: 0;
  border: 0;
  color: #f0e3c4;
  font-family: var(--font-story);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.time-badge {
  background: transparent;
  padding: 0;
  border: 0;
  color: rgba(245,236,215,0.82);
  font-size: 0.8rem;
}

.tone-badge {
  background: rgba(43,36,28,0.42);
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(160,120,64,0.16);
  color: rgba(245,236,215,0.64);
  font-size: 0.7rem;
}

.hud-resource-strip {
  background: rgba(46,42,37,0.68);
  border-color: rgba(160,120,64,0.3);
  box-shadow: 0 12px 26px rgba(0,0,0,0.24);
}

.support-orb {
  width: 58px;
  height: 58px;
}

.support-orb-icon {
  width: 30px;
  height: 30px;
}

.support-orb-label {
  font-size: 0.62rem;
}

.minimap-access {
  gap: 0.25rem;
  width: 188px;
  border-radius: 16px;
  background: rgba(54,46,36,0.54);
  box-shadow: 0 12px 22px rgba(0,0,0,0.2);
}

.minimap-image {
  filter: saturate(1.08) brightness(1.06);
}

.scene-home-shell {
  grid-template-rows: 1fr auto;
  align-content: stretch;
  gap: 0;
  padding-top: 0;
}

.scene-hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.scene-hotspot {
  --hotspot-x: 22%;
  --hotspot-y: 49%;
  position: absolute;
  left: var(--hotspot-x);
  top: var(--hotspot-y);
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  pointer-events: auto;
  z-index: 5;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.22s ease;
  opacity: 0;
}

.scene-hotspot.is-positioned {
  animation: hotspotReveal 0.22s ease forwards;
}

.scene-hotspot-work.is-positioned {
  animation-delay: 0.02s;
}

.scene-hotspot-market.is-positioned {
  animation-delay: 0.09s;
}

.scene-hotspot-core {
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.scene-hotspot:not(.is-positioned) .scene-hotspot-core {
  opacity: 0;
  transform: scale(0.94);
}

.scene-hotspot.is-positioned .scene-hotspot-core {
  opacity: 1;
  transform: scale(1);
}

@keyframes hotspotReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scene-hotspot.is-positioned {
  opacity: 1;
}

.scene-hotspot:hover,
.scene-hotspot:focus-visible {
  background: transparent;
  border: 0;
  transform: translate(-50%, calc(-50% - 4px));
}

.scene-hotspot:active {
  transform: translate(-50%, calc(-50% + 2px)) scale(0.985);
}

.scene-hotspot-core {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,244,219,0.98), rgba(188,146,67,0.84));
  border: 3px solid rgba(160,120,64,0.56);
  box-shadow: 0 12px 28px rgba(0,0,0,0.22), 0 0 14px rgba(201,168,76,0.16);
  animation: laneFloat 3.2s ease-in-out infinite;
}

.scene-hotspot-core::before,
.scene-hotspot-core::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(212,168,67,0.18);
}

.scene-hotspot-core::after {
  inset: -15px;
  border-color: rgba(212,168,67,0.1);
}

.scene-hotspot-work .scene-hotspot-core {
  width: 104px;
  height: 104px;
  animation-delay: 0s;
}

.scene-hotspot-market .scene-hotspot-core {
  animation-delay: 0.65s;
}

.scene-hotspot-travel .scene-hotspot-core {
  animation-delay: 1.15s;
}

.scene-hotspot-icon {
  width: 68%;
  height: 68%;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.26));
}

.scene-hotspot-meta {
  position: absolute !important;
}

.scene-bottom-ribbon {
  align-self: center;
  width: min(100%, 720px);
  margin: auto auto 0;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding-bottom: 0.2rem;
  z-index: 6;
}

.scene-ribbon-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.16);
  background: rgba(24,18,13,0.54);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 34px rgba(0,0,0,0.24);
}

.scene-ribbon-btn {
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(160,120,64,0.4);
  background: radial-gradient(circle at 30% 30%, rgba(255,244,219,0.98), rgba(188,146,67,0.84));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0,0,0,0.22), 0 0 10px rgba(201,168,76,0.12);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.scene-ribbon-btn:hover,
.scene-ribbon-btn:focus-visible {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(212,168,67,0.68);
}

.scene-ribbon-btn:active {
  transform: translateY(1px) scale(0.985);
}

.scene-ribbon-icon {
  width: 28px;
  height: 28px;
}

.scene-runtime-keepalive {
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.scene-bottom-rail {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.location-illustration img {
  filter: saturate(1.04) contrast(1.02) brightness(1.07);
}

.location-illustration::after {
  background:
    radial-gradient(circle at 50% 56%, rgba(255,237,186,0.16), rgba(0,0,0,0.08) 48%, rgba(0,0,0,0.34) 100%),
    linear-gradient(to bottom, rgba(255,247,228,0.03), rgba(9,7,5,0.08) 38%, rgba(9,7,5,0.38) 100%);
}

.location-illustration .loc-label {
  top: 0.95rem;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  background: rgba(20,16,13,0.46);
  border: 1px solid rgba(201,168,76,0.14);
  font-size: 0.76rem;
  color: rgba(245,236,215,0.7);
  backdrop-filter: blur(6px);
}

.support-drawer-map {
  width: min(1380px, calc(100vw - 0.6rem));
}

.support-map-card {
  background:
    radial-gradient(circle at top, rgba(255,233,176,0.10), transparent 34%),
    linear-gradient(180deg, rgba(27,21,16,0.95), rgba(13,10,8,0.98));
}

.support-map-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(380px, 1.05fr);
  gap: 1.25rem;
  min-height: 100%;
}

.support-map-visual,
.support-map-sidebar {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  min-width: 0;
}

.map-shell {
  padding: 1.25rem;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(54,43,31,0.94), rgba(19,15,11,0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 20px 36px rgba(0,0,0,0.24);
}

#map-canvas {
  min-height: 760px;
  border-radius: 24px;
  background: radial-gradient(circle at top, rgba(255,244,214,0.10), transparent 48%), #1a140f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 18px 34px rgba(0,0,0,0.28);
}

.map-legend {
  margin-top: 0;
  padding: 0.8rem 0.95rem 0;
  font-size: 0.8rem;
  color: rgba(245,236,215,0.72);
  border-top: 0;
}

.map-node-info {
  margin-top: 0;
  padding: 1.2rem;
  background: linear-gradient(180deg, rgba(49,39,28,0.94), rgba(24,19,14,0.98));
  border-color: rgba(201,168,76,0.2);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 16px 28px rgba(0,0,0,0.22);
}

.map-route-focus {
  gap: 0.75rem;
  margin-top: 0;
}

.map-route-selection {
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 22px;
  border-color: rgba(201,168,76,0.2);
  background: linear-gradient(180deg, rgba(48,38,28,0.92), rgba(22,18,13,0.98));
  box-shadow: 0 18px 30px rgba(0,0,0,0.22);
}

.map-route-selection-copy {
  gap: 0.25rem;
}

.map-route-selection-title {
  font-family: var(--font-story);
  font-size: 1.38rem;
}

.map-route-selection-detail {
  font-size: 0.96rem;
}

.map-route-branches {
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 0.95rem;
}

.map-route-branch {
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.map-route-branch:hover,
.map-route-branch.is-selected {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(201,168,76,0.12), rgba(255,255,255,0.04));
  box-shadow: 0 14px 22px rgba(0,0,0,0.18);
}

.map-route-branch.is-disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.map-route-branch.is-disabled:hover {
  transform: none;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.map-route-branch-art {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(17,14,12,0.68);
  border: 1px solid rgba(201,168,76,0.18);
}

.map-route-branch-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.04) contrast(1.02) brightness(1.03);
}

.map-route-branch-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.map-route-branch-kicker {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,236,215,0.62);
}

.map-route-branch-name {
  font-family: var(--font-story);
  font-size: 1.2rem;
}

.map-route-branch-meta {
  font-size: 0.92rem;
  line-height: 1.45;
}

.map-route-branch-note {
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(245,236,215,0.72);
}

.map-route-branch-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.map-route-branch-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.48rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.12);
  font-size: 0.8rem;
  color: rgba(245,236,215,0.84);
}

.map-route-empty {
  padding: 1rem;
  border-radius: 18px;
  font-size: 0.8rem;
}

.view-sheet-travel {
  width: min(100%, 1180px);
  background:
    radial-gradient(circle at top, rgba(255,231,173,0.06), transparent 24%),
    linear-gradient(180deg, rgba(22,17,12,0.82), rgba(15,12,9,0.9));
}

.sheet-header-travel {
  margin-bottom: 1rem;
}

.travel-visual-stage {
  display: grid;
  gap: 0.9rem;
}

.travel-focus {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(42,34,24,0.84), rgba(28,22,16,0.8)),
    var(--focus-art) center center / cover no-repeat;
}

.travel-route-shell {
  display: grid;
  gap: 0.75rem;
}

.travel-route-canvas-ghost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(201,168,76,0.16);
  background: linear-gradient(180deg, rgba(47,37,27,0.74), rgba(24,19,14,0.78));
  color: rgba(245,236,215,0.8);
}

.travel-route-ghost-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.travel-route-ghost-copy {
  font-size: 0.78rem;
  line-height: 1.42;
  text-align: right;
}

.routes-list-visual {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

.route-card-compact {
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 0.8rem;
}

.route-card-confirm {
  grid-template-columns: 200px minmax(0, 1fr) auto;
  background: linear-gradient(180deg, rgba(58,46,31,0.92), rgba(30,24,18,0.98));
}

.route-art img {
  filter: saturate(1.04) contrast(1.02) brightness(1.02);
}

.route-actions-compact {
  margin-top: 0.35rem;
}

.route-card-selected .route-kicker {
  color: #f2dfaa;
}

.route-card-selected .route-danger {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 8px 18px rgba(0,0,0,0.2);
}

@media (max-width: 900px) {
  .scene-header {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .scene-header-left {
    justify-content: center;
    flex-wrap: wrap;
  }

  .scene-header-right {
    justify-content: center;
  }

  .scene-hotspot {
    width: 72px;
    height: 72px;
  }

  .scene-hotspot-core,
  .scene-hotspot-work .scene-hotspot-core {
    width: 72px;
    height: 72px;
  }

  .scene-bottom-ribbon {
    width: 100%;
  }

  .scene-ribbon-actions {
    width: min(100%, 100%);
    flex-wrap: wrap;
  }

  .scene-ribbon-btn {
    width: 52px;
    height: 52px;
  }

  .support-map-grid {
    grid-template-columns: 1fr;
  }

  .travel-route-canvas-ghost {
    flex-direction: column;
    align-items: flex-start;
  }

  .travel-route-ghost-copy {
    text-align: left;
  }

  .routes-list-visual {
    grid-template-columns: 1fr;
  }

  .route-card-compact,
  .route-card-confirm {
    grid-template-columns: 1fr;
  }
}

/* ============ FINAL UI FIX ROUND OVERRIDES ============ */
@media (min-width: 901px) {
  .scene-stage {
    overflow: visible;
  }

  .view-sheet,
  .view-sheet-travel,
  .view-story-sheet {
    width: min(1240px, calc(100vw - 2rem));
    margin: clamp(5.25rem, 11vh, 6.7rem) auto 0;
    padding: 1.05rem 1.1rem 1.15rem;
    max-height: min(calc(100dvh - 7.1rem), 980px);
  }

  .story-sheet-copy {
    width: min(100%, 1080px);
    margin: 0 auto;
  }

  .market-sheet-body {
    grid-template-columns: minmax(0, 1.85fr) minmax(320px, 0.95fr);
  }

  .trade-preview {
    top: 0.3rem;
  }
}

.work-focus-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
  gap: 0.9rem;
  margin: 0 0 0.9rem;
  padding: 0.95rem;
  border-radius: 24px;
  border: 1px solid rgba(201,168,76,0.18);
  background:
    linear-gradient(135deg, rgba(24,20,16,0.84), rgba(36,31,26,0.78)),
    var(--focus-art) center center / cover no-repeat;
  box-shadow: 0 18px 32px rgba(0,0,0,0.22);
}

.work-focus-hero.work-focus-hero-compact {
  grid-template-columns: minmax(0, 1fr);
}

.work-focus-hero-main,
.work-focus-side {
  min-width: 0;
}

.work-focus-hero-main {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.work-focus-kicker,
.work-focus-side-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.work-focus-title {
  font-family: var(--font-story);
  font-size: 1.48rem;
  line-height: 1.25;
  color: #f3e4c3;
}

.work-focus-summary {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.work-focus-chip-row,
.quest-tracker-chip-row,
.work-card-state,
.work-card-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.work-focus-chip-row {
  margin-top: 0.1rem;
}

.work-focus-note {
  max-width: 100%;
  text-align: left;
}

@media (max-width: 900px) {
  .map-bottom-action-shell,
  .map-bottom-action-shell.is-ready {
    flex-direction: column;
    align-items: stretch;
  }

  .map-bottom-destination {
    text-align: center;
  }
}

.work-focus-side {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 0.9rem 0.95rem;
  border-radius: 20px;
  border: 1px solid rgba(201,168,76,0.14);
  background: rgba(15,12,10,0.48);
  backdrop-filter: blur(8px);
}

.work-focus-side-copy {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(232,220,200,0.84);
}

.work-focus-actions {
  display: grid;
  gap: 0.45rem;
}

.work-focus-actions .btn {
  justify-self: start;
}

.work-state-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(245,236,215,0.9);
  font-size: 0.72rem;
  line-height: 1.2;
}

.work-state-chip.tone-focus {
  background: rgba(201,168,76,0.16);
  color: #f2dfaa;
}

.work-state-chip.tone-live {
  background: rgba(107,143,94,0.16);
  color: #d8e7cf;
}

.work-state-chip.tone-locked {
  background: rgba(184,84,80,0.14);
  color: #f0cbc7;
}

.quest-tracker-card-status {
  margin-top: 0.55rem;
  padding: 0.95rem 1rem;
}

.quest-tracker-status-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.quest-tracker-status-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.12);
  background: rgba(15,12,10,0.34);
}

.quest-tracker-status-label {
  font-size: 0.68rem;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.quest-tracker-status-body {
  min-width: 0;
  display: grid;
  gap: 0.16rem;
}

.quest-tracker-status-title {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.quest-tracker-status-note {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.quest-tracker-card-sheet {
  margin: 0 0 0.9rem;
  padding: 0.85rem 0.95rem;
}

.quest-tracker-sheet-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.quest-tracker-sheet-copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.quest-tracker-sheet-copy h3 {
  font-family: var(--font-story);
  font-size: 1.08rem;
  line-height: 1.32;
  color: var(--text-primary);
}

.quest-tracker-card-sheet .quest-tracker-next {
  margin-top: 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.quest-tracker-card-sheet .quest-tracker-actions {
  margin-top: 0.55rem;
}

.work-list {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.9rem;
}

.work-list:empty {
  display: none;
}

.work-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  min-height: 196px;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  box-shadow: 0 14px 26px rgba(0,0,0,0.16);
}

.work-card.is-live {
  border-color: rgba(201,168,76,0.22);
}

.work-card.is-primary {
  border-color: rgba(201,168,76,0.34);
  background: linear-gradient(180deg, rgba(45,37,27,0.96), rgba(17,14,12,0.98));
  box-shadow: 0 18px 34px rgba(0,0,0,0.22);
}

.work-card-copy {
  gap: 0.45rem;
}

.work-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.work-card-title {
  font-family: var(--font-story);
  font-size: 1.08rem;
  line-height: 1.35;
}

.work-card-summary {
  font-size: 0.8rem;
  line-height: 1.55;
}

.work-card-actions {
  min-width: 150px;
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}

.work-card-action-note {
  max-width: 160px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(232,220,200,0.74);
  text-align: right;
}

.work-log-shell {
  margin-top: 0.85rem;
  padding-top: 0.8rem;
}

.work-log-shell.work-log-shell-quiet {
  margin-top: 0.45rem;
  padding-top: 0.55rem;
  border-top-color: rgba(201,168,76,0.08);
}

.work-log-shell.work-log-shell-quiet .work-log-header {
  color: rgba(201,168,76,0.74);
}

.work-log-shell.work-log-shell-quiet .journal-entries-compact {
  grid-template-columns: minmax(0, 1fr);
}

.work-log-shell.work-log-shell-quiet .journal-card {
  padding: 0.55rem 0.75rem;
  background: linear-gradient(180deg, rgba(19,15,13,0.82), rgba(14,11,10,0.88));
}

.journal-entries-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.journal-entries-compact .journal-card {
  padding: 0.7rem 0.85rem;
  background: linear-gradient(180deg, rgba(22,18,15,0.92), rgba(16,13,11,0.96));
}

@media (max-width: 900px) {
  .scene-stage {
    overflow: hidden;
  }

  .view-sheet,
  .view-story-sheet,
  .view-sheet-travel {
    width: 100%;
    margin-top: 0.75rem;
    max-height: min(calc(100dvh - 1.2rem), 100dvh);
    padding: 0.9rem;
  }

  .story-sheet-copy {
    width: 100%;
  }

  .work-focus-hero,
  .work-card,
  .quest-tracker-sheet-row {
    grid-template-columns: 1fr;
  }

  .quest-tracker-sheet-row {
    flex-direction: column;
  }

  .work-card-actions {
    min-width: 0;
    justify-items: stretch;
  }

  .work-card-actions .btn {
    width: 100%;
  }

  .work-card-action-note {
    max-width: none;
    text-align: left;
  }

  .work-list,
  .journal-entries-compact {
    grid-template-columns: 1fr;
  }
}
