:root {
  --glass: rgba(11, 16, 26, 0.78);
  --glass-hi: rgba(15, 22, 36, 0.92);
  --border: rgba(255, 255, 255, 0.11);
  --text: #f3f7ff;
  --muted: #93a6c5;
  --human: #38bdf8;
  --elf: #34d399;
  --dwarf: #fbbf24;
  --demon: #f43f5e;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070b14;
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

#glCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.panel {
  pointer-events: auto;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* Top Bar */
.top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.top-group {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 11px;
  backdrop-filter: blur(14px);
}

.top-group .btn {
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.app-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fff, #7dd3fc, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-variant-numeric: tabular-nums;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.13s;
}

.btn:hover { background: rgba(255, 255, 255, 0.14); }
.nuke-btn {
  border-color: rgba(239, 68, 68, 0.55);
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.45), rgba(180, 83, 9, 0.35));
  color: #fef08a;
}
.nuke-btn:hover, .nuke-btn.selected {
  border-color: #f87171;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.72), rgba(234, 88, 12, 0.65));
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.55);
}
.btn.active, .btn.selected {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}
.btn.accent {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-color: transparent;
}
.btn.danger {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(244, 63, 94, 0.55);
  color: #fda4af;
}
.btn.good {
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}

.slice-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.slice-wrap input[type="range"] {
  width: 82px;
  accent-color: #38bdf8;
}

/* Right Stack: Relative Power UI + Overlord/Hero + Chronicles */
.right-hud {
  position: absolute;
  top: 106px;
  right: 12px;
  width: 318px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.power-panel {
  padding: 12px 14px;
}

.sec-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.power-bar {
  display: flex;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.pwr-seg { height: 100%; transition: width 0.3s ease; }
.pwr-0 { background: var(--human); }
.pwr-1 { background: var(--elf); }
.pwr-2 { background: var(--dwarf); }
.pwr-3 { background: var(--demon); }

.pwr-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 11px;
  margin-bottom: 8px;
}

.pwr-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.trigger-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.event-card {
  display: none;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(251, 191, 36, 0.18));
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 11.5px;
}

.event-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.28);
  color: #fef08a;
  margin-bottom: 5px;
}

.event-actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.chronicle-panel {
  padding: 10px 13px;
  max-height: 175px;
  overflow-y: auto;
}

.chron-item {
  font-size: 11px;
  color: #dbe7fb;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.35;
}

.chron-item:last-child { border-bottom: none; }
.chron-yr {
  color: #7dd3fc;
  font-weight: 700;
  font-family: Consolas, monospace;
}

/* Bottom God-Mode Dock */
.bottom-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

#activeActionBanner {
  pointer-events: none;
  background: rgba(11, 16, 26, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #bae6fd;
}

.dock-card {
  width: 100%;
  max-width: 1060px;
  padding: 10px 13px;
}

.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dock-tabs {
  display: flex;
  gap: 6px;
}

.tool-pane { display: none; }
.tool-pane.active { display: block; }

.spawn-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.spawn-choice {
  padding: 5px 9px;
  font-size: 11.5px;
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.batch-row input[type="number"] {
  width: 78px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
  user-select: text;
  -webkit-user-select: text;
}

/* Politics & Diplomacy Modal */
.politics-modal {
  position: fixed;
  top: 144px;
  left: 12px;
  width: 390px;
  max-height: calc(100vh - 308px);
  display: none;
  flex-direction: column;
  padding: 14px;
  z-index: 20;
}

.politics-modal.open { display: flex; }

.economy-modal { width: 440px; }
.oil-banner {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #fde68a;
  margin-bottom: 8px;
}
.fx-section-hdr {
  font-size: 11px;
  font-weight: 700;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 6px 0 4px;
}
.fx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  margin-bottom: 6px;
}
.fx-table th, .fx-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 5px;
  text-align: center;
}
.fx-table th {
  background: rgba(15, 23, 42, 0.72);
  color: #93c5fd;
  font-weight: 700;
}
.fx-up { color: #4ade80; font-weight: 700; }
.fx-down { color: #f87171; font-weight: 700; }
.fx-flat { color: #94a3b8; font-weight: 700; }
.trade-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 10.5px;
  color: #e2e8f0;
  margin-bottom: 4px;
}
.comms-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.comms-full { background: rgba(34, 197, 94, 0.22); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.45); }
.comms-part { background: rgba(56, 189, 248, 0.22); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.45); }
.comms-cour { background: rgba(148, 163, 184, 0.20); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }
.comms-blackout { background: rgba(239, 68, 68, 0.28); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.65); }

.era-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-left: 5px;
  vertical-align: middle;
}
.era-0 { background: rgba(180, 130, 70, 0.28); color: #fde68a; border: 1px solid rgba(217, 160, 82, 0.55); }
.era-1 { background: rgba(245, 158, 11, 0.28); color: #fdba74; border: 1px solid rgba(251, 146, 60, 0.65); }
.era-2 { background: rgba(14, 165, 233, 0.30); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.72); }
.era-prog-wrap {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  padding: 4px 6px;
  margin: 4px 0;
  font-size: 10px;
}
.era-prog-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  overflow: hidden;
  margin: 3px 0;
}
.era-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #38bdf8);
  transition: width 0.25s ease;
}

