/* ==========================================================================
   GRAY DOOM — STUDIO PRODUCTION DIEGETIC TACTICAL UI/UX SYSTEM (v1.0)
   Aesthetic: Brutal Technological Realism (Weathered Gunmetal, Command Brass,
   Radar Cyan, Chamfered Military Bezels, Above-the-Fold Spatial Viewport)
   ========================================================================== */

:root {
  --studio-obsidian: #060a0f;
  --studio-gunmetal: #0c141d;
  --studio-plate: #111c28;
  --studio-plate-hi: #172636;
  --studio-bezel: #2a4156;
  --studio-bezel-hi: #466985;
  --studio-brass: #d89b3c;
  --studio-brass-hi: #f3c26b;
  --studio-brass-dim: rgba(216, 155, 60, 0.18);
  --studio-cyan: #58c7d8;
  --studio-cyan-hi: #8ce5f2;
  --studio-cyan-dim: rgba(88, 199, 216, 0.16);
  --studio-crimson: #dc4c56;
  --studio-emerald: #3ca87d;
  --studio-ink: #eaf1f6;
  --studio-muted: #8ea4b5;
  --studio-chamfer-sm: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  --studio-chamfer-md: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

/* --------------------------------------------------------------------------
   1. GLOBAL SHELL & TYPOGRAPHY CALIBRATION
   -------------------------------------------------------------------------- */
body {
  background:
    radial-gradient(circle at 50% 0%, rgba(26, 54, 74, 0.42) 0%, rgba(9, 15, 22, 0.96) 55%, #05080c 100%),
    #05080c;
  color: var(--studio-ink);
}

/* Remove wasted 8vh top/bottom margin when inside the active game client */
main.shell {
  width: min(1620px, 96vw);
  margin: 0 auto;
  padding: 12px 0 36px;
}

/* Style Login Screen as a Diegetic Tactical Command Terminal */
#login-panel {
  max-width: 580px;
  margin: 5vh auto;
  padding: 36px 40px;
  background:
    linear-gradient(165deg, rgba(18, 31, 45, 0.95) 0%, rgba(9, 16, 24, 0.98) 100%);
  border: 1px solid var(--studio-bezel-hi);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(88, 199, 216, 0.12);
  clip-path: var(--studio-chamfer-md);
  position: relative;
}

#login-panel::before {
  content: "TERMINAL AUTH // SECTOR GZ-17";
  position: absolute;
  top: 12px;
  right: 18px;
  font: 700 0.65rem var(--font-ui);
  letter-spacing: 0.16em;
  color: var(--studio-brass);
  opacity: 0.85;
}

#login-panel h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.02;
  margin: 6px 0 10px;
  color: var(--studio-ink);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

#login-panel button {
  background: linear-gradient(180deg, #e2a544 0%, #b87b1e 100%);
  border: 1px solid var(--studio-brass-hi);
  color: #080d13;
  font-weight: 800;
  letter-spacing: 0.12em;
  clip-path: var(--studio-chamfer-sm);
  box-shadow: 0 4px 18px rgba(216, 155, 60, 0.28);
}

#login-panel button:hover {
  background: linear-gradient(180deg, #eeb457 0%, #ca8a27 100%);
}

/* --------------------------------------------------------------------------
   2. COMPACT DIEGETIC IN-GAME TOP HUD (.game-hud-sticky)
   Replaces the bloated 540px SaaS header with a sleek 92px 2-tier Command Bar
   so 88% of the 900px screen is dedicated to the playable map/settlement!
   -------------------------------------------------------------------------- */
#game-panel .game-hud-sticky {
  position: sticky;
  top: 0;
  z-index: 120;
  padding: 6px 14px 6px !important;
  margin: 0 calc(-50vw + 50%) 8px !important;
  padding-inline: max(14px, calc(50vw - 710px)) !important;
  background: linear-gradient(180deg, rgba(8, 14, 21, 0.98) 0%, rgba(11, 20, 30, 0.96) 100%) !important;
  border-bottom: 1px solid var(--studio-bezel-hi) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), inset 0 -1px 0 rgba(216, 155, 60, 0.25) !important;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "brand resources actions"
    "nav nav status";
  align-items: center;
  gap: 6px 14px;
}

/* Top-Left: Compact Commander Callsign & Sector Plate */
#game-panel .game-hud-sticky > header {
  display: contents;
}

#game-panel .game-hud-sticky > header > div:first-child {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 10px;
  background: linear-gradient(90deg, rgba(216, 155, 60, 0.16), rgba(16, 28, 40, 0.85));
  border-left: 3px solid var(--studio-brass);
  border-top: 1px solid rgba(216, 155, 60, 0.35);
  border-bottom: 1px solid rgba(42, 65, 86, 0.8);
  border-right: 1px solid rgba(42, 65, 86, 0.8);
}

#game-panel .game-hud-sticky > header > div:first-child .eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--studio-brass);
  display: none;
}

#game-panel #callsign {
  font-size: 1.08rem !important;
  line-height: 1.1 !important;
  margin: 0 !important;
  white-space: nowrap;
  letter-spacing: 0.06em;
  color: var(--studio-ink);
}

/* Top-Center: Compact 4-Resource Live Telemetry Strip */
#game-panel .game-hud-sticky > .resource-bar {
  grid-area: resources;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
  gap: 6px !important;
  margin: 0 !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource {
  padding: 4px 10px !important;
  background: rgba(9, 17, 26, 0.92) !important;
  border: 1px solid rgba(56, 86, 110, 0.75) !important;
  border-top: 2px solid var(--studio-cyan) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  min-height: 36px !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(1) { border-top-color: #46b886 !important; }
#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(2) { border-top-color: #d98845 !important; }
#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(3) { border-top-color: #58c7d8 !important; }
#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(4) { border-top-color: #e3b34b !important; }

#game-panel .game-hud-sticky > .resource-bar .resource__identity {
  font-size: 0.66rem !important;
  letter-spacing: 0.06em !important;
  gap: 5px !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource__identity img {
  width: 18px !important;
  height: 18px !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource strong {
  font-size: 0.86rem !important;
  line-height: 1 !important;
  color: var(--studio-ink) !important;
  white-space: nowrap !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource > span:last-child {
  font-size: 0.66rem !important;
  color: var(--studio-brass-hi) !important;
  white-space: nowrap;
}

/* Top-Right: Utility Controls (Sitters, Sound, Disconnect) */
#game-panel .game-hud-sticky .header-actions {
  grid-area: actions;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin: 0 !important;
}

#game-panel .game-hud-sticky .header-actions button {
  padding: 5px 9px !important;
  font-size: 0.68rem !important;
  min-height: 30px !important;
  border-color: var(--studio-bezel-hi) !important;
  background: rgba(15, 27, 39, 0.9) !important;
  color: var(--studio-ink) !important;
  white-space: nowrap;
}

#game-panel .game-hud-sticky .header-actions button:hover {
  border-color: var(--studio-cyan) !important;
  color: var(--studio-cyan-hi) !important;
}

/* Row 2 Left: Single-Line Diegetic Tactical Navigation */
#game-panel .game-hud-sticky > nav.game-navigation {
  grid-area: nav;
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 4px !important;
  padding: 2px 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  scrollbar-width: none;
}

#game-panel .game-hud-sticky > nav.game-navigation a {
  padding: 4px 10px !important;
  font-size: 0.71rem !important;
  min-height: 28px !important;
  white-space: nowrap !important;
  border-radius: 2px !important;
  background: rgba(14, 24, 36, 0.92) !important;
  border: 1px solid rgba(45, 71, 94, 0.85) !important;
  gap: 5px !important;
}

#game-panel .game-hud-sticky > nav.game-navigation a img {
  width: 14px !important;
  height: 14px !important;
}

#game-panel .game-hud-sticky > nav.game-navigation a.is-active-tab,
#game-panel .game-hud-sticky > nav.game-navigation a[aria-current="location"] {
  background: linear-gradient(180deg, rgba(216, 155, 60, 0.26), rgba(20, 35, 50, 0.96)) !important;
  border-color: var(--studio-brass-hi) !important;
  color: var(--studio-brass-hi) !important;
  box-shadow: inset 0 0 8px rgba(216, 155, 60, 0.25) !important;
}

/* Row 2 Right: Compact Sector & Influence Status Readout */
#game-panel .game-hud-sticky > .status {
  grid-area: status;
  margin: 0 !important;
  padding: 2px 8px !important;
  border: 1px solid rgba(45, 71, 94, 0.65) !important;
  background: rgba(7, 13, 20, 0.85) !important;
  font-size: 0.66rem !important;
  gap: 10px !important;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. STAGE SWITCHER & COMPACT COMMAND HUB RIBBON
   -------------------------------------------------------------------------- */
#game-panel .settlement-stage-switcher {
  margin: 2px 0 4px !important;
  gap: 6px !important;
}

#game-panel .stage-tab {
  padding: 3px 10px !important;
  font-size: 0.72rem !important;
  border-radius: 2px !important;
  clip-path: var(--studio-chamfer-sm);
}

#game-panel .stage-tab img {
  width: 14px !important;
  height: 14px !important;
}

#game-panel .stage-tab__key {
  width: 16px !important;
  height: 16px !important;
  font-size: 0.64rem !important;
}

/* Compress the 260px .hero.game-stage banner into a 42px Diegetic Command Bar */
#game-panel .hero.game-stage {
  grid-template-columns: 1fr auto !important;
  align-items: center !important;
  min-height: 0 !important;
  gap: 10px !important;
  padding: 4px 12px !important;
  margin: 0 0 6px !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  border-left: 3px solid var(--studio-brass) !important;
  background: linear-gradient(90deg, rgba(13, 24, 36, 0.94) 0%, rgba(10, 19, 29, 0.82) 100%) !important;
}

#game-panel .hero.game-stage > div:nth-of-type(2) {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  min-width: 0 !important;
}

