/* ==========================================================================
   FOUR QUARTERS: SOVEREIGN DOMINION — STEAM PC GRAND STRATEGY ENGINE
   Architecture:
   - Strict 3-Row Non-Overlapping Grid (48px Top Bar | 1fr Map | 58px Bottom Dock)
   - body.menu-active completely hides all in-game HUD & notifications on Title Screen
   - Integrated Status & Chronicle Ticker (No floating popups overlapping menus!)
   ========================================================================== */

:root {
  --iron-abyss: #070605;
  --iron-dark: rgba(14, 11, 9, 0.98);
  --iron-mid: rgba(24, 19, 15, 0.98);
  --iron-plate: #282018;
  --iron-elevated: #362b20;

  --brass-bright: #faecc4;
  --brass-gold: #dfb466;
  --brass-main: #c89d54;
  --brass-dark: #856025;
  --brass-border: rgba(200, 157, 84, 0.55);
  --brass-subtle: rgba(200, 157, 84, 0.28);

  --ivory-bright: #fcf7eb;
  --ivory-mid: #e5d8c1;
  --ivory-dim: #b5a489;

  --crimson-wax: #b91c1c;
  --crimson-bright: #ef4444;
  --lapis-blue: #1d4ed8;
  --verdigris-green: #15803d;
  --emerald-bright: #22c55e;

  --font-display: "Cinzel", "Palatino Linotype", "Book Antiqua", "Trajan Pro", Georgia, serif;
  --font-ui: "Segoe UI", "Candara", "Optima", system-ui, -apple-system, sans-serif;

  --chamfer-sm: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  --chamfer-md: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px);
  --shadow-plinth: 0 14px 36px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(250, 236, 196, 0.14);

  --transition-fast: 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-normal: 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #c89d54 #0b0806;
}

/* Custom Forged-Brass & Obsidian Iron Game Scrollbars (Zero Browser Default Scrollbars) */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: #0a0806;
  border-left: 1px solid rgba(200, 157, 84, 0.22);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.9);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e5be73 0%, #b38337 50%, #78541d 100%);
  border: 1px solid rgba(250, 236, 196, 0.65);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 3px rgba(0, 0, 0, 0.85);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #faecc4 0%, #dfb466 50%, #9c6f27 100%);
  border-color: #ffffff;
}

*::-webkit-scrollbar-thumb:active {
  background: #faecc4;
}

*::-webkit-scrollbar-corner {
  background: #0a0806;
}

html, body {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background-color: #06090e;
  color: var(--ivory-bright);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ui-scale-large {
  font-size: 16.5px;
}

/* CRITICAL: Hide all in-game HUD bars, sidebars & tooltips while Title Screen or Chamber is open */
body.menu-active .hud-top-bar,
body.menu-active .hud-side-left,
body.menu-active .hud-side-right,
body.menu-active .hud-bottom-dock,
body.menu-active .imperial-economy-bar,
body.menu-active .territory-tooltip {
  display: none !important;
}

body.menu-active .war-table-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "map";
}

.ui-svg-icon {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.gold-text {
  color: var(--brass-bright);
  font-weight: 800;
}

/* ==========================================================================
   AMBIENT WAR-ROOM EMBER & SPARKS CANVAS
   ========================================================================== */
.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 65;
}

/* ==========================================================================
   1. STEAM PC GRAND STRATEGY TITLE SCREEN (THE IMPERIAL MONOLITH)
   ========================================================================== */
.steam-title-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 48px 0 64px;
  background:
    linear-gradient(90deg, rgba(7, 6, 5, 0.97) 0%, rgba(12, 10, 8, 0.88) 38%, rgba(8, 12, 18, 0.38) 72%, rgba(7, 6, 5, 0.85) 100%);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.steam-title-screen.menu-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.title-screen-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.92);
  border: 2px solid rgba(200, 157, 84, 0.25);
  margin: 10px;
}

/* Left Architectural Monolith Spine */
.monolith-panel {
  position: relative;
  z-index: 2;
  width: 430px;
  max-width: 92vw;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16, 13, 10, 0.98) 0%, rgba(24, 19, 14, 0.96) 50%, rgba(12, 9, 7, 0.98) 100%);
  border-left: 2px solid var(--brass-main);
  border-right: 2px solid var(--brass-main);
  box-shadow:
    0 0 80px rgba(0, 0, 0, 0.95),
    inset 0 0 0 4px rgba(10, 8, 6, 0.95),
    inset 0 0 0 5px rgba(200, 157, 84, 0.35);
  padding: 12px 24px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
}

.monolith-top-ornament {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-main), transparent);
}

.ornament-diamond {
  width: 7px;
  height: 7px;
  background: var(--brass-bright);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--brass-main);
}

.imperial-crest-medallion {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.9));
}

.crest-svg {
  width: 100%;
  height: 100%;
}

.monolith-title-block {
  text-align: center;
  width: 100%;
  flex-shrink: 0;
}

.monolith-overline {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--brass-main);
  margin-bottom: 2px;
}

.monolith-main-title {
  font-family: var(--font-display);
  font-size: 2.05rem;
  font-weight: 900;
  letter-spacing: 3.5px;
  line-height: 1.02;
  background: linear-gradient(180deg, #fffdf7 0%, #f5deb3 48%, #b88635 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.95));
}

.monolith-sub-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 5px;
  color: var(--ivory-mid);
  margin-top: 2px;
}

.monolith-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}

.div-wing {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-main), transparent);
}

.div-gem {
  width: 6px;
  height: 6px;
  background: var(--brass-bright);
  transform: rotate(45deg);
}