/* Global World Search Bar & Quick-Finder Dropdown */
.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-input {
  width: 215px;
  padding: 5px 24px 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: rgba(15, 23, 42, 0.86);
  color: #f1f5f9;
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.18s, width 0.2s, box-shadow 0.18s;
}
.search-input:focus {
  width: 255px;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22);
}
.search-input::placeholder { color: #94a3b8; }
.search-clear {
  position: absolute;
  right: 5px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
}
.search-clear:hover { color: #f8fafc; }
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 348px;
  max-height: 410px;
  background: rgba(10, 16, 30, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 11px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  padding: 8px;
  z-index: 60;
  flex-direction: column;
  gap: 6px;
}
.search-dropdown.open { display: flex; }
.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.search-chip {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.search-chip:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(56, 189, 248, 0.65);
  color: #f8fafc;
}
.search-results {
  overflow-y: auto;
  max-height: 295px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  text-align: left;
  transition: background 0.14s, border-color 0.14s;
}
.search-row:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
}
.search-row-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
}
.search-row-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 1px;
}
.search-row-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  white-space: nowrap;
}
.search-empty {
  padding: 14px 8px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

.dip-controls {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 9px;
  margin-bottom: 10px;
}

.dip-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 7px;
}

.dip-selects select {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 5px;
  font-size: 11.5px;
}

.dip-btns {
  display: flex;
  gap: 6px;
}

.nations-scroll {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nation-row {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
}

.nation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.sp-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  color: #090d16;
}
.sp-0 { background: var(--human); }
.sp-1 { background: var(--elf); }
.sp-2 { background: var(--dwarf); }
.sp-3 { background: var(--demon); color: #fff; }

.nation-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.script-sample {
  color: #fde68a;
  font-size: 12.5px;
  letter-spacing: 1px;
}

.nation-war { font-size: 11px; color: #fda4af; margin-top: 3px; font-weight: 600; }
.nation-ally { font-size: 11px; color: #6ee7b7; margin-top: 2px; font-weight: 600; }
.empty-msg { font-size: 12px; color: var(--muted); text-align: center; padding: 18px 8px; }

#toast {
  position: fixed;
  top: 106px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--glass-hi);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#webglError {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #060911;
  z-index: 99;
  text-align: center;
}

/* Floating 3D Globe Territory & City Name Labels */
#labelsLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.globe-label {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(14, 18, 30, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #f8fafc;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.globe-label:hover {
  background: rgba(24, 34, 56, 0.96);
  filter: brightness(1.12);
}

.globe-label.capital {
  padding: 3px 9px;
  font-size: 11px;
  background: rgba(16, 20, 34, 0.94);
}

.globe-label strong {
  color: #ffffff;
  font-weight: 700;
}

.globe-label small {
  color: #93c5fd;
  font-size: 9.5px;
  margin-left: 4px;
}

