:root {
  --surface-1: rgba(15, 18, 26, 0.92);
  --surface-2: rgba(8, 10, 15, 0.9);
  --surface-3: rgba(255, 255, 255, 0.03);
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(247, 160, 15, 0.4);
  --grid-line: rgba(255, 255, 255, 0.045);
}

body.has-sidebar {
  background: radial-gradient(circle at 20% -10%, rgba(247, 160, 15, 0.14), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(110, 110, 255, 0.1), transparent 55%),
    #05070d;
  color: var(--tl-text);
  font-family: 'Inter', sans-serif;
  position: relative;
}

body.has-sidebar::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 140px 140px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

body.has-sidebar::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(247, 160, 15, 0.07), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body.has-sidebar .content {
  background: transparent;
}

.content {
  flex: 1;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }

.top-bar-line {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.58);
}

.header-divider {
  opacity: 0.45;
}

.page-title {
  font-family: 'Orbitron';
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  color: var(--tl-primary);
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(247, 160, 15, 0.35);
  background: rgba(247, 160, 15, 0.08);
  letter-spacing: 0.16rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.85);
}

.coin-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(247, 160, 15, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(247, 160, 15, 0.8), rgba(120, 72, 9, 0.85));
  box-shadow: 0 0 12px rgba(247, 160, 15, 0.35);
  font-size: 0.85rem;
  color: #fff1c5;
}

.header-chip strong {
  letter-spacing: 0.04rem;
  font-size: 0.78rem;
  color: #fff5d9;
}

.top-actions { display: none; }

.command-deck { display: block; }

.kingdom-panel {
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: clamp(0.9rem, 2vw, 1.4rem);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: stretch;
  gap: clamp(0.9rem, 2vw, 1.5rem);
}

.kingdom-panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 22px;
  border: 1px solid rgba(247, 160, 15, 0.25);
  pointer-events: none;
  opacity: 0.6;
}

.kingdom-media {
  flex: 0 0 clamp(200px, 30%, 360px);
  max-width: 360px;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(0.4rem, 0.8vw, 0.6rem);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.kingdom-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.center-node {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
  position: relative;
  flex: 1;
  min-width: min(280px, 100%);
}

.kingdom-info { gap: 0.5rem; }

.kingdom-story {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 480px;
}

.kingdom-chip {
  display: none;
}

.center-node .node-title { font-family: 'Orbitron'; font-size: clamp(1rem, 1.8vw, 1.6rem); letter-spacing: 0.35rem; color: rgba(255, 255, 255, 0.92); }

.center-node .lvl { font-size: 0.75rem; color: rgba(255, 255, 255, 0.6); text-transform: uppercase; letter-spacing: 0.25rem; }

.kingdom-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}

.collection-hub {
  flex: 1 1 100%;
  margin-top: 0.4rem;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  border: 1px dashed rgba(247, 160, 15, 0.35);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.collection-title {
  font-family: 'Orbitron';
  color: var(--tl-primary);
  letter-spacing: 0.2rem;
  text-transform: none;
  font-size: 0.8rem;
}

.resource-tabs {
  display: flex;
  gap: 0.35rem;
}

.resource-tab {
  padding: 0.35rem 0.7rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s ease;
}

.resource-tab:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.resource-tab[data-active="true"] {
  border-color: var(--tl-primary);
  background: rgba(247, 160, 15, 0.12);
  color: var(--tl-primary);
}

.resource-section {
  display: none;
}

.resource-section[data-visible="true"] {
  display: block;
}

.collection-readout {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
}

.collection-group {
  display: block;
}

.collection-subtitle {
  text-transform: uppercase;
  letter-spacing: 0.35rem;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.35rem;
}

.collection-readout.rare {
  opacity: 0.85;
}

.collection-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
  flex: 1;
}

.collection-line.empty {
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  grid-column: 1 / -1;
}

.collection-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.collection-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.collection-text { 
  display: flex; 
  align-items: baseline; 
  gap: 0.5rem; 
  flex: 1;
  min-width: 0;
}
.collection-label {
  letter-spacing: 0.05rem;
  text-transform: none;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}
.collection-value { 
  font-size: 0.85rem; 
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 3.5em;
  flex-shrink: 0;
}

#collected-display, #collected-rare-display { font-family: 'IBM Plex Mono', monospace; }

.intel-panel { display: none; }

.node-section { display: flex; flex-direction: column; gap: 0.6rem; }

