/* ==========================================================================
   EliteChess — Chess Empire Strategy & Operations Stylesheet
   Refined Obsidian & Antique Gold Architecture (Desktop + Full-Width Mobile)
   ========================================================================== */

#view-tasks .tasks-hub-container,
#referral-content-wrapper {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 0 48px;
  color: var(--text-primary, #F8FAFC);
  box-sizing: border-box;
}

.emp-page-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
}

/* --- 1. Compact Header Bar & Switchable Tabs --- */
.emp-command-hero {
  background: linear-gradient(180deg, #161822 0%, #101219 100%);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emp-compact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.emp-compact-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.emp-crest-badge {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-crest-badge svg {
  width: 34px;
  height: 34px;
}

.emp-brand-text {
  min-width: 0;
}

.emp-brand-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.emp-page-title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.15;
}

.emp-class-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #E2E8F0;
}

.emp-class-pill.is-promoted {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.55);
  color: #FDE68A;
}

.emp-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  color: #E5C158;
  margin-top: 2px;
}

.emp-compact-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.emp-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  background: #0A0C12;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
  font-weight: 800;
  color: #FFFFFF;
}

.emp-stat-pill.accent {
  border-color: rgba(212, 175, 55, 0.42);
  background: rgba(212, 175, 55, 0.1);
}

.emp-yield-val {
  color: #FDE68A;
}

.emp-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.emp-jump-btn.primary {
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  color: #09090B;
  border-color: transparent;
}

.emp-jump-btn.primary svg,
.emp-streak-btn:not(:disabled) svg,
.emp-alliance-btn.primary svg,
.emp-copy-btn.primary svg,
.emp-promote-btn svg,
.emp-copy-link-btn svg,
.emp-op-btn.claim svg,
#sheet-confirm-upgrade-btn svg {
  color: #09090B !important;
  stroke: currentColor !important;
  width: 15px;
  height: 15px;
}

.emp-main-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.emp-main-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #CBD5E1;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.emp-main-tab-btn:hover {
  border-color: rgba(212, 175, 55, 0.45);
  color: #FFFFFF;
}

.emp-main-tab-btn.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.72);
  color: #FDE68A;
}

.emp-tab-badge {
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  white-space: nowrap;
}

.emp-main-tab-btn.active .emp-tab-badge {
  background: rgba(212, 175, 55, 0.22);
  color: #FDE68A;
}

.emp-tab-badge.ready {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
}

/* --- 2. Section Heads & Inline Filter Rail --- */
.emp-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.emp-section-highlight {
  outline: 1px solid rgba(212, 175, 55, 0.6);
  outline-offset: 6px;
  border-radius: 12px;
}

.emp-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.emp-section-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.emp-section-sub {
  margin: 2px 0 0;
  font-size: 0.79rem;
  color: #94A3B8;
}

.emp-count-pill {
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 800;
  color: #D4AF37;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
}

.emp-filter-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.emp-filter-btn {
  min-height: 33px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #94A3B8;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.emp-filter-btn:hover {
  color: #FFFFFF;
  border-color: rgba(212, 175, 55, 0.35);
}

.emp-filter-btn.active {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.6);
  color: #FDE68A;
}

/* --- 3. Compact High-Contrast Product Cards --- */
.emp-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.emp-product-card {
  background: #141720;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 0;
}

.emp-product-card:hover {
  border-color: rgba(212, 175, 55, 0.55);
  background: #191D29;
}

.emp-product-card.can-afford {
  border-color: rgba(212, 175, 55, 0.5);
}