#game-panel .hero.game-stage .faction-heading {
  margin: 0 !important;
  gap: 6px !important;
}

#game-panel .hero.game-stage .faction-emblem {
  width: 22px !important;
  height: 22px !important;
}

#game-panel .hero.game-stage h2 {
  font-size: 0.92rem !important;
  margin: 0 !important;
  letter-spacing: 0.06em !important;
  white-space: nowrap !important;
}

#game-panel .hero.game-stage > div:nth-of-type(2) > p {
  display: none !important;
}

#game-panel .hero.game-stage .hero-actions {
  gap: 5px !important;
  margin: 0 0 0 auto !important;
}

#game-panel .hero.game-stage .hero-actions button {
  padding: 4px 9px !important;
  font-size: 0.68rem !important;
  min-height: 24px !important;
}

#game-panel .hero.game-stage #upgrade {
  background: linear-gradient(180deg, #e2a544 0%, #b87b1e 100%) !important;
  border-color: var(--studio-brass-hi) !important;
  color: #080d13 !important;
  font-weight: 800 !important;
}

#game-panel .hero.game-stage .upgrade {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding-left: 10px !important;
}

#game-panel .hero.game-stage .upgrade strong {
  font-size: 0.98rem !important;
  color: var(--studio-brass-hi) !important;
}

#game-panel .hero.game-stage .upgrade span {
  font-size: 0.68rem !important;
}

/* --------------------------------------------------------------------------
   4. ABOVE-THE-FOLD SPATIAL SETTLEMENT STAGE (DORF1 & DORF2)
   -------------------------------------------------------------------------- */
#game-panel .settlement.functional-landscape {
  padding: 8px 14px 12px !important;
  margin: 0 0 12px !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  background-color: var(--studio-gunmetal) !important;
  background-image: none !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65) !important;
}

/* Eliminate the 320px empty header gap above dorf1/dorf2/forces! */
#game-panel .functional-landscape > .section-heading {
  min-height: 32px !important;
  padding: 4px 12px !important;
  margin: -8px -14px 6px !important;
  align-items: center !important;
  background: linear-gradient(90deg, rgba(12, 22, 33, 0.96), rgba(16, 30, 44, 0.88)) !important;
  border-bottom: 1px solid var(--studio-bezel) !important;
}

#game-panel .functional-landscape > .section-heading h2 {
  font-size: 1.02rem !important;
  margin: 0 !important;
}

#game-panel .functional-landscape > .section-heading .eyebrow {
  font-size: 0.58rem !important;
  margin: 0 !important;
}

#game-panel .functional-landscape > .section-heading > p {
  margin: 0 !important;
  padding: 2px 8px !important;
  font-size: 0.72rem !important;
}

#game-panel .functional-landscape > .workspace-note {
  display: none !important;
}

#game-panel .dorf1-filter-bar {
  margin: 0 0 6px !important;
  gap: 5px !important;
}

#game-panel .dorf1-filter-bar .filter-pill {
  padding: 3px 9px !important;
  font-size: 0.68rem !important;
  border-radius: 2px !important;
}

/* Constrain Stage Height so 100% of the 1200x720 Isometric Pad Ground fits unclipped! */
#game-panel .dorf1-natural-stage,
#game-panel .dorf2-city-stage {
  grid-template-columns: minmax(0, 1200px) minmax(290px, 340px) !important;
  justify-content: center !important;
  gap: 14px !important;
  margin: 4px 0 10px !important;
  align-items: start !important;
}

#game-panel .dorf1-canvas,
#game-panel .dorf2-canvas {
  aspect-ratio: 1200 / 720 !important;
  width: 100% !important;
  max-width: 1200px !important;
  max-height: 720px !important;
  height: auto !important;
  border: 2px solid var(--studio-bezel-hi) !important;
  border-radius: 4px !important;
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.55),
    0 10px 30px rgba(0, 0, 0, 0.65) !important;
}

#game-panel .dorf1-background,
#game-panel .dorf2-background {
  background-size: 100% 100% !important;
  background-position: center center !important;
  filter: none !important;
}

#game-panel .dorf1-village-core {
  left: 50.0% !important;
  top: 46.53% !important;
}

#game-panel .dorf2-wall-badge {
  left: 56.17% !important;
  top: 81.25% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}

#game-panel .dorf-field-node::after,
#game-panel .dorf-building-node::after {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(16, 36, 52, 0.28), rgba(8, 18, 28, 0.42)) !important;
  box-shadow: inset 0 0 0 1.5px rgba(88, 199, 216, 0.55) !important;
}

#game-panel .dorf-field-node.is-selected::after,
#game-panel .dorf-building-node.is-selected::after {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(42, 85, 118, 0.55), rgba(12, 30, 46, 0.68)) !important;
  box-shadow: inset 0 0 0 2px #ffd166 !important;
}

/* Studio Tactical Reticle & Level Medallions on Dorf1/Dorf2 Nodes */
#game-panel .dorf-field-node__badge,
#game-panel .dorf-building-node__badge {
  background: linear-gradient(180deg, #1a2d3e 0%, #0b141e 100%) !important;
  border: 1px solid var(--studio-brass) !important;
  color: var(--studio-brass-hi) !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85) !important;
}

/* Docked Right-Hand Tactical Inspector Sidebar */
#game-panel .dorf1-sidebar,
#game-panel .dorf2-sidebar {
  max-height: 720px !important;
  overflow-y: auto !important;
  display: grid !important;
  gap: 8px !important;
  padding-right: 2px;
}

#game-panel .dorf-telemetry-card {
  background: linear-gradient(160deg, rgba(16, 28, 41, 0.96), rgba(9, 16, 24, 0.98)) !important;
  border: 1px solid var(--studio-bezel) !important;
  border-left: 3px solid var(--studio-cyan) !important;
  border-radius: 3px !important;
  padding: 10px 12px !important;
}

#game-panel .inspection-telemetry-card {
  border-left-color: var(--studio-brass) !important;
}

#game-panel .inspector-costs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 8px 0 !important;
}

#game-panel .inspector-costs span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 4px 6px !important;
  background: rgba(7, 13, 20, 0.9) !important;
  border: 1px solid rgba(56, 86, 110, 0.65) !important;
  border-radius: 2px !important;
  font-size: 0.7rem !important;
  font-family: var(--font-mono) !important;
  color: var(--studio-ink) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#game-panel .inspector-costs span img {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
  object-fit: contain !important;
}

#game-panel .inspector-btn {
  width: 100% !important;
  padding: 7px 12px !important;
  background: linear-gradient(180deg, #e5a94c 0%, #b87b20 100%) !important;
  border: 1px solid var(--studio-brass-hi) !important;
  color: #080d14 !important;
  font-weight: 800 !important;
  font-size: 0.76rem !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-radius: 2px !important;
  clip-path: var(--studio-chamfer-sm);
  cursor: pointer !important;
}

#game-panel .radar-crimson-alert[hidden] {
  display: none !important;
}

/* World Map Stage (#sector-title) Compact Framing */
#game-panel .sector-console {
  padding: 14px 18px !important;
  margin: 4px 0 16px !important;
  border: 1px solid var(--studio-bezel-hi) !important;
}

/* --------------------------------------------------------------------------
   5. PUBLIC SITE, WORLD PORTAL & ONBOARDING (WELCOME, JOIN, WORLD)
   -------------------------------------------------------------------------- */
body.public-site {
  background:
    linear-gradient(180deg, rgba(6, 11, 17, 0.84) 0%, rgba(7, 12, 19, 0.95) 45%, #05080c 100%),
    url('/assets/runtime/landing-world/gray-meridian-overview-v4.png') center top / cover no-repeat fixed !important;
}

.public-header {
  background: rgba(7, 12, 19, 0.92) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--studio-bezel-hi) !important;
  padding: 10px 24px !important;
}

.public-button {
  background: linear-gradient(180deg, #e5a94c 0%, #b87b20 100%) !important;
  border: 1px solid var(--studio-brass-hi) !important;
  color: #080d14 !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  clip-path: var(--studio-chamfer-sm);
  box-shadow: 0 4px 18px rgba(216, 155, 60, 0.25);
}

.public-button--ghost {
  background: rgba(13, 24, 36, 0.88) !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  color: var(--studio-cyan-hi) !important;
  box-shadow: none;
}

.public-button--ghost:hover {
  border-color: var(--studio-brass-hi) !important;
  color: var(--studio-brass-hi) !important;
}

/* World Login Split-Screen Command Terminal (/world.html) */
body.world-page .world-layout {
  width: min(1620px, 96vw);
  padding: 20px 0 48px;
}

.world-command-grid {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}

.world-command-grid #world-login {
  max-width: none;
  margin: 0;
  background: linear-gradient(165deg, rgba(16, 29, 42, 0.96), rgba(8, 15, 23, 0.98));
  border: 1px solid var(--studio-bezel-hi);
  border-top: 3px solid var(--studio-brass);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
}

.world-theater-brief {
  background: linear-gradient(165deg, rgba(13, 24, 36, 0.94), rgba(8, 14, 21, 0.97));
  border: 1px solid var(--studio-bezel-hi);
  padding: 22px;
  display: grid;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
}

.world-theater-banner {
  position: relative;
  border: 1px solid var(--studio-bezel-hi);
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: #060b10;
}

.world-theater-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.world-theater-banner__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 16px;
  background: linear-gradient(180deg, transparent, rgba(5, 9, 14, 0.95));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

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

.world-server-card {
  background: rgba(9, 17, 26, 0.92);
  border: 1px solid var(--studio-bezel);
  border-left: 3px solid var(--studio-cyan);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  color: var(--studio-ink);
}

.world-server-card:hover {
  border-color: var(--studio-brass-hi);
  background: rgba(18, 32, 46, 0.96);
}

.world-server-card strong {
  font: 700 0.95rem var(--font-display);
  letter-spacing: 0.05em;
  color: var(--studio-brass-hi);
}