.section-heading { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; justify-content: space-between; }

.section-heading h2 { font-family: 'Orbitron'; letter-spacing: 0.18rem; font-size: 0.9rem; margin: 0; text-transform: uppercase; }

.section-heading p { margin: 0; color: rgba(255, 255, 255, 0.55); font-size: 0.75rem; }

/* VIP Collect All Button */
.collect-all-btn {
  background: linear-gradient(135deg, rgba(247, 160, 15, 0.2), rgba(247, 160, 15, 0.1));
  border: 1px solid rgba(247, 160, 15, 0.5);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tl-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.collect-all-btn:hover:not(:disabled):not(.on-cooldown) {
  background: linear-gradient(135deg, rgba(247, 160, 15, 0.35), rgba(247, 160, 15, 0.2));
  border-color: var(--tl-primary);
  box-shadow: 0 0 15px rgba(247, 160, 15, 0.3);
  transform: translateY(-1px);
}

.collect-all-btn:active:not(:disabled):not(.on-cooldown) {
  transform: translateY(0);
}

.collect-all-btn.on-cooldown,
.collect-all-btn:disabled {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.2), rgba(80, 80, 80, 0.1));
  border-color: rgba(150, 150, 150, 0.4);
  color: rgba(150, 150, 150, 0.7);
  cursor: not-allowed;
}

.collect-all-btn.on-cooldown:hover,
.collect-all-btn:disabled:hover {
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.25), rgba(80, 80, 80, 0.15));
}

.collect-all-btn .lock-icon {
  margin-right: 0.25rem;
  font-size: 0.7rem;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem; 
}

.node {
  position: relative;
  border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0;
  display: flex;
  flex-direction: column;
  --progress: 0;
  overflow: hidden;
}

.node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(247, 160, 15, 0.12);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 2;
}

.node:hover::before { opacity: 1; }

.node-header { display: none; }

.node-pill { display: none; }

.status-dot { display: none; }

.node-body { display: none; }

.node-details { 
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.6rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.node-media {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.node-media > img[data-media-image] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.95;
  filter: saturate(1.05);
}

.node-media .resource-icon[data-icon] { 
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  opacity: 0.6;
}

.node-media > img[data-media-image] ~ .resource-icon[data-icon] {
  display: none;
}

.resource-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.resource-badge img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

.resource-badge span {
  font-size: 1.1rem;
}

.node .name { font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02rem; color: #fff; }
.node .lvl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12rem; color: rgba(255, 255, 255, 0.6); }

.resource-tag { display: none; }

.resource-icon { font-size: 0.9rem; }

.resource-tag img { display: none; }

.node-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  --progress-color-start: rgba(247, 160, 15, 0.4);
  --progress-color-end: rgba(247, 160, 15, 0.9);
}

.node-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--progress-color-start), var(--progress-color-end));
  transform: scaleX(var(--progress));
  transform-origin: left center;
  transition: transform 0.3s ease, background 0.3s ease;
}

.node-info {
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--surface-1);
}

.stat-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'IBM Plex Mono', monospace;
}

.node .stock { color: var(--tl-primary); font-weight: 600; font-size: 0.75rem; }

.node .rate { color: rgba(255, 255, 255, 0.55); font-size: 0.62rem; }

.cap-line { display: none; }

.node-actions { display: flex; gap: 0.4rem; }

.cooldown-line { display: none; }

.cost-chip[data-type="rare"] {
  background: rgba(247, 160, 15, 0.12);
  border-color: rgba(247, 160, 15, 0.45);
  color: rgba(255, 230, 210, 0.95);
}

.mini-collect {
  flex: 1;
  border-radius: 8px;
  border: 1px solid rgba(247, 160, 15, 0.45);
  background: rgba(247, 160, 15, 0.18);
  color: var(--tl-primary);
  padding: 0.35rem 0.5rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mini-collect:hover { background: rgba(247, 160, 15, 0.28); }
.mini-collect:disabled { opacity: 0.4; cursor: not-allowed; }

.upgrade-btn {
  flex: 1;
  border-radius: 8px;
  border: 1px solid rgba(110, 110, 255, 0.4);
  background: rgba(110, 110, 255, 0.1);
  color: rgba(198, 203, 255, 0.95);
  padding: 0.35rem 0.5rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  cursor: pointer;
  transition: all 0.2s;
}

.upgrade-btn:hover { background: rgba(110, 110, 255, 0.2); }

.meta-line,
.auto-line,
.timer-line,
.config-line {
  display: none;
}

.node.nearly-full .node-progress {
  --progress-color-start: rgba(247, 196, 15, 0.45);
  --progress-color-end: rgba(247, 118, 15, 0.9);
}

.node.maxed .node-progress {
  --progress-color-start: rgba(255, 118, 118, 0.4);
  --progress-color-end: rgba(255, 71, 71, 0.9);
}

.node.shake {
  animation: nodeShake 0.7s linear infinite;
}

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

.gain-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(247, 160, 15, 0.12);
  color: var(--tl-primary);
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  animation: floatGain 1.4s ease forwards;
  border: 1px solid rgba(247, 160, 15, 0.45);
  text-shadow: 0 0 18px rgba(247, 160, 15, 0.55);
}