/* Chiseled Metallic Plinth Buttons */
.monolith-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.plinth-btn {
  position: relative;
  width: 100%;
  padding: 8px 16px;
  background: linear-gradient(180deg, #241d16 0%, #16110d 100%);
  border: 1.5px solid var(--brass-dark);
  clip-path: var(--chamfer-md);
  color: var(--ivory-bright);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 5px 14px rgba(0, 0, 0, 0.8);
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.plinth-btn::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(200, 157, 84, 0.2);
  clip-path: var(--chamfer-md);
  pointer-events: none;
}

.plinth-btn:hover {
  transform: scale(1.015);
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, #35291e 0%, #1f1710 100%);
  box-shadow: 0 0 22px rgba(200, 157, 84, 0.35);
}

.plinth-btn.plinth-story {
  background: linear-gradient(180deg, #2d1b4e 0%, #160c28 100%);
  border-color: #a78bfa;
}

.plinth-btn.plinth-story:hover {
  background: linear-gradient(180deg, #3c2368 0%, #1f1138 100%);
  border-color: #ddd6fe;
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.4);
}

.plinth-tag {
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 1px 5px;
  margin-left: 6px;
  background: rgba(246, 216, 139, 0.2);
  border: 1px solid var(--brass-bright);
  color: var(--brass-bright);
  vertical-align: middle;
}

.plinth-btn.plinth-primary {
  background: linear-gradient(180deg, #1b3626 0%, #0f2016 100%);
  border-color: #34d399;
}

.plinth-btn.plinth-primary:hover {
  background: linear-gradient(180deg, #234732 0%, #142b1d 100%);
  border-color: #a7f3d0;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.35);
}

.plinth-btn.plinth-gold {
  background: linear-gradient(180deg, #4a3312 0%, #261908 100%);
  border-color: var(--brass-main);
}

.plinth-btn.plinth-gold:hover {
  background: linear-gradient(180deg, #634418 0%, #36230b 100%);
  border-color: var(--brass-bright);
}

.plinth-btn.plinth-cyan {
  background: linear-gradient(180deg, #0c2d48 0%, #07192a 100%);
  border-color: #38bdf8;
}

.plinth-btn.plinth-cyan:hover {
  background: linear-gradient(180deg, #15456f 0%, #0c2d48 100%);
  border-color: #7dd3fc;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
}

.plinth-rivet {
  width: 6px;
  height: 6px;
  background: var(--brass-main);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.plinth-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  flex: 1;
}

.plinth-label {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 1.8px;
  line-height: 1.15;
  color: var(--ivory-bright);
}

.plinth-meta {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.15;
  color: var(--brass-bright);
  opacity: 0.9;
}

/* Carved Brass Settings Bar */
.monolith-settings-bar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  flex-shrink: 0;
}

.brass-toggle-btn {
  background: #14100c;
  border: 1px solid var(--brass-subtle);
  clip-path: var(--chamfer-sm);
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.brass-toggle-btn:hover {
  border-color: var(--brass-bright);
  background: #231c15;
}

.bt-key {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  line-height: 1.1;
  color: var(--ivory-dim);
}

.bt-val {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--brass-bright);
}

.monolith-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--ivory-dim);
  border-top: 1px solid rgba(200, 157, 84, 0.2);
  padding-top: 5px;
  flex-shrink: 0;
}

/* Right-Side Atmospheric World Atlas Plaque */
.title-world-plaque {
  position: relative;
  z-index: 2;
  align-self: flex-end;
  margin-bottom: 36px;
  width: 550px;
  max-width: 45vw;
  background: linear-gradient(180deg, rgba(16, 13, 10, 0.94) 0%, rgba(10, 8, 6, 0.97) 100%);
  border: 1.5px solid var(--brass-main);
  clip-path: var(--chamfer-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-plinth);
}

@media (max-width: 1100px) {
  .title-world-plaque {
    display: none;
  }
  .steam-title-screen {
    justify-content: center;
    padding: 0;
  }
}

.world-plaque-header {
  border-bottom: 1px solid rgba(200, 157, 84, 0.3);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.wp-tag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--brass-main);
}

.world-plaque-header h2 {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--ivory-bright);
  margin-top: 2px;
}

.world-quarters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quarter-plaque {
  background: rgba(24, 19, 15, 0.92);
  border: 1px solid rgba(200, 157, 84, 0.25);
  border-left: 3px solid var(--brass-main);
  padding: 9px 12px;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.quarter-plaque:hover {
  transform: translateY(-2px);
  background: rgba(42, 32, 22, 0.96);
  border-color: var(--brass-bright);
}

.quarter-plaque[data-quarter="north"] { border-left-color: #60a5fa; }
.quarter-plaque[data-quarter="west"] { border-left-color: #34d399; }
.quarter-plaque[data-quarter="east"] { border-left-color: #fb923c; }
.quarter-plaque[data-quarter="south"] { border-left-color: #facc15; }
.quarter-plaque[data-quarter="heartland"] { border-left-color: #c084fc; }

.qp-cardinal {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--ivory-dim);
}

.qp-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--ivory-bright);
}

.qp-stats {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brass-bright);
  margin-top: 2px;
}

.qp-capital {
  font-size: 0.7rem;
  color: var(--ivory-mid);
}

/* ==========================================================================
   2. BATTLE MODE SETUP CHAMBER — WORLD MAP & HANGING HERALDIC BANNERS
   ========================================================================== */
.chamber-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  background:
    radial-gradient(circle at 50% 15%, rgba(200, 157, 84, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(8, 6, 5, 0.98) 0%, rgba(16, 13, 10, 0.97) 50%, rgba(8, 6, 5, 0.99) 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 30px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 157, 84, 0.35) transparent;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.chamber-screen.chamber-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

.chamber-frame {
  margin: auto;
  width: 100%;
  max-width: 1260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chamber-header {
  text-align: center;
}

.chamber-overline {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--brass-main);
}

.chamber-header h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--ivory-bright);
  margin: 1px 0;
}

.chamber-header p {
  font-size: 0.82rem;
  color: var(--ivory-mid);
}

.chamber-section-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 2.2px;
  color: var(--brass-bright);
  border-bottom: 1px solid rgba(200, 157, 84, 0.25);
  padding-bottom: 3px;
  margin-top: 2px;
}

/* 4 Battle Mode World Map Cards */
.chamber-maps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.map-select-card {
  position: relative;
  background: linear-gradient(180deg, #1b1611 0%, #0f0c09 100%);
  border: 1.5px solid rgba(200, 157, 84, 0.32);
  clip-path: var(--chamfer-sm);
  padding: 10px 12px;
  color: var(--ivory-bright);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.map-select-card:hover {
  transform: translateY(-2px);
  border-color: var(--brass-main);
  background: linear-gradient(180deg, #282017 0%, #15100c 100%);
}

.map-select-card.selected {
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, #382914 0%, #1b1309 100%);
  box-shadow: 0 0 18px rgba(200, 157, 84, 0.35), inset 0 0 0 1px rgba(246, 216, 139, 0.35);
}

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

.msc-subtitle {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--brass-main);
  text-transform: uppercase;
}

.msc-badge {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 2px 6px;
  background: rgba(200, 157, 84, 0.16);
  border: 1px solid rgba(200, 157, 84, 0.45);
  color: var(--brass-bright);
}

.map-select-card.selected .msc-badge {
  background: var(--brass-bright);
  color: #0b0907;
}

.msc-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--ivory-bright);
}

.msc-desc {
  font-size: 0.72rem;
  color: var(--ivory-mid);
  line-height: 1.28;
}

.msc-meta {
  font-size: 0.66rem;
  font-weight: 800;
  color: #6ee7b7;
  margin-top: 2px;
}

/* 4 Hanging Swallowtail Heraldic War Banners */
.heraldic-banners-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 2px 0;
}

.heraldic-banner-card {
  position: relative;
  height: 215px;
  padding: 12px 14px 28px;
  background: linear-gradient(180deg, var(--banner-dark, #2a1215) 0%, #120e0b 90%);
  border-top: 5px solid var(--brass-main);
  border-left: 1.5px solid rgba(200, 157, 84, 0.35);
  border-right: 1.5px solid rgba(200, 157, 84, 0.35);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 89%, 0 100%);
  color: var(--ivory-bright);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  transition: transform var(--transition-normal), filter var(--transition-normal), border-color var(--transition-normal);
  filter: brightness(0.8) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.85));
}

.heraldic-banner-card:hover {
  transform: translateY(-4px);
  filter: brightness(0.96);
}

.heraldic-banner-card.selected {
  transform: translateY(-6px);
  filter: brightness(1.1) drop-shadow(0 0 18px var(--faction-color));
  border-top-color: var(--brass-bright);
  border-left-color: var(--brass-bright);
  border-right-color: var(--brass-bright);
}

.hb-roman {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brass-bright);
}

.hb-shield-crest {
  width: 50px;
  height: 58px;
  background: var(--faction-color);
  border: 2px solid var(--brass-bright);
  clip-path: polygon(50% 0%, 100% 15%, 100% 65%, 50% 100%, 0% 65%, 0% 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.65);
}

.hb-shield-crest .ui-svg-icon {
  width: 26px;
  height: 26px;
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.hb-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--ivory-bright);
}

.hb-house {
  font-size: 0.72rem;
  color: var(--ivory-mid);
  line-height: 1.2;
}

.hb-specialty-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brass-bright);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(200, 157, 84, 0.4);
  padding: 3px 8px;
}

.hb-selected-seal {
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 1.8px;
  color: #090705;
  background: var(--brass-bright);
  padding: 2px 10px;
}

/* Bottom Chamber Dossier & Form Console */
.chamber-bottom-console {
  background: var(--iron-mid);
  border: 1.5px solid var(--brass-main);
  clip-path: var(--chamfer-md);
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow-plinth);
}

.house-dossier-panel {
  border-right: 1px solid rgba(200, 157, 84, 0.28);
  padding-right: 22px;
}

.dossier-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brass-bright);
}

.dossier-motto {
  font-style: italic;
  font-size: 0.84rem;
  color: var(--ivory-dim);
  margin-bottom: 5px;
}

.dossier-lore {
  font-size: 0.88rem;
  color: var(--ivory-bright);
  line-height: 1.45;
}

.chamber-config-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chamber-select-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chamber-select-group label {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--brass-bright);
}

.engraved-select {
  background: #120e0a;
  border: 1px solid var(--brass-main);
  color: var(--ivory-bright);
  padding: 6px 11px;
  font-size: 0.84rem;
  font-weight: 700;
  min-width: 240px;
}

.chamber-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* ==========================================================================
   3. 5-ZONE NON-OVERLAPPING WAR TABLE GRID (RISK-STYLE SIDEBARS)
      - Top Bar (46px): Active Sovereign, Year, Phase Stepper, System Menu
      - Left Sidebar (200px): War Seals, Four Continents, Map Lenses, Camera Zoom
      - Center Map Viewport (1fr): 100% Unobstructed Interactive Map
      - Right Sidebar (235px): 4 Kingdoms Vertical Standings & Live War Chronicle
      - Bottom Command Bar (58px): Tactical Command Console & Primary Phase Button
   ========================================================================== */
.war-table-layout {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) 255px;
  grid-template-rows: 50px minmax(0, 1fr) 74px;
  grid-template-areas:
    "topbar    topbar   topbar"
    "leftside  map      rightside"
    "bottombar bottombar bottombar";
  overflow: hidden;
  background: #04080f;
}

@media (max-width: 1200px) {
  .war-table-layout {
    grid-template-columns: 195px minmax(0, 1fr) 235px;
  }
}

/* --- ZONE 1: SLIM TOP IMPERIAL HEADER BAR (GRAND IMPERIAL CROWN RIBBON) --- */
.hud-top-bar {
  grid-area: topbar;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 50px;
  background: linear-gradient(180deg, #1f1913 0%, #0e0b08 100%);
  border-bottom: 2px solid var(--brass-main);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.9);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  z-index: 25;
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.active-sovereign-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sovereign-crest {
  width: 28px;
  height: 30px;
  border: 1.5px solid var(--brass-bright);
  clip-path: polygon(50% 0%, 100% 15%, 100% 68%, 50% 100%, 0% 68%, 0% 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sovereign-details {
  min-width: 0;
  overflow: hidden;
}

.sovereign-name {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 900;
  color: var(--ivory-bright);
  line-height: 1.1;
}

.sovereign-subtitle {
  font-size: 0.72rem;
  color: var(--ivory-mid);
  line-height: 1.1;
}

.turn-medallion {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--brass-bright);
  background: #18120c;
  border: 1px solid var(--brass-main);
  padding: 4px 10px;
  flex-shrink: 0;
}

.phase-stepper-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.phase-step-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ivory-dim);
  background: #120e0a;
  border: 1px solid rgba(200, 157, 84, 0.2);
}