.world-server-card small {
  color: var(--studio-muted);
  font-size: 0.74rem;
}

/* Join Registration Enhancement (/join.html) */
.join-layout {
  width: min(1140px, 94vw) !important;
  margin: 0 auto !important;
  padding: 20px 0 48px !important;
}

.join-intro h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem) !important;
  margin: 4px 0 8px !important;
}

.join-step {
  background: linear-gradient(165deg, rgba(15, 27, 40, 0.95), rgba(8, 15, 22, 0.98)) !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  border-top: 3px solid var(--studio-brass) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.7) !important;
}

/* --------------------------------------------------------------------------
   6. MOBILE 390x844 RESPONSIVE SAFEGUARDS (ZERO HORIZONTAL OVERFLOW)
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  #game-panel .game-hud-sticky {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "resources resources"
      "nav nav";
    position: relative;
  }
  #game-panel .game-hud-sticky > .status {
    display: none !important;
  }
  #game-panel .game-hud-sticky > .resource-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #game-panel .dorf1-natural-stage,
  #game-panel .dorf2-city-stage,
  .world-command-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 520px) {
  .world-server-cards {
    grid-template-columns: 1fr;
  }
  #game-panel .game-hud-sticky .header-actions button {
    padding: 4px 6px !important;
    font-size: 0.62rem !important;
  }
}

.world-command-grid:has(#world-login[hidden]) {
  display: none !important;
}

/* --------------------------------------------------------------------------
   7. LANDING PORTAL STUDIO OVERHAUL (body.landing-page)
   Purges SaaS/Fintech pills & neon mint; enforces Brutal Technological Realism,
   Tick-Ruler Scrollbar (Gaussian 44-tick wave), and OCD (ADR-015) Telemetry
   -------------------------------------------------------------------------- */
:root,
html,
body.landing-page {
  color-scheme: dark;
}

body.landing-page *,
body.landing-page *::before,
body.landing-page *::after {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

body.landing-page *::-webkit-scrollbar,
body.landing-page *::-webkit-scrollbar-button,
body.landing-page *::-webkit-scrollbar-track,
body.landing-page *::-webkit-scrollbar-thumb,
body.landing-page *::-webkit-scrollbar-corner {
  width: 0px !important;
  height: 0px !important;
  display: none !important;
  background: transparent !important;
}

body.landing-page {
  --gd-cyan: #58c7d8 !important;
  --gd-cyan-dim: rgba(88, 199, 216, 0.16) !important;
  --gd-cyan-glow: 0 0 18px rgba(88, 199, 216, 0.28) !important;
  --gd-accent: #f3c26b !important;
  --gd-accent-dim: rgba(216, 155, 60, 0.18) !important;
  --gd-accent-glow: 0 0 20px rgba(216, 155, 60, 0.32) !important;
  font-family: var(--font-ui) !important;
  background-color: var(--studio-obsidian) !important;
  background-image:
    linear-gradient(rgba(42, 65, 86, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 65, 86, 0.18) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(88, 199, 216, 0.08) 0%, transparent 70%) !important;
  background-size: 36px 36px, 36px 36px, 100% 100% !important;
  background-attachment: fixed !important;
}

/* Tick-Ruler Scrollbar (44 Gaussian Ticks) */
.studio-tick-scrollbar {
  position: fixed;
  right: 5px;
  top: 64px;
  bottom: 18px;
  width: 22px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 4px 2px;
  user-select: none;
  cursor: ns-resize;
}

.studio-tick-mark {
  width: 4px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.22);
  transition: width 0.12s ease-out, background-color 0.12s ease-out, box-shadow 0.12s ease-out;
  pointer-events: none;
}

.studio-tick-mark.is-major {
  width: 6px;
  background: rgba(216, 155, 60, 0.38);
}

.studio-tick-mark.is-landmark {
  width: 9px;
  background: rgba(88, 199, 216, 0.52);
}

.studio-tick-mark.dist-3 {
  width: 6px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.28);
}

.studio-tick-mark.dist-2 {
  width: 8px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.38);
}

.studio-tick-mark.dist-1 {
  width: 12px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.62);
}

.studio-tick-mark.dist-0 {
  width: 18px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.38);
}

@media (max-width: 768px) {
  .studio-tick-scrollbar {
    display: none;
  }
}

/* Diegetic Section Framing & Tactical Index Headers */
body.landing-page .section-title {
  text-align: left !important;
  max-width: 1180px;
  margin: 0 auto 2.2rem !important;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(90deg, rgba(17, 28, 40, 0.94) 0%, rgba(10, 17, 25, 0.65) 100%);
  border: 1px solid var(--studio-bezel);
  border-left: 4px solid var(--studio-brass);
  clip-path: var(--studio-chamfer-sm);
  display: grid;
  gap: 0.35rem;
  position: relative;
}

body.landing-page .section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font: 700 0.72rem var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--studio-brass-hi);
}

body.landing-page .section-title h2 {
  font-family: var(--font-display) !important;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem) !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  margin: 0 !important;
  color: var(--studio-ink) !important;
}

body.landing-page .section-title p {
  margin: 0 !important;
  max-width: 860px !important;
  font-size: 0.96rem !important;
  color: #cbd5e1 !important;
}

/* UI Glyph Standard for Curated Game Icons */
body.landing-page .ui-glyph {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -3px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}

body.landing-page .ui-glyph--lg {
  width: 24px;
  height: 24px;
}

/* Ontology Concept Dialect (ADR-015) Widgets */
.ocd-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.55rem 0.9rem;
  background: rgba(8, 14, 21, 0.92);
  border: 1px solid var(--studio-bezel);
  border-left: 3px solid var(--studio-cyan);
  margin-bottom: 1.25rem;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.o1-ring-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  font-weight: 600;
}

.o1-micro-ring {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.o1-micro-ring circle.ring-base {
  fill: none;
  stroke: rgba(216, 155, 60, 0.25);
  stroke-width: 2.2;
}

.o1-micro-ring circle.ring-fill {
  fill: none;
  stroke: var(--studio-cyan-hi);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.o2-led-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--studio-cyan-hi);
}

.o2-led-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--studio-cyan-hi);
  box-shadow: 0 0 6px var(--studio-cyan);
  display: inline-block;
}

.o2-led-dot--amber {
  background: var(--studio-brass-hi);
  box-shadow: 0 0 6px var(--studio-brass);
}

.o3-sparkline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}

.o3-sparkline {
  width: 48px;
  height: 16px;
  background: rgba(6, 10, 15, 0.85);
  border: 1px solid rgba(70, 105, 133, 0.5);
}

.o3-sparkline polyline {
  fill: none;
  stroke: var(--studio-cyan-hi);
  stroke-width: 1.5;
}

.o7-crypto-seal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(11, 20, 30, 0.95);
  border: 1px solid var(--studio-bezel-hi);
  color: var(--studio-brass-hi);
  font-family: monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.o5-radar-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.9rem;
  background: rgba(8, 14, 21, 0.9);
  border: 1px solid var(--studio-bezel);
  margin-left: auto;
}