@keyframes floatGain {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-25px) scale(1.05); }
}

.placeholder {
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-size: 0.9rem;
  width: 100%;
}

.status-message {
  border-radius: 16px;
  padding: 0.75rem 1rem;
  background: rgba(247, 160, 15, 0.12);
  border: 1px solid rgba(247, 160, 15, 0.3);
  color: var(--tl-primary);
  font-size: 0.85rem;
  letter-spacing: 0.08rem;
}

.status-message[data-type="error"] {
  background: rgba(255, 82, 82, 0.1);
  border-color: rgba(255, 82, 82, 0.4);
  color: #ff8b8b;
}

.kingdom-bank {
  margin-top: 1.2rem;
  padding: 1rem 1.25rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.kingdom-bank-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.kingdom-bank-label {
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.65);
}

.kingdom-bank-value {
  font-family: 'Orbitron';
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
}

.kingdom-bank-rate {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: var(--tl-primary);
  white-space: nowrap;
}

.kingdom-progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.kingdom-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(247, 160, 15, 0.25), rgba(247, 160, 15, 0.95));
  box-shadow: 0 0 12px rgba(247, 160, 15, 0.4);
  transition: width 0.3s ease;
}

.kingdom-bank-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'IBM Plex Mono', monospace;
}

/* TLRPG Distribution Section */
.kingdom-distribution {
  margin-top: 1.2rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.06) 0%, rgba(255, 215, 0, 0.02) 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.distribution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.distribution-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.distribution-token-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.distribution-timer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
}

.distribution-timer .timer-icon {
  font-size: 0.85rem;
}

.distribution-timer .timer-value {
  color: #ffd700;
  font-weight: 600;
}

.distribution-estimate {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.estimate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.estimate-row.current {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.estimate-row.next-level {
  background: rgba(80, 200, 120, 0.08);
  border: 1px dashed rgba(80, 200, 120, 0.3);
}

.estimate-row.target-level {
  background: rgba(80, 200, 120, 0.08);
  border: 1px dashed rgba(80, 200, 120, 0.3);
}

.estimate-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.estimate-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.estimate-value.highlight {
  color: #50c878;
}

.estimate-bonus {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: rgba(80, 200, 120, 0.2);
  border-radius: 4px;
  color: #50c878;
}

.distribution-ineligible {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ineligible-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.ineligible-icon {
  font-size: 1.1rem;
}

.distribution-loading {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 0.5rem;
}

.passive-error {
  color: #ff9fa0;
  font-size: 0.78rem;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 0.25rem;
}

.kingdom-passive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kingdom-passive-actions button {
  flex: 1;
  min-width: 160px;
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  font-weight: 600;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
}

.kingdom-passive-actions .upgrade-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
}

.kingdom-passive-actions button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 960px) {
  .kingdom-panel {
    flex-direction: column;
  }
  .kingdom-media {
    flex-basis: 100%;
    max-width: 100%;
  }
  .collection-hub {
    flex-basis: 100%;
  }
}

.kingdom-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 10, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 40;
}

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

.kingdom-modal-card {
  width: min(520px, 92vw);
  background: rgba(5, 7, 13, 0.95);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: clamp(1rem, 2vw, 1.8rem);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.kingdom-modal-card h3 {
  margin: 0;
  font-family: 'Orbitron';
  letter-spacing: 0.35rem;
  text-transform: uppercase;
  color: var(--tl-primary);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.modal-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
}

.modal-panel .panel-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.3rem;
  color: rgba(255, 255, 255, 0.55);
}

.modal-panel .panel-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.modal-panel .panel-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