.emp-product-card.is-class-c {
  background: linear-gradient(180deg, rgba(36, 28, 15, 0.92) 0%, #141720 100%);
  border-color: rgba(212, 175, 55, 0.42);
}

.emp-product-card.is-locked {
  background: #12151E;
  border-color: rgba(255, 255, 255, 0.12);
}

.emp-card-top {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.emp-art-frame {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #0A0C12;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.emp-art-frame.is-exclusive-art {
  border-color: rgba(212, 175, 55, 0.55);
}

.emp-art-img,
.emp-art-svg-wrap,
.empire-art-svg {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-lock-pin {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(15, 17, 25, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.65);
  color: #FDE68A;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-lock-pin svg {
  width: 9px;
  height: 9px;
}

.emp-card-heading {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.emp-card-subline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.emp-card-name {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.22;
}

.emp-tier-tag {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #FDE68A;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.emp-card-yield-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 900;
  color: #FDE68A;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 3px 8px;
  border-radius: 7px;
  flex-shrink: 0;
}

.emp-card-lvl {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 700;
  color: #E2E8F0;
}

.emp-card-footer {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.emp-next-gain {
  font-family: var(--font-mono, monospace);
  font-size: 0.73rem;
  font-weight: 700;
  color: #CBD5E1;
  white-space: nowrap;
}

.emp-upgrade-btn {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  color: #09090B;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.emp-upgrade-btn:hover {
  opacity: 0.92;
}

.emp-upgrade-btn.dim {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
  color: #F8FAFC;
}

.emp-lock-req-btn {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.12);
  color: #FDE68A;
  font-size: 0.74rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.emp-lock-req-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.65);
}

.emp-lock-req-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FCD34D;
  flex-shrink: 0;
}

.emp-lock-req-icon svg {
  width: 13px;
  height: 13px;
}

.emp-lock-req-txt {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-lock-req-arrow {
  color: #FDE68A;
  font-weight: 900;
  flex-shrink: 0;
}

.emp-upgrade-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
}

.emp-action-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #E2E8F0;
}

.emp-action-status svg {
  width: 13px;
  height: 13px;
  color: #D4AF37;
}

.emp-action-status.maxed {
  color: #6EE7B7;
}

/* --- 4. Class C Exclusive Showcase --- */
.emp-exclusive-vault {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emp-exclusive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.emp-exclusive-eyebrow {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #D4AF37;
}

.emp-exclusive-title {
  margin: 2px 0;
  font-size: 1.04rem;
  font-weight: 800;
  color: #FFFFFF;
}

.emp-exclusive-sub {
  margin: 0;
  font-size: 0.78rem;
  color: #94A3B8;
}

.emp-promote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  color: #09090B;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.emp-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #E2E8F0;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.emp-unlocked-pill {
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
  font-size: 0.74rem;
  font-weight: 800;
}

/* --- 5. Synergies & Ranks Matrix --- */
.emp-strategy-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.emp-strategy-block {
  background: #111218;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emp-sub-heading {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #FFFFFF;
}

.emp-synergy-list,
.emp-rank-ladder {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.emp-synergy-row,
.emp-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.emp-synergy-row.active,
.emp-rank-row.current {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.07);
}

.emp-syn-title,
.emp-rank-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFFFFF;
}

.emp-syn-title span {
  color: #D4AF37;
  margin-left: 4px;
}

.emp-syn-req,
.emp-rank-req {
  font-size: 0.7rem;
  color: #94A3B8;
}

.emp-syn-state,
.emp-rank-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748B;
}

.emp-syn-state.active {
  color: #6EE7B7;
}

.emp-rank-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emp-rank-mult {
  font-size: 0.74rem;
  font-weight: 800;
  color: #FDE68A;
}

/* --- 6. Daily Streak, Task Operations & Social Missions --- */
.emp-reset-timer {
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 10px;
  border-radius: 8px;
}

.emp-streak-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #111218;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  padding: 13px 14px;
}

.emp-streak-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.emp-streak-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emp-streak-label {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
}

.emp-streak-info strong {
  font-size: 0.9rem;
  color: #FFFFFF;
}

.gold-accent {
  color: #FDE68A;
  font-family: var(--font-mono, monospace);
}

.emp-streak-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.emp-streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.66rem;
  color: #94A3B8;
}

.emp-streak-day strong {
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: #FDE68A;
}

.emp-streak-day.current {
  border-color: rgba(212, 175, 55, 0.7);
  background: rgba(212, 175, 55, 0.14);
  color: #FFFFFF;
}