.o5-radar-svg {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.o5-radar-svg polygon.radar-grid {
  fill: none;
  stroke: rgba(216, 155, 60, 0.28);
  stroke-width: 0.9;
}

.o5-radar-svg polygon.radar-poly {
  fill: rgba(25, 198, 219, 0.24);
  stroke: var(--studio-cyan-hi);
  stroke-width: 1.4;
}

.o5-radar-meta,
.o5-radar-legend {
  display: grid;
  gap: 3px;
  font-size: 0.74rem;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

.o5-radar-meta strong,
.o5-radar-legend strong {
  color: var(--studio-brass-hi);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

body.landing-page .landing-nav {
  padding: 0.55rem 1.75rem !important;
  background: linear-gradient(180deg, rgba(7, 12, 18, 0.98), rgba(10, 18, 27, 0.95)) !important;
  border-bottom: 1px solid var(--studio-bezel-hi) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.78) !important;
}

body.landing-page .landing-nav .nav-links a {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.92rem;
  color: #cbd5e1;
}

body.landing-page .btn-primary,
body.landing-page .btn-play-now,
body.landing-page .btn-hero-primary {
  background: linear-gradient(180deg, #e5a94c 0%, #b87b20 100%) !important;
  border: 1px solid var(--studio-brass-hi) !important;
  color: #080d14 !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  border-radius: 2px !important;
  clip-path: var(--studio-chamfer-sm);
  box-shadow: 0 4px 20px rgba(216, 155, 60, 0.32) !important;
}

body.landing-page .btn-secondary,
body.landing-page .btn-hero-secondary {
  background: rgba(12, 22, 33, 0.92) !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  color: var(--studio-cyan-hi) !important;
  font-family: var(--font-display) !important;
  border-radius: 2px !important;
  clip-path: var(--studio-chamfer-sm);
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
}

body.landing-page .btn-secondary:hover {
  border-color: var(--studio-brass-hi) !important;
  color: var(--studio-brass-hi) !important;
}

body.landing-page .landing-hero {
  min-height: auto !important;
  padding: 1.6rem 1.5rem 2.2rem !important;
}

body.landing-page .hero-bg-layer.active {
  opacity: 0.68 !important;
  filter: contrast(1.08) saturate(1.06) !important;
}

body.landing-page .hero-backdrop-vignette {
  background: radial-gradient(circle at 50% 32%, rgba(6, 10, 16, 0.25) 0%, rgba(6, 10, 16, 0.82) 72%, rgba(6, 8, 12, 0.98) 100%) !important;
}

body.landing-page .hero-badge-wrap {
  border-radius: 2px !important;
  background: rgba(11, 20, 30, 0.92) !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  border-left: 3px solid var(--studio-brass) !important;
  color: var(--studio-brass-hi) !important;
  padding: 0.32rem 0.95rem !important;
  margin-bottom: 0.85rem !important;
  clip-path: var(--studio-chamfer-sm);
}

body.landing-page .radar-pulse-dot {
  background: var(--studio-brass-hi) !important;
  box-shadow: 0 0 8px var(--studio-brass) !important;
}

body.landing-page .landing-hero h1 {
  font-family: var(--font-display) !important;
  font-size: clamp(2.4rem, 4.8vw, 3.9rem) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  margin: 0 0 0.65rem !important;
  color: var(--studio-ink) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.9), 0 0 1px rgba(243, 194, 107, 0.4);
}

body.landing-page .landing-hero p.subtitle {
  font-size: 1.02rem !important;
  max-width: 760px !important;
  margin: 0 auto 1.15rem !important;
  color: #cbd5e1 !important;
}

body.landing-page .hero-realm-selector {
  margin: 0 auto 1.15rem !important;
  gap: 0.6rem !important;
}

body.landing-page .realm-btn {
  background: linear-gradient(165deg, rgba(14, 25, 37, 0.92), rgba(8, 15, 23, 0.96)) !important;
  border: 1px solid var(--studio-bezel) !important;
  border-left: 3px solid var(--studio-cyan) !important;
  border-radius: 2px !important;
  clip-path: var(--studio-chamfer-sm);
  padding: 0.55rem 0.85rem !important;
  min-height: 54px !important;
}

body.landing-page .realm-btn.active {
  border-color: var(--studio-brass-hi) !important;
  border-left: 3px solid var(--studio-brass-hi) !important;
  background: linear-gradient(165deg, rgba(28, 42, 56, 0.95), rgba(14, 24, 36, 0.98)) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65), inset 0 0 12px rgba(216, 155, 60, 0.18) !important;
}

body.landing-page .hero-cta-group {
  margin-bottom: 1rem !important;
  gap: 0.75rem !important;
}

body.landing-page .hero-cta-group .btn-primary,
body.landing-page .hero-cta-group .btn-secondary {
  padding: 0.68rem 1.45rem !important;
  font-size: 0.92rem !important;
}

body.landing-page .hero-quick-badges {
  margin-bottom: 0.85rem !important;
  gap: 0.65rem 1.2rem !important;
  font-size: 0.78rem !important;
}

body.landing-page .server-status-bar {
  margin-bottom: 1.1rem !important;
  gap: 0.5rem !important;
}

body.landing-page .server-status-bar .status-item {
  border-radius: 2px !important;
  background: rgba(9, 16, 24, 0.92) !important;
  border: 1px solid rgba(56, 86, 110, 0.65) !important;
  border-left: 2px solid var(--studio-brass) !important;
  padding: 0.3rem 0.75rem !important;
  font-size: 0.76rem !important;
}

body.landing-page .preview-showcase,
body.landing-page .hierarchy-viewer {
  border-radius: 2px !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  border-top: 2px solid var(--studio-brass) !important;
  clip-path: var(--studio-chamfer-md);
}

body.landing-page .preview-showcase {
  max-height: 280px !important;
  overflow: hidden !important;
}

body.landing-page .preview-showcase img {
  max-height: 280px !important;
  object-fit: cover !important;
}

body.landing-page .h-faction-btn,
body.landing-page .h-tier-btn,
body.landing-page .faction-tab-btn,
body.landing-page .lb-tab-btn {
  border-radius: 2px !important;
  clip-path: var(--studio-chamfer-sm);
  font-family: var(--font-display) !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  background: rgba(11, 19, 29, 0.92) !important;
  color: #e2e8f0 !important;
}

body.landing-page .h-faction-btn.active,
body.landing-page .h-tier-btn.active,
body.landing-page .faction-tab-btn.active,
body.landing-page .lb-tab-btn.active {
  background: linear-gradient(180deg, rgba(216, 155, 60, 0.25), rgba(16, 28, 42, 0.96)) !important;
  border-color: var(--studio-brass-hi) !important;
  color: var(--studio-brass-hi) !important;
  box-shadow: inset 0 0 10px rgba(216, 155, 60, 0.2) !important;
}

body.landing-page .hook-card,
body.landing-page .h-card,
body.landing-page .world-card,
body.landing-page .faction-pane,
body.landing-page .trait-badge-card,
body.landing-page .unit-portrait-card,
body.landing-page .community-card,
body.landing-page .ticker-bar-wrap,
body.landing-page .matrix-table-wrap {
  border-radius: 2px !important;
  border: 1px solid var(--studio-bezel) !important;
  border-top: 2px solid var(--studio-brass) !important;
  background: linear-gradient(165deg, rgba(14, 24, 36, 0.95), rgba(8, 14, 22, 0.98)) !important;
  clip-path: var(--studio-chamfer-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65) !important;
}

body.landing-page .hook-icon-wrap {
  border-radius: 2px !important;
  clip-path: var(--studio-chamfer-sm);
  background: rgba(11, 20, 30, 0.95) !important;
  border: 1px solid var(--studio-brass) !important;
  color: var(--studio-brass-hi) !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
}

body.landing-page .hierarchy-tactical-pin {
  border-radius: 2px !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  border-left: 3px solid var(--studio-brass-hi) !important;
  background: rgba(8, 14, 21, 0.94) !important;
  animation: none !important;
}



/* =====================================================================
   DORF3 — Endless toroidal world map (public/world-map-endless.js)
   Canvas fills the stage; the legacy 7x7 diorama grid stays in the DOM
   (app.js still renders it) but is no longer the visible surface.
   ===================================================================== */
body .sector-console .toroidal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 6px 12px; margin: 0 0 10px; min-height: 0; height: auto;
}
body .sector-console .toroidal-toolbar > * { margin-top: 0; margin-bottom: 0; }
body .sector-console .toroidal-nav-pad { display: none; }
body .sector-console .toroidal-focal-badge { flex-direction: row; align-items: baseline; gap: 10px; padding: 0; border: 0; background: none; }
body .sector-console .toroidal-focal-badge .focal-badge__coords { font-size: 1.15rem; }
body .sector-console .toroidal-jump-form { margin-left: auto; }

body .toroidal-map-stage {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: stretch;
  height: clamp(440px, calc(100vh - 300px), 760px);
}
body .toroidal-grid-wrapper.has-endless-map {
  position: relative; padding: 0; overflow: hidden; border-radius: 2px;
  border: 1px solid rgba(214, 170, 82, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 12px 32px rgba(0, 0, 0, 0.45);
  background: #1b2318;
}
body .toroidal-grid-wrapper.has-endless-map .toroidal-grid-7x7 { display: none; }
body .toroidal-map-stage .quick-march-card { align-self: start; max-height: 100%; overflow: auto; }

.endless-map { position: absolute; inset: 0; }
.endless-map__canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; outline: none; }
.endless-map__canvas.is-dragging { cursor: grabbing; }
.endless-map__canvas:focus-visible { box-shadow: inset 0 0 0 2px #e5aa3e; }
.endless-map__hud { position: absolute; inset: 0; pointer-events: none; }
.endless-map__hud > * { pointer-events: auto; }

.endless-map__readout {
  position: absolute; left: 12px; top: 12px; display: flex; gap: 10px; align-items: baseline;
  padding: 6px 12px 6px 10px; background: rgba(8, 12, 16, 0.82); border-left: 3px solid #e5aa3e;
  font: 600 0.82rem/1.1 var(--font-ui, system-ui); color: #f1ead8; letter-spacing: 0.04em; pointer-events: none;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.endless-map__cursor { font-variant-numeric: tabular-nums; color: #ffd27a; }
.endless-map__name { color: #b9c2c8; font-weight: 500; max-width: 34ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.endless-map__compass { position: absolute; left: 12px; bottom: 12px; width: 58px; height: 58px; pointer-events: none; }
.endless-map__compass circle { fill: rgba(8, 12, 16, 0.72); stroke: rgba(229, 170, 62, 0.5); }
.endless-map__compass line { stroke: #e5aa3e; stroke-width: 1.6; }
.endless-map__compass .axis-e { stroke: rgba(229, 170, 62, 0.6); }
.endless-map__compass text { fill: #e5aa3e; font: 700 9px var(--font-ui, system-ui); }
.endless-map__zoom {
  position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; align-items: stretch;
  background: rgba(8, 12, 16, 0.85); border: 1px solid rgba(229, 170, 62, 0.4);
}
.endless-map__zoom button {
  width: 36px; height: 34px; border: 0; border-bottom: 1px solid rgba(229, 170, 62, 0.25); background: transparent;
  color: #f1ead8; font: 700 1.05rem var(--font-ui, system-ui); cursor: pointer; padding: 0;
}
.endless-map__zoom button:hover, .endless-map__zoom button:focus-visible { background: rgba(229, 170, 62, 0.18); color: #ffd27a; outline: none; }
.endless-map__zoom-level { font: 600 0.64rem var(--font-ui, system-ui); color: #9aa6ad; text-align: center; padding: 3px 0; border-bottom: 1px solid rgba(229, 170, 62, 0.25); }

.endless-map__minimap {
  position: absolute; right: 12px; bottom: 12px; width: 168px; height: 168px; cursor: crosshair;
  border: 1px solid rgba(229, 170, 62, 0.5); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); image-rendering: pixelated;
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 960px) {
  body .toroidal-map-stage { grid-template-columns: 1fr; height: auto; }
  body .toroidal-grid-wrapper.has-endless-map { height: 62vh; min-height: 340px; }
  body .sector-console .toroidal-jump-form { margin-left: 0; }
  .endless-map__minimap { width: 112px; height: 112px; }
  .endless-map__zoom button { width: 44px; height: 44px; }
}
body .sector-console .toroidal-jump-form button { min-height: 0; height: 30px; padding: 0 14px; }
body .sector-console .toroidal-jump-form input { height: 30px; }

/* ==========================================================================
   TRAVIAN T4 GPACK × SCI-FI RTS COMMAND BRIDGE HUD (Opus-Pro Swarm Synthesis)
   Replaces the 5-row boxy SaaS header with a sleek GPack Medallion Dock (#mtop)
   and Chamfered Resource Strip (#resWrap) using 3D painted medallions in
   /assets/runtime/ui-icon/*.png and /assets/runtime/ui-shell/*.png
   ========================================================================== */
#game-panel .game-hud-sticky {
  display: grid !important;
  grid-template-areas:
    "brand resources actions"
    "nav   nav       status" !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  padding: 4px 12px !important;
  margin: 0 calc(-50vw + 50%) 4px !important;
  padding-inline: max(12px, calc(50vw - 760px)) !important;
  background: linear-gradient(180deg, #12202f 0%, #0b141f 55%, #070d15 100%) !important;
  border-bottom: 1px solid #29455c !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(216, 155, 60, 0.28),
    0 4px 16px rgba(0, 0, 0, 0.75) !important;
  gap: 4px 8px !important;
  align-items: center !important;
}

/* 1. Brand: Compact Commander Badge (AAA Strategy HUD Proportions) */
#game-panel .game-hud-sticky > header > div:first-child {
  grid-area: brand !important;
  position: relative !important;
  padding: 2px 10px 2px 30px !important;
  min-height: 30px !important;
  display: flex !important;
  align-items: center !important;
  background: linear-gradient(135deg, rgba(216, 155, 60, 0.18) 0%, rgba(14, 26, 38, 0.95) 70%) !important;
  border: 1px solid rgba(216, 155, 60, 0.48) !important;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px) !important;
  box-shadow: inset 0 0 10px rgba(216, 155, 60, 0.12) !important;
}

#game-panel .game-hud-sticky > header > div:first-child::before {
  content: "" !important;
  position: absolute !important;
  left: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 20px !important;
  height: 20px !important;
  background: url('/assets/runtime/ui-icon/settlement.png') center / contain no-repeat !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65)) !important;
}

#game-panel #callsign {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  color: #fce7b2 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  white-space: nowrap !important;
}

