:root {
  --primary-header: hsl(210, 18%, 18%);
  --body-bg: hsl(210, 25%, 96%);
  --text-primary: hsl(210, 18%, 15%);
  --text-secondary: hsl(210, 8%, 45%);
  --ember-red: hsl(4, 85%, 56%);
  --ember-red-hex: #e94545;
  --card-bg: #ffffff;
  --card-border: hsl(210, 8%, 85%);
  --card-radius: 0.75rem;
  --elite-gradient-start: #667eea;
  --elite-gradient-end: #764ba2;
  --status-healthy: #16a34a;
  --status-warning: #ca8a04;
  --status-critical: #dc2626;
  --tier-elite: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --tier-high: #2563eb;
  --tier-mid: #6b7280;
  --industrial-glow: rgba(233, 69, 69, 0.3);
  --input-bg: hsl(210, 25%, 98%);
  --input-border: hsl(210, 8%, 80%);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  --glass-blur: 10px;
  --dark-glass-bg: rgba(30, 41, 59, 0.85);
  --dark-glass-border: rgba(255, 255, 255, 0.1);
  
  --glow-healthy: rgba(22, 163, 74, 0.4);
  --glow-warning: rgba(202, 138, 4, 0.4);
  --glow-critical: rgba(220, 38, 38, 0.4);
  
  --heatbar-height: 6px;
  --progress-ring-size: 44px;
  --progress-ring-stroke: 4px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--body-bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

input, select, textarea {
  font-size: 16px !important;
}

.rokforge-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
}

.rokforge-section-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

.rokforge-body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
}

.rokforge-button {
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.rokforge-button:focus {
  outline: 2px solid var(--ember-red);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--ember-red);
  color: white;
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 0 15px var(--industrial-glow);
  transform: translateY(-1px);
  background-color: hsl(4, 85%, 50%);
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background-color: hsl(210, 25%, 94%);
  border-color: var(--ember-red);
}

.btn-success {
  background-color: var(--status-healthy);
  color: white;
}

.btn-danger {
  background-color: var(--status-critical);
  color: white;
}