.phase-step-pill.active {
  color: var(--brass-bright);
  background: linear-gradient(180deg, #3d2a0d 0%, #1f1506 100%);
  border-color: var(--brass-bright);
  box-shadow: 0 0 12px rgba(200, 157, 84, 0.25);
}

.phase-chevron {
  color: var(--brass-main);
  font-size: 0.72rem;
}

.utility-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-util {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  background: var(--iron-plate);
  border: 1px solid var(--brass-subtle);
  color: var(--ivory-bright);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-util:hover {
  border-color: var(--brass-bright);
  background: var(--iron-elevated);
}

.btn-util-gold {
  background: linear-gradient(180deg, #5c4016 0%, #33220a 100%);
  border-color: var(--brass-bright);
  color: var(--brass-bright);
}

/* --- ZONE 2: LEFT SIDEBAR (WAR SEALS, FOUR CONTINENTS, LENSES, CAMERA) --- */
.hud-side-left {
  grid-area: leftside;
  background: linear-gradient(180deg, #16120e 0%, #0d0a08 100%);
  border-right: 2px solid var(--brass-main);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 157, 84, 0.25) transparent;
  min-width: 0;
  z-index: 15;
}

.side-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-section-bottom {
  margin-top: auto;
}

.side-section-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--brass-main);
  border-bottom: 1px solid rgba(200, 157, 84, 0.25);
  padding-bottom: 2px;
}

.btn-side-seals {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  min-height: 28px;
  background: linear-gradient(180deg, #282018 0%, #18130e 100%);
  border: 1px solid var(--brass-main);
  clip-path: var(--chamfer-sm);
  color: var(--ivory-bright);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-side-seals:hover {
  border-color: var(--brass-bright);
  background: var(--iron-elevated);
}

.seals-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hud-count-pill {
  background: #120e0a;
  border: 1px solid var(--brass-main);
  color: var(--brass-bright);
  padding: 1px 6px;
  font-size: 0.70rem;
  font-weight: 900;
}

.hud-count-pill.pulse-ready {
  background: var(--brass-dark);
  color: #ffffff;
  animation: pulseBrass 1.4s infinite;
}

/* Vertical Four Continents List in Left Sidebar */
.continents-side-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.continent-side-card {
  background: linear-gradient(180deg, #16120d 0%, #0d0a07 100%);
  border: 1px solid rgba(200, 157, 84, 0.22);
  border-radius: 3px;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.continent-side-card:hover {
  background: linear-gradient(180deg, #221c15 0%, #14100c 100%);
  border-color: rgba(200, 157, 84, 0.5);
}

.csc-top,
.csc-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  line-height: 1.1;
}

.csc-dir {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.csc-bonus {
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--brass-bright);
}

.csc-lore {
  font-size: 0.62rem;
  color: var(--ivory-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 85px;
}

.csc-owner {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* 2x2 Map Lens Grid in Left Sidebar */
.map-lens-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px;
  border-radius: 4px;
  border: 1px solid rgba(200, 157, 84, 0.18);
}

.btn-lens {
  padding: 4px 2px;
  min-height: 24px;
  background: #14100c;
  border: 1px solid rgba(200, 157, 84, 0.25);
  color: var(--ivory-mid);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.btn-lens:hover {
  color: var(--ivory-bright);
  border-color: var(--brass-main);
}

.btn-lens.active-lens,
.btn-util.active-lens {
  background: linear-gradient(180deg, #4a3312 0%, #241807 100%);
  border-color: var(--brass-bright);
  color: var(--brass-bright);
}

.zoom-side-row {
  display: grid;
  grid-template-columns: 28px 1fr 28px 24px 24px;
  gap: 3px;
  margin-top: 3px;
}

.zoom-side-row .btn-util {
  padding: 2px 2px;
  font-size: 0.65rem;
  min-height: 24px;
}

/* --- ZONE 3: DEDICATED CENTER MAP VIEWPORT (100% Unobstructed) --- */
.game-viewport {
  grid-area: map;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-viewport.dragging {
  cursor: grabbing;
}

#worldMap {
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: block;
}

.viewport-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.78);
  z-index: 2;
}

/* --- ZONE 4: RIGHT SIDEBAR — RISK-STYLE KINGDOMS STANDINGS & LIVE CHRONICLE --- */
.hud-side-right {
  grid-area: rightside;
  background: linear-gradient(180deg, #16120e 0%, #0d0a08 100%);
  border-left: 2px solid var(--brass-main);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  z-index: 15;
}

.kingdoms-side-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.kingdom-side-card {
  background: #110d0a;
  border: 1px solid rgba(200, 157, 84, 0.22);
  border-left: 3px solid var(--k-color, var(--brass-main));
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all var(--transition-fast);
}

.kingdom-side-card.active-turn {
  border-color: var(--brass-bright);
  border-left: 3px solid var(--k-color, var(--brass-bright));
  background: linear-gradient(90deg, #271e14 0%, #17120c 100%);
  box-shadow: 0 0 12px rgba(200, 157, 84, 0.35);
  animation: houseActivePulse 2.4s infinite ease-in-out;
}

@keyframes houseActivePulse {
  0%, 100% { border-color: rgba(200, 157, 84, 0.45); }
  50% { border-color: #fde047; box-shadow: 0 0 16px rgba(253, 224, 71, 0.38); }
}

.ksc-power-track {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 2px;
  overflow: hidden;
  margin: 1px 0 2px 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ksc-power-fill {
  height: 100%;
  transition: width 0.35s ease;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.kingdom-side-card.eliminated {
  opacity: 0.35;
  filter: grayscale(0.9);
}

.ksc-header {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.f-crest {
  width: 18px;
  height: 20px;
  clip-path: polygon(50% 0%, 100% 15%, 100% 68%, 50% 100%, 0% 68%, 0% 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--brass-bright);
}

.f-crest .ui-svg-icon {
  width: 11px;
  height: 11px;
  color: #ffffff;
}

.ksc-title-group {
  flex: 1;
  min-width: 0;
}

.ksc-name {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--ivory-bright);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ksc-sub {
  font-size: 0.58rem;
  color: var(--ivory-dim);
  line-height: 1.02;
}

.ksc-turn-badge {
  font-family: var(--font-display);
  font-size: 0.54rem;
  font-weight: 900;
  color: #090705;
  background: var(--brass-bright);
  padding: 1px 4px;
  flex-shrink: 0;
}

.ksc-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 3px;
  border-top: 1px solid rgba(200, 157, 84, 0.16);
}

.ksc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.0;
}

.ksc-val {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--ivory-bright);
}

.ksc-lbl {
  font-size: 0.50rem;
  font-weight: 800;
  color: var(--ivory-dim);
  letter-spacing: 0.4px;
}

/* Integrated Decree & Live Scrolling Chronicle in Right Sidebar */
.side-chronicle-section {
  flex: 1 1 0;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.integrated-status-ticker {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--ivory-bright);
  background: #110d0a;
  border: 1px solid rgba(200, 157, 84, 0.3);
  border-left: 3px solid var(--brass-main);
  padding: 4px 6px;
  line-height: 1.2;
  word-wrap: break-word;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.integrated-status-ticker.visible.toast-gold {
  border-color: var(--brass-bright);
  color: var(--brass-bright);
  background: #241909;
}

.integrated-status-ticker.visible.toast-emerald {
  border-color: #34d399;
  color: #a7f3d0;
  background: #0d261c;
}

.integrated-status-ticker.visible.toast-crimson {
  border-color: #f87171;
  color: #fecdd3;
  background: #2b1114;
}

.chronicle-side-feed {
  flex: 1 1 0;
  min-height: 55px;
  background: #0b0907;
  border: 1px solid rgba(200, 157, 84, 0.2);
  padding: 4px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 157, 84, 0.3) transparent;
}

/* --- ZONE 5: DEDICATED BOTTOM TACTICAL COMMAND BAR (COMMANDER'S WAR DESK) --- */
.hud-bottom-dock {
  grid-area: bottombar;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 74px;
  background: linear-gradient(180deg, #1b1610 0%, #0b0907 100%);
  border-top: 2px solid var(--brass-main);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.95);
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 25;
}

.dock-zone-center {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.dock-zone-phase-cta {
  flex-shrink: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(200, 157, 84, 0.3);
  display: flex;
  align-items: center;
}

.cmd-bar-inner {
  width: 100%;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.cmd-section-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.cmd-province-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}

.cmd-province-card > div {
  min-width: 0;
  overflow: hidden;
}

.cmd-terrain-emblem {
  width: 26px;
  height: 26px;
  background: #120e0a;
  border: 1px solid var(--brass-main);
  clip-path: var(--chamfer-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cmd-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--brass-bright);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-sub {
  font-size: 0.68rem;
  color: var(--ivory-mid);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

.log-entry {
  padding: 4px 8px;
  background: #120e0a;
  border-left: 3px solid var(--brass-main);
  color: var(--ivory-mid);
}

.log-time {
  color: var(--brass-bright);
  font-weight: 800;
  margin-right: 4px;
}

.log-combat { border-left-color: var(--crimson-bright); }
.log-conquest { border-left-color: var(--brass-bright); }
.log-reinforce { border-left-color: #60a5fa; }
.log-reward { border-left-color: #34d399; }

/* ==========================================================================
   Cartographic SVG Layers (Antique Nautical & Heraldic Standards)
   ========================================================================== */
.carto-grid-line {
  stroke: #c89d54;
  stroke-opacity: 0.08;
  stroke-width: 1px;
  stroke-dasharray: 6, 8;
  pointer-events: none;
}

.rhumb-ray {
  stroke: #c89d54;
  stroke-opacity: 0.06;
  stroke-width: 0.8px;
  pointer-events: none;
}

.compass-dir-label {
  fill: #e8c675;
  fill-opacity: 0.55;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.meridian-sea-title {
  fill: #d8c8a8;
  fill-opacity: 0.42;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 3.5px;
  text-anchor: middle;
  pointer-events: none;
}

.ocean-wave-layer-1 {
  pointer-events: none;
  animation: oceanSwellDrift 18s linear infinite;
}

.ocean-caustics-drift {
  pointer-events: none;
  animation: oceanCausticsPulse 9s ease-in-out infinite alternate;
}

@keyframes oceanSwellDrift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 12px); }
  100% { transform: translate(-160px, 0); }
}

@keyframes oceanCausticsPulse {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0.95; transform: scale(1.02); }
}

.ocean-wave-crest {
  fill: none;
  stroke: #bae6fd;
  stroke-width: 1.8px;
  stroke-linecap: round;
  stroke-opacity: 0.32;
  pointer-events: none;
  animation: waveCrestRoll 4.2s ease-in-out infinite;
}

@keyframes waveCrestRoll {
  0%, 100% { transform: translateX(-6px); stroke-opacity: 0.14; }
  50% { transform: translateX(8px); stroke-opacity: 0.48; }
}

.continent-deep-trench {
  fill: none;
  stroke: #020b16;
  stroke-width: 44px;
  stroke-linejoin: round;
  stroke-opacity: 0.55;
  pointer-events: none;
}

.continent-reef-glow {
  fill: none;
  stroke: #0ea5e9;
  stroke-width: 30px;
  stroke-linejoin: round;
  stroke-opacity: 0.22;
  pointer-events: none;
  animation: reefShimmer 5s ease-in-out infinite alternate;
}

@keyframes reefShimmer {
  0% { stroke-opacity: 0.17; stroke-width: 28px; }
  100% { stroke-opacity: 0.29; stroke-width: 33px; }
}

.continent-outer-shelf {
  fill: none;
  stroke: #2dd4bf;
  stroke-width: 17px;
  stroke-linejoin: round;
  stroke-opacity: 0.20;
  pointer-events: none;
}

.continent-coastal-foam {
  fill: none;
  stroke: #e0f2fe;
  stroke-width: 5.5px;
  stroke-linejoin: round;
  stroke-dasharray: 18, 8, 10, 6;
  stroke-opacity: 0.38;
  pointer-events: none;
  animation: surfFoamPulse 3.6s ease-in-out infinite alternate;
}

@keyframes surfFoamPulse {
  0% { stroke-opacity: 0.24; stroke-width: 4.5px; }
  100% { stroke-opacity: 0.48; stroke-width: 6.5px; }
}

.continent-cliff-extrusion {
  fill: #05070b;
  stroke: #020305;
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.continent-coast-outline {
  fill: none;
  stroke-width: 2.2px;
  stroke-linejoin: round;
  stroke-opacity: 0.78;
  pointer-events: none;
}

.continent-map-header {
  pointer-events: none;
}

.continent-map-title {
  font-family: var(--font-display);
  font-size: 11.8px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-anchor: middle;
  dominant-baseline: middle;
  stroke: #05070b;
  stroke-width: 2.2px;
  paint-order: stroke fill;
}

.sea-lane-glow {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 5.5px;
  stroke-opacity: 0.18;
  pointer-events: none;
}

.sea-lane-dash {
  fill: none;
  stroke: #bae6fd;
  stroke-width: 1.8px;
  stroke-dasharray: 7, 6;
  stroke-opacity: 0.72;
  pointer-events: none;
  animation: seaFlow 20s linear infinite;
}

.sea-ship-icon {
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
}

@keyframes seaFlow {
  to { stroke-dashoffset: -120; }
}

.territory-path {
  cursor: pointer;
  stroke-linejoin: round;
  transition: fill-opacity var(--transition-fast), stroke-width var(--transition-fast);
}

.territory-path:hover {
  fill-opacity: 0.86 !important;
  stroke: #faecc4 !important;
  stroke-width: 3px !important;
}

.province-terrain-art,
.targeting-arrows-layer,
.badges-layer,
.vfx-layer,
.sea-lanes-layer,
.continent-shelf-layer {
  pointer-events: none;
}

.continent-borders-layer {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.lens-continents .continent-borders-layer,
.world-map.lens-continents .continent-borders-layer {
  opacity: 1;
}

.potential-target-arrow {
  fill: none;
  stroke: #f6e0a6;
  stroke-width: 2.2px;
  stroke-dasharray: 6, 4;
  stroke-opacity: 0.85;
}

.active-assault-arrow,
.ai-assault-arrow {
  fill: none;
  stroke: #ef4444;
  stroke-width: 3.8px;
  stroke-dasharray: 9, 4;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.9));
  animation: arrowMarch 0.75s linear infinite;
}

.fortify-march-arrow {
  fill: none;
  stroke: #60a5fa;
  stroke-width: 3.4px;
  stroke-dasharray: 8, 4;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.9));
  animation: arrowMarch 0.75s linear infinite;
}

@keyframes arrowMarch {
  to { stroke-dashoffset: -26; }
}

/* 3D Heraldic Army Shield Standards (Zero Transform on Hover — Zero Vibration!) */
.territory-badge-group {
  pointer-events: none;
}

.token-selection-ring {
  fill: none;
  stroke: transparent;
  stroke-width: 2.5px;
  transition: stroke 0.14s ease;
}

.territory-badge-group.token-hovered .token-selection-ring {
  stroke: #faecc4 !important;
  stroke-width: 3px;
}

.token-selection-ring.active-source-ring {
  stroke: #faecc4 !important;
  stroke-width: 3.2px;
  stroke-dasharray: 5, 3;
}

.token-selection-ring.active-target-ring {
  stroke: #ef4444 !important;
  stroke-width: 3.4px;
}

.token-selection-ring.muster-ready-ring {
  stroke: #4ade80;
  stroke-width: 2.4px;
  stroke-dasharray: 5, 3;
  animation: ringPulseOpacity 1.5s ease-in-out infinite;
}

.token-selection-ring.attack-ready-ring {
  stroke: rgba(250, 236, 196, 0.8);
  stroke-width: 2.2px;
}

.token-selection-ring.targetable-enemy-ring {
  stroke: #f87171;
  stroke-width: 2.8px;
  stroke-dasharray: 5, 3;
  animation: ringPulseOpacity 1s ease-in-out infinite;
}

.token-selection-ring.fortify-ready-ring {
  stroke: #60a5fa;
  stroke-width: 2.4px;
  stroke-dasharray: 4, 3;
}

@keyframes ringPulseOpacity {
  0%, 100% { stroke-opacity: 0.98; }
  50% { stroke-opacity: 0.32; }
}

.province-scroll-ribbon {
  fill: rgba(12, 10, 8, 0.94);
  stroke: rgba(200, 157, 84, 0.55);
  stroke-width: 1px;
}

.territory-label-text {
  fill: #fdf8ee;
  font-family: var(--font-ui);
  font-size: 11.4px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-anchor: middle;
  stroke: #050403;
  stroke-width: 2.3px;
  paint-order: stroke fill;
}

.troop-count-text {
  fill: #ffffff;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 900;
  text-anchor: middle;
  stroke: #050403;
  stroke-width: 3.2px;
  paint-order: stroke fill;
}

.citadel-token .troop-count-text {
  font-size: 15.5px;
}

.vfx-floating-text {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 900;
  text-anchor: middle;
  stroke: #000000;
  stroke-width: 3.5px;
  paint-order: stroke fill;
  animation: floatUpFade 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.vfx-shockwave-ring {
  animation: expandRing 0.85s ease-out forwards;
}

@keyframes floatUpFade {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-32px); opacity: 0; }
}

@keyframes expandRing {
  0% { r: 12px; stroke-opacity: 0.95; stroke-width: 3.5px; }
  100% { r: 40px; stroke-opacity: 0; stroke-width: 1px; }
}

/* ==========================================================================
   Command Duel & Slider Controls
   ========================================================================== */
.cmd-duel-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #120e0a;
  padding: 4px 11px;
  border: 1px solid var(--brass-subtle);
}

.duel-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.duel-prov {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ivory-mid);
}

.duel-count {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.duel-vs {
  color: var(--brass-main);
}

.forecast-pill {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 3px 8px;
  border: 1.5px solid;
  background: #0d0a07;
}

.cmd-slider-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 135px;
  font-size: 0.78rem;
  color: var(--ivory-bright);
}

.cmd-slider-box input[type="range"] {
  width: 100%;
  height: 14px;
  accent-color: var(--brass-main);
  cursor: pointer;
}

.cmd-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ai-cmd-state {
  justify-content: space-between;
  width: 100%;
  font-size: 0.86rem;
}

.ai-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.cmd-ai-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-pulse-orb {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  transform: rotate(45deg);
  animation: pulseBrass 1s infinite;
}

/* ==========================================================================
   FORGED WAR BUTTONS
   ========================================================================== */
.btn-war {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 13px;
  clip-path: var(--chamfer-sm);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.7px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  color: var(--ivory-bright);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
}

.btn-war:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-brass-seal,
.btn-gold {
  background: linear-gradient(180deg, #6e4c1b 0%, #3b270b 100%);
  border-color: var(--brass-bright);
  color: var(--brass-bright);
}
.btn-brass-seal:hover:not(:disabled),
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(180deg, #8c6223 0%, #523610 100%);
  color: #ffffff;
}

.btn-crimson {
  background: linear-gradient(180deg, #991b1b 0%, #5c0f0f 100%);
  border-color: #fca5a5;
  color: #fff1f2;
}
.btn-crimson:hover:not(:disabled) {
  background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
}

.btn-blue {
  background: linear-gradient(180deg, #1e40af 0%, #112466 100%);
  border-color: #93c5fd;
}
.btn-blue:hover:not(:disabled) {
  background: linear-gradient(180deg, #2563eb 0%, #1d3a8a 100%);
}

.btn-iron,
.btn-secondary {
  background: var(--iron-plate);
  border-color: var(--brass-subtle);
  color: var(--ivory-mid);
}
.btn-iron:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  background: var(--iron-elevated);
  color: var(--ivory-bright);
  border-color: var(--brass-bright);
}

.pulse-cta {
  animation: pulseBrass 1.6s infinite;
}

@keyframes pulseBrass {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 157, 84, 0.55); }
  50% { box-shadow: 0 0 14px 2px rgba(200, 157, 84, 0.45); }
}

/* ==========================================================================
   Cartographic Province Dossier Tooltip
   ========================================================================== */
.territory-tooltip {
  position: fixed;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.98) 0%, rgba(11, 9, 7, 0.98) 100%);
  border: 1.5px solid var(--brass-main);
  clip-path: var(--chamfer-sm);
  padding: 10px 13px;
  font-size: 0.84rem;
  box-shadow: var(--shadow-plinth);
  z-index: 45;
  display: none;
  width: 255px;
}

.territory-tooltip.visible {
  display: block;
}

.tooltip-header {
  padding-left: 8px;
  margin-bottom: 5px;
}

.tooltip-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tooltip-header h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--brass-bright);
}

.tooltip-dir-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 900;
}

.tooltip-realm {
  font-size: 0.76rem;
  color: var(--ivory-mid);
}

.tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ivory-bright);
}