.emp-streak-day.claimed {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #6EE7B7;
}

.emp-streak-day.claimed strong {
  color: #6EE7B7;
}

.emp-streak-day.grand:not(.claimed) {
  border-color: rgba(212, 175, 55, 0.35);
}

.emp-streak-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  color: #09090B;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.emp-streak-btn:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: #64748B;
  cursor: default;
}

.emp-ops-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.emp-ops-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.emp-ops-meter-txt {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #94A3B8;
  white-space: nowrap;
}

.emp-ops-meter-txt strong {
  color: #FFFFFF;
}

.emp-ops-meter-txt .ready-txt {
  font-style: normal;
  color: #FDE68A;
  font-weight: 800;
}

.emp-ops-meter-bar {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.emp-ops-meter-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #D4AF37, #10B981);
}

.emp-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.emp-op-card {
  background: #141720;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  min-width: 0;
  overflow: hidden;
}

.emp-op-card.claimable {
  border-color: rgba(212, 175, 55, 0.65);
  box-shadow: inset 3px 0 0 #D4AF37;
}

.emp-op-card.claimed {
  border-color: rgba(16, 185, 129, 0.3);
  background: #11151B;
}

.emp-op-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 180px;
  min-width: 0;
}

.emp-op-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #FDE68A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.emp-op-icon svg {
  width: 17px;
  height: 17px;
}

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

.emp-op-info h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
}

.emp-op-prog {
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 700;
  color: #CBD5E1;
}

.emp-op-prog.ready {
  color: #FDE68A;
}

.emp-op-prog.done {
  color: #6EE7B7;
}

.emp-op-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.emp-op-reward {
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 800;
  color: #FDE68A;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.emp-op-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #E2E8F0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.emp-op-btn.start:hover {
  border-color: rgba(212, 175, 55, 0.45);
  color: #FFFFFF;
}

.emp-op-btn.claim {
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  color: #09090B;
  border-color: transparent;
}

.emp-op-btn.done {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6EE7B7;
  cursor: default;
}

.emp-empty-ops {
  grid-column: 1 / -1;
  padding: 20px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  text-align: center;
  color: #94A3B8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

/* Community Missions */
.emp-social-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.emp-sub-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.emp-bounty-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 800;
  color: #FDE68A;
}

.emp-social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.emp-social-card {
  background: #111218;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 9px;
}

.emp-social-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.emp-social-meta {
  min-width: 0;
}

.emp-social-plat {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94A3B8;
}

.emp-social-left h4 {
  margin: 1px 0 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFFFFF;
}

.emp-social-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* --- 7. Integrated Alliance & Recruit Network --- */
.emp-alliance-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.emp-alliance-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 12px;
}

.emp-invite-console,
.emp-roster-panel {
  background: #111218;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.emp-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.emp-code-display {
  font-family: var(--font-mono, monospace);
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #FDE68A;
  margin-top: 2px;
}

.emp-copy-chip,
.emp-mini-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.1);
  color: #FDE68A;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.emp-link-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #08090D;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 3px 3px 3px 10px;
}

.emp-link-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #CBD5E1;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
}

.emp-copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: none;
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  color: #09090B;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.emp-share-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.emp-share-chip {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #E2E8F0;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.emp-share-chip:hover {
  border-color: rgba(212, 175, 55, 0.45);
}

.emp-alliance-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.emp-kpi-mini {
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.emp-kpi-mini:last-child {
  border-right: none;
}

.emp-kpi-mini span {
  font-size: 0.66rem;
  color: #94A3B8;
  font-weight: 700;
}

.emp-kpi-mini strong {
  font-family: var(--font-mono, monospace);
  font-size: 0.96rem;
  font-weight: 900;
  color: #FFFFFF;
}

.emp-kpi-mini.gold strong {
  color: #FDE68A;
}

.emp-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.emp-roster-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #FFFFFF;
}

.emp-roster-head span {
  font-size: 0.72rem;
  color: #D4AF37;
  font-weight: 700;
}