/* 2. Resource Bar (#resWrap Compact 2x2 Grid Pods with Dedicated 30px Icon Gutter) */
#game-panel .game-hud-sticky > .resource-bar {
  grid-area: resources !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(135px, 1fr)) !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  column-gap: 5px !important;
  row-gap: 1px !important;
  min-width: 0 !important;
  min-height: 32px !important;
  /* 30px left gutter guarantees the 20x20 ::before icon NEVER overlaps numbers or labels */
  padding: 2px 7px 4px 30px !important;
  background: linear-gradient(180deg, #112030 0%, #09121c 100%) !important;
  border: 1px solid rgba(56, 86, 110, 0.7) !important;
  border-top: 1.5px solid var(--studio-cyan) !important;
  border-radius: 3px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 4px rgba(0, 0, 0, 0.4) !important;
  overflow: hidden !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource::before {
  content: "" !important;
  position: absolute !important;
  left: 5px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 20px !important;
  height: 20px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7)) !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(1)::before {
  background-image: url('/assets/runtime/ui-icon/energy.png') !important;
}
#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(2)::before {
  background-image: url('/assets/runtime/ui-icon/materials.png') !important;
}
#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(3)::before {
  background-image: url('/assets/runtime/ui-icon/intelligence.png') !important;
}
#game-panel .game-hud-sticky > .resource-bar .resource:nth-child(4)::before {
  background-image: url('/assets/runtime/ui-icon/credits.png') !important;
}

/* Row 1 Col 1: Resource Identity Label */
#game-panel .game-hud-sticky > .resource-bar .resource__identity {
  grid-column: 1 / 2 !important;
  grid-row: 1 / 2 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 0.56rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  line-height: 1.1 !important;
}

/* Keep SVG in DOM for verify-ui-icons.js while showing 3D painted GPack medallion via ::before */
#game-panel .game-hud-sticky > .resource-bar .resource__identity img {
  display: none !important;
}

/* Row 1 Col 2: Hourly Production Rate */
#game-panel .game-hud-sticky > .resource-bar .resource .resource__rate,
#game-panel .game-hud-sticky > .resource-bar .resource > span.resource__rate {
  grid-column: 2 / 3 !important;
  grid-row: 1 / 2 !important;
  justify-self: end !important;
  font-size: 0.56rem !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  color: #34d399 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.1 !important;
}

/* Row 2 Col 1: Stock / Capacity Tabular Readout */
#game-panel .game-hud-sticky > .resource-bar .resource strong,
#game-panel .game-hud-sticky > .resource-bar .resource strong.resource__stock {
  grid-column: 1 / 2 !important;
  grid-row: 2 / 3 !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums !important;
  color: #f8fafc !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

/* Row 2 Col 2: Compact Micro-Badge for Capacity Status (Never Overlaps Numbers) */
#game-panel .game-hud-sticky > .resource-bar .resource .resource__capacity-status {
  grid-column: 2 / 3 !important;
  grid-row: 2 / 3 !important;
  justify-self: end !important;
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  margin: 0 !important;
  padding: 1px 3px !important;
  font-size: 0.46rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  border-radius: 2px !important;
  background: rgba(220, 76, 86, 0.24) !important;
  border: 1px solid rgba(248, 113, 113, 0.5) !important;
  color: #fecaca !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource .resource__capacity-status.is-near {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
  color: #fde047 !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource .resource__capacity-status.is-full {
  background: rgba(220, 38, 38, 0.28) !important;
  border-color: rgba(248, 113, 113, 0.7) !important;
  color: #fca5a5 !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource .resource__capacity-status img {
  width: 8px !important;
  height: 8px !important;
}

/* Bottom capacity progress bar */
#game-panel .game-hud-sticky > .resource-bar .resource .resource__meter-bar {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 2px !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource .resource__meter-track {
  height: 100% !important;
  background: linear-gradient(90deg, #38bdf8 0%, #53f2de 100%) !important;
  transition: width 0.3s ease !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource.resource--capacity-warning .resource__meter-track {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%) !important;
}

#game-panel .game-hud-sticky > .resource-bar .resource.is-full .resource__meter-track {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%) !important;
}

/* External Route Chips & Header Action Micro-Buttons */
#game-panel .game-hud-sticky .header-actions {
  gap: 4px !important;
}

#game-panel .game-hud-sticky .header-actions button {
  padding: 2px 7px !important;
  font-size: 0.6rem !important;
  min-height: 24px !important;
  letter-spacing: 0.04em !important;
}

#game-panel .game-hud-sticky .header-external-routes {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin-right: 2px !important;
}

#game-panel .game-hud-sticky .route-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 2px 6px !important;
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  min-height: 24px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  color: #94a3b8 !important;
  background: rgba(15, 27, 39, 0.85) !important;
  border: 1px solid var(--studio-bezel-hi) !important;
  border-radius: 2px !important;
  transition: all 0.16s ease !important;
}

#game-panel .game-hud-sticky .route-chip:hover {
  color: #f8fafc !important;
  border-color: var(--studio-cyan) !important;
  background: rgba(24, 44, 64, 0.95) !important;
}

/* 3. Navigation: Sleek 8-Tab Tactical Dock (Zero Clipping on Tabs 7 & 8) */
#game-panel .game-hud-sticky > nav.game-navigation {
  grid-area: nav !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 2px 4px !important;
  margin: 0 !important;
  background: linear-gradient(180deg, #0b1520 0%, #070e16 100%) !important;
  border: 1px solid #264057 !important;
  border-radius: 3px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

#game-panel .game-hud-sticky > nav.game-navigation a {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 6px !important;
  min-height: 22px !important;
  font-size: 0.6rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  color: #9cb3c5 !important;
  background: rgba(15, 28, 42, 0.72) !important;
  border: 1px solid rgba(45, 74, 99, 0.6) !important;
  border-radius: 2px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

#game-panel .game-hud-sticky > nav.game-navigation a:hover {
  color: #f8fafc !important;
  border-color: #58c7d8 !important;
  background: rgba(24, 44, 64, 0.92) !important;
}

/* Keep monochrome SVG in DOM for verify-ui-icons.js while showing 3D painted GPack medallion via ::before */
#game-panel .game-hud-sticky > nav.game-navigation a img {
  display: none !important;
}

#game-panel .game-hud-sticky > nav.game-navigation a::before {
  content: "" !important;
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  display: inline-block !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)) !important;
}

#game-panel .game-hud-sticky > nav.game-navigation a[href="#resource-fields-title"]::before {
  background-image: url('/assets/runtime/ui-icon/construction.png') !important;
}
#game-panel .game-hud-sticky > nav.game-navigation a[href="#settlement-title"]::before {
  background-image: url('/assets/runtime/ui-icon/settlement.png') !important;
}
#game-panel .game-hud-sticky > nav.game-navigation a[href="#sector-title"]::before {
  background-image: url('/assets/runtime/ui-icon/world-map.png') !important;
}
#game-panel .game-hud-sticky > nav.game-navigation a[href="#forces-title"]::before {
  background-image: url('/assets/runtime/ui-icon/recon.png') !important;
}
#game-panel .game-hud-sticky > nav.game-navigation a[href="#reports-title"]::before {
  background-image: url('/assets/runtime/ui-icon/intelligence.png') !important;
}
#game-panel .game-hud-sticky > nav.game-navigation a[href="#chat-title"]::before {
  background-image: url('/assets/runtime/ui-icon/alliance.png') !important;
}
#game-panel .game-hud-sticky > nav.game-navigation a[href="#social-title"]::before {
  background-image: url('/assets/runtime/ui-icon/trade.png') !important;
}
#game-panel .game-hud-sticky > nav.game-navigation a[href="#endgame-title"]::before {
  background-image: url('/assets/runtime/ui-icon/storage.png') !important;
}