.tooltip-forecast {
  border-top: 1px solid rgba(200, 157, 84, 0.25);
  margin-top: 5px;
  padding-top: 5px;
  font-size: 0.8rem;
}

/* ==========================================================================
   Native <dialog> Modals (Tactical Field of Honor & War Archives)
   ========================================================================== */
dialog.game-modal {
  border: 2px solid var(--brass-main);
  clip-path: var(--chamfer-md);
  background: linear-gradient(180deg, #18130e 0%, #0d0a07 100%);
  color: var(--ivory-bright);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.96), inset 0 0 0 3px rgba(200, 157, 84, 0.2);
  max-width: 780px;
  width: 93vw;
  margin: auto;
  padding: 0;

  transition:
    opacity var(--transition-normal),
    transform var(--transition-normal),
    display var(--transition-normal) allow-discrete,
    overlay var(--transition-normal) allow-discrete;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
}

dialog.codex-modal-wide {
  max-width: 860px;
}

dialog.game-modal:modal {
  overscroll-behavior: contain;
}

dialog.game-modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  dialog.game-modal[open] {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

dialog.game-modal::backdrop {
  background-color: rgba(4, 3, 2, 0.85);
  backdrop-filter: blur(5px);
  overflow: hidden;
  overscroll-behavior: contain;
  transition:
    opacity var(--transition-normal),
    display var(--transition-normal) allow-discrete,
    overlay var(--transition-normal) allow-discrete;
  opacity: 0;
}

dialog.game-modal[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog.game-modal[open]::backdrop {
    opacity: 0;
  }
}

.modal-inner {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overline {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--brass-main);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--brass-bright);
}