.lbl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* === 3-Mode Viewing Plane Switcher === */
.view-switcher {
  display: inline-flex;
  gap: 3px;
  background: rgba(8, 12, 22, 0.72);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.view-btn.active[data-view="underground"] {
  background: linear-gradient(135deg, #b45309, #d97706);
  border-color: #fbbf24;
  color: #fff;
}
.view-btn.active[data-view="underworld"] {
  background: linear-gradient(135deg, #b91c1c, #ea580c);
  border-color: #fb923c;
  color: #fff;
}

/* === Entity Inspector Card (Click Creature / Vehicle -> Follow / FPV) === */
.entity-inspector {
  position: fixed;
  top: 76px;
  left: 14px;
  width: 245px;
  display: none;
  z-index: 24;
  pointer-events: auto;
  border: 2px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
}
.entity-inspector.open { display: block; }
.insp-body {
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.insp-body strong { color: #f8fafc; }
.insp-hp-bar {
  width: 100%;
  height: 7px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 4px;
  overflow: hidden;
  margin: 5px 0 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.insp-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.2s;
}
.insp-actions { display: flex; gap: 6px; }

.structure-inspector {
  width: 286px;
  border-color: rgba(251, 191, 36, 0.52);
}
.struct-nation-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.struct-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.struct-output-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 5px 7px;
  margin: 5px 0;
  color: #bae6fd;
  font-size: 11px;
  line-height: 1.38;
}
.morality-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
  margin: 3px 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.morality-fill {
  height: 100%;
  transition: width 0.3s ease;
}

/* === On-Screen Exit Follow / FPV Banner === */
#exitTrackBanner {
  position: fixed;
  top: 104px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(12, 18, 32, 0.92);
  border: 2px solid #38bdf8;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  z-index: 30;
  pointer-events: auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65);
}
#exitTrackBanner.show { display: inline-flex; }

/* === 1x SPEED LIVE TV NEWS CHANNEL BROADCAST OVERLAY ("MYTHOS TV") === */
.tv-bar {
  position: fixed;
  bottom: 170px;
  left: 50%;
  transform: translateX(-50%);
  width: min(740px, calc(100vw - 320px));
  display: none;
  flex-direction: row;
  align-items: stretch;
  background: rgba(10, 14, 24, 0.94);
  border: 2px solid #38bdf8;
  border-radius: 5px;
  overflow: hidden;
  z-index: 18;
  pointer-events: auto;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.tv-bar.urg-breaking { border-color: #ef4444; }
.tv-bar.urg-milestone { border-color: #f59e0b; }
.tv-bar.urg-world { border-color: #06b6d4; }

.tv-studio-wrap {
  position: relative;
  width: 84px;
  min-width: 84px;
  background: #070d1c;
  border-right: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}
#tvAnchorCanvas {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  display: block;
}
.tv-live-bug {
  position: absolute;
  top: 4px;
  left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 5px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.tv-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: tvBlink 1.1s steps(2, start) infinite;
}
@keyframes tvBlink { 50% { opacity: 0.15; } }

.tv-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tv-top-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  background: linear-gradient(90deg, #0c4a6e, #1e293b);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.tv-bar.urg-breaking .tv-top-strip { background: linear-gradient(90deg, #991b1b, #7f1d1d 55%, #1e293b); }
.tv-bar.urg-milestone .tv-top-strip { background: linear-gradient(90deg, #b45309, #92400e 55%, #1e293b); }
.tv-bar.urg-world .tv-top-strip { background: linear-gradient(90deg, #0e7490, #155e75 55%, #1e293b); }

.tv-logo {
  background: #f8fafc;
  color: #0f172a;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.8px;
}
.tv-urg-badge { color: #fef08a; font-weight: 800; }
.tv-meta-bug { margin-left: auto; color: #cbd5e1; font-size: 9.5px; }
.tv-min-btn {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
  cursor: pointer;
  border-radius: 3px;
  padding: 0 5px;
  font-size: 10px;
}
.tv-min-btn:hover { background: #ef4444; color: #fff; }

.tv-chyron {
  padding: 5px 10px 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.tv-chyron:hover { background: rgba(56, 189, 248, 0.12); }
.tv-headline {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.tv-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.tv-subcaption {
  font-size: 10.5px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-cam-cta {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(14, 116, 144, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.5);
  padding: 1px 6px;
  border-radius: 3px;
}

.tv-ticker {
  background: #060913;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
  white-space: nowrap;
  padding: 2px 0;
}
.tv-ticker-track {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #e2e8f0;
  padding-left: 100%;
  animation: tvMarquee 36s linear infinite;
}
@keyframes tvMarquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}


/* === 1x SPEED LIVE PICTURE-IN-PICTURE (PiP) 3D TV MONITOR WINDOW === */
.tv-pip-monitor {
  position: fixed;
  bottom: 170px;
  left: 14px;
  width: 256px;
  height: 144px;
  display: none;
  z-index: 19;
  pointer-events: auto;
  border-radius: 6px;
  border: 2px solid #ef4444;
  background: transparent;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.tv-pip-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
}
.tv-pip-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.0) 0px,
      rgba(255, 255, 255, 0.0) 3px,
      rgba(255, 255, 255, 0.03) 4px
    );
}
.tv-pip-top {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.tv-pip-top .tv-live-bug {
  position: static;
  flex-shrink: 0;
}
.tv-pip-loc {
  background: rgba(8, 12, 24, 0.82);
  color: #f8fafc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-pip-jump {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(14, 116, 144, 0.88);
  border: 1px solid #38bdf8;
  color: #f8fafc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 3px 7px;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.tv-pip-jump:hover {
  background: #0284c7;
  color: #fff;
}
@media (max-width: 1280px) {
  .tv-bar {
    left: calc(50% + 126px);
    width: min(640px, calc(100vw - 300px));
  }
}

/* === UPDATE 19: "GOD PRO" TELEMETRY & FATE CONTROL DECK + COUNTRY NUKE & GOD'S PUNISHMENT UI === */
.god-pro-btn {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(245, 158, 11, 0.28)) !important;
  border-color: rgba(56, 189, 248, 0.65) !important;
  color: #fef08a !important;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.god-pro-btn:hover, .god-pro-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.55), rgba(245, 158, 11, 0.52)) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}
.divine-btn {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25), rgba(255, 255, 255, 0.22)) !important;
  border-color: rgba(250, 204, 21, 0.72) !important;
  color: #fef9c3 !important;
}
.divine-btn.selected, .divine-btn:hover {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.52), rgba(254, 240, 138, 0.45)) !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.55);
}
.nuke-country-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.24);
  border: 1px solid rgba(248, 113, 113, 0.35);
  font-size: 11px;
}
.nuke-avail-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f87171;
}
.nuke-avail-badge.ready {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.6);
}

.god-pro-modal {
  position: fixed;
  top: 112px;
  left: 12px;
  width: min(465px, calc(100vw - 24px));
  max-height: calc(100vh - 295px);
  display: none;
  flex-direction: column;
  padding: 10px 12px;
  z-index: 26;
  background: rgba(8, 13, 24, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.48);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.god-pro-modal.open { display: flex; }
.gp-header {
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding-bottom: 6px;
  margin-bottom: 8px;
  color: #7dd3fc;
  letter-spacing: 0.4px;
}
.gp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.gp-tab {
  flex: 1;
  min-width: 78px;
  padding: 4px 6px !important;
  font-size: 10.5px !important;
  text-align: center;
}
.gp-tab.active {
  background: rgba(14, 165, 233, 0.34);
  border-color: #38bdf8;
  color: #fff;
}
.gp-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 3px;
}
.gp-pane { display: none; flex-direction: column; gap: 8px; }
.gp-pane.active { display: flex; }
.gp-section {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 9px;
  padding: 8px 9px;
}
.gp-sec-hdr {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #93c5fd;
  margin-bottom: 6px;
}
.gp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #cbd5e1;
  margin-bottom: 5px;
}
.gp-select {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 7px;
  padding: 4px 6px;
  font-size: 11px;
  flex: 1;
}
.gp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gp-slider-row {
  display: grid;
  grid-template-columns: 1fr 110px 42px;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #cbd5e1;
  margin-bottom: 4px;
}
.gp-grid-2 .gp-slider-row {
  grid-template-columns: 74px 1fr 34px;
}
.gp-slider-row input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
}
.gp-slider-row strong {
  text-align: right;
  color: #fef08a;
  font-variant-numeric: tabular-nums;
}
.gp-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.gp-btn-grid .btn {
  padding: 5px 6px;
  font-size: 10.5px;
}
.gp-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.gp-kpi-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 8px;
  padding: 7px 9px;
}
.gp-kpi-lbl {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.gp-kpi-val {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.gp-kpi-sub {
  font-size: 10px;
  color: #7dd3fc;
  margin-top: 1px;
}

/* === UPDATE 20: CLEAN FULL-SCREEN EARTH MODE, DISPLAY LAYER TOGGLES, MEGA CITY BADGES & 12-HOUR QUEST PROGRESSION === */
.build-badge {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.7px;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
}
.build-badge.beta {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.55);
}
.build-badge.release {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.65);
}
.layer-switcher {
  display: inline-flex;
  gap: 2px;
  background: rgba(8, 12, 22, 0.72);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.layer-btn {
  padding: 3px 6px !important;
  font-size: 10px !important;
  opacity: 0.52;
}
.layer-btn.active {
  opacity: 1.0;
  background: rgba(14, 165, 233, 0.30);
  border-color: rgba(56, 189, 248, 0.65);
}
.clean-fs-btn {
  border-color: rgba(52, 211, 153, 0.5) !important;
  color: #a7f3d0 !important;
}
.clean-restore-pill {
  position: fixed;
  top: 10px;
  right: 12px;
  display: none;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.84);
  border: 1px solid rgba(56, 189, 248, 0.45);
  z-index: 45;
  pointer-events: auto;
  opacity: 0.22;
  transition: opacity 0.2s ease;
}
.clean-restore-pill:hover { opacity: 0.98; }

/* Hide ALL consoles, bars, drawers, popovers & dock in Clean Full-Screen Mode — Draggable Mythos TV & Live PiP Cam remain INDEPENDENT! */
body.clean-fullscreen .top-bar,
body.clean-fullscreen .right-hud,
body.clean-fullscreen .bottom-dock,
body.clean-fullscreen .single-drawer,
body.clean-fullscreen .view-rules-popover,
body.clean-fullscreen .politics-modal,
body.clean-fullscreen .god-pro-modal,
body.clean-fullscreen .entity-inspector {
  display: none !important;
}
body.clean-fullscreen .clean-restore-pill {
  display: inline-flex;
}
body.clean-fullscreen .tv-floating-rig {
  pointer-events: auto !important;
}

.mega-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.32), rgba(249, 115, 22, 0.32));
  color: #fef08a;
  border: 1px solid rgba(250, 204, 21, 0.72);
}