#game-panel .game-hud-sticky > nav.game-navigation a.is-active-tab,
#game-panel .game-hud-sticky > nav.game-navigation a[aria-current="location"] {
  background: radial-gradient(ellipse at 50% 100%, rgba(88, 199, 216, 0.32) 0%, rgba(216, 155, 60, 0.22) 60%, rgba(16, 30, 44, 0.96) 100%) !important;
  border-color: #f3c26b !important;
  border-bottom: 2px solid #58c7d8 !important;
  color: #fce7b2 !important;
  box-shadow: inset 0 0 8px rgba(88, 199, 216, 0.22) !important;
}

/* Row 2 Right: Compact Sector & Influence Status Readout */
#game-panel .game-hud-sticky > .status {
  grid-area: status !important;
  margin: 0 !important;
  padding: 2px 7px !important;
  min-height: 24px !important;
  border: 1px solid rgba(45, 71, 94, 0.6) !important;
  border-radius: 3px !important;
  background: rgba(7, 13, 20, 0.88) !important;
  font-size: 0.56rem !important;
  gap: 7px !important;
  white-space: nowrap !important;
}

/* 4. Eliminate Duplicate Stage Switcher Row on Desktop & Refine Sub-Header Ribbons */
@media (min-width: 769px) {
  #game-panel .settlement-stage-switcher {
    display: none !important;
  }
}

#game-panel .hero.game-stage {
  min-height: 26px !important;
  padding: 2px 10px !important;
  margin: 0 0 4px !important;
  background: linear-gradient(90deg, rgba(14, 26, 38, 0.92) 0%, rgba(9, 17, 26, 0.88) 100%) !important;
  border: 1px solid #233b50 !important;
  border-left: 2.5px solid var(--studio-brass) !important;
  border-radius: 3px !important;
}

#game-panel .hero.game-stage .eyebrow {
  font-size: 0.56rem !important;
  letter-spacing: 0.08em !important;
}

#game-panel .hero.game-stage h2 {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
}

#game-panel .hero.game-stage .hero-actions button,
#game-panel .hero.game-stage .hero-actions a {
  padding: 2px 7px !important;
  font-size: 0.58rem !important;
  min-height: 21px !important;
}

#game-panel .hero.game-stage .upgrade strong {
  font-size: 0.72rem !important;
}

#game-panel .hero.game-stage .upgrade span {
  font-size: 0.58rem !important;
}

#game-panel .functional-landscape > .section-heading {
  min-height: 24px !important;
  padding: 2px 10px !important;
  margin: -6px -14px 4px !important;
}

#game-panel .functional-landscape > .section-heading .eyebrow {
  font-size: 0.52rem !important;
  letter-spacing: 0.08em !important;
}

#game-panel .functional-landscape > .section-heading h2 {
  font-size: 0.74rem !important;
  letter-spacing: 0.05em !important;
}

#game-panel .functional-landscape > .section-heading p {
  font-size: 0.58rem !important;
}

#game-panel .functional-landscape > .workspace-note {
  font-size: 0.62rem !important;
  margin: 0 0 4px !important;
  line-height: 1.25 !important;
  color: #7c93a8 !important;
}

#game-panel .dorf1-filter-bar {
  margin: 0 0 5px !important;
  padding: 1px 0 !important;
  gap: 4px !important;
}

#game-panel .dorf1-filter-bar .filter-pill {
  padding: 2px 8px !important;
  font-size: 0.58rem !important;
  min-height: 21px !important;
}

@media (max-width: 960px) {
  #game-panel .game-hud-sticky > .resource-bar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #game-panel .game-hud-sticky > .resource-bar .resource { padding-left: 30px !important; }
  #game-panel .game-hud-sticky > .resource-bar .resource::before { width: 18px !important; height: 18px !important; left: 5px !important; }
}

/* Foreground Building & Resource Operation VFX Overlay (Opus-Pro Volumetric Sprite & Shader System) */
.dorf-building-node,
.dorf-field-node {
  position: absolute;
  overflow: visible !important;
}
.building-op-vfx-overlay {
  position: absolute;
  inset: -26px;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.building-op-vfx-overlay img.vfx-construction-rig-art,
.dorf-building-node .building-op-vfx-overlay img.vfx-construction-rig-art,
.dorf-field-node .building-op-vfx-overlay img.vfx-construction-rig-art {
  position: absolute;
  width: 68px;
  height: 68px;
  object-fit: contain;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 3;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.38));
  animation: gdConstructionBob 2.8s ease-in-out infinite;
}
.vfx-dust-cloud {
  position: absolute;
  width: 64px;
  height: 64px;
  background: url('/assets/vfx/ui/construction-dust.png') center / contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0;
  z-index: 4;
}
.vfx-dust-a {
  animation: gdDustPlumeA 3.2s ease-out infinite;
}
.vfx-dust-b {
  animation: gdDustPlumeB 3.2s ease-out -1.6s infinite;
}
.vfx-work-pulse {
  position: absolute;
  width: 76px;
  height: 76px;
  background: url('/assets/vfx/ui/command-pulse.png') center / contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0.55;
  z-index: 1;
  animation: gdWorkPulse var(--vfx-dur, 2.8s) ease-in-out infinite;
}
.vfx-work-pulse.is-command {
  width: 84px;
  height: 48px;
  filter: hue-rotate(-10deg) saturate(1.25);
}
.vfx-atmo-glow {
  position: absolute;
  width: 72px;
  height: 42px;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(8px);
  z-index: 1;
  animation: gdAtmoBreathe var(--vfx-dur, 3.2s) ease-in-out infinite;
}
.vfx-atmo-glow.is-amber {
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.46) 0%, rgba(245, 158, 11, 0.16) 55%, transparent 75%);
}
.vfx-atmo-glow.is-furnace {
  background: radial-gradient(ellipse at center, rgba(249, 115, 22, 0.56) 0%, rgba(234, 88, 12, 0.22) 55%, transparent 75%);
}
.vfx-atmo-glow.is-cyan {
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.44) 0%, rgba(14, 165, 233, 0.15) 55%, transparent 75%);
}
.vfx-atmo-glow.is-bio {
  background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.42) 0%, rgba(56, 189, 248, 0.14) 55%, transparent 75%);
}
.vfx-furnace-glow {
  position: absolute;
  width: 34px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.82) 0%, rgba(249, 115, 22, 0.48) 50%, transparent 75%);
  mix-blend-mode: screen;
  filter: blur(3px);
  z-index: 2;
  animation: gdFurnaceFlicker 1.35s ease-in-out infinite alternate;
}
.vfx-smoke-plume {
  position: absolute;
  width: 48px;
  height: 48px;
  background: url('/assets/vfx/ui/construction-dust.png') center / contain no-repeat;
  mix-blend-mode: screen;
  filter: brightness(1.12) contrast(0.92);
  opacity: 0;
  z-index: 3;
}
.vfx-smoke-a {
  animation: gdSmokeRiseA var(--vfx-dur, 3.2s) ease-out infinite;
}
.vfx-smoke-b {
  animation: gdSmokeRiseB var(--vfx-dur, 3.2s) ease-out calc(var(--vfx-dur, 3.2s) * -0.5) infinite;
}
.vfx-ember-motes {
  position: absolute;
  inset: 0;
  z-index: 4;
}
.vfx-ember-motes i {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #fde68a 45%, rgba(245, 158, 11, 0) 100%);
  mix-blend-mode: screen;
  filter: blur(0.4px);
  opacity: 0;
}
.vfx-ember-motes.is-cyan i {
  background: radial-gradient(circle, #ffffff 0%, #7dd3fc 45%, rgba(56, 189, 248, 0) 100%);
}
.vfx-ember-motes.is-bio i {
  background: radial-gradient(circle, #ffffff 0%, #6ee7b7 45%, rgba(52, 211, 153, 0) 100%);
}
.vfx-ember-motes i:nth-child(1) {
  margin-left: -10px;
  animation: gdMoteFloatA var(--vfx-dur, 2.8s) ease-out infinite;
}
.vfx-ember-motes i:nth-child(2) {
  margin-left: 8px;
  animation: gdMoteFloatB var(--vfx-dur, 2.8s) ease-out -0.9s infinite;
}
.vfx-ember-motes i:nth-child(3) {
  margin-left: 0px;
  animation: gdMoteFloatA var(--vfx-dur, 2.8s) ease-out -1.8s infinite;
}
.settlement-compound-underlay .living-operation-visual,
.settlement-compound-underlay .living-core-operation-fx,
.settlement-compound-underlay .living-city-role-fx,
.settlement-compound-underlay .living-building-mechanism {
  mix-blend-mode: screen;
}
@keyframes gdConstructionBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.03); }
}
@keyframes gdDustPlumeA {
  0% { transform: translate(-8px, 6px) scale(0.55); opacity: 0; }
  30% { opacity: 0.68; }
  100% { transform: translate(-20px, -22px) scale(1.32); opacity: 0; }
}
@keyframes gdDustPlumeB {
  0% { transform: translate(8px, 6px) scale(0.55); opacity: 0; }
  30% { opacity: 0.62; }
  100% { transform: translate(22px, -24px) scale(1.36); opacity: 0; }
}
@keyframes gdSmokeRiseA {
  0% { transform: translate(-4px, -2px) scale(0.45); opacity: 0; }
  35% { opacity: 0.52; }
  100% { transform: translate(-14px, -34px) scale(1.25); opacity: 0; }
}
@keyframes gdSmokeRiseB {
  0% { transform: translate(6px, 0px) scale(0.45); opacity: 0; }
  35% { opacity: 0.46; }
  100% { transform: translate(16px, -36px) scale(1.28); opacity: 0; }
}
@keyframes gdWorkPulse {
  0%, 100% { transform: scale(0.84); opacity: 0.26; }
  50% { transform: scale(1.12); opacity: 0.68; }
}
@keyframes gdAtmoBreathe {
  0%, 100% { transform: scale(0.88); opacity: 0.42; }
  50% { transform: scale(1.14); opacity: 0.86; }
}
@keyframes gdFurnaceFlicker {
  0% { transform: scale(0.9); opacity: 0.52; }
  100% { transform: scale(1.16); opacity: 0.95; }
}
@keyframes gdMoteFloatA {
  0% { transform: translate(0, 4px) scale(0.6); opacity: 0; }
  25% { opacity: 0.92; }
  100% { transform: translate(-8px, -28px) scale(1.1); opacity: 0; }
}
@keyframes gdMoteFloatB {
  0% { transform: translate(0, 4px) scale(0.6); opacity: 0; }
  25% { opacity: 0.88; }
  100% { transform: translate(9px, -26px) scale(1.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .building-op-vfx-overlay,
  .building-op-vfx-overlay * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   GRAY DOOM — Travian T4 GPack × Sci-Fi RTS 2.5D Command Interface
   Functional Families 2, 3, 4, 5, 6, 7 & 8 (100% Zero-Gap GPack Rollout)
   3D Medallion & Chamfered Chrome Style System
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --gp-slate-900: #0d0f14;
  --gp-slate-800: #161a23;
  --gp-slate-700: #1e2330;
  --gp-slate-600: #272d3d;
  --gp-slate-500: #3a4256;
  --gp-chrome-highlight: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 60%);
  --gp-brass-rim: #c9a84c;
  --gp-brass-glow: rgba(201,168,76,.45);
  --gp-cyan-accent: #4af0e1;
  --gp-cyan-glow: rgba(74,240,225,.35);
  --gp-gold-rim: #e2c044;
  --gp-crimson: #e63946;
  --gp-crimson-glow: rgba(230,57,70,.55);
  --gp-rivet: radial-gradient(circle, #58564e 0%, #3a3830 55%, transparent 70%);
  --gp-chamfer: 1px 1px 0 rgba(255,255,255,.08), -1px -1px 0 rgba(0,0,0,.45);
  --gp-inset-shadow: inset 0 1px 0 rgba(201,168,76,.22), inset 0 -1px 0 rgba(0,0,0,.6);
  --gp-card-border: 1px solid rgba(201,168,76,.18);
  --gp-card-bg: linear-gradient(168deg, var(--gp-slate-700) 0%, var(--gp-slate-900) 100%);
  --gp-medallion-shadow: 0 1px 3px rgba(0,0,0,.7), 0 0 0 1px rgba(201,168,76,.25);
  --gp-transition-fast: 160ms cubic-bezier(.4,0,.2,1);
  --gp-transition-med: 280ms cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAMILY 2 — dorf1 / dorf2 (Village & Building Views: t4/f, t4/g, t4/g/s)
   ═══════════════════════════════════════════════════════════════════════════ */

.dorf1-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: var(--gp-slate-800);
  border: 1px solid rgba(201,168,76,.16);
  border-radius: 4px;
  box-shadow: var(--gp-inset-shadow), 0 2px 6px rgba(0,0,0,.5);
}

.dorf1-filter-bar .filter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font: 600 11px/1.2 'Rajdhani', 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #b8c2d0;
  background: linear-gradient(180deg, var(--gp-slate-600) 0%, var(--gp-slate-800) 100%);
  border: 1px solid rgba(201,168,76,.16);
  border-radius: 3px;
  box-shadow: var(--gp-chamfer), 0 1px 3px rgba(0,0,0,.45);
  cursor: pointer;
  transition: color var(--gp-transition-fast), box-shadow var(--gp-transition-fast),
              border-color var(--gp-transition-fast), background var(--gp-transition-fast);
  user-select: none;
}

.dorf1-filter-bar .filter-pill:not([data-filter="all"]) {
  padding-left: 28px;
}

.dorf1-filter-bar .filter-pill:hover {
  color: #f0f4f8;
  border-color: rgba(201,168,76,.38);
  box-shadow: var(--gp-chamfer), 0 0 8px var(--gp-brass-glow);
}

.dorf1-filter-bar .filter-pill.is-active,
.dorf1-filter-bar .filter-pill.active,
.dorf1-filter-bar .filter-pill[aria-pressed="true"] {
  color: var(--gp-gold-rim);
  background: linear-gradient(180deg, #2a3346 0%, #161b26 100%);
  border-color: var(--gp-brass-rim);
  box-shadow: var(--gp-chamfer), 0 0 10px var(--gp-brass-glow), inset 0 1px 0 rgba(201,168,76,.32);
}

.dorf1-filter-bar .filter-pill:not([data-filter="all"])::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.65));
}