.modal-sub {
  font-size: 0.86rem;
  color: var(--ivory-mid);
  margin-top: 2px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(200, 157, 84, 0.25);
}

/* ==========================================================================
   Tactical Field of Honor (Battle Command Screen)
   ========================================================================== */
.skirmish-modal-header {
  text-align: center;
}

.skirmish-theater-tag {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--brass-main);
}

.skirmish-modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1.5px;
  color: var(--ivory-bright);
  margin: 2px 0 5px;
}

.skirmish-terrain-badge {
  display: inline-block;
  font-size: 0.8rem;
  background: #120e0a;
  border: 1px solid var(--brass-subtle);
  padding: 3px 12px;
  color: var(--brass-bright);
}

.battlefield-panorama {
  width: 100%;
  height: 88px;
  background: #0c0a08;
  border: 1px solid var(--brass-subtle);
  overflow: hidden;
  position: relative;
}

.panorama-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.battle-forces-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  background: #100c09;
  padding: 10px 16px;
  border: 1px solid var(--brass-subtle);
}

.force-card {
  text-align: center;
  padding: 8px;
  border-top: 4px solid;
  background: #18130e;
}

.force-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 900;
}

.force-prov-origin {
  font-size: 0.76rem;
  color: var(--ivory-mid);
}

.force-battalions {
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  margin: 2px 0;
}

.force-label {
  font-size: 0.72rem;
  color: var(--ivory-dim);
}

.vs-medallion {
  width: 40px;
  height: 40px;
  transform: rotate(45deg);
  background: #241a0d;
  border: 1.5px solid var(--brass-main);
  color: var(--brass-bright);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-medallion .ui-svg-icon {
  transform: rotate(-45deg);
}

.battle-ratio-bar {
  display: flex;
  height: 9px;
  overflow: hidden;
  background: #0a0806;
  border: 1px solid var(--brass-subtle);
}

.ratio-fill-atk,
.ratio-fill-def {
  height: 100%;
  transition: width 0.25s ease;
}

.doctrine-selection-section h3 {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--brass-bright);
  margin-bottom: 8px;
}

.doctrine-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.doctrine-card-btn {
  position: relative;
  background: linear-gradient(180deg, #211a13 0%, #120e0a 100%);
  border: 1.5px solid rgba(200, 157, 84, 0.28);
  clip-path: var(--chamfer-sm);
  padding: 13px 7px 9px;
  text-align: center;
  cursor: pointer;
  color: var(--ivory-bright);
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.doctrine-card-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #33271b 0%, #1a140e 100%);
  border-color: var(--brass-bright);
}

.doctrine-card-btn.recommended-doc {
  border-color: #34d399;
}

.rec-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #065f46;
  color: #ecfdf5;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 2px 4px;
  text-transform: uppercase;
}

.doctrine-card-btn.selected {
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, #4a3312 0%, #241807 100%);
  box-shadow: 0 0 14px rgba(200, 157, 84, 0.45);
}

.doc-icon {
  color: var(--brass-bright);
  margin: 4px 0;
}

.doc-icon .ui-svg-icon {
  width: 22px;
  height: 22px;
}

.doc-title {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 900;
  margin-bottom: 2px;
}

.doc-tag {
  font-size: 0.68rem;
  color: var(--brass-bright);
  margin-bottom: 3px;
}

.doc-desc {
  font-size: 0.66rem;
  color: var(--ivory-mid);
  line-height: 1.2;
}

.clash-result-banner {
  background: #100c09;
  border: 1.5px solid var(--brass-main);
  padding: 10px;
  text-align: center;
}