/* Release Version Locked Silhouette Styling */
.prog-locked {
  opacity: 0.38 !important;
  filter: grayscale(0.85);
  border-style: dashed !important;
  position: relative;
}
.prog-locked::after {
  content: '🔒';
  margin-left: 3px;
  font-size: 9.5px;
}

.quests-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(234, 179, 8, 0.24)) !important;
  border-color: rgba(250, 204, 21, 0.62) !important;
  color: #fef08a !important;
}
.quests-modal {
  width: min(440px, calc(100vw - 24px));
}
.quest-tier-hdr {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #7dd3fc;
  margin: 8px 0 4px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  padding-bottom: 2px;
}
.quest-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 11px;
}
.quest-card.done {
  background: rgba(20, 83, 45, 0.26);
  border-color: rgba(74, 222, 128, 0.48);
}
.quest-card.locked-sil {
  opacity: 0.62;
  border-style: dashed;
}
.quest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: #f8fafc;
}
.quest-reward {
  margin-top: 3px;
  font-size: 10px;
  color: #fde68a;
  font-weight: 700;
}

/* Achievement Unlocked Toast Banner */
.ach-toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  min-width: 280px;
  padding: 9px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(120, 53, 15, 0.92));
  border: 2px solid #facc15;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 18px rgba(250, 204, 21, 0.35);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ach-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ach-toast-sub { font-size: 9px; font-weight: 900; letter-spacing: 1.2px; color: #fde68a; }