.upgrade-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  top: auto;
  z-index: 50;
  transition: bottom 0.35s ease;
  background: rgba(5, 7, 13, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  padding: 1.5rem;
  z-index: 10;
}

.upgrade-drawer.open { bottom: 0; }

.drawer-content {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.drawer-title {
  font-family: 'Orbitron';
  letter-spacing: 0.3rem;
  text-transform: uppercase;
  color: var(--tl-primary);
}

.drawer-close {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  cursor: pointer;
}

.drawer-grid,
.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.drawer-card,
.metric-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.drawer-card h4,
.metric-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.metric-label {
  font-size: 0.75rem;
  letter-spacing: 0.25rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.metric-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 0.25rem;
}

.metric-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.cost-list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
}

.cost-chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
}

.cost-chip[data-state="missing"] {
  border-color: rgba(255, 91, 91, 0.6);
  background: rgba(255, 91, 91, 0.1);
  color: #ffb0b0;
}

.drawer-status {
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.08rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.drawer-status[data-state="warning"] {
  border-color: rgba(255, 91, 91, 0.4);
  background: rgba(255, 91, 91, 0.08);
  color: #ffb0b0;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 1200px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding: 1rem; gap: 0.5rem; }
  .logo { margin: 0; }
  .sidebar-toggle { position: static; right: auto; top: auto; }
  .nav-menu { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; width: 100%; }
  .nav-btn { flex: 0 0 auto; border-left: none; border-bottom: 3px solid transparent; border-radius: 14px; justify-content: center; min-width: 140px; }
  .nav-btn.active { border-left: none; border-bottom-color: var(--tl-primary); box-shadow: 0 0 0 1px rgba(247, 160, 15, 0.35); }
  body.sidebar-collapsed .nav-btn { padding-inline: 1rem; }
  .logout { margin: 0 auto 0 0; }
  .command-deck { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
.top-bar { flex-direction: column; align-items: flex-start; }
  .node-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 520px) {
.content { padding: 1.2rem 1rem 2rem; }
  .node-actions { flex-direction: column; }
  .mini-collect { width: 100%; }
}

/* Collection Loading Overlay */
.collecting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 13, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

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

.collecting-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem;
  border-radius: 24px;
  background: rgba(15, 18, 26, 0.9);
  border: 1px solid rgba(247, 160, 15, 0.35);
  box-shadow: 0 0 60px rgba(247, 160, 15, 0.15), 0 0 120px rgba(247, 160, 15, 0.08);
  max-width: 90vw;
  text-align: center;
}

.collecting-spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
  border-top-color: var(--tl-primary);
  animation-duration: 1.2s;
}

.spinner-ring:nth-child(2) {
  inset: 8px;
  border-right-color: rgba(247, 160, 15, 0.6);
  animation-duration: 1.8s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  inset: 16px;
  border-bottom-color: rgba(247, 160, 15, 0.3);
  animation-duration: 2.4s;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.collecting-message {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  color: var(--tl-primary);
  letter-spacing: 0.15rem;
  text-transform: uppercase;
}

.collecting-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.countdown-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--tl-primary);
  text-shadow: 0 0 20px rgba(247, 160, 15, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.countdown-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.15rem;
  text-transform: uppercase;
}

.collecting-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 280px;
  line-height: 1.5;
}

/* ============================================
   HORIZONTAL BUSINESS ROW LAYOUT
   ============================================ */

.business-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.business-row {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.business-row:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 20px rgba(247, 160, 15, 0.1);
}

/* Row Header: Icon, Label, Stats, Progress */
.business-row-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.business-row-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.business-row-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tl-primary);
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  min-width: 110px;
}

.business-row-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  font-size: 0.75rem;
}

.business-row-stored {
  color: rgba(255, 255, 255, 0.8);
  font-family: 'JetBrains Mono', monospace;
}

.business-row-rate {
  color: var(--tl-success, #4ade80);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.business-row-progress {
  flex: 1;
  min-width: 100px;
  max-width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.business-row-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tl-primary), #fbbf24);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.business-row-progress-fill[data-full="true"] {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  animation: fullPulse 1.5s ease-in-out infinite;
}

.business-row-progress-fill[data-nearly-full="true"] {
  background: linear-gradient(90deg, #eab308, #fbbf24);
}

@keyframes fullPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Level Blocks - Horizontal Layout */
.business-row-levels {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.business-level-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 70px;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  cursor: default;
  transition: all 0.2s ease;
  position: relative;
  gap: 0.15rem;
}

.business-level-block .level-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
}