.clash-summary {
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.clash-synergy-note {
  font-size: 0.8rem;
  color: var(--brass-bright);
  margin-bottom: 4px;
}

.clash-losses {
  font-size: 0.84rem;
  font-weight: 800;
}

.loss-number {
  color: #f87171;
}

.clash-outcome {
  margin-top: 5px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
}

.clash-outcome.conquered { color: #4ade80; }
.clash-outcome.repelled { color: #f87171; }

.skirmish-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   War Stratagem Seals & Codex Archives
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
}

.stratagem-card {
  background: linear-gradient(180deg, #241c14 0%, #120e0a 100%);
  border: 1.5px solid var(--brass-subtle);
  clip-path: var(--chamfer-sm);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.stratagem-card:hover {
  transform: translateY(-2px);
  border-color: var(--brass-bright);
}

.stratagem-card.card-selected {
  border-color: var(--brass-bright);
  background: linear-gradient(180deg, #4a3312 0%, #241807 100%);
  box-shadow: 0 0 16px rgba(200, 157, 84, 0.45);
}

.card-corps-symbol {
  color: var(--brass-bright);
  margin-bottom: 5px;
}

.card-corps-symbol .ui-svg-icon {
  width: 26px;
  height: 26px;
}

.card-corps-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--brass-bright);
}

.card-territory {
  font-size: 0.78rem;
  color: var(--ivory-bright);
  margin-top: 2px;
  font-weight: 700;
}

.card-continent {
  font-size: 0.7rem;
  color: var(--ivory-mid);
}

.empty-cards-notice {
  text-align: center;
  padding: 24px;
  color: var(--ivory-mid);
  background: #120e0a;
  border: 1px solid var(--brass-subtle);
  font-size: 0.88rem;
}

.codex-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.86rem;
  color: var(--ivory-mid);
}

.codex-block h3 {
  font-family: var(--font-display);
  font-size: 0.96rem;
  letter-spacing: 1px;
  color: var(--brass-bright);
  margin-bottom: 5px;
}

.codex-continents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 5px;
}

.codex-cont-card {
  background: #120e0a;
  padding: 9px 11px;
  border: 1px solid rgba(200, 157, 84, 0.2);
  border-left: 4px solid;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
}

.doctrine-matrix {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.codex-doc-item {
  background: #120e0a;
  padding: 8px 11px;
  border: 1px solid rgba(200, 157, 84, 0.2);
  border-left: 4px solid var(--brass-main);
  font-size: 0.82rem;
}

.victory-modal-inner {
  text-align: center;
  padding: 30px 26px;
}

.victory-crown-emblem .ui-svg-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
}

.victory-header h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 2px;
  color: var(--brass-bright);
}

.victor-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  margin: 8px 0;
}

.victory-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 16px 0;
}

.v-stat-box {
  background: #120e0a;
  border: 1px solid var(--brass-main);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v-stat-box span {
  font-size: 0.76rem;
  color: var(--ivory-mid);
}

.v-stat-box strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--brass-bright);
}

.victory-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ==========================================================================
   DYNASTY WARRIORS-STYLE STORY MODE SCREEN, CUTSCENES & MINIGAME ARENA
   ========================================================================== */
.story-stage-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.story-stage-hidden {
  display: none !important;
}