.emp-roster-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 8px;
  color: #64748B;
  gap: 5px;
}

.emp-roster-empty h4 {
  margin: 0;
  font-size: 0.86rem;
  color: #CBD5E1;
}

.emp-roster-empty p {
  margin: 0;
  font-size: 0.74rem;
  max-width: 260px;
}

.emp-roster-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.emp-roster-row,
.emp-custom-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.76rem;
}

.emp-roster-user {
  display: flex;
  flex-direction: column;
}

.emp-roster-user span {
  font-size: 0.66rem;
  color: #94A3B8;
}

.emp-roster-royalties {
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  color: #6EE7B7;
}

/* --- 8. Empire Upgrade Strategy Drawer Modal --- */
#modal-empire-upgrade-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}

#modal-empire-upgrade-sheet.active {
  display: flex !important;
}

.empire-upgrade-sheet-box {
  background: #13141B;
  border: 1px solid rgba(212, 175, 55, 0.35);
  width: min(100vw - 12px, 440px);
  max-height: min(88dvh, calc(100vh - 20px));
  overflow-y: auto;
  border-radius: 18px;
  padding: 20px 16px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

@media (min-width: 768px) {
  #modal-empire-upgrade-sheet {
    align-items: center !important;
  }
}

.sheet-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
  font-size: 1.2rem;
  cursor: pointer;
}

.sheet-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.emp-art-frame.is-modal-art {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.emp-art-frame.is-modal-art .emp-art-img,
.emp-art-frame.is-modal-art .empire-art-svg {
  width: 52px;
  height: 52px;
}

.sheet-upgrade-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #FFFFFF;
}

.sheet-upgrade-desc {
  margin: 0;
  font-size: 0.78rem;
  color: #94A3B8;
  line-height: 1.42;
}

.sheet-level-progression-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  font-weight: 800;
  color: #CBD5E1;
}

.sheet-level-progression-pill .gold-text {
  color: #FDE68A;
}

.sheet-profit-matrix {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  padding: 11px;
}

.sheet-profit-divider {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, 0.08);
}

.sheet-profit-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sheet-profit-col-label {
  font-size: 0.66rem;
  color: #94A3B8;
  font-weight: 700;
}

.sheet-profit-col-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-mono, monospace);
  font-size: 0.92rem;
  font-weight: 900;
  color: #FFFFFF;
}

.sheet-profit-col.highlight-gold .sheet-profit-col-val {
  color: #FDE68A;
}

.sheet-conditions-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sheet-conditions-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
}

.sheet-conditions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-cond-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #CBD5E1;
}

.sheet-cond-row.met {
  color: #6EE7B7;
}

.sheet-cond-text {
  flex: 1;
}

.sheet-cond-prog {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #94A3B8;
}

.sheet-cond-go {
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  background: rgba(212, 175, 55, 0.16);
  color: #FDE68A;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.sheet-payback-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #94A3B8;
}

.sheet-cost-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-mono, monospace);
  font-size: 1.3rem;
  font-weight: 900;
  color: #FFFFFF;
}

.btn-sheet-go-ahead {
  width: 100%;
  min-height: 44px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  color: #09090B;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
}

.btn-sheet-go-ahead.locked,
.btn-sheet-go-ahead.maxed,
.btn-sheet-go-ahead.cannot-afford {
  background: rgba(255, 255, 255, 0.08);
  color: #94A3B8;
}

/* --- 9. Responsive Tablet & Full-Width Mobile UX --- */
@media (max-width: 980px) {
  .emp-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .emp-social-grid,
  .emp-alliance-grid,
  .emp-strategy-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  #view-tasks .tasks-hub-container,
  #referral-content-wrapper {
    padding: 4px 10px 84px !important;
  }
  #view-tasks .emp-upgrade-btn {
    white-space: nowrap !important;
    min-height: 34px !important;
    padding: 0 11px !important;
  }
}