.dorf1-filter-bar .filter-pill[data-filter="composites"]::before {
  background-image: url('/assets/runtime/ui-icon/materials.png');
}
.dorf1-filter-bar .filter-pill[data-filter="ceramics"]::before {
  background-image: url('/assets/runtime/ui-icon/storage.png');
}
.dorf1-filter-bar .filter-pill[data-filter="alloys"]::before {
  background-image: url('/assets/runtime/ui-icon/construction.png');
}
.dorf1-filter-bar .filter-pill[data-filter="provisions"]::before {
  background-image: url('/assets/runtime/ui-icon/energy.png');
}
.dorf1-filter-bar .filter-pill[data-filter="upgrading"]::before {
  background-image: url('/assets/runtime/ui-icon/construction.png');
}
.dorf1-filter-bar .filter-pill[data-filter="ready"]::before {
  background-image: url('/assets/runtime/report-icon/construction-complete.png');
}

/* Telemetry Cards (Travian T4 box.png / build-panel.png Chamfered Plates) */
.dorf-telemetry-card,
.inspection-telemetry-card,
.queue-telemetry-card,
.production-telemetry-card,
.troop-telemetry-card,
.expansion-telemetry-card {
  position: relative;
  background:
    linear-gradient(168deg, rgba(22, 28, 39, 0.94) 0%, rgba(11, 15, 22, 0.97) 100%),
    url('/assets/runtime/ui-shell/build-panel.png') center / cover no-repeat;
  border: var(--gp-card-border);
  border-radius: 4px;
  box-shadow:
    var(--gp-inset-shadow),
    0 4px 12px rgba(0,0,0,.58),
    var(--gp-chamfer);
  padding: 14px 16px 12px;
  overflow: hidden;
}

.dorf-telemetry-card::before,
.inspection-telemetry-card::before,
.queue-telemetry-card::before,
.production-telemetry-card::before,
.troop-telemetry-card::before,
.expansion-telemetry-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gp-brass-rim) 28%, var(--gp-cyan-accent) 50%, var(--gp-brass-rim) 72%, transparent 100%);
  opacity: .65;
  pointer-events: none;
}

.dorf-telemetry-card h3,
.inspection-telemetry-card h3,
.queue-telemetry-card h3,
.production-telemetry-card h3,
.troop-telemetry-card h3,
.expansion-telemetry-card h3 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 26px;
}

.dorf-telemetry-card h3::before,
.inspection-telemetry-card h3::before,
.queue-telemetry-card h3::before,
.production-telemetry-card h3::before,
.troop-telemetry-card h3::before,
.expansion-telemetry-card h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

.dorf-telemetry-card h3::before {
  background-image: url('/assets/runtime/ui-icon/settlement.png');
}
.inspection-telemetry-card h3::before {
  background-image: url('/assets/runtime/ui-icon/construction.png');
}
.queue-telemetry-card h3::before {
  background-image: url('/assets/runtime/ui-icon/construction.png');
}
.production-telemetry-card h3::before {
  background-image: url('/assets/runtime/ui-icon/energy.png');
}
.troop-telemetry-card h3::before {
  background-image: url('/assets/runtime/ui-icon/storage.png');
}
.expansion-telemetry-card h3::before {
  background-image: url('/assets/runtime/ui-icon/world-map.png');
}

/* Embossed Level Medallions (Travian t4/g/s/glvl.gif & lvl11_20_active.gif) */
.dorf-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  font: 800 11px/1 'Rajdhani', 'Segoe UI', sans-serif;
  color: #fce7b2;
  text-shadow: 0 1px 2px rgba(0,0,0,.9);
  background:
    radial-gradient(ellipse at 35% 25%, rgba(255,255,255,.22) 0%, transparent 55%),
    linear-gradient(160deg, #323a48 0%, #171c26 55%, #0b0e14 100%);
  border: 1.5px solid var(--gp-brass-rim);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px #080b10,
    0 0 8px rgba(201,168,76,.32),
    0 2px 5px rgba(0,0,0,.78),
    inset 0 1px 0 rgba(255,255,255,.18);
}

.building,
.field-atlas__slot {
  background: var(--gp-card-bg);
  border: 1px solid rgba(201,168,76,.16);
  box-shadow: var(--gp-chamfer), 0 2px 8px rgba(0,0,0,.5);
  transition: border-color var(--gp-transition-fast), box-shadow var(--gp-transition-med);
}