.story-kingdoms-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.story-kingdom-card {
  background: linear-gradient(180deg, #1b1510 0%, #0e0b08 100%);
  border: 1.5px solid rgba(200, 157, 84, 0.32);
  border-top: 4px solid var(--faction-color, var(--brass-main));
  clip-path: var(--chamfer-sm);
  padding: 10px 12px;
  color: var(--ivory-bright);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.story-kingdom-card:hover {
  transform: translateY(-2px);
  border-color: var(--brass-bright);
}

.story-kingdom-card.selected {
  background: linear-gradient(180deg, #322414 0%, #161009 100%);
  border-color: var(--brass-bright);
  border-top-color: var(--faction-color);
  box-shadow: 0 0 18px rgba(200, 157, 84, 0.35);
}

.skc-portrait {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.officer-portrait-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.skc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.skc-saga {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--brass-bright);
}

.skc-name {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 900;
  color: var(--ivory-bright);
}

.skc-hero {
  font-size: 0.72rem;
  color: var(--ivory-mid);
}

.skc-progress {
  font-size: 0.64rem;
  font-weight: 800;
  color: #4ade80;
}

.story-chapters-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1220px) {
  .story-chapters-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.story-chapter-card {
  background: linear-gradient(180deg, #1a140f 0%, #100c09 100%);
  border: 1.5px solid rgba(200, 157, 84, 0.35);
  clip-path: var(--chamfer-md);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--shadow-plinth);
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.story-chapter-card.chapter-completed {
  border-color: #34d399;
}

.story-chapter-card.chapter-locked {
  opacity: 0.62;
  background: linear-gradient(180deg, #130f0c 0%, #0b0806 100%);
  border-color: rgba(148, 163, 184, 0.25);
}

.story-chapter-card.locked-shake {
  animation: lockedCardShake 0.36s ease-in-out;
}

@keyframes lockedCardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.scc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.scc-act {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--brass-bright);
}

.scc-status {
  font-size: 0.58rem;
  font-weight: 900;
  padding: 2px 6px;
  border: 1px solid rgba(200, 157, 84, 0.4);
  color: var(--ivory-mid);
}

.scc-status.status-locked {
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.btn-chapter-locked {
  opacity: 0.78;
  border-color: rgba(248, 113, 113, 0.38);
  color: #cbd5e1;
  font-size: 0.68rem;
}

.story-chapter-card.chapter-completed .scc-status {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
  color: #6ee7b7;
}

.scc-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--ivory-bright);
  line-height: 1.2;
}

.scc-sub {
  font-size: 0.68rem;
  color: var(--ivory-mid);
  line-height: 1.22;
}

.scc-stages-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.scc-pill {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 5px;
  background: rgba(200, 157, 84, 0.14);
  border: 1px solid rgba(200, 157, 84, 0.3);
  color: var(--brass-bright);
}

.scc-obj {
  font-size: 0.68rem;
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.28);
  border-left: 3px solid #10b981;
  padding: 4px 7px;
  line-height: 1.24;
}

.story-bottom-bar {
  background: var(--iron-mid);
  border: 1.5px solid var(--brass-main);
  clip-path: var(--chamfer-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.story-synopsis-box {
  font-size: 0.84rem;
  color: var(--ivory-bright);
  line-height: 1.4;
}

/* Cutscene War-Council Theater */
.cutscene-theater-box {
  background: linear-gradient(180deg, #18130e 0%, #0d0a07 100%);
  border: 2px solid var(--brass-main);
  clip-path: var(--chamfer-md);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-plinth);
}

.cutscene-stage-top {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: center;
}

.cutscene-portrait-card {
  background: #120e0a;
  border: 1.5px solid var(--brass-bright);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.cutscene-portrait-frame {
  width: 112px;
  height: 112px;
}

.cs-speaker-name {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--brass-bright);
}

.cs-speaker-role {
  font-size: 0.74rem;
  color: var(--ivory-mid);
}

.cutscene-dialogue-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-step-indicator {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brass-main);
}

.cs-dialogue-text {
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ivory-bright);
  background: rgba(0, 0, 0, 0.38);
  border-left: 4px solid var(--brass-bright);
  padding: 14px 18px;
  min-height: 88px;
}

.cs-choices-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cs-choice-btn {
  background: linear-gradient(180deg, #2b1f13 0%, #150f09 100%);
  border: 1.5px solid var(--brass-main);
  padding: 10px 14px;
  color: var(--ivory-bright);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.cs-choice-btn:hover,
.cs-choice-btn.choice-picked {
  border-color: #4ade80;
  background: linear-gradient(180deg, #143625 0%, #0b1f15 100%);
  color: #a7f3d0;
}

.cutscene-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(200, 157, 84, 0.25);
  padding-top: 12px;
}

/* Interactive Tactical Minigame Stage */
.minigame-arena-box {
  background: #120e0a;
  border: 2px solid var(--brass-main);
  clip-path: var(--chamfer-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.story-minigame-canvas {
  width: 100%;
  max-width: 760px;
  height: auto;
  border: 1.5px solid rgba(200, 157, 84, 0.45);
  background: #0d0a07;
  cursor: pointer;
}

.story-minigame-hud {
  width: 100%;
  max-width: 760px;
}

.mg-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mg-hint-text {
  font-size: 0.76rem;
  color: var(--ivory-mid);
  text-align: center;
  flex: 1;
}

.story-minigame-result {
  width: 100%;
  max-width: 760px;
  background: rgba(6, 78, 59, 0.45);
  border: 1.5px solid #34d399;
  padding: 10px 14px;
  color: #a7f3d0;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

/* Right Sidebar Story Objective Box & Mid-Battle Officer Callout Banner */
.story-objective-box {
  background: rgba(16, 48, 36, 0.55);
  border: 1px solid #34d399;
  border-left: 3px solid #10b981;
  padding: 5px 8px;
  font-size: 0.68rem;
  color: var(--ivory-bright);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sob-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 900;
  color: #6ee7b7;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sob-text {
  font-size: 0.66rem;
  color: var(--ivory-mid);
  line-height: 1.2;
}

.sob-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--brass-bright);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 5px;
  border-top: 1px solid rgba(52, 211, 153, 0.25);
}

.officer-callout-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  width: min(560px, 90%);
  background: linear-gradient(90deg, rgba(16, 12, 9, 0.96) 0%, rgba(34, 25, 16, 0.96) 100%);
  border: 2px solid var(--brass-bright);
  clip-path: var(--chamfer-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.officer-callout-banner.callout-hidden {
  opacity: 0;
  transform: translate(-50%, -12px);
}

.ocb-portrait {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.ocb-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ocb-speaker {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--brass-bright);
}

.ocb-text {
  font-size: 0.84rem;
  color: var(--ivory-bright);
  line-height: 1.3;
}

/* ==========================================================================
   MULTI-LANGUAGE & ARABIC (RTL) GRAND STRATEGY TYPOGRAPHY & LAYOUT ENGINE
   - Coherent Imperial Arabic Fonts: El Messiri, Amiri, Cairo + System Fallbacks
   - Zero letter-spacing so Arabic cursive glyphs never disconnect
   - Full RTL directional border & panel symmetry while keeping SVG/Canvas
     coordinate math locked in LTR
   ========================================================================== */

#menuLangToggleBtn,
#toggleLangBtn {
  border-color: rgba(52, 211, 153, 0.65);
  background: linear-gradient(180deg, #162c22 0%, #0d1a14 100%);
}

#menuLangToggleBtn:hover,
#toggleLangBtn:hover {
  border-color: #6ee7b7;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

#menuLangToggleBtn .bt-val,
#toggleLangBtn {
  color: #6ee7b7;
}

body.lang-ar {
  --font-display: "El Messiri", "Amiri", "Cairo", "Noto Kufi Arabic", "Traditional Arabic", "Sakkal Majalla", "Scheherazade New", Georgia, serif;
  --font-ui: "Cairo", "El Messiri", "Tajawal", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
  line-height: 1.5;
}

/* Critical: Arabic script is cursive; positive letter-spacing breaks glyph joining in some engines */
body.lang-ar,
body.lang-ar *,
body.lang-ar *::before,
body.lang-ar *::after {
  letter-spacing: 0 !important;
}

/* Keep SVG Map Viewport & HTML5 Minigame Canvas in LTR coordinate space so pan/zoom & X/Y coordinates remain identical */
body.lang-ar .game-viewport,
body.lang-ar #mapViewport,
body.lang-ar .story-minigame-canvas {
  direction: ltr;
}

/* Center-aligned blocks stay centered in RTL */
body.lang-ar .monolith-title-block,
body.lang-ar .plinth-content,
body.lang-ar .chamber-header,
body.lang-ar .world-plaque-header,
body.lang-ar .banner-card,
body.lang-ar .story-kingdom-card {
  text-align: center;
}

/* Flip Steam Title Screen backdrop gradient & Monolith border for RTL */
body.lang-ar .steam-title-screen {
  background:
    radial-gradient(circle at 30% 42%, rgba(212, 163, 73, 0.14) 0%, transparent 55%),
    linear-gradient(270deg, rgba(6, 5, 4, 0.96) 0%, rgba(11, 9, 7, 0.88) 42%, rgba(12, 16, 24, 0.55) 100%);
}

body.lang-ar .monolith-panel {
  border-right: none;
  border-left: 2px solid var(--brass-main);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.95);
}

body.lang-ar .plinth-tag {
  margin-left: 0;
  margin-right: 6px;
}

/* Flip Left & Right Sidebar borders in RTL */
body.lang-ar .hud-side-left {
  border-right: none;
  border-left: 2px solid var(--brass-main);
}

body.lang-ar .hud-side-right {
  border-left: none;
  border-right: 2px solid var(--brass-main);
}

body.lang-ar .dock-zone-phase-cta {
  border-left: none;
  border-right: 1px solid rgba(200, 157, 84, 0.28);
  padding-left: 0;
  padding-right: 14px;
}

/* Flip Left-Accented Cards to Right-Accented Cards in RTL */
body.lang-ar .kingdom-side-card {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 4px solid var(--p-color, var(--brass-main));
}

body.lang-ar .integrated-status-ticker {
  border-left: 1px solid var(--brass-subtle);
  border-right: 3px solid var(--brass-bright);
}

body.lang-ar .log-entry {
  border-left: none;
  border-right: 2px solid var(--brass-dark);
}

body.lang-ar .log-entry.log-conquest {
  border-right-color: #f87171;
}

body.lang-ar .log-entry.log-reinforce {
  border-right-color: #4ade80;
}

body.lang-ar .log-entry.log-Eliminate {
  border-right-color: #fbbf24;
}

body.lang-ar .codex-cont-card {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 3px solid var(--brass-main);
}

body.lang-ar .codex-doc-item {
  border-left: 1px solid var(--brass-subtle);
  border-right: 3px solid var(--brass-main);
}

body.lang-ar .cs-dialogue-text {
  border-left: none;
  border-right: 3px solid var(--brass-main);
  font-family: "Amiri", "El Messiri", "Cairo", serif;
  font-size: 1.05rem;
  line-height: 1.65;
}

body.lang-ar .story-objective-box {
  border-left: 1px solid rgba(52, 211, 153, 0.45);
  border-right: 3px solid #34d399;
}

body.lang-ar .scc-obj {
  border-left: none;
  border-right: 2px solid #34d399;
}

body.lang-ar .house-dossier-panel {
  border-left: 1px solid var(--brass-subtle);
  border-right: 4px solid var(--house-color, var(--brass-main));
}

/* Harmonize Arabic Heading Sizes so they fit all HUD bars cleanly */
body.lang-ar .monolith-main-title {
  font-size: 1.95rem;
  line-height: 1.1;
}

body.lang-ar .monolith-sub-title {
  font-size: 0.92rem;
  line-height: 1.15;
}

body.lang-ar .side-section-title {
  font-size: 0.72rem;
}

body.lang-ar .map-continent-banner {
  font-size: 13px;
}

body.lang-ar .map-sea-label {
  font-style: normal;
  font-size: 11px;
}

body.lang-ar .territory-label {
  font-size: 11px;
}

/* ==========================================================================
   EQUAL-FORCES SUDDEN-DEATH CLASH MINIGAME ARENA
   ========================================================================== */
.equal-clash-pill {
  background: linear-gradient(180deg, #451a03 0%, #270e02 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
  animation: pulseBrass 1.3s infinite;
}

.equal-clash-arena {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #100c09;
  border: 1.5px solid var(--brass-main);
  padding: 12px 14px;
}

.equal-duel-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #18130e;
  border: 1px solid rgba(200, 157, 84, 0.35);
  padding: 8px 12px;
}

.ed-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ed-side.ed-right {
  align-items: flex-end;
  text-align: right;
}

.ed-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 900;
}

.ed-hearts {
  font-size: 1.05rem;
  letter-spacing: 2px;
}

.ed-vs-pill {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 900;
  color: #fde68a;
  background: rgba(180, 83, 9, 0.35);
  border: 1px solid #f59e0b;
  padding: 4px 10px;
}

.equal-duel-canvas {
  width: 100%;
  height: auto;
  border: 1.5px solid var(--brass-bright);
  background: #090d16;
  cursor: pointer;
  display: block;
}

body.lang-ar .equal-duel-canvas {
  direction: ltr;
}

.equal-duel-controls {
  display: flex;
  justify-content: center;
}

.btn-equal-strike {
  width: 100%;
  padding: 10px 18px;
  font-size: 0.92rem;
  animation: pulseBrass 1.2s infinite;
}

/* ========================================================
   3D AAA WORLD VIEWPORT & 3D CAMERA CONTROLS
   ======================================================== */
.world-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 4;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.world-3d-canvas:active {
  cursor: grabbing;
}

body.lang-ar .world-3d-canvas,
body.lang-ar .skirmish-3d-canvas {
  direction: ltr;
}

.cam-3d-controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 3px;
}

.cam-3d-controls-grid .cam-btn,
.cam-3d-controls-grid .btn-lens {
  width: 100%;
  min-height: 24px;
  padding: 3px 2px;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(180deg, rgba(35, 26, 17, 0.92), rgba(18, 13, 9, 0.96));
  border: 1px solid rgba(200, 157, 84, 0.45);
  color: var(--parchment-light);
  transition: all 0.18s ease;
}

.cam-3d-controls-grid .cam-btn:hover,
.cam-3d-controls-grid .btn-lens:hover {
  border-color: var(--brass-bright);
  color: #fffbeb;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.28);
  transform: translateY(-1px);
}

.cam-3d-controls-grid .cam-btn.active,
.cam-3d-controls-grid .btn-lens.active-lens {
  background: linear-gradient(180deg, rgba(180, 130, 45, 0.42), rgba(92, 62, 18, 0.55));
  border-color: #fde68a;
  color: #fde68a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35), inset 0 0 8px rgba(253, 230, 138, 0.2);
}

.cam-3d-controls-grid .cam-light-btn {
  grid-column: auto;
}

.skirmish-3d-canvas {
  width: 100%;
  height: auto;
  max-height: 155px;
  display: block;
  margin: 8px 0;
  border: 1.5px solid var(--brass-main);
  background: #060911;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.85), 0 4px 14px rgba(0, 0, 0, 0.55);
  cursor: grab;
}

.skirmish-3d-canvas:active {
  cursor: grabbing;
}

/* ========================================================
   STORY MODE MULTI-PATH, SOVEREIGN ENDINGS & WAR ABILITIES
   ======================================================== */
.story-endings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(200, 157, 84, 0.28);
}

.seb-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brass-bright);
  letter-spacing: 0.5px;
}

.ending-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 0.72rem;
  border-radius: 3px;
  background: rgba(15, 11, 8, 0.9);
  border: 1px solid rgba(200, 157, 84, 0.35);
  color: var(--ivory-mid);
  transition: all 0.2s ease;
}

.ending-pill.ending-unlocked {
  border-color: var(--end-color, #f59e0b);
  color: #fffbeb;
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.22);
}

.ending-pill.ending-locked {
  opacity: 0.65;
}

.scc-style-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 3px;
}

.cs-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: start;
}

.cs-choice-main {
  font-weight: 800;
  color: var(--ivory-bright);
}

.cs-choice-consequence {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fde68a;
  opacity: 0.92;
}

.sob-path-tag {
  font-size: 0.72rem;
  margin-bottom: 3px;
}