.ach-toast-title { font-size: 14px; font-weight: 900; color: #fff; margin-top: 2px; }
.ach-toast-reward { font-size: 11px; color: #7dd3fc; margin-top: 2px; font-weight: 700; }


/* ============================================================================
   UPDATE 21: DECLUTTERED SINGLE-DRAWER HUD, VIEW & RULES POPOVER,
   DRAGGABLE MYTHOS TV RIG & INTERACTIVE 5-BRANCH ACHIEVEMENT TREE
   ============================================================================ */

/* Slim, Grouped Single-Row Top Telemetry Bar */
.top-bar {
  top: 8px;
  left: 10px;
  right: 10px;
  flex-wrap: nowrap;
  gap: 6px;
}
.top-group {
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 10px;
}
.top-telemetry .stat-chip {
  padding: 3px 6px;
  font-size: 11px;
}
.top-center-controls {
  gap: 6px;
}
.speed-switcher {
  display: inline-flex;
  gap: 2px;
  background: rgba(8, 12, 22, 0.72);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.speed-switcher .time-btn {
  padding: 3px 6px !important;
  font-size: 10.5px !important;
}
.top-actions .btn {
  padding: 4px 7px;
  font-size: 10.5px;
}
@media (max-width: 1520px) {
  .top-bar { flex-wrap: wrap; }
  .top-group { flex-wrap: wrap; }
}

/* Compact Right Widget — Dynamically clears wrapped top-bar height! */
.right-hud {
  top: var(--topbar-bottom, 56px) !important;
  right: 10px;
  width: 248px;
  gap: 8px;
}
.power-panel {
  padding: 9px 11px;
}
.chronicle-panel {
  padding: 8px 11px;
  max-height: 165px;
}

/* Collapsible "View & Rules" Popover */
.view-rules-popover {
  position: fixed;
  top: var(--topbar-bottom, 56px) !important;
  right: 10px;
  width: 316px;
  padding: 11px 13px;
  display: none;
  z-index: 36;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: rgba(10, 15, 28, 0.94);
}
.view-rules-popover.open { display: block; }
.vr-section-lbl {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #93a6c5;
  margin: 8px 0 4px;
}
.vr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.vr-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
}
.vr-grid .btn, .vr-grid-3 .btn {
  padding: 5px 7px !important;
  font-size: 10.5px !important;
  text-align: center;
}

/* Strict Single-Drawer Positioning (Mathematically clears top-bar at ALL widths!) */
.single-drawer,
.politics-modal,
.god-pro-modal {
  position: fixed;
  top: var(--topbar-bottom, 56px) !important;
  left: 10px !important;
  max-height: calc(100vh - var(--topbar-bottom, 56px) - 18px) !important;
  display: none;
  flex-direction: column;
  z-index: 32;
}
.single-drawer.open,
.politics-modal.open,
.god-pro-modal.open {
  display: flex !important;
}

/* Single-Drawer Search Panel */
.search-drawer {
  width: min(390px, calc(100vw - 24px));
  padding: 11px 13px;
  gap: 8px;
}
.search-drawer .search-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.search-drawer .search-input {
  width: 100%;
  padding: 7px 28px 7px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  outline: none;
}
.search-drawer .search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.search-drawer .search-results {
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Collapsible Tools Bottom Dock (Single-Drawer!) */
.bottom-dock {
  display: none;
  bottom: 10px;
  z-index: 31;
}
.bottom-dock.open {
  display: flex;
}

/* Non-Overlapping Corner Inspectors (Fixed Bottom-Right, Clear of Left Drawers & Draggable TV!) */
.entity-inspector,
.structure-inspector {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  bottom: 12px !important;
  right: 12px !important;
  width: 276px;
  padding: 10px 12px;
  z-index: 34;
}

/* Unified Draggable Mythos TV & Live 3D PiP Cam Rig (Bottom-Right default — clear of Left Drawers!) */
.tv-floating-rig {
  position: fixed;
  bottom: 12px;
  right: 12px;
  left: auto;
  width: min(560px, calc(100vw - 320px));
  display: none;
  flex-direction: column;
  gap: 0;
  z-index: 35;
  pointer-events: auto;
  border-radius: 9px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.72);
}
.tv-floating-rig.dragging {
  opacity: 0.95;
  box-shadow: 0 18px 46px rgba(56, 189, 248, 0.35);
}
.tv-drag-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.92), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: #bae6fd;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: grab;
  touch-action: none;
}
.tv-floating-rig.dragging .tv-drag-grip {
  cursor: grabbing;
  background: linear-gradient(90deg, #0284c7, #2563eb);
  color: #ffffff;
}
.tv-rig-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
  background: rgba(8, 12, 22, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 0 0 8px 8px;
  padding: 5px;
}
.tv-floating-rig .tv-pip-monitor {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  width: 176px !important;
  min-width: 176px !important;
  height: 108px !important;
  border-radius: 5px;
  flex-shrink: 0;
}
.tv-floating-rig .tv-pip-viewport {
  width: 100%;
  height: 100%;
}
.tv-floating-rig .tv-bar {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  width: auto !important;
  flex: 1;
  min-width: 0;
  box-shadow: none;
  border-radius: 5px;
}

/* === UPDATE 21: INTERACTIVE 5-BRANCH ACHIEVEMENT & UNLOCK TREE === */
.ach-tree-modal {
  width: min(920px, calc(100vw - 24px)) !important;
  padding: 12px 14px;
  background: rgba(9, 14, 26, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.42);
}
.ach-legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 10.5px;
  color: #cbd5e1;
  margin: 4px 0 8px;
}
.ach-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.ach-dot.gold { background: #facc15; box-shadow: 0 0 6px #facc15; }
.ach-dot.cyan { background: #22d3ee; box-shadow: 0 0 6px #22d3ee; }
.ach-dot.dim  { background: #475569; }

.ach-tree-split {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 10px;
  min-height: 300px;
  max-height: calc(100vh - var(--topbar-bottom, 56px) - 148px);
}
#toast {
  top: auto !important;
  bottom: 18px !important;
}
.ach-toast {
  top: var(--topbar-bottom, 66px) !important;
}
@media (max-width: 820px) {
  .ach-tree-split { grid-template-columns: 1fr; }
}
.ach-tree-canvas {
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ach-branch-row {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 9px;
  padding: 7px 9px;
}
.ach-branch-hdr {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-left: 3px solid #38bdf8;
  padding-left: 7px;
  margin-bottom: 6px;
}
.ach-branch-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.ach-connector {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  user-select: none;
}
.ach-connector.lit {
  color: #facc15;
  text-shadow: 0 0 6px rgba(250, 204, 21, 0.55);
}
.ach-node {
  min-width: 118px;
  max-width: 146px;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.ach-node:hover {
  transform: translateY(-1px);
  border-color: #7dd3fc;
}
.ach-node.state-completed {
  background: linear-gradient(135deg, rgba(113, 63, 18, 0.45), rgba(161, 98, 7, 0.26));
  border-color: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.28);
}
.ach-node.state-active {
  background: linear-gradient(135deg, rgba(8, 51, 68, 0.72), rgba(14, 116, 144, 0.34));
  border-color: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.34);
}
.ach-node.state-locked {
  opacity: 0.54;
  border-style: dashed;
  filter: grayscale(0.45);
}
.ach-node.selected {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
  opacity: 1 !important;
}
.ach-node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  color: #f8fafc;
}
.ach-st-ico { font-size: 10px; }
.ach-mini-bar {
  width: 100%;
  height: 4px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 3px;
}
.ach-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #38bdf8);
}
.ach-node.state-completed .ach-mini-fill {
  background: linear-gradient(90deg, #facc15, #f59e0b);
}
.ach-node-sub {
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 700;
}

/* Node Inspector Guide Card */
.ach-node-inspector {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 10px;
  padding: 11px 13px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ach-insp-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 7px;
}
.ach-insp-title {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
}
.ach-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}
.ach-badge.gold { background: rgba(250, 204, 21, 0.25); color: #fef08a; border: 1px solid #facc15; }
.ach-badge.cyan { background: rgba(34, 211, 238, 0.22); color: #a5f3fc; border: 1px solid #22d3ee; }
.ach-badge.dim  { background: rgba(71, 85, 105, 0.45); color: #cbd5e1; border: 1px solid #64748b; }
.ach-prereq-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: #94a3b8;
}
.ach-prereq-pill {
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}
.ach-prereq-pill.ok  { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.ach-prereq-pill.req { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.ach-insp-sec {
  background: rgba(8, 13, 24, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
}
.ach-insp-lbl {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #7dd3fc;
  margin-bottom: 4px;
}
.ach-insp-text {
  font-size: 11.5px;
  color: #e2e8f0;
  line-height: 1.45;
}
.ach-prog-bar {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 4px;
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.ach-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  transition: width 0.25s ease;
}
.ach-prog-fill.state-completed {
  background: linear-gradient(90deg, #eab308, #facc15);
}
.ach-prog-txt {
  font-size: 10.5px;
  font-weight: 700;
  color: #bae6fd;
}
.ach-guide-list {
  margin: 0;
  padding-left: 17px;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.5;
}
.ach-guide-list li { margin-bottom: 4px; }
.ach-unlock-list {
  margin: 0;
  padding-left: 16px;
  font-size: 11px;
  color: #fde68a;
  font-weight: 700;
  line-height: 1.5;
}


/* ============================================================================
   UPDATE 23: MAIN-SCREEN NEW GLOBE, EXTREME HOSTILE PILL,
   CONFIRM MODAL & "GOD HAS LOST CREATION" BLACK HOLE DEATH SCREEN
   ============================================================================ */

.new-globe-main-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.34), rgba(14, 165, 233, 0.30)) !important;
  border-color: rgba(52, 211, 153, 0.68) !important;
  color: #ecfdf5 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.22);
}
.new-globe-main-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.54), rgba(14, 165, 233, 0.48)) !important;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.42);
}