.business-level-block .level-status {
  font-size: 0.9rem;
  line-height: 1;
}

.business-level-block .level-requirement {
  position: absolute;
  bottom: -6px;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  background: var(--surface-1);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Unlocked State */
.business-level-block.unlocked {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}

.business-level-block.unlocked .level-number {
  color: #4ade80;
}

.business-level-block.unlocked .level-status {
  color: #22c55e;
}

/* Available to Unlock State */
.business-level-block.available {
  border-color: var(--tl-primary);
  background: rgba(247, 160, 15, 0.15);
  cursor: pointer;
}

.business-level-block.available:hover {
  background: rgba(247, 160, 15, 0.25);
  transform: translateY(-2px);
}

.business-level-block.available .level-number {
  color: var(--tl-primary);
}

.business-level-block.available .level-status {
  color: var(--tl-primary);
}

/* Locked State */
.business-level-block.locked {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.business-level-block.locked .level-number {
  color: rgba(255, 255, 255, 0.4);
}

.business-level-block.locked .level-status {
  color: rgba(255, 255, 255, 0.3);
}

.business-level-more {
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
  padding: 0 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .business-row {
    padding: 0.75rem 1rem;
  }
  
  .business-row-header {
    flex-wrap: wrap;
  }
  
  .business-row-stats {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    order: 3;
  }
  
  .business-row-progress {
    order: 4;
    width: 100%;
    max-width: none;
    margin-top: 0.25rem;
  }
  
  .business-row-levels {
    gap: 0.35rem;
  }
  
  .business-level-block {
    min-width: 44px;
    height: 44px;
  }
  
  .business-level-block .level-number {
    font-size: 0.55rem;
  }
  
  .business-level-block .level-status {
    font-size: 0.75rem;
  }
}

/* ============================================
   RESOURCE COLLECTION ANIMATION
   ============================================ */

.resource-collection-animation {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

.floating-resource {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(247, 160, 15, 0.2);
  border: 2px solid var(--tl-primary);
  box-shadow: 0 0 15px rgba(247, 160, 15, 0.5);
  left: var(--start-x);
  top: var(--start-y);
  transform: translate(-50%, -50%) scale(0);
  transition: none;
  z-index: 10001;
}

.floating-resource-icon {
  font-size: 1.4rem;
}

.floating-resource.phase-spawn {
  animation: resourceSpawn 0.15s ease-out forwards;
}

.floating-resource.phase-flying {
  animation: resourceFly 0.4s ease-in forwards;
}

.floating-resource.phase-done {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

@keyframes resourceSpawn {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes resourceFly {
  0% {
    left: var(--start-x);
    top: var(--start-y);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: var(--end-x);
    top: var(--end-y);
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
}

/* Pulse effect for header resources */
.resource-pulse {
  animation: headerPulse 0.4s ease-out;
}

@keyframes headerPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.2);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

/* ============================================
   BUSINESS LEVEL MODAL (NEW CENTERED MODAL)
   ============================================ */

.business-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}

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

.business-modal {
  background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
  border: 1px solid rgba(247, 160, 15, 0.3);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 
    0 0 60px rgba(247, 160, 15, 0.15),
    0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.business-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(247, 160, 15, 0.1), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.business-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.business-modal-title .modal-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px rgba(247, 160, 15, 0.5));
}

.business-modal-title h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: 0.05rem;
}

.modal-level-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(247, 160, 15, 0.2);
  border: 1px solid rgba(247, 160, 15, 0.4);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--tl-primary);
  letter-spacing: 0.05rem;
  margin-top: 0.25rem;
}

.business-modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.business-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.business-modal-content {
  padding: 1.25rem 1.5rem;
  max-height: 55vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 160, 15, 0.4) rgba(255, 255, 255, 0.05);
}

.business-modal-content::-webkit-scrollbar {
  width: 8px;
}

.business-modal-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.business-modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(247, 160, 15, 0.5), rgba(247, 160, 15, 0.3));
  border-radius: 4px;
}

.business-modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(247, 160, 15, 0.7), rgba(247, 160, 15, 0.5));
}