.building:hover,
.field-atlas__slot:hover {
  border-color: rgba(201,168,76,.42);
  box-shadow: var(--gp-chamfer), 0 0 12px var(--gp-brass-glow), 0 3px 10px rgba(0,0,0,.55);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAMILY 3 — dorf3 (World Map: t4/m, t4/wm)
   ═══════════════════════════════════════════════════════════════════════════ */

.toroidal-toolbar {
  background: linear-gradient(180deg, #1d2433 0%, #10141d 100%);
  border: 1px solid rgba(201,168,76,.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.6),
    0 4px 12px rgba(0,0,0,.65);
}

.toroidal-nav-pad .toroidal-pan-btn {
  background: linear-gradient(180deg, var(--gp-slate-600) 0%, var(--gp-slate-800) 100%);
  border: 1px solid rgba(201,168,76,.22);
  box-shadow: var(--gp-chamfer), 0 1px 3px rgba(0,0,0,.5);
}

.toroidal-nav-pad .toroidal-pan-btn:hover {
  border-color: rgba(74,240,225,.48);
  box-shadow: var(--gp-chamfer), 0 0 8px var(--gp-cyan-glow);
}

.toroidal-focal-badge {
  background:
    radial-gradient(ellipse at 40% 30%, rgba(74,240,225,.12) 0%, transparent 60%),
    linear-gradient(160deg, #1e2330 0%, #0d0f14 100%);
  border: 1.5px solid rgba(74,240,225,.38);
  box-shadow:
    0 0 10px var(--gp-cyan-glow),
    inset 0 1px 0 rgba(255,255,255,.1);
}

.quick-march-card {
  position: relative;
  background:
    linear-gradient(168deg, rgba(22, 28, 39, 0.95) 0%, rgba(11, 15, 22, 0.98) 100%),
    url('/assets/runtime/ui-shell/build-panel.png') center / cover no-repeat;
  border: var(--gp-card-border);
  box-shadow: var(--gp-inset-shadow), 0 6px 18px rgba(0,0,0,.68), var(--gp-chamfer);
}

.quick-march-card #scout,
.quick-march-card #attack,
.quick-march-card #logistics {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 34px;
}

.quick-march-card #scout::before,
.quick-march-card #attack::before,
.quick-march-card #logistics::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

.quick-march-card #scout::before {
  background-image: url('/assets/runtime/map-marker/scout-moving.png');
}
.quick-march-card #attack::before {
  background-image: url('/assets/runtime/map-marker/incoming-threat.png');
}
.quick-march-card #logistics::before {
  background-image: url('/assets/runtime/map-marker/convoy-moving.png');
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAMILY 4 — dorf4 (War Room, Units, Hero & Quests: t4/u, t4/u2, t4/a, t4/q)
   ═══════════════════════════════════════════════════════════════════════════ */

.war-room-subnav .war-room-tab {
  position: relative;
  padding-left: 32px;
}

.war-room-subnav .war-room-tab::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

#tab-war-radar::before {
  background-image: url('/assets/runtime/report-icon/scout-report.png');
}
#tab-war-dispatch::before {
  background-image: url('/assets/runtime/map-marker/incoming-threat.png');
}
#tab-war-simulator::before {
  background-image: url('/assets/runtime/unit-state/atlantic-coalition-combat-report.png');
}

.radar-col {
  position: relative;
  background: var(--gp-card-bg);
  border: var(--gp-card-border);
  box-shadow: var(--gp-inset-shadow), 0 2px 8px rgba(0,0,0,.5);
}

.radar-crimson-alert {
  position: relative;
  padding-left: 38px;
  background: linear-gradient(135deg, rgba(230,57,70,.22) 0%, rgba(230,57,70,.08) 100%);
  border: 1px solid rgba(230,57,70,.42);
  border-left: 3px solid var(--gp-crimson);
  box-shadow: 0 0 12px var(--gp-crimson-glow);
}

.radar-crimson-alert::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: url('/assets/runtime/report-icon/critical-alert.png') center / contain no-repeat;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

.unit-grid > *,
.art-roster-card,
.commander-art,
.campaign-art {
  position: relative;
  background: var(--gp-card-bg);
  border: var(--gp-card-border);
  box-shadow: var(--gp-chamfer), var(--gp-inset-shadow), 0 3px 10px rgba(0,0,0,.52);
}

.commander-art .art-badge,
.campaign-art .art-badge,
.social-art .art-badge,
.event-art .art-badge {
  position: relative;
  padding-left: 28px;
}

.commander-art .art-badge::before,
.campaign-art .art-badge::before,
.social-art .art-badge::before,
.event-art .art-badge::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

.commander-art .art-badge::before {
  background-image: url('/assets/runtime/hero-inventory/promoted-status.png');
}
.campaign-art .art-badge::before {
  background-image: url('/assets/runtime/report-icon/quest-available.png');
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAMILY 5 — Reports & Tactical Chat / Mail (t4/report, t4/scouts, t4/msg)
   ═══════════════════════════════════════════════════════════════════════════ */

#report-inbox > *,
.report-card {
  position: relative;
  background: var(--gp-card-bg);
  border: var(--gp-card-border);
  border-left: 3px solid var(--gp-brass-rim);
  border-radius: 4px;
  box-shadow: var(--gp-chamfer), var(--gp-inset-shadow), 0 2px 8px rgba(0,0,0,.5);
  transition: border-color var(--gp-transition-fast), box-shadow var(--gp-transition-fast);
}

#report-inbox > *:hover,
.report-card:hover {
  border-color: rgba(201,168,76,.42);
  box-shadow: var(--gp-chamfer), 0 0 12px var(--gp-brass-glow), 0 4px 12px rgba(0,0,0,.58);
}

.chat-channels-nav .chat-tab {
  position: relative;
  padding-left: 30px;
  background: linear-gradient(180deg, var(--gp-slate-600) 0%, var(--gp-slate-800) 100%);
  border: 1px solid rgba(201,168,76,.18);
  box-shadow: var(--gp-chamfer);
}

.chat-channels-nav .chat-tab::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

.chat-channels-nav .chat-tab[data-channel="global"]::before {
  background-image: url('/assets/runtime/communication/system-announcement.png');
}
.chat-channels-nav .chat-tab[data-channel="alliance"]::before {
  background-image: url('/assets/runtime/communication/alliance-message.png');
}
.chat-channels-nav .chat-tab[data-channel="whispers"]::before {
  background-image: url('/assets/runtime/communication/direct-message.png');
}

.chat-panel,
.message-form {
  background: var(--gp-card-bg);
  border: var(--gp-card-border);
  box-shadow: var(--gp-inset-shadow), 0 3px 10px rgba(0,0,0,.52);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAMILY 6 — Alliance, Diplomacy, Marketplace, Medals & Artefacts
   (t4/ally, t4/gloriamedals, t4/t, t4/artefact)
   ═══════════════════════════════════════════════════════════════════════════ */

.social-card,
#market-form,
#alliance-view,
.social-art {
  position: relative;
  background:
    linear-gradient(168deg, rgba(22, 28, 39, 0.94) 0%, rgba(11, 15, 22, 0.97) 100%),
    url('/assets/runtime/ui-shell/build-panel.png') center / cover no-repeat;
  border: var(--gp-card-border);
  box-shadow: var(--gp-chamfer), var(--gp-inset-shadow), 0 3px 12px rgba(0,0,0,.55);
}

.social-art .art-badge::before {
  background-image: url('/assets/runtime/communication/victory-medal.png');
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAMILY 7 — Endgame Wonder / Strategic Complex & Live Events
   (t4/g/ww, t4/special)
   ═══════════════════════════════════════════════════════════════════════════ */

.endgame,
.complex-visual,
.objective-grid > *,
.season-feed,
.event-art {
  position: relative;
  background:
    linear-gradient(168deg, rgba(24, 30, 42, 0.95) 0%, rgba(11, 15, 22, 0.98) 100%),
    url('/assets/runtime/ui-shell/build-panel.png') center / cover no-repeat;
  border: 1px solid rgba(201,168,76,.28);
  box-shadow:
    var(--gp-chamfer),
    var(--gp-inset-shadow),
    0 0 16px rgba(201,168,76,.14),
    0 4px 14px rgba(0,0,0,.62);
}

.event-art .art-badge::before {
  background-image: url('/assets/runtime/communication/endgame-season.png');
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAMILY 8 — Game Master Controls & System Modals (t4/misc, t4/p, gm.html)
   ═══════════════════════════════════════════════════════════════════════════ */

.npc-modal-card,
.sitter-modal-card {
  position: relative;
  background:
    linear-gradient(168deg, rgba(19, 25, 36, 0.96) 0%, rgba(9, 13, 19, 0.98) 100%),
    url('/assets/runtime/ui-shell/modal.png') center / cover no-repeat;
  border: 1px solid var(--gp-brass-rim);
  box-shadow:
    var(--gp-inset-shadow),
    0 0 24px rgba(201,168,76,.25),
    0 12px 36px rgba(0,0,0,.78);
}

#npc-modal-title,
#sitter-modal-title {
  position: relative;
  padding-left: 30px;
}

#npc-modal-title::before,
#sitter-modal-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

#npc-modal-title::before {
  background-image: url('/assets/runtime/ui-icon/credits.png');
}
#sitter-modal-title::before {
  background-image: url('/assets/runtime/communication/service-medal.png');
}

.gm-header,
.gm-card {
  position: relative;
  background:
    linear-gradient(168deg, rgba(18, 25, 36, 0.95) 0%, rgba(10, 15, 22, 0.98) 100%),
    url('/assets/runtime/ui-shell/build-panel.png') center / cover no-repeat !important;
  border: 1px solid rgba(201,168,76,.26) !important;
  box-shadow: var(--gp-inset-shadow), 0 4px 16px rgba(0,0,0,.6) !important;
}

.gm-nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 34px !important;
  background: linear-gradient(180deg, var(--gp-slate-600) 0%, var(--gp-slate-800) 100%) !important;
  border: 1px solid rgba(201,168,76,.2) !important;
  box-shadow: var(--gp-chamfer), 0 2px 5px rgba(0,0,0,.5);
}

.gm-nav-btn.active {
  border-color: var(--gp-brass-rim) !important;
  color: #fce7b2 !important;
  box-shadow: var(--gp-chamfer), 0 0 12px var(--gp-brass-glow) !important;
}

.gm-nav-btn::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  box-shadow: var(--gp-medallion-shadow);
}

.gm-nav-btn[data-tab="tab-accounts"]::before {
  background-image: url('/assets/runtime/ui-icon/settlement.png');
}
.gm-nav-btn[data-tab="tab-operations"]::before {
  background-image: url('/assets/runtime/ui-icon/credits.png');
}
.gm-nav-btn[data-tab="tab-spatial"]::before {
  background-image: url('/assets/runtime/map-marker/victory-beacon.png');
}
.gm-nav-btn[data-tab="tab-broadcast"]::before {
  background-image: url('/assets/runtime/communication/system-announcement.png');
}
.gm-nav-btn[data-tab="tab-audit"]::before {
  background-image: url('/assets/runtime/report-icon/scout-report.png');
}