.extreme-hostile-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.7px;
  padding: 2px 7px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.88), rgba(225, 29, 72, 0.78));
  color: #fff1f2;
  border: 1px solid #fb7185;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.55);
  animation: hostilePulse 1.6s ease-in-out infinite;
}
@keyframes hostilePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(244, 63, 94, 0.45); }
  50%      { box-shadow: 0 0 18px rgba(244, 63, 94, 0.90); }
}

/* 1-Click Active-Play New Globe Confirmation Modal */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 15, 0.68);
  backdrop-filter: blur(5px);
  z-index: 80;
  pointer-events: auto;
}
.confirm-modal-backdrop.open { display: flex; }
.confirm-modal-card {
  width: min(380px, calc(100vw - 28px));
  padding: 16px 18px;
  background: rgba(11, 17, 30, 0.96);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.78);
}
.confirm-modal-title {
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  margin-bottom: 6px;
}
.confirm-modal-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 14px;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Hide ALL HUD, Labels, Inspectors, Popovers & Mythos TV during Black Hole Death Screen! */
body.death-screen-active .hud,
body.death-screen-active #labelsLayer,
body.death-screen-active #toast,
body.death-screen-active .confirm-modal-backdrop {
  display: none !important;
}

/* Solemn Cinematic "God Has Lost Creation" Death Screen Overlay */
.death-screen-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.10) 20%, rgba(2, 4, 12, 0.72) 100%);
  transition: opacity 1.4s ease;
}
.death-screen-overlay.show,
.death-screen-overlay.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
.death-screen-card {
  text-align: center;
  max-width: 640px;
  padding: 28px 34px;
  border-radius: 16px;
  background: rgba(5, 7, 16, 0.62);
  border: 1px solid rgba(251, 191, 36, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.82), 0 0 42px rgba(251, 146, 60, 0.18);
}
.death-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3.2px;
  color: #fbbf24;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}