.rokforge-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rokforge-card:hover {
  border-color: hsl(210, 8%, 75%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rokforge-input {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 16px;
  min-height: 44px;
  width: 100%;
  transition: all 0.2s ease;
}

.rokforge-input:focus {
  outline: none;
  border-color: var(--ember-red);
  box-shadow: 0 0 0 3px rgba(233, 69, 69, 0.15);
}

.rokforge-input::placeholder {
  color: var(--text-secondary);
}

.status-healthy {
  background-color: var(--status-healthy);
  animation: pulse-glow-green 2s ease-in-out infinite;
}

.status-warning {
  background-color: var(--status-warning);
  animation: pulse-glow-yellow 2s ease-in-out infinite;
}

.status-critical {
  background-color: var(--status-critical);
  animation: pulse-glow-red 2s ease-in-out infinite;
}

.tier-elite {
  background: var(--tier-elite);
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.tier-high {
  background-color: var(--tier-high);
}

.tier-mid {
  background-color: var(--tier-mid);
}

.tier-below-mid {
  background-color: hsl(210, 8%, 40%);
}

.elite-text {
  background: linear-gradient(135deg, var(--elite-gradient-start) 0%, var(--elite-gradient-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ember-accent {
  color: var(--ember-red);
}

.nav-header {
  background-color: var(--primary-header);
  border-bottom: 1px solid hsl(210, 8%, 25%);
}

.vital-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--ember-red);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) 0 env(safe-area-inset-left, 0);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.vital-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.vital-logo:hover {
  opacity: 0.85;
}

.logo-pulse {
  font-size: 1.5rem;
  color: var(--ember-red);
  animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  56% { transform: scale(1); }
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  letter-spacing: -0.02em;
}

.header-breadcrumb {
  display: none;
  align-items: center;
}

.breadcrumb-back {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  min-height: 36px;
}

.breadcrumb-back:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.vital-pill {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: hsl(210, 18%, 14%);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(233, 69, 69, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.vital-pill.visible {
  display: flex;
}

.pill-status {
  display: flex;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-healthy);
}

.status-dot.pulse-active {
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { 
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  }
  50% { 
    opacity: 0.8;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0);
  }
}

.pill-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.pill-kingdom, .pill-season {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pill-icon {
  font-size: 0.7rem;
  opacity: 0.7;
}

.pill-text {
  white-space: nowrap;
}

.pill-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-search {
  position: relative;
  display: none;
}

.header-search.visible {
  display: block;
}

.search-trigger {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s;
}

.search-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.search-expanded {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: hsl(210, 18%, 14%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header-search.expanded .search-trigger {
  display: none;
}

.header-search.expanded .search-expanded {
  display: flex;
}

.search-expanded input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
}

.search-expanded input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}

.search-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 280px;
  max-height: 300px;
  overflow-y: auto;
  background: hsl(210, 18%, 14%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.search-results.show {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: white;
  text-decoration: none;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.result-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
}

.result-id {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.header-user {
  position: relative;
  display: none;
}

.header-user.visible {
  display: block;
}

.user-trigger {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.25rem;
}

.user-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: hsl(210, 18%, 14%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem;
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.user-dropdown.show {
  display: block;
}

.user-status {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
}

.user-role {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.user-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.15s;
}

.user-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.logout-action:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.header-nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-nav-desktop.hidden-auth {
  display: none;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  min-height: 40px;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}


@media (max-width: 767px) {
  .header-content {
    padding: 0.5rem 0.75rem;
  }
  
  .logo-text {
    font-size: 1.1rem;
  }
  
  .logo-pulse {
    font-size: 1.25rem;
  }
  
  .header-nav-desktop {
    display: none !important;
  }
  
  .vital-pill .pill-text {
    display: none;
  }
  
  .vital-pill .pill-icon {
    font-size: 0.85rem;
    opacity: 1;
  }
  
  .vital-pill {
    padding: 0.35rem 0.6rem;
    gap: 0.35rem;
  }
  
  .pill-divider {
    height: 12px;
  }
  
  .breadcrumb-text {
    display: none;
  }
  
  .breadcrumb-back {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }
  
  .search-expanded {
    position: fixed;
    top: 60px;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    transform: none;
  }
  
  .search-results {
    position: fixed;
    top: 110px;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }
}


.upload-zone {
  border: 2px dashed var(--card-border);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
  background-color: var(--input-bg);
}

.upload-zone:hover {
  border-color: var(--ember-red);
  background-color: hsl(210, 25%, 95%);
}

.upload-zone.dragover {
  border-color: var(--ember-red);
  background-color: rgba(233, 69, 69, 0.05);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 1rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background-color: hsl(210, 25%, 94%);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-border);
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid hsl(210, 25%, 92%);
}

.data-table tr:hover {
  background-color: hsl(210, 25%, 97%);
}

.industrial-shadow {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.resource-food { color: #16a34a; }
.resource-wood { color: #d97706; }
.resource-stone { color: #6b7280; }
.resource-gold { color: #ca8a04; }
.resource-opened { color: #2563eb; }

@keyframes flash-inject {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px currentColor; }
  50% { box-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

@keyframes pulse-glow-green {
  0%, 100% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 15px rgba(34, 197, 94, 0.8), 0 0 25px rgba(34, 197, 94, 0.4); }
}

@keyframes pulse-glow-yellow {
  0%, 100% { box-shadow: 0 0 5px rgba(234, 179, 8, 0.5); }
  50% { box-shadow: 0 0 15px rgba(234, 179, 8, 0.8), 0 0 25px rgba(234, 179, 8, 0.4); }
}

@keyframes pulse-glow-red {
  0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.8), 0 0 25px rgba(239, 68, 68, 0.4); }
}

@keyframes industrial-glow-pulse {
  0%, 100% { box-shadow: 0 0 10px var(--industrial-glow); }
  50% { box-shadow: 0 0 25px var(--industrial-glow), 0 0 50px var(--industrial-glow); }
}

@keyframes accordion-down {
  from { height: 0; opacity: 0; }
  to { height: var(--accordion-height); opacity: 1; }
}

@keyframes accordion-up {
  from { height: var(--accordion-height); opacity: 1; }
  to { height: 0; opacity: 0; }
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.animate-industrial-glow {
  animation: industrial-glow-pulse 2s ease-in-out infinite;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--ember-red);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .sticky-banner-mobile {
    position: relative;
  }
  
  .mobile-hide-on-scroll {
    transition: transform 0.3s ease;
  }
}

@media (min-width: 769px) {
  .sticky-banner {
    position: sticky;
    top: 0;
    z-index: 50;
  }
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: hsl(210, 25%, 94%);
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: hsl(210, 8%, 75%);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: hsl(210, 8%, 60%);
}

.text-industrial-300 { color: hsl(210, 8%, 35%); }
.text-industrial-400 { color: var(--text-secondary); }
.text-industrial-500 { color: hsl(210, 8%, 55%); }

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
}

.glass-card-dark {
  background: var(--dark-glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--dark-glass-border);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
}

.glass-pill {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.sticky-context-pill {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--dark-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--dark-glass-border);
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
}

.sticky-context-pill .kingdom-tag {
  color: var(--ember-red-hex);
}

.sticky-context-pill .season-badge {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.player-row-glow {
  position: relative;
  transition: all 0.3s ease;
}


.data-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 9999px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
}

.data-pill .pill-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.65rem;
}

.data-pill .pill-icon.healing {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.data-pill .pill-icon.universal {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.data-pill .pill-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.data-pill .pill-divider {
  width: 1px;
  height: 16px;
  background: rgba(102, 126, 234, 0.3);
}

.progress-ring {
  width: var(--progress-ring-size);
  height: var(--progress-ring-size);
  position: relative;
}

.progress-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-ring .ring-bg {
  fill: none;
  stroke: hsl(210, 8%, 90%);
  stroke-width: var(--progress-ring-stroke);
}

.progress-ring .ring-progress {
  fill: none;
  stroke-width: var(--progress-ring-stroke);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.progress-ring .ring-progress.healthy {
  stroke: var(--status-healthy);
  filter: drop-shadow(0 0 4px var(--glow-healthy));
}

.progress-ring .ring-progress.warning {
  stroke: var(--status-warning);
  filter: drop-shadow(0 0 4px var(--glow-warning));
}

.progress-ring .ring-progress.critical {
  stroke: var(--status-critical);
  filter: drop-shadow(0 0 4px var(--glow-critical));
}

.progress-ring .ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
}

.resource-heatbar {
  display: flex;
  height: var(--heatbar-height);
  border-radius: 3px;
  overflow: hidden;
  background: hsl(210, 8%, 92%);
  width: 100%;
}

.resource-heatbar .heatbar-opened {
  height: 100%;
  transition: width 0.4s ease;
}

.resource-heatbar .heatbar-bag {
  height: 100%;
  transition: width 0.4s ease;
}

.resource-heatbar.food .heatbar-opened { background: #22c55e; }
.resource-heatbar.food .heatbar-bag { background: rgba(34, 197, 94, 0.35); }

.resource-heatbar.wood .heatbar-opened { background: #d97706; }
.resource-heatbar.wood .heatbar-bag { background: rgba(217, 119, 6, 0.35); }

.resource-heatbar.stone .heatbar-opened { background: #6b7280; }
.resource-heatbar.stone .heatbar-bag { background: rgba(107, 114, 128, 0.35); }

.resource-heatbar.gold .heatbar-opened { background: #eab308; }
.resource-heatbar.gold .heatbar-bag { background: rgba(234, 179, 8, 0.35); }

.scan-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--card-radius);
  overflow: hidden;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ember-red-hex), transparent);
  box-shadow: 0 0 20px var(--ember-red-hex), 0 0 40px var(--ember-red-hex);
  animation: scan-sweep 2s ease-in-out infinite;
}

@keyframes scan-sweep {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.scan-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: white;
  font-size: 0.875rem;
  z-index: 1;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  background: var(--card-bg);
  border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 200;
  overflow: hidden;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 199;
}

.bottom-sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: hsl(210, 8%, 80%);
  border-radius: 2px;
  margin: 0.75rem auto;
}

.bottom-sheet-content {
  padding: 0 1.5rem 2rem;
  max-height: calc(90vh - 40px);
  overflow-y: auto;
}

.metric-bold {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.compact-row {
  padding: 0.5rem 0.75rem;
}

.compact-row td {
  padding: 0.5rem 0.5rem;
}

@media (max-width: 768px) {
  .sticky-context-pill {
    display: none !important;
  }
  
  .data-pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .progress-ring {
    --progress-ring-size: 44px;
    --progress-ring-stroke: 3px;
  }
  
  .progress-ring .ring-center {
    font-size: 0.7rem;
  }
  
  .fighter-card {
    padding: 0.75rem !important;
  }
  
  .fighter-card > div {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .fighter-card .identity-section {
    width: 100% !important;
    order: 1;
  }
  
  .fighter-card .stats-section {
    order: 2;
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 1.5rem !important;
  }
  
  .fighter-card .stats-section > div {
    text-align: left !important;
  }
  
  .fighter-card .resources-section {
    order: 3;
    gap: 0.35rem !important;
  }
  
  .fighter-card .resource-bubble {
    padding: 0.3rem 0.4rem !important;
    font-size: 0.65rem !important;
    min-width: 0;
  }
  
  .fighter-card .resource-bubble i {
    font-size: 0.6rem !important;
  }
  
  .fighter-card .resource-bubble .resource-value {
    font-size: 0.7rem !important;
  }
  
  .fighter-card .metrics-section {
    order: 4;
    width: 100% !important;
    flex-wrap: wrap;
    gap: 0.5rem !important;
    justify-content: flex-start;
    align-items: center;
  }
  
  .fighter-card .war-days-display {
    flex: 0 0 auto;
    padding: 0.4rem 0.6rem !important;
  }
  
  .fighter-card .war-days-value {
    font-size: 0.95rem !important;
  }
  
  .fighter-card .war-days-label {
    font-size: 0.55rem !important;
  }
  
  .fighter-card .dev-speedups {
    padding: 0.25rem 0.4rem !important;
    font-size: 0.65rem !important;
  }
  
  .fighter-card .dev-speedups .pill-icon {
    width: 16px !important;
    height: 16px !important;
    font-size: 0.55rem !important;
  }
  
  .fighter-card .dev-speedups .pill-value {
    font-size: 0.65rem !important;
  }
  
  .fighter-card .dev-speedups .pill-divider {
    margin: 0 0.2rem !important;
  }
  
  .fighter-card .actions-cluster {
    margin-left: 0;
    gap: 0.5rem !important;
  }
  
  .fighter-card .actions-cluster .badge {
    padding: 0.35rem 0.5rem !important;
  }
  
  .war-days-tooltip {
    display: none !important;
  }
  
  .last-sync-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
  }
}

.dense-table th,
.dense-table td {
  padding: 0.5rem 0.375rem;
  font-size: 0.8rem;
}

.dense-table .player-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .dense-table th,
  .dense-table td {
    padding: 0.625rem 0.5rem;
    font-size: 0.85rem;
  }
}

.tactical-filter-bar {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--glass-shadow);
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.filter-divider {
  width: 1px;
  height: 28px;
  background: var(--card-border);
  margin: 0 0.25rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: white;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-pill:hover {
  border-color: var(--ember-red);
  background: hsl(4, 85%, 97%);
}

.filter-pill.active {
  background: var(--ember-red);
  color: white;
  border-color: var(--ember-red);
}

.filter-pill.active:hover {
  background: hsl(4, 85%, 50%);
}

.filter-pill i {
  font-size: 0.65rem;
}

.filter-pill.tier-elite.active {
  background: linear-gradient(135deg, var(--elite-gradient-start) 0%, var(--elite-gradient-end) 100%);
  border-color: var(--elite-gradient-start);
}

.filter-pill.tier-high.active {
  background: var(--tier-high);
  border-color: var(--tier-high);
}

.filter-pill.tier-mid.active {
  background: var(--tier-mid);
  border-color: var(--tier-mid);
}

.filter-pill.war-reserves.active {
  background: #dc2626;
  border-color: #dc2626;
  animation: war-pulse 1.5s ease-in-out infinite;
}

@keyframes war-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 10px 3px rgba(220, 38, 38, 0.3); }
}

.war-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.war-mode-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ember-red) 0%, #ff6b35 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.war-mode-toggle.active {
  border-color: var(--ember-red);
  box-shadow: 0 0 20px rgba(233, 69, 69, 0.4);
}

.war-mode-toggle.active::before {
  opacity: 1;
}

.war-mode-toggle span {
  position: relative;
  z-index: 1;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.war-mode-toggle i {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 0.9rem;
}

.war-mode-toggle.active i {
  animation: war-icon-pulse 1s ease-in-out infinite;
}

@keyframes war-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

body.war-mode .fighter-card {
  background: rgba(30, 30, 46, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.war-mode .fighter-card * {
  color: rgba(255, 255, 255, 0.85);
}

body.war-mode .fighter-card .text-industrial-400 {
  color: rgba(255, 255, 255, 0.5) !important;
}

body.war-mode .war-dim {
  opacity: 0.25;
  filter: grayscale(50%);
}

body.war-mode .war-highlight {
  position: relative;
}

body.war-mode .war-highlight::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgba(233, 69, 69, 0.15) 0%, rgba(255, 107, 53, 0.15) 100%);
  animation: war-glow 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes war-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}


.war-days-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, rgba(233, 69, 69, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-radius: 0.5rem;
  border: 1px solid rgba(233, 69, 69, 0.2);
  min-width: 60px;
  cursor: help;
  position: relative;
}

.war-days-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ember-red-hex);
}

.war-days-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
}

.war-days-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(30, 41, 59, 0.95);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
  pointer-events: none;
}

.war-days-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(30, 41, 59, 0.95);
}

.war-days-display:hover .war-days-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

.empty-filter-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-filter-state .heartbeat-icon {
  font-size: 4rem;
  color: var(--ember-red);
  opacity: 0.4;
  animation: heartbeat-empty 2s ease-in-out infinite;
}

@keyframes heartbeat-empty {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  14% { transform: scale(1.15); opacity: 0.6; }
  28% { transform: scale(1); opacity: 0.4; }
  42% { transform: scale(1.1); opacity: 0.5; }
  56% { transform: scale(1); opacity: 0.4; }
}

.empty-filter-state p {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

.opened-primary {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--ember-red-hex);
}

.bag-secondary {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

body.war-mode {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
}

body.war-mode .glass-card,
body.war-mode .rokforge-card {
  background: rgba(30, 30, 46, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

body.war-mode .tactical-filter-bar {
  background: rgba(30, 30, 46, 0.95);
  border-color: var(--ember-red);
}

body.war-mode .sticky-context-pill {
  background: rgba(233, 69, 69, 0.9);
}

body.war-mode .data-pill {
  background: linear-gradient(135deg, rgba(233, 69, 69, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
  border-color: rgba(233, 69, 69, 0.4);
}

body.war-mode .player-row-glow {
  box-shadow: 0 0 15px rgba(233, 69, 69, 0.2);
}

@media (max-width: 768px) {
  .tactical-filter-bar {
    padding: 0.5rem;
    gap: 0.35rem;
    flex-wrap: wrap;
    overflow-x: visible;
  }
  
  .filter-section-label {
    display: none;
  }
  
  .filter-divider {
    display: none;
  }
  
  .filter-section {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  
  .filter-pill {
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
    min-height: 32px;
  }
  
  .war-mode-toggle {
    padding: 0.35rem 0.6rem;
    min-height: 32px;
    justify-content: center;
  }
  
  .war-mode-toggle span {
    font-size: 0.65rem;
  }
  
  .dashboard-mobile-padding {
    padding-top: 0 !important;
  }
}