/* Status Banner */
.modal-status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.modal-status-banner.active {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.modal-status-banner.unlocked {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.modal-status-banner.available {
  background: rgba(247, 160, 15, 0.15);
  border: 1px solid rgba(247, 160, 15, 0.4);
  color: var(--tl-primary);
  animation: availableBannerPulse 2s ease-in-out infinite;
}

@keyframes availableBannerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 160, 15, 0); }
  50% { box-shadow: 0 0 15px rgba(247, 160, 15, 0.2); }
}

.modal-status-banner.locked {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

.modal-status-banner .status-icon {
  font-size: 1.1rem;
}

/* Stats Grid */
.modal-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
}

.modal-stat-card.highlight {
  background: rgba(247, 160, 15, 0.08);
  border-color: rgba(247, 160, 15, 0.3);
}

.modal-stat-card .stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.modal-stat-card .stat-value {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.modal-stat-card .stat-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.modal-stat-card .stat-number.increase {
  color: #4ade80;
}

.modal-stat-card .stat-unit {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Level Comparison */
.modal-comparison {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.modal-comparison .comparison-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.modal-comparison .comparison-row.highlight {
  color: #4ade80;
  font-weight: 600;
}

.modal-comparison .comparison-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.modal-comparison .comparison-row.highlight .comparison-label {
  color: #4ade80;
}

.modal-comparison .comparison-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
}

.modal-comparison .comparison-arrow {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  padding: 0.25rem 0;
}

/* Notice */
.modal-notice {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.modal-notice.warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.modal-notice.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.modal-notice .notice-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.modal-notice strong {
  display: block;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.modal-notice p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  line-height: 1.4;
}

/* Footer */
.business-modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 0.75rem;
}

.modal-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-btn.primary {
  background: linear-gradient(135deg, var(--tl-primary), #e6920d);
  border: none;
  color: #000;
  box-shadow: 0 4px 15px rgba(247, 160, 15, 0.3);
}

.modal-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(247, 160, 15, 0.4);
}

.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.modal-btn.disabled,
.modal-btn:disabled {
  background: rgba(100, 100, 100, 0.3);
  border: 1px solid rgba(100, 100, 100, 0.3);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  box-shadow: none;
}

.modal-btn.disabled:hover,
.modal-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Kingdom upgrade modal - specific overrides */
.kingdom-upgrade-modal .requirement-item.missing .requirement-amount {
  color: #ff6b6b;
}

.kingdom-upgrade-modal .requirement-deficit {
  color: #ff6b6b;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

/* Stage requirement warning */
.modal-stage-requirement {
  margin-bottom: 1rem;
}

.stage-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.05));
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  padding: 1rem;
}

.stage-warning-box .stage-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stage-warning-text {
  flex: 1;
}