.death-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
  line-height: 1.28;
  color: #f8fafc;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}
.death-epitaph {
  font-size: 12.5px;
  color: #cbd5e1;
  margin-bottom: 22px;
  letter-spacing: 0.3px;
}
.death-new-globe-btn {
  padding: 12px 30px !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: 0.6px;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #f59e0b, #ea580c, #dc2626) !important;
  border: 2px solid #fde68a !important;
  color: #ffffff !important;
  box-shadow: 0 0 26px rgba(245, 158, 11, 0.58), 0 8px 24px rgba(0, 0, 0, 0.65);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.death-new-globe-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 38px rgba(251, 191, 36, 0.85), 0 10px 28px rgba(0, 0, 0, 0.72);
}

/* === UPDATE 24: SLIM LIVE "EARTH CORE HP" HEALTH BAR === */
.core-hp-bar-wrap {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, 68vw);
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px 12px 7px;
  border-radius: 10px;
  background: rgba(9, 13, 24, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 26;
  pointer-events: auto;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.core-hp-bar-wrap.visible {
  display: flex;
}
.core-hp-bar-wrap.state-warn {
  border-color: rgba(239, 68, 68, 0.72);
  box-shadow: 0 8px 26px rgba(220, 38, 38, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.core-hp-bar-wrap.state-crit {
  border-color: rgba(217, 70, 239, 0.92);
  animation: coreWrapCrit 0.95s ease-in-out infinite;
}
.core-hp-bar-wrap.hit-flash {
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.85), 0 8px 26px rgba(239, 68, 68, 0.55) !important;
  border-color: #ffffff !important;
}
@keyframes coreWrapCrit {
  0%, 100% { box-shadow: 0 0 14px rgba(217, 70, 239, 0.45), 0 8px 24px rgba(0, 0, 0, 0.65); }
  50% { box-shadow: 0 0 26px rgba(255, 30, 86, 0.82), 0 8px 28px rgba(217, 70, 239, 0.45); }
}
body.clean-fullscreen .core-hp-bar-wrap,
body.death-screen-active .core-hp-bar-wrap {
  display: none !important;
}
.core-hp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.45px;
}
.core-hp-label {
  color: #fde68a;
  text-transform: uppercase;
  white-space: nowrap;
}
.core-hp-readout {
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.core-hp-crit-badge {
  font-size: 9.5px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(90deg, #be123c, #d946ef);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.35px;
  animation: hostilePulse 1.1s ease-in-out infinite;
  white-space: nowrap;
}
.core-hp-ind-badge {
  font-size: 9.5px;
  font-weight: 900;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.24);
  border: 1px solid rgba(56, 189, 248, 0.55);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.core-hp-track {
  position: relative;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.core-hp-flash {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}
.core-hp-fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  transition: width 0.14s ease-out;
  z-index: 2;
}
.core-hp-fill.state-healthy {
  background: linear-gradient(90deg, #b45309, #f59e0b, #fbbf24);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.55);
}
.core-hp-fill.state-warn {
  background: linear-gradient(90deg, #991b1b, #ef4444, #f87171);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.65);
}
.core-hp-fill.state-crit {
  background: linear-gradient(90deg, #d946ef, #ff1e56, #fb7185);
  animation: coreCritPulse 0.75s ease-in-out infinite;
}
@keyframes coreCritPulse {
  0%, 100% { filter: brightness(1.0); box-shadow: 0 0 12px rgba(217, 70, 239, 0.7); }
  50% { filter: brightness(1.38); box-shadow: 0 0 20px rgba(255, 30, 86, 0.95); }
}

/* === UPDATE 25 (RELEASE ONLY): WELCOME SCREEN / MAIN MENU & INTERACTIVE TUTORIAL GUIDE === */
body.main-menu-active .top-bar,
body.main-menu-active .right-hud,
body.main-menu-active .bottom-dock,
body.main-menu-active #tvFloatingRig,
body.main-menu-active #earthCoreHpBar,
body.main-menu-active #labelsLayer,
body.main-menu-active #exitTrackBanner,
body.main-menu-active #viewRulesPopover,
body.main-menu-active #searchDrawer {
  display: none !important;
}
body.main-menu-active .hud {
  z-index: 120 !important;
  pointer-events: none;
}
body.main-menu-active #questsModal.open {
  z-index: 125 !important;
  pointer-events: auto;
}

.welcome-menu-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 88;
  background: radial-gradient(circle at center, rgba(6, 10, 22, 0.14) 24%, rgba(3, 6, 16, 0.72) 100%);
  pointer-events: auto;
}
.welcome-menu-overlay.show {
  display: flex;
}
.welcome-card {
  width: min(460px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 28px;
  border-radius: 16px;
  background: rgba(8, 13, 26, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.78), 0 0 42px rgba(56, 189, 248, 0.16);
  text-align: center;
}
.welcome-crest {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.6px;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.48);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.welcome-title {
  margin: 0 0 6px;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #f8fafc;
  text-shadow: 0 4px 20px rgba(14, 165, 233, 0.45);
}
.welcome-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 18px;
}
.welcome-nav-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.welcome-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 11px 15px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.welcome-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(22, 34, 58, 0.94);
}
.welcome-btn.primary {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.92), rgba(3, 105, 161, 0.92));
  border-color: rgba(125, 211, 252, 0.78);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.30);
}
.welcome-btn.accent {
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.85), rgba(13, 148, 136, 0.85));
  border-color: rgba(74, 222, 128, 0.72);
}
.wb-main {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
}
.wb-sub {
  font-size: 10.5px;
  color: #cbd5e1;
}
.welcome-subpanel {
  text-align: left;
}
.welcome-sub-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}
.wc-field {
  margin-bottom: 11px;
}
.wc-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #bae6fd;
  margin-bottom: 4px;
}
.wc-input-row {
  display: flex;
  gap: 6px;
}
.wc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  font-size: 12.5px;
  outline: none;
}
.wc-input:focus {
  border-color: #38bdf8;
}
.wc-saves-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}
.wc-save-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.26);
}
.wc-save-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}
.wc-save-meta {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}
.wc-save-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.wc-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 12px;
  color: #e2e8f0;
}