@media (max-width: 640px) {
  .emp-page-shell {
    gap: 14px;
  }
  .emp-command-hero {
    padding: 11px 12px;
    border-radius: 12px;
    gap: 9px;
  }
  .emp-compact-bar {
    gap: 8px;
  }
  .emp-crest-badge {
    width: 30px;
    height: 30px;
  }
  .emp-crest-badge svg {
    width: 30px;
    height: 30px;
  }
  .emp-page-title {
    font-size: 1.12rem;
  }
  .emp-compact-right {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .emp-stat-pill {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.78rem;
  }
  .emp-jump-btn {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.75rem;
  }
  .emp-main-tabs {
    gap: 5px;
    padding-top: 8px;
  }
  .emp-main-tab-btn {
    flex-direction: column;
    gap: 2px;
    min-height: 44px;
    padding: 5px 4px;
    font-size: 0.75rem;
  }
  .emp-tab-badge {
    font-size: 0.62rem;
    padding: 1px 6px;
  }
  .emp-filter-rail {
    gap: 5px;
  }
  .emp-filter-btn {
    min-height: 31px;
    padding: 0 10px;
    font-size: 0.72rem;
  }
  .emp-product-grid,
  .emp-ops-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .emp-product-card {
    padding: 11px 12px;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
  }
  .emp-op-card {
    flex-wrap: wrap;
    padding: 10px 11px;
    gap: 8px;
  }
  .emp-op-right {
    margin-left: auto;
  }
  .emp-op-reward {
    font-size: 0.68rem;
    padding: 3px 6px;
  }
  .emp-streak-strip {
    padding: 11px 12px;
    gap: 9px;
  }
  .emp-streak-days {
    gap: 4px;
  }
  .emp-streak-day {
    padding: 6px 2px;
    font-size: 0.62rem;
  }
  .emp-streak-day strong {
    font-size: 0.66rem;
  }
  .emp-streak-btn {
    padding: 0 12px;
    min-height: 34px;
    font-size: 0.74rem;
  }
  .emp-op-card {
    padding: 11px 12px;
    gap: 8px;
  }
  .emp-op-head-line {
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
  }
  .emp-op-title-wrap {
    flex: 1 1 155px;
  }
  .emp-op-reward {
    white-space: normal;
    max-width: 100%;
    font-size: 0.68rem;
    line-height: 1.25;
  }
  .emp-social-card {
    flex-direction: row;
    align-items: center;
    padding: 10px 11px;
  }
  .emp-social-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
  }
  .emp-alliance-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .emp-invite-console,
  .emp-roster-panel {
    padding: 12px;
  }
  .emp-share-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- 10. Light Theme Compatibility --- */
html.light-theme .emp-command-hero,
body.light-theme .emp-command-hero,
html.light-theme .emp-product-card,
body.light-theme .emp-product-card,
html.light-theme .emp-streak-strip,
body.light-theme .emp-streak-strip,
html.light-theme .emp-op-card,
body.light-theme .emp-op-card,
html.light-theme .emp-social-card,
body.light-theme .emp-social-card,
html.light-theme .emp-invite-console,
body.light-theme .emp-invite-console,
html.light-theme .emp-roster-panel,
body.light-theme .emp-roster-panel,
html.light-theme .emp-strategy-block,
body.light-theme .emp-strategy-block,
html.light-theme .empire-upgrade-sheet-box,
body.light-theme .empire-upgrade-sheet-box {
  background: #FFFFFF;
  border-color: #E2E8F0;
  color: #0F172A;
}

html.light-theme .emp-stat-pill,
body.light-theme .emp-stat-pill {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

html.light-theme .emp-yield-val,
body.light-theme .emp-yield-val {
  color: #B45309;
}

html.light-theme .emp-page-title,
body.light-theme .emp-page-title,
html.light-theme .emp-section-title,
body.light-theme .emp-section-title,
html.light-theme .emp-card-name,
body.light-theme .emp-card-name,
html.light-theme .emp-op-info h4,
body.light-theme .emp-op-info h4,
html.light-theme .sheet-upgrade-title,
body.light-theme .sheet-upgrade-title {
  color: #0F172A;
}