.stage-warning-text strong {
  display: block;
  color: #ff6b6b;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.stage-warning-text p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

.stage-warning-text .stage-current {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* ============================================
   ENHANCED LEVEL BLOCKS
   ============================================ */

/* Level Badge inside block */
.business-level-block .level-badge {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.business-level-block .level-badge.current {
  background: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.business-level-block .level-badge.unlocked {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  font-size: 0.7rem;
}

.business-level-block .level-badge.available {
  background: rgba(247, 160, 15, 0.3);
  color: var(--tl-primary);
}

.business-level-block .level-badge.locked {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.65rem;
}

.business-level-block .level-badge.mystery {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
  color: #c084fc;
  font-size: 0.45rem;
  letter-spacing: 0.02rem;
}

/* Level Rate */
.business-level-block .level-rate {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.business-level-block .level-rate.base {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

.business-level-block.unlocked .level-rate,
.business-level-block.current .level-rate {
  color: rgba(34, 197, 94, 0.9);
}

.business-level-block.available .level-rate {
  color: rgba(247, 160, 15, 0.9);
}

/* Kingdom Requirement */
.business-level-block .level-kingdom-req {
  position: absolute;
  bottom: -8px;
  font-size: 0.55rem;
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Current Level - special styling */
.business-level-block.current {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.15);
}

.business-level-block.current .level-number {
  color: #4ade80;
}

/* Clickable state */
.business-level-block[data-clickable="true"] {
  cursor: pointer;
}

.business-level-block[data-clickable="true"]:hover {
  transform: translateY(-2px);
}

/* Next Stage block */
.business-level-block.next-stage {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
  border: 1px dashed rgba(139, 92, 246, 0.4);
  min-width: 70px;
}

.business-level-block.next-stage .level-number {
  color: rgba(139, 92, 246, 0.7);
  font-size: 0.7rem;
}

.business-level-block.next-stage .level-rate {
  color: rgba(236, 72, 153, 0.6);
  font-size: 0.5rem;
}

/* ============================================
   MODAL REQUIREMENTS SECTION
   ============================================ */

.modal-requirements {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.modal-requirements .requirements-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tl-primary);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-requirements .requirement-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-requirements .requirement-item:last-child {
  margin-bottom: 0;
}

.modal-requirements .requirement-icon {
  font-size: 1.1rem;
  width: 28px;
  text-align: center;
}

.modal-requirements .requirement-name {
  flex: 1;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.modal-requirements .requirement-amount {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.modal-requirements .requirement-item.bronze {
  background: rgba(247, 160, 15, 0.1);
  border-color: rgba(247, 160, 15, 0.2);
}

.modal-requirements .requirement-item.bronze .requirement-amount {
  color: var(--tl-primary);
}

.modal-requirements .requirement-item.resource {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.15);
}

.modal-requirements .requirement-item.rare {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
}

.modal-requirements .requirement-item.rare .requirement-amount {
  color: #c084fc;
}

.modal-requirements .requirement-item.kingdom-req {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.modal-requirements .requirement-item.kingdom-req .requirement-amount {
  color: #fbbf24;
}

/* Has enough / Not enough color states */
.modal-requirements .requirement-item.has-enough {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.modal-requirements .requirement-item.has-enough .requirement-amount {
  color: #22c55e;
}

.modal-requirements .requirement-item.not-enough {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.modal-requirements .requirement-item.not-enough .requirement-amount {
  color: #ef4444;
}

.modal-requirements .requirement-owned {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: 0.25rem;
  font-weight: 400;
}

.modal-requirements .requirements-divider {
  font-size: 0.65rem;
  color: rgba(168, 85, 247, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  margin: 0.75rem 0 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(168, 85, 247, 0.3);
}

/* Production Info Section */
.modal-production-info {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.modal-production-info .production-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(34, 197, 94, 0.9);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}

.modal-production-info .production-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-production-info .production-row:last-child {
  border-bottom: none;
}

.modal-production-info .production-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.modal-production-info .production-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.modal-production-info .production-row.highlight {
  background: rgba(34, 197, 94, 0.1);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem -0.5rem;
}

.modal-production-info .production-row.highlight .production-value.increase {
  color: #22c55e;
  font-weight: 700;
}

.modal-production-info .production-row.total {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(34, 197, 94, 0.3);
}

.modal-production-info .production-row.total .production-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.modal-production-info .production-row.total .production-value {
  color: var(--tl-primary);
  font-size: 0.95rem;
}

/* Stat hint for L0 */
.modal-stat-card .stat-hint {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ============================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet */
@media (max-width: 900px) {
  .business-row-header {
    gap: 0.5rem;
  }
  
  .business-row-label {
    min-width: 90px;
    font-size: 0.8rem;
  }
  
  .business-row-progress {
    max-width: 150px;
  }
  
  .business-level-block {
    min-width: 60px;
    height: 60px;
  }
  
  .business-level-block .level-number {
    font-size: 0.75rem;
  }
  
  .business-level-block .level-badge {
    font-size: 0.5rem;
  }
  
  .business-level-block .level-rate {
    font-size: 0.55rem;
  }
}

/* Mobile Large */
@media (max-width: 640px) {
  .business-rows-container {
    gap: 0.5rem;
  }
  
  .business-row {
    padding: 0.75rem;
    border-radius: 10px;
  }
  
  .business-row-header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.4rem 0.6rem;
    align-items: center;
  }
  
  .business-row-icon {
    font-size: 1.3rem;
    grid-row: 1 / 3;
  }
  
  .business-row-label {
    min-width: unset;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
  }
  
  .business-row-stats {
    grid-column: 2;
    margin-left: 0;
    gap: 0.5rem;
    font-size: 0.65rem;
    justify-content: flex-start;
  }
  
  .business-row-progress {
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
    height: 5px;
    margin-top: 0.25rem;
  }
  
  .business-row-levels {
    gap: 0.3rem;
    padding-top: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .business-row-levels::-webkit-scrollbar {
    display: none;
  }
  
  .business-level-block {
    min-width: 52px;
    height: 52px;
    flex-shrink: 0;
    padding: 0.25rem 0.35rem;
    border-radius: 8px;
  }
  
  .business-level-block .level-number {
    font-size: 0.65rem;
  }
  
  .business-level-block .level-badge {
    font-size: 0.45rem;
    padding: 0.1rem 0.25rem;
  }
  
  .business-level-block .level-rate {
    font-size: 0.5rem;
  }
  
  .business-level-block .level-status {
    font-size: 0.7rem;
  }
  
  .business-level-block .level-requirement {
    font-size: 0.4rem;
    bottom: -4px;
    padding: 0px 3px;
  }
  
  .business-level-more {
    font-size: 1rem;
  }
  
  /* Collect All button mobile */
  .collect-all-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
  }
  
  .section-heading {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .section-heading h2 {
    font-size: 0.85rem;
  }
}

/* Mobile Small */
@media (max-width: 400px) {
  .business-row {
    padding: 0.6rem;
  }
  
  .business-row-icon {
    font-size: 1.1rem;
  }
  
  .business-row-label {
    font-size: 0.65rem;
  }
  
  .business-row-stats {
    font-size: 0.6rem;
    gap: 0.4rem;
  }
  
  .business-level-block {
    min-width: 36px;
    height: 36px;
  }
  
  .business-level-block .level-number {
    font-size: 0.45rem;
  }
  
  .business-level-block .level-status {
    font-size: 0.6rem;
  }
}

/* Very small screens - scroll hint */
@media (max-width: 480px) {
  .business-row-levels::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, var(--surface-1));
    pointer-events: none;
    opacity: 0.8;
  }
  
  .business-row-levels {
    position: relative;
  }
}

/* ============================================
   VIP BOOST STYLING
   ============================================ */

/* VIP badge in rate display */
.vip-boost-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid;
  border-radius: 4px;
  animation: vipGlow 2s ease-in-out infinite;
}

@keyframes vipGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* VIP rate comparison */
.business-vip-comparison,
.vip-rate-comparison {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin: 0.35rem 0;
}

.f2p-rate {
  color: #888;
  text-decoration: line-through;
  opacity: 0.7;
}

.vip-rate {
  font-weight: 600;
}

/* VIP boosted progress bar */
.business-row-progress.vip-boosted,
.kingdom-progress-bar.vip-boosted {
  border: 1px solid var(--vip-color, #50C878);
  box-shadow: 0 0 8px var(--vip-color, #50C878)33;
}

/* VIP promotion link */
.business-vip-promo,
.vip-promo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #50C878;
  background: linear-gradient(135deg, rgba(80, 200, 120, 0.1), rgba(80, 200, 120, 0.05));
  border: 1px solid rgba(80, 200, 120, 0.3);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.business-vip-promo:hover,
.vip-promo-link:hover {
  background: linear-gradient(135deg, rgba(80, 200, 120, 0.2), rgba(80, 200, 120, 0.1));
  border-color: rgba(80, 200, 120, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(80, 200, 120, 0.2);
}

.vip-promo-link.upgrade {
  color: #50C878;
}

.vip-promo-icon {
  font-size: 0.9rem;
}

/* VIP tier specific progress bar colors */
.business-row[data-vip-tier="silver"] .business-row-progress-fill,
.kingdom-progress-bar[data-vip-tier="silver"] .kingdom-progress-fill {
  background: linear-gradient(90deg, #C0C0C0, #A0A0A0) !important;
}

.business-row[data-vip-tier="gold"] .business-row-progress-fill,
.kingdom-progress-bar[data-vip-tier="gold"] .kingdom-progress-fill {
  background: linear-gradient(90deg, #FFD700, #FFA500) !important;
}

.business-row[data-vip-tier="diamond"] .business-row-progress-fill,
.kingdom-progress-bar[data-vip-tier="diamond"] .kingdom-progress-fill {
  background: linear-gradient(90deg, #B9F2FF, #87CEEB) !important;
}

.business-row[data-vip-tier="ruby"] .business-row-progress-fill,
.kingdom-progress-bar[data-vip-tier="ruby"] .kingdom-progress-fill {
  background: linear-gradient(90deg, #E0115F, #C41E3A) !important;
}

.business-row[data-vip-tier="emerald"] .business-row-progress-fill,
.kingdom-progress-bar[data-vip-tier="emerald"] .kingdom-progress-fill {
  background: linear-gradient(90deg, #50C878, #2E8B57) !important;
}

/* Kingdom VIP boost styling */
.kingdom-bank-rate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kingdom-bank-rate .vip-boost-badge {
  font-size: 0.55rem;
}