/* Interactive 6-Step HUD Spotlight Guide (Release Only) */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 96;
  pointer-events: none;
}
.tutorial-overlay.show {
  display: block;
}
.tutorial-spotlight {
  position: fixed;
  border-radius: 10px;
  border: 2.5px solid #38bdf8;
  box-shadow: 0 0 0 9999px rgba(4, 8, 18, 0.56), 0 0 24px rgba(56, 189, 248, 0.85);
  pointer-events: none;
  transition: all 0.25s ease;
}
.tutorial-card {
  position: fixed;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.96);
  border: 1.5px solid rgba(56, 189, 248, 0.72);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.82);
  pointer-events: auto;
  z-index: 98;
}
.tut-step-badge {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1.6px;
  color: #38bdf8;
  margin-bottom: 4px;
}
.tut-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
}
.tut-body {
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  margin-bottom: 12px;
}
.tut-cheat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
}
.tut-cheat-item {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.20);
}
.tut-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

/* === UPDATE 26: ONLINE ACCOUNT GATE, CLOUD SYNC INDICATOR & IN-GAME REVIEW/SUGGESTION BOX === */
.cloud-sync-badge {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 94;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: rgba(8, 13, 26, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e2e8f0;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.cloud-sync-badge.sync-ok {
  border-color: rgba(34, 197, 94, 0.52);
  color: #86efac;
}
.cloud-sync-badge.sync-busy {
  border-color: rgba(250, 204, 21, 0.65);
  color: #fde047;
}
.cloud-sync-badge.sync-err {
  border-color: rgba(248, 113, 113, 0.65);
  color: #fca5a5;
}
body.clean-fullscreen .cloud-sync-badge,
body.death-screen-active .cloud-sync-badge {
  display: none !important;
}

.auth-gate-card {
  width: min(430px, 92vw);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(15, 23, 42, 0.78);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  margin-bottom: 14px;
}
.auth-tab-btn {
  padding: 8px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.92), rgba(2, 132, 199, 0.92));
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.28);
}
.auth-form {
  text-align: left;
}
.auth-error-msg {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(153, 27, 27, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.62);
  color: #fecaca;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.auth-form-hint {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 12px;
}
.auth-submit-btn {
  align-items: center !important;
  justify-content: center;
  text-align: center !important;
  font-size: 13.5px;
  font-weight: 800;
}

.welcome-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.26);
}
.welcome-user-pill {
  font-size: 11.5px;
  font-weight: 800;
  color: #7dd3fc;
}
.welcome-footer-links {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 10.5px;
}
.welcome-footer-links a {
  color: #94a3b8;
  text-decoration: none;
}
.welcome-footer-links a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* Review & Suggestion Modal */
#feedbackModal.show,
#privacyModal.show {
  display: flex !important;
  z-index: 130 !important;
}
.feedback-modal-card {
  width: min(480px, 92vw);
  padding: 20px 22px;
  border-radius: 14px;
  background: rgba(8, 13, 26, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.48);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
  text-align: left;
}
.fb-auto-banner {
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fef08a;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 10px;
}
.fb-section-lbl {
  font-size: 11px;
  font-weight: 800;
  color: #bae6fd;
  margin: 10px 0 5px;
}
.fb-star-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fb-star-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 19px;
  line-height: 1;
  color: #475569;
  cursor: pointer;
  transition: transform 0.1s ease, color 0.15s ease, border-color 0.15s ease;
}
.fb-star-btn.active {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.65);
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.55);
}
.fb-star-btn:hover {
  transform: scale(1.08);
}
.fb-star-lbl {
  margin-left: 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fde047;
}
.fb-cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fb-cat-pill {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.30);
  color: #cbd5e1;
  cursor: pointer;
}
.fb-cat-pill.active {
  background: rgba(14, 165, 233, 0.26);
  border-color: #38bdf8;
  color: #ffffff;
}
.fb-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}
.fb-textarea:focus {
  border-color: #38bdf8;
}
.fb-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