.story-abilities-bar {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(200, 157, 84, 0.28);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sab-header {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--brass-bright);
  letter-spacing: 0.4px;
}

.sab-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.btn-story-ability {
  padding: 4px 4px;
  font-size: 0.66rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: #fef3c7;
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.55), rgba(69, 26, 3, 0.85));
  border: 1px solid #f59e0b;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-story-ability:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.75), rgba(120, 53, 15, 0.92));
  border-color: #fde68a;
  transform: translateY(-1px);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.btn-story-ability:disabled {
  opacity: 0.4;
  border-color: rgba(120, 113, 108, 0.4);
  background: rgba(28, 25, 23, 0.6);
  cursor: not-allowed;
}

.victory-ending-plaque {
  margin: 12px auto 4px;
  max-width: 580px;
  padding: 10px 14px;
  background: rgba(15, 11, 8, 0.88);
  border: 1.5px solid #f59e0b;
  border-radius: 4px;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.2);
}

.vep-badge {
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.vep-desc {
  font-size: 0.78rem;
  color: var(--ivory-mid);
  line-height: 1.45;
}

/* ==========================================================================
   STORY CINEMATIC TRANSITION BRIDGE & DIRECT CHAPTER ADVANCE
   ========================================================================== */
.story-transition-bridge {
  margin: 12px auto 8px;
  max-width: 620px;
  background: rgba(22, 17, 13, 0.95);
  border: 1.5px solid var(--brass-main);
  border-left: 4px solid var(--brass-bright);
  border-radius: 4px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(200, 157, 84, 0.2);
  text-align: right;
}

body:not(.lang-ar) .story-transition-bridge {
  text-align: left;
  border-left: 1.5px solid var(--brass-main);
  border-right: 4px solid var(--brass-bright);
}

.stb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(200, 157, 84, 0.25);
  padding-bottom: 6px;
}

.stb-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--brass-bright);
  text-transform: uppercase;
}

.stb-next-tag {
  font-size: 0.76rem;
  color: var(--ivory-mid);
}

.stb-next-tag strong {
  color: var(--ivory-bright);
  font-family: var(--font-display);
}

.stb-narrative {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #f7eedc;
  font-style: italic;
}

.story-direct-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.advance-direct-btn {
  font-size: 0.96rem !important;
  font-weight: 900 !important;
  padding: 12px 24px !important;
  background: linear-gradient(135deg, #c2410c, #991b1b) !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45) !important;
  letter-spacing: 0.8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast) !important;
}

.advance-direct-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.75) !important;
}

.btn-save-menu {
  opacity: 0.75;
  font-size: 0.78rem !important;
  padding: 8px 14px !important;
}

/* ==========================================================================
   IMPASSABLE NATURAL BARRIERS (Great Inland Lakes & Deadly Mountain Peaks)
   ========================================================================== */
.impassable-zones-layer {
  cursor: help;
}

.impassable-zone {
  transition: filter var(--transition-fast);
}

.impassable-zone:hover {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.75));
}

.impassable-lake .impassable-zone-path {
  fill: #0369a1;
  fill-opacity: 0.78;
  stroke: #38bdf8;
  stroke-width: 2.2px;
  stroke-dasharray: 6, 4;
}

.impassable-peaks .impassable-zone-path {
  fill: #1c1917;
  fill-opacity: 0.90;
  stroke: #f59e0b;
  stroke-width: 2.4px;
}

.impassable-zone-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  stroke: #05070b;
  stroke-width: 2.4px;
  paint-order: stroke fill;
}

.impassable-lake .impassable-zone-label {
  fill: #bae6fd;
}

.impassable-peaks .impassable-zone-label {
  fill: #fde68a;
}

/* ==========================================================================
   IMPERIAL SEASON & TREASURY HUD BAR (INTEGRATED CROWN RIBBON)
   ========================================================================== */
.imperial-economy-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 3px 10px;
  background: rgba(10, 8, 5, 0.75);
  border: 1px solid rgba(200, 157, 84, 0.3);
  border-radius: 4px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.7);
  font-size: 0.75rem;
  font-family: var(--font-display);
  color: var(--ivory-light);
  user-select: none;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.imperial-economy-bar::-webkit-scrollbar {
  display: none;
}

.eco-season {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--season-color, #4ade80);
  color: var(--season-color, #4ade80);
  font-weight: 800;
  font-size: 0.74rem;
}

.eco-res {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(200, 157, 84, 0.18);
  border-radius: 3px;
  font-size: 0.74rem;
}

.eco-res strong {
  font-weight: 800;
  color: #fff;
}

.eco-res.eco-gold strong {
  color: #fde047;
}

.eco-res.eco-starving {
  border: 1px solid #ef4444;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  animation: pulseStarve 1.2s infinite alternate;
}

@keyframes pulseStarve {
  from { box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }
  to { box-shadow: 0 0 12px rgba(239, 68, 68, 0.9); }
}

.eco-units {
  color: #7dd3fc;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
}

.eco-btn {
  padding: 3px 9px;
  font-size: 0.70rem;
  font-weight: 800;
  font-family: var(--font-display);
  background: linear-gradient(180deg, #d97706, #92400e);
  color: #fffbeb;
  border: 1px solid #fde047;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.eco-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f59e0b, #b45309);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.5);
}

.eco-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   PROVINCIAL LOGISTICS & CONSTRUCTION STRIP (Tier 2 Command Bar)
   ========================================================================== */
.logistics-strip {
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(212, 163, 73, 0.22);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.logistics-strip::-webkit-scrollbar {
  display: none;
}

.ls-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.70rem;
  font-family: var(--font-display);
  color: var(--ivory-mid);
  flex-shrink: 0;
}

.ls-yield {
  color: #fde68a;
  font-weight: 700;
}

.ls-units {
  color: #7dd3fc;
}

.ls-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.ls-btn {
  padding: 2px 6px;
  min-height: 22px;
  font-size: 0.66rem;
  font-weight: 800;
  font-family: var(--font-display);
  background: rgba(30, 22, 16, 0.85);
  color: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ls-btn:hover:not(:disabled) {
  background: rgba(146, 64, 14, 0.75);
  border-color: #fde047;
  transform: translateY(-1px);
}

.ls-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-color: rgba(120, 113, 108, 0.3);
}

/* ==========================================================================
   LOGISTICS & BAZAAR DIALOG
   ========================================================================== */
.logistics-dialog {
  max-width: 820px;
  width: 92vw;
  max-height: 88vh;
  background: rgba(15, 11, 8, 0.96);
  color: var(--ivory-light);
  border: 2px solid var(--border-gold-bright);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 157, 84, 0.3) transparent;
}

.logistics-dialog::backdrop {
  background: rgba(2, 6, 12, 0.82);
  backdrop-filter: blur(6px);
}

.lg-shell {
  padding: 18px 22px;
}

.lg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(212, 163, 73, 0.35);
  padding-bottom: 10px;
}

.lg-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fde68a;
  margin: 0;
}

.lg-close {
  background: transparent;
  border: none;
  color: #e7e5e4;
  font-size: 1.2rem;
  cursor: pointer;
}

.lg-treasury {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 163, 73, 0.25);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fef08a;
}

.lg-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
}

@media (max-width: 720px) {
  .lg-grid {
    grid-template-columns: 1fr;
  }
}

.lg-col h3 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: #facc15;
  margin: 0 0 8px 0;
}

.lg-col label {
  display: block;
  font-size: 0.78rem;
  color: var(--ivory-mid);
  margin-bottom: 8px;
}

.lg-col select {
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  background: #1c150f;
  color: #fff;
  border: 1px solid #785222;
  border-radius: 4px;
  font-family: inherit;
}

.lg-preview {
  margin-top: 10px;
  padding: 10px;
  background: rgba(20, 15, 10, 0.85);
  border: 1px solid rgba(212, 163, 73, 0.35);
  border-radius: 4px;
}

.lg-preview.lg-invalid {
  border-color: #ef4444;
  color: #fca5a5;
  font-size: 0.80rem;
}

.lg-preview.lg-hint {
  color: var(--ivory-mid);
  font-size: 0.78rem;
  font-style: italic;
}

.lg-pillar {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
}

.lg-pnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #92400e;
  color: #fff;
  font-weight: 900;
  font-size: 0.68rem;
  flex-shrink: 0;
}

.lg-pillar p {
  margin: 1px 0 0 0;
  color: var(--ivory-mid);
  line-height: 1.3;
}

.lg-route {
  font-size: 0.74rem;
  color: #7dd3fc;
  padding: 4px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  margin-top: 6px;
}

.lg-gains {
  font-weight: 800;
  font-size: 0.84rem;
  color: #4ade80;
  margin: 6px 0;
}

.lg-trades {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lg-trade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(30, 22, 16, 0.85);
  border: 1px solid #785222;
  border-radius: 4px;
  color: #fef3c7;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.80rem;
  transition: all 0.15s ease;
}

.lg-trade:hover {
  background: rgba(146, 64, 14, 0.85);
  border-color: #fde047;
  transform: translateY(-1px);
}

.lg-trade-cost {
  color: #fde047;
  font-weight: 800;
}

.lg-note {
  margin-top: 12px;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}
