:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  width: 100%;
  display: block;
  background: #020617;
  color: #e5e7eb;
}

#root {
  width: 100%;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}
.rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.3px;
  line-height: 1;
  user-select: none;
  pointer-events: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Size variants */
.rarity-size-sm {
  font-size: 9px;
  height: 16px;
  padding: 0 6px;
}

.rarity-size-md {
  font-size: 11px;
  height: 20px;
  padding: 0 8px;
}

/* Rarity colors */
.rarity-common {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.9), rgba(100, 116, 139, 0.95));
  color: #f1f5f9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.rarity-rare {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 1));
  color: #dbeafe;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.rarity-epic {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(126, 34, 206, 1));
  color: #f3e8ff;
  box-shadow: 0 1px 5px rgba(168, 85, 247, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.rarity-legendary {
  background: linear-gradient(135deg, rgba(251, 191, 36, 1), rgba(245, 158, 11, 1));
  color: #451a03;
  box-shadow: 
    0 1px 6px rgba(251, 191, 36, 0.6),
    0 0 12px rgba(251, 191, 36, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: legendary-glow 2s ease-in-out infinite alternate;
}

@keyframes legendary-glow {
  0% {
    box-shadow: 
      0 1px 6px rgba(251, 191, 36, 0.6),
      0 0 12px rgba(251, 191, 36, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  100% {
    box-shadow: 
      0 1px 8px rgba(251, 191, 36, 0.8),
      0 0 18px rgba(251, 191, 36, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}
@keyframes heatBarPulse {
  0% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(1.25);
  }
}

.contracts-heat-overview {
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(14, 165, 233, 0.05));
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.contracts-heat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.heat-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.heat-buttons {
  display: flex;
  gap: 8px;
}

.heat-btn {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.5);
  color: #e0f2fe;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.heat-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

.heat-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.heat-btn.secondary {
  background: rgba(248, 250, 252, 0.1);
  border-color: rgba(248, 250, 252, 0.35);
}

.heat-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.heat-reduction-chip {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(254, 226, 226, 0.3);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.heat-icon {
  font-size: 28px;
}

.heat-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: #cbd5f5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.heat-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  transition: background 0.2s, color 0.2s;
}

.heat-help-btn:hover {
  background: rgba(14, 165, 233, 0.3);
  color: #e0f2fe;
}

.heat-value {
  font-size: 22px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.heat-status {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.heat-warning {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.heat-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.heat-bar-inner {
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease, background 0.3s ease;
}

.heat-bar-inner.heat-bar-animate {
  animation: heatBarPulse 1.2s infinite alternate;
}

.raid-risk-card {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(248, 250, 252, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.raid-risk-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.raid-risk-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: #94a3b8;
}

.raid-risk-value {
  font-size: 20px;
  font-weight: 700;
  color: #f87171;
}

.raid-risk-meta {
  font-size: 0.85rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.raid-cooldown {
  color: #fbbf24;
  font-weight: 600;
}

.raid-threshold {
  color: #94a3b8;
  font-weight: 600;
}

.raid-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.08);
  border: 1px solid rgba(248, 250, 252, 0.12);
  overflow: hidden;
}

.raid-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fbbf24, #ef4444);
  transition: width 0.3s ease;
}

.raid-risk-footer {
  font-size: 0.85rem;
  color: #cbd5f5;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.raid-last-raid {
  color: #fecaca;
  font-weight: 600;
}

.raid-no-raid {
  opacity: 0.8;
}

.heat-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.heat-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.heat-custom input {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: #e2e8f0;
  width: 90px;
}

.heat-cost-note {
  font-size: 0.85rem;
  color: #fef3c7;
  font-weight: 600;
  min-width: 80px;
}

.heat-note {
  color: #94a3b8;
  font-size: 0.8rem;
}

/* Heat Explanation Modal */
.heat-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.heat-modal {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 16px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.2s ease-out;
}

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

.heat-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.heat-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
}

.heat-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.heat-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.heat-modal-content {
  padding: 20px;
}

.heat-modal-content > p {
  margin: 0 0 16px 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.heat-modal-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.heat-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.heat-detail-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.heat-detail-item span:last-child {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.4;
}

.heat-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
}

.heat-modal-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border: none;
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.heat-modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}
.sabotage-lock-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 10px;
  border: 2px solid rgba(244, 63, 94, 0.65);
  background: rgba(244, 63, 94, 0.14);
  color: #fecdd3;
  font-weight: 700;
  text-align: left;
}

.sabotage-lock-banner .sabotage-lock-banner-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}

.sabotage-lock-banner .sabotage-lock-banner-text {
  line-height: 1.25;
}

.sabotage-lock-banner.warning {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.sabotage-lock-banner.info {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}
.password-cracking-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  max-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  font-family: 'Courier New', monospace;
  color: #00ff00;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  z-index: 10000;
  overflow: auto;
}

/* Intro Screen */
.password-cracking-intro {
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  box-sizing: border-box;
}

.password-cracking-intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
  margin: auto;
}

.password-cracking-intro h1 {
  font-size: 2rem;
  margin: 0;
  text-align: center;
  text-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
  color: #00ff00;
}

.password-cracking-intro-text {
  width: 100%;
  text-align: left;
  color: #00ff00;
  line-height: 1.8;
}

.password-cracking-intro-text p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.password-cracking-intro-text ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.password-cracking-intro-text li {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.password-cracking-intro-difficulty {
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  margin-top: 1rem !important;
}

.password-cracking-start-button {
  padding: 1rem 2rem;
  background: linear-gradient(90deg, #00ff00, #00cc00);
  border: 2px solid #00ff00;
  border-radius: 4px;
  color: #000;
  font-weight: bold;
  font-size: 1.1rem;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.password-cracking-start-button:hover {
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
  transform: scale(1.05);
}

.password-cracking-start-button:active {
  transform: scale(0.98);
}

/* Game Screen */
.password-cracking-game {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 100%;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  justify-content: flex-start;
  box-sizing: border-box;
}

.password-cracking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.password-cracking-timer {
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.password-cracking-timer .warning {
  color: #ff9900;
  text-shadow: 0 0 10px rgba(255, 153, 0, 0.5);
  animation: pulse-warning 0.5s infinite;
}

.password-cracking-timer .critical {
  color: #ff0000;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
  animation: pulse-critical 0.3s infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.password-cracking-attempts {
  font-size: 1rem;
  color: #00ff00;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

/* Main Content Area */
.password-cracking-main {
  display: flex;
  width: 100%;
  gap: 1rem;
  overflow: visible;
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
}

/* Input Section */
.password-cracking-input-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.password-cracking-input-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
  box-sizing: border-box;
}

.password-cracking-input {
  width: 100%;
  padding: 1rem;
  background: #000;
  border: 1px solid #00ff00;
  border-radius: 4px;
  color: #00ff00;
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  text-align: center;
  letter-spacing: 0.5rem;
  outline: none;
  transition: box-shadow 0.2s;
}

.password-cracking-input:focus {
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.6) inset;
}

.password-cracking-input::placeholder {
  color: #00660066;
  letter-spacing: 0.3rem;
}

.password-cracking-input-indicator {
  text-align: center;
  font-size: 1.2rem;
  color: #00ff00;
  letter-spacing: 0.3rem;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.password-cracking-feedback {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  text-align: center;
  font-size: 0.95rem;
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.password-cracking-feedback-correct {
  background: rgba(0, 255, 0, 0.2);
  border: 1px solid #00ff00;
  color: #00ff00;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
}

.password-cracking-feedback-partial {
  background: rgba(255, 153, 0, 0.2);
  border: 1px solid #ff9900;
  color: #ffcc00;
  text-shadow: 0 0 10px rgba(255, 153, 0, 0.6);
}

.password-cracking-feedback-wrong {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid #ff0000;
  color: #ff6666;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
}

/* History Section */
.password-cracking-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
  flex: 1 1 auto;
  min-width: 250px;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.password-cracking-history h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: #00ff00;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
  text-align: center;
  border-bottom: 1px solid #00ff00;
  padding-bottom: 0.5rem;
}

.password-cracking-history-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.password-cracking-history-indicator {
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid #00ff00;
  background: rgba(0, 0, 0, 0.6);
  color: #00ff00;
  transition: all 0.2s;
}

.password-cracking-history-indicator.partial {
  background: rgba(255, 204, 0, 0.2);
  border-color: #ffcc00;
  color: #ffcc00;
}

.password-cracking-history-indicator.complete {
  background: rgba(0, 255, 0, 0.3);
  border-color: #00ff00;
  color: #00ff00;
}

.password-cracking-history-indicator:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px currentColor;
}

.password-cracking-history-indicator.active {
  transform: scale(1.15);
  box-shadow: 0 0 15px currentColor;
}

.password-cracking-history-detail {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #00660044;
  border-radius: 4px;
  animation: slide-in 0.2s ease;
}

.password-cracking-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.password-cracking-history-empty {
  text-align: center;
  color: #006600;
  font-style: italic;
  padding: 1rem;
}

.password-cracking-history-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #00660044;
  border-radius: 3px;
  font-size: 0.9rem;
  gap: 0.5rem;
}

.password-cracking-history-digits {
  display: flex;
  gap: 0.4rem;
}

.password-cracking-digit {
  font-weight: bold;
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.05rem;
}

.password-cracking-digit-correct {
  background: rgba(0, 255, 0, 0.2);
  border: 2px solid #00ff00;
  color: #00ff00;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
}

.password-cracking-digit-misplaced {
  background: rgba(255, 204, 0, 0.2);
  border: 2px solid #ffcc00;
  color: #ffcc00;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.password-cracking-digit-wrong {
  background: rgba(255, 0, 0, 0.2);
  border: 2px solid #ff0000;
  color: #ff6666;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

.password-cracking-history-feedback-summary {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  padding: 0.25rem 0;
  color: #00ff00;
}

/* Keypad */
.password-cracking-keypad {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
  box-sizing: border-box;
}

.password-cracking-keypad-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.password-cracking-key {
  padding: 0.75rem;
  background: #1a3a1a;
  border: 2px solid #00ff00;
  border-radius: 4px;
  color: #00ff00;
  font-size: 1.2rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.password-cracking-key:not(:disabled):hover {
  background: #00ff00;
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
  text-shadow: none;
}

.password-cracking-key:active:not(:disabled) {
  transform: scale(0.95);
}

.password-cracking-key.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.password-cracking-key:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.password-cracking-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.password-cracking-action-button {
  padding: 0.75rem;
  background: #1a3a1a;
  border: 2px solid #00ff00;
  border-radius: 4px;
  color: #00ff00;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.password-cracking-action-button:not(:disabled):hover {
  background: #00ff00;
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
  text-shadow: none;
}

.password-cracking-action-button:active:not(:disabled) {
  transform: scale(0.95);
}

.password-cracking-action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Info */
.password-cracking-info {
  text-align: center;
  color: #00ff00;
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

.password-cracking-info p {
  margin: 0;
}

/* Result Screens */
.password-cracking-success,
.password-cracking-failure {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.password-cracking-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 2rem;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
  max-width: 600px;
  width: 100%;
}

.password-cracking-success .password-cracking-result {
  border-color: #00ff00;
}

.password-cracking-failure .password-cracking-result {
  border-color: #ff0000;
}

.password-cracking-result-icon {
  font-size: 4rem;
  font-weight: bold;
  text-shadow: 0 0 20px currentColor;
  animation: bounce 0.6s ease-in-out;
}

.password-cracking-success .password-cracking-result-icon {
  color: #00ff00;
}

.password-cracking-failure .password-cracking-result-icon {
  color: #ff0000;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.password-cracking-result h2 {
  margin: 0;
  font-size: 1.8rem;
  text-shadow: 0 0 15px currentColor;
}

.password-cracking-success h2 {
  color: #00ff00;
}

.password-cracking-failure h2 {
  color: #ff0000;
}

.password-cracking-result p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.password-cracking-correct-code {
  margin-top: 1rem !important;
  padding-top: 1rem;
  border-top: 1px solid #ff0000;
  color: #ff6666;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .password-cracking-main {
    flex-direction: column;
  }

  .password-cracking-history {
    min-width: auto;
    flex: 0 1 auto;
    max-height: 300px;
  }

  .password-cracking-container {
    min-height: 100vh;
    padding: 0.5rem;
  }

  .password-cracking-intro-content {
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  .password-cracking-intro h1 {
    font-size: 1.5rem;
  }

  .password-cracking-intro-text p,
  .password-cracking-intro-text li {
    font-size: 0.9rem;
  }

  .password-cracking-start-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .password-cracking-game {
    max-width: 100%;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
  }

  .password-cracking-header {
    flex-direction: row;
    gap: 1rem;
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .password-cracking-timer {
    font-size: 1rem;
    flex-shrink: 0;
  }

  .password-cracking-attempts {
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .password-cracking-input-section {
    padding: 0;
  }

  .password-cracking-input-display {
    padding: 1rem;
  }

  .password-cracking-input {
    padding: 0.75rem;
    font-size: 1.3rem;
  }

  .password-cracking-history {
    padding: 1rem;
    min-height: auto;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .password-cracking-history h3 {
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
  }

  .password-cracking-history-indicators {
    gap: 0.3rem;
    display: flex !important;
  }

  .password-cracking-history-indicator {
    min-width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .password-cracking-history-detail {
    padding: 0.5rem;
  }

  .password-cracking-history-item {
    padding: 0.4rem;
  }

  .password-cracking-history-digits {
    gap: 0.3rem;
  }

  .password-cracking-digit {
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
  }

  .password-cracking-history-feedback-summary {
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .password-cracking-keypad {
    padding: 1rem;
    gap: 0.75rem;
  }

  .password-cracking-keypad-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }

  .password-cracking-key {
    padding: 0.6rem 0.3rem;
    font-size: 1rem;
  }

  .password-cracking-actions {
    gap: 0.5rem;
  }

  .password-cracking-action-button {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  .password-cracking-result {
    padding: 2rem 1rem;
    gap: 1rem;
  }

  .password-cracking-result-icon {
    font-size: 3rem;
  }

  .password-cracking-result h2 {
    font-size: 1.5rem;
  }

  .password-cracking-result p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .password-cracking-intro-content {
    padding: 1rem;
    gap: 1rem;
  }

  .password-cracking-intro h1 {
    font-size: 1.2rem;
  }

  .password-cracking-intro-text p,
  .password-cracking-intro-text li {
    font-size: 0.85rem;
  }

  .password-cracking-start-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .password-cracking-game {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .password-cracking-header {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .password-cracking-timer {
    font-size: 1rem;
  }

  .password-cracking-keypad {
    padding: 1rem 0.5rem;
    gap: 0.75rem;
  }

  .password-cracking-keypad-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3rem;
  }

  .password-cracking-key {
    padding: 0.5rem 0.2rem;
    font-size: 0.9rem;
  }

  .password-cracking-input {
    padding: 0.75rem;
    font-size: 1.2rem;
  }

  .password-cracking-result {
    padding: 1.5rem 0.75rem;
  }

  .password-cracking-result-icon {
    font-size: 2.5rem;
  }

  .password-cracking-result h2 {
    font-size: 1.2rem;
  }

  .password-cracking-result p {
    font-size: 0.9rem;
  }
}
/* Container - Fullscreen */
.black-market-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #1a0a0f 0%, #0a0a1a 100%);
  font-family: 'Courier New', monospace;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Intro Screen */
.black-market-intro {
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.black-market-intro-content {
  max-width: 600px;
  background: rgba(20, 10, 15, 0.95);
  border: 2px solid #8b0000;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 0 40px rgba(139, 0, 0, 0.5);
  animation: slideIn 0.4s ease-out;
}

.black-market-intro h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: #ff6b6b;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.black-market-intro-text {
  color: #ddd;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.black-market-intro-text p {
  margin-bottom: 1rem;
}

.black-market-intro-text ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.black-market-intro-text li {
  margin: 0.7rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.black-market-intro-text li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #ff6b6b;
}

.black-market-intro-difficulty {
  font-size: 1.1rem;
  color: #ffaa00;
  text-align: center;
  margin-top: 1.5rem;
}

.black-market-start-button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(135deg, #8b0000 0%, #5a0000 100%);
  color: #fff;
  border: 2px solid #ff6b6b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.black-market-start-button:hover {
  background: linear-gradient(135deg, #a00000 0%, #6a0000 100%);
  border-color: #ff8888;
  box-shadow: 0 6px 12px rgba(255, 107, 107, 0.4);
  transform: translateY(-2px);
}

/* Game Screen */
.black-market-game {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.black-market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(139, 0, 0, 0.2);
  border: 1px solid #8b0000;
  border-radius: 8px;
  flex-shrink: 0;
}

.black-market-timer {
  font-size: 1.8rem;
  font-weight: bold;
  color: #00ff88;
}

.black-market-timer .critical {
  color: #ff0000;
  animation: pulse 0.5s infinite;
}

.black-market-timer .warning {
  color: #ffaa00;
}

.black-market-attempts {
  font-size: 1.3rem;
  color: #ffaa00;
}

/* Memory Display (watching phase) */
.memory-display {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 300px;
}

.memory-item-large {
  text-align: center;
  animation: scaleInBig 0.3s ease-out;
}

.memory-item-emoji {
  font-size: 8rem;
  margin-bottom: 1rem;
  animation: pulse 0.6s ease-in-out;
}

.memory-item-name {
  font-size: 2rem;
  color: #ffaa00;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.memory-waiting {
  font-size: 1.5rem;
  color: #00ff88;
  text-align: center;
  animation: fadeInOut 2s infinite;
}

/* Memory Grid (playing phase) */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.memory-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: rgba(20, 10, 15, 0.8);
  border: 2px solid var(--item-color, #555);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0;
}

.memory-item:hover:not(:disabled) {
  border-color: #ff6b6b;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
  transform: scale(1.05);
}

.memory-item.active {
  background: var(--item-color, #555);
  box-shadow: 0 0 30px var(--item-color, #555);
  animation: pulse 0.3s ease;
}

.memory-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.memory-item-emoji {
  font-size: 2.5rem;
}

.memory-item-label {
  font-size: 0.75rem;
  color: #ddd;
  text-align: center;
  line-height: 1.2;
}

/* Result Screens */
.black-market-success,
.black-market-failure {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.black-market-result {
  text-align: center;
  background: rgba(20, 10, 15, 0.95);
  border-radius: 12px;
  padding: 3rem;
  max-width: 500px;
  animation: popIn 0.4s ease-out;
}

.black-market-success .black-market-result {
  border: 3px solid #00ff00;
  box-shadow: 0 0 40px rgba(0, 255, 0, 0.5);
}

.black-market-failure .black-market-result {
  border: 3px solid #ff0000;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.5);
}

.black-market-result-icon {
  font-size: 6rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
  animation: scaleIn 0.5s ease-out;
}

.black-market-success .black-market-result-icon {
  color: #00ff00;
  text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}

.black-market-failure .black-market-result-icon {
  color: #ff0000;
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

.black-market-result h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

.black-market-success .black-market-result h2 {
  color: #00ff88;
}

.black-market-failure .black-market-result h2 {
  color: #ff6b6b;
}

.black-market-result p {
  font-size: 1.2rem;
  color: #ddd;
  line-height: 1.6;
}

@media (max-height: 700px) {
  .black-market-intro {
    padding: 1rem;
  }

  .black-market-intro-content {
    padding: 1.5rem;
  }

  .black-market-intro h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .black-market-game {
    padding: 0.9rem;
    gap: 1rem;
  }

  .black-market-header {
    padding: 0.75rem 1rem;
  }

  .black-market-timer {
    font-size: 1.4rem;
  }

  .black-market-attempts {
    font-size: 1rem;
  }

  .memory-item-large .memory-item-emoji {
    font-size: 5.5rem;
  }

  .memory-item-name {
    font-size: 1.5rem;
  }

  .black-market-result {
    padding: 2rem;
  }

  .black-market-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
  }

  .black-market-result h2 {
    font-size: 1.6rem;
  }

  .black-market-result p {
    font-size: 1rem;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInOut {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@keyframes scaleInBig {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .black-market-intro-content {
    padding: 2rem;
  }

  .black-market-intro h1 {
    font-size: 1.8rem;
  }

  .memory-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.8rem;
  }

  .memory-item-emoji {
    font-size: 2rem;
  }

  .memory-item-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .black-market-container {
    padding: 0;
  }

  .black-market-intro h1 {
    font-size: 1.5rem;
  }

  .black-market-intro-content {
    padding: 1.5rem;
  }

  .black-market-game {
    padding: 1rem;
    gap: 1rem;
  }

  .black-market-header {
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
  }

  .black-market-timer {
    font-size: 1.4rem;
  }

  .black-market-attempts {
    font-size: 1rem;
  }

  .memory-item-emoji {
    font-size: 1.5rem;
  }

  .memory-item-large .memory-item-emoji {
    font-size: 5rem;
  }

  .memory-item-name {
    font-size: 1.5rem;
  }

  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .memory-item {
    padding: 1rem 0.8rem;
  }
}

/* Container - Fullscreen */
.overclock-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0f0f1e 100%);
  font-family: 'Courier New', monospace;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Intro Screen */
.overclock-intro {
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.overclock-intro-content {
  max-width: 600px;
  background: rgba(15, 15, 30, 0.95);
  border: 2px solid #00ffff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
  animation: slideIn 0.4s ease-out;
}

.overclock-intro h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: #00ffff;
  text-align: center;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.overclock-intro-text {
  color: #ddd;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.overclock-intro-text p {
  margin-bottom: 1rem;
}

.overclock-intro-text ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.overclock-intro-text li {
  margin: 0.7rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.overclock-intro-text li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #00ffff;
}

.overclock-intro-difficulty {
  font-size: 1.1rem;
  color: #ffaa00;
  text-align: center;
  margin-top: 1.5rem;
}

.overclock-start-button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(135deg, #0066cc 0%, #003399 100%);
  color: #fff;
  border: 2px solid #00ffff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.overclock-start-button:hover {
  background: linear-gradient(135deg, #0080ff 0%, #0052cc 100%);
  border-color: #00ffff;
  box-shadow: 0 6px 15px rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* Game Screen */
.overclock-game {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.overclock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(0, 102, 204, 0.15);
  border: 1px solid #00ffff;
  border-radius: 8px;
  flex-shrink: 0;
}

.overclock-timer {
  font-size: 1.8rem;
  font-weight: bold;
  color: #00ff88;
}

.overclock-timer .critical {
  color: #ff0000;
  animation: pulse 0.5s infinite;
}

.overclock-timer .warning {
  color: #ffaa00;
}

.overclock-score {
  font-size: 1.3rem;
  color: #00ffff;
}

/* =============================
   Option C: Circuit routing UI
   ============================= */

.overclock-routing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

.routing-instructions {
  color: #ddd;
  opacity: 0.9;
  text-align: center;
  font-size: 1rem;
}

.overclock-grid {
  --overclock-grid-size: min(92vw, 560px, max(220px, calc(100dvh - 300px)));
  width: var(--overclock-grid-size);
  height: var(--overclock-grid-size);
  display: grid;
  gap: 8px;
  padding: 10px;
  background: rgba(15, 15, 30, 0.8);
  border: 2px solid #00ffff;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.15);
}

.overclock-tile {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
  outline: none;
}

.overclock-tile.solution-path::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 9px;
  background: rgba(0, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.22);
  pointer-events: none;
  z-index: 0;
}

.overclock-tile.locked {
  cursor: not-allowed;
  opacity: 0.85;
  border-color: rgba(255, 255, 255, 0.25);
  filter: saturate(0.85);
}

.overclock-tile:active {
  transform: scale(0.98);
}

.overclock-tile.endpoint {
  border-color: rgba(0, 255, 136, 0.75);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.25);
}

.overclock-tile.endpoint.end {
  border-color: rgba(255, 170, 0, 0.75);
  box-shadow: 0 0 14px rgba(255, 170, 0, 0.22);
}

.endpoint-marker {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.85rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.lock-marker {
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 0.85rem;
  opacity: 0.9;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* Pipe drawing: render explicit segments so 2 connectors always show */
.tile-pipe {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.endpoint-marker,
.lock-marker {
  z-index: 2;
  pointer-events: none;
}

.overclock-debug-toggle {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(0, 255, 255, 0.9);
  font-weight: 700;
  cursor: pointer;
}

.overclock-debug-toggle:hover {
  background: rgba(0, 255, 255, 0.08);
}

.pipe-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  height: 26%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(0, 255, 255, 0.95) 0%, rgba(0, 255, 255, 0.15) 70%, rgba(0, 0, 0, 0) 76%);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
}

.pipe-seg {
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.25), rgba(0, 255, 255, 0.95), rgba(0, 255, 255, 0.25));
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
}

.pipe-seg.up {
  left: 50%;
  top: 8%;
  width: 18%;
  height: 45%;
  transform: translateX(-50%);
}

.pipe-seg.down {
  left: 50%;
  bottom: 8%;
  width: 18%;
  height: 45%;
  transform: translateX(-50%);
}

.pipe-seg.left {
  top: 50%;
  left: 8%;
  width: 45%;
  height: 18%;
  transform: translateY(-50%);
}

.pipe-seg.right {
  top: 50%;
  right: 8%;
  width: 45%;
  height: 18%;
  transform: translateY(-50%);
}

/* Main Game Area */
.overclock-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

/* Control Panel */
.overclock-control-panel {
  background: rgba(15, 15, 30, 0.8);
  border: 2px solid #00ffff;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.overclock-power-display {
  text-align: center;
}

.power-label {
  font-size: 1rem;
  color: #00ffff;
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.power-value {
  font-size: 3.5rem;
  font-weight: bold;
  color: #ffaa00;
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}

.power-value.in-target {
  color: #00ff00;
  text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
  animation: pulse 0.6s infinite;
}

.power-bar-container {
  margin-bottom: 1rem;
}

.power-bar-background {
  position: relative;
  width: 100%;
  height: 30px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #555;
  border-radius: 4px;
  overflow: hidden;
}

.power-bar-target {
  position: absolute;
  height: 100%;
  background: rgba(0, 255, 0, 0.2);
  border-left: 2px solid #00ff00;
  border-right: 2px solid #00ff00;
}

.power-bar-current {
  height: 100%;
  background: linear-gradient(90deg, #0066cc 0%, #00ffff 100%);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
  transition: width 0.2s ease;
}

.power-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #888;
}

.overclock-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.overclock-btn {
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: bold;
  border: 2px solid #555;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ddd;
}

.overclock-btn-up {
  background: rgba(0, 200, 100, 0.2);
  border-color: #00cc00;
  color: #00ff88;
}

.overclock-btn-up:hover {
  background: rgba(0, 200, 100, 0.4);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
  transform: scale(1.05);
}

.overclock-btn-down {
  background: rgba(200, 0, 100, 0.2);
  border-color: #cc0000;
  color: #ff6b6b;
}

.overclock-btn-down:hover {
  background: rgba(200, 0, 100, 0.4);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
  transform: scale(1.05);
}

.overclock-hint {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  font-style: italic;
}

/* Gauges */
.overclock-gauges {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gauge-container {
  background: rgba(15, 15, 30, 0.8);
  border: 2px solid #555;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gauge-title {
  font-size: 0.9rem;
  color: #00ffff;
  font-weight: bold;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.gauge-circle {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 1rem;
}

.gauge-circle.normal {
  filter: drop-shadow(0 0 15px rgba(0, 255, 0, 0.5));
}

.gauge-circle.warning {
  filter: drop-shadow(0 0 15px rgba(255, 170, 0, 0.5));
}

.gauge-circle.critical {
  filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.5));
}

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

.gauge-svg circle {
  fill: none;
  stroke: #333;
}

.gauge-progress {
  stroke: currentColor;
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s ease;
}

.gauge-circle.normal .gauge-progress {
  color: #00ff00;
}

.gauge-circle.warning .gauge-progress {
  color: #ffaa00;
}

.gauge-circle.critical .gauge-progress {
  color: #ff0000;
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: bold;
  color: #ddd;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
}

.gauge-labels .safe {
  color: #00ff00;
}

.gauge-labels .warn {
  color: #ffaa00;
}

.gauge-labels .critical-label {
  color: #ff0000;
}

/* Target Info */
.overclock-target-info {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 102, 204, 0.15);
  border: 1px solid #00ffff;
  border-radius: 8px;
  flex-shrink: 0;
}

.target-indicator {
  flex: 1;
  padding: 0.8rem;
  background: rgba(255, 170, 0, 0.1);
  border: 2px solid #ffaa00;
  border-radius: 6px;
  font-weight: bold;
  color: #ffaa00;
  text-align: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.target-indicator.active {
  background: rgba(0, 255, 0, 0.1);
  border-color: #00ff00;
  color: #00ff00;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.stability-warning {
  flex: 1;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #555;
  border-radius: 6px;
  color: #ddd;
  text-align: center;
  font-size: 0.95rem;
}

/* Result Screens */
.overclock-success,
.overclock-failure {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.overclock-result {
  text-align: center;
  background: rgba(15, 15, 30, 0.95);
  border-radius: 12px;
  padding: 3rem;
  max-width: 500px;
  animation: popIn 0.4s ease-out;
}

.overclock-success .overclock-result {
  border: 3px solid #00ff00;
  box-shadow: 0 0 40px rgba(0, 255, 0, 0.5);
}

.overclock-failure .overclock-result {
  border: 3px solid #ff0000;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.5);
}

.overclock-result-icon {
  font-size: 6rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
  animation: scaleIn 0.5s ease-out;
}

.overclock-success .overclock-result-icon {
  color: #00ff00;
  text-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}

.overclock-failure .overclock-result-icon {
  color: #ff0000;
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

.overclock-result h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

.overclock-success .overclock-result h2 {
  color: #00ff88;
}

.overclock-failure .overclock-result h2 {
  color: #ff6b6b;
}

.overclock-result p {
  font-size: 1.2rem;
  color: #ddd;
  line-height: 1.6;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .overclock-intro-content {
    padding: 2rem;
  }

  .overclock-intro h1 {
    font-size: 1.8rem;
  }

  .overclock-main {
    grid-template-columns: 1fr;
  }

  .power-value {
    font-size: 2.5rem;
  }

  .gauge-circle {
    width: 120px;
    height: 120px;
  }

  .gauge-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .overclock-container {
    padding: 0;
  }

  .overclock-intro h1 {
    font-size: 1.5rem;
  }

  .overclock-intro-content {
    padding: 1.5rem;
  }

  .overclock-game {
    padding: 1rem;
    gap: 1rem;
  }

  .overclock-header {
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
  }

  .overclock-timer {
    font-size: 1.4rem;
  }

  .overclock-score {
    font-size: 1rem;
  }

  .power-value {
    font-size: 2rem;
  }

  .overclock-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .overclock-btn {
    font-size: 0.85rem;
    padding: 0.6rem;
  }

  .gauge-circle {
    width: 100px;
    height: 100px;
  }

  .gauge-value {
    font-size: 1.2rem;
  }

  .target-indicator,
  .stability-warning {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
}

@media (max-height: 700px) {
  .overclock-intro {
    padding: 1rem;
  }

  .overclock-intro-content {
    padding: 1.5rem;
  }

  .overclock-intro h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .overclock-game {
    padding: 0.9rem;
    gap: 1rem;
  }

  .overclock-header {
    padding: 0.75rem 1rem;
  }

  .overclock-timer {
    font-size: 1.4rem;
  }

  .overclock-score {
    font-size: 1rem;
  }
}
/* ICE PATTERN BREAKER - Full Game Styles */

/* Container */
.cyberheist-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0a0a1a 0%, #0a1628 50%, #0f0a20 100%);
  font-family: 'Courier New', 'Consolas', monospace;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  -webkit-user-select: none;
}

/* ==================== INTRO SCREEN ==================== */
.ice-intro {
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.ice-intro-content {
  max-width: 500px;
  width: 100%;
  background: rgba(10, 20, 40, 0.95);
  border: 2px solid #00d4ff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 
    0 0 30px rgba(0, 212, 255, 0.3),
    inset 0 0 50px rgba(0, 212, 255, 0.05);
  animation: introSlide 0.5s ease-out;
}

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

.ice-intro-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ice-intro-header h1 {
  font-size: 1.5rem;
  color: #00d4ff;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
  letter-spacing: 2px;
  text-align: center;
}

.ice-icon {
  font-size: 1.8rem;
  animation: icePulse 2s ease-in-out infinite;
}

@keyframes icePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.ice-intro-objective {
  text-align: center;
  color: #aaccee;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.ice-rules {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ice-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 212, 255, 0.08);
  border-radius: 8px;
  border-left: 3px solid #00d4ff;
}

.rule-icon {
  font-size: 1.3rem;
  min-width: 32px;
  text-align: center;
}

.rule-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rule-text strong {
  color: #00d4ff;
  font-size: 0.9rem;
}

.rule-text span {
  color: #8899aa;
  font-size: 0.8rem;
}

.ice-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #ff6b6b;
  font-size: 0.85rem;
  font-weight: bold;
}

.ice-start-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #00a8cc 0%, #00d4ff 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 1.1rem;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

.ice-start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.6);
}

.ice-start-button:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.3rem;
}

/* ==================== GAME SCREEN ==================== */
.ice-playing {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.75rem;
}

/* Screen shake on error */
.screen-shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* HUD */
.ice-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: rgba(0, 20, 40, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.ice-hud-progress {
  display: flex;
  align-items: center;
}

.progress-circle {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  min-width: 70px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.1);
  border: 2px solid #00d4ff;
}

.progress-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: #00d4ff;
  line-height: 1;
}

.progress-label {
  font-size: 0.9rem;
  color: #668899;
}

.ice-hud-timer {
  display: flex;
  align-items: center;
}

.timer-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.1);
  border: 2px solid #00d4ff;
  transition: all 0.3s ease;
}

.timer-critical {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
  animation: criticalPulse 0.5s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 68, 68, 0.5); }
  50% { box-shadow: 0 0 25px rgba(255, 68, 68, 0.8); }
}

.timer-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: #00d4ff;
  line-height: 1;
}

.timer-critical .timer-value {
  color: #ff4444;
}

.timer-label {
  font-size: 0.6rem;
  color: #668899;
  text-transform: uppercase;
}

.ice-hud-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
}

.ice-level-container {
  width: 100%;
  max-width: 200px;
}

.ice-level-label {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  color: #668899;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.ice-level-bar {
  height: 8px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.ice-level-fill {
  height: 100%;
  background: linear-gradient(90deg, #00a8cc, #00d4ff);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.ice-pattern-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 212, 255, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.4);
}

/* Global Timer */
.ice-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  margin-bottom: 0.3rem;
}

.ice-timer .timer-icon {
  font-size: 1rem;
}

.ice-timer .timer-value {
  font-size: 1.1rem;
  font-weight: bold;
  color: #00d4ff;
  min-width: 40px;
  text-align: center;
}

.ice-timer.timer-critical {
  background: rgba(255, 50, 50, 0.2);
  border-color: #ff3333;
  animation: timerPulse 0.5s ease-in-out infinite;
}

.ice-timer.timer-critical .timer-value {
  color: #ff3333;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.02); }
}

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

.pattern-label {
  font-size: 0.85rem;
  font-weight: bold;
  color: #00d4ff;
  letter-spacing: 1px;
}

.ice-hud-errors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.errors-label {
  font-size: 0.6rem;
  color: #668899;
  letter-spacing: 1px;
}

.error-pips {
  display: flex;
  gap: 6px;
}

.error-pip {
  font-size: 1.1rem;
  color: #445566;
  transition: all 0.3s ease;
}

.error-active {
  color: #ff4444;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
  animation: errorPop 0.3s ease-out;
}

@keyframes errorPop {
  0% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ==================== PATTERN TYPE BANNER ==================== */
.ice-pattern-type-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  margin: 0.5rem 1rem;
  border-radius: 12px;
  border: 3px solid;
  animation: bannerPulse 1.5s ease-in-out infinite;
}

@keyframes bannerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.01); }
}

.banner-icon {
  font-size: 2.2rem;
}

.banner-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.banner-label {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.banner-hint {
  font-size: 1rem;
  color: #ffffff;
  opacity: 0.9;
  margin-top: 2px;
}

/* Correct Answer Banner */
.ice-correct-answer-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.8rem 1.5rem;
  margin: 0.5rem 1rem;
  background: rgba(0, 255, 136, 0.2);
  border: 3px solid #00ff88;
  border-radius: 12px;
  animation: correctBannerPulse 0.8s ease-in-out infinite alternate;
}

@keyframes correctBannerPulse {
  from { 
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    transform: scale(1);
  }
  to { 
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.7);
    transform: scale(1.02);
  }
}

.correct-icon {
  font-size: 2rem;
}

.correct-text {
  font-size: 1.3rem;
  font-weight: bold;
  color: #00ff88;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

/* Phase Indicator */
.ice-phase-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
}

.phase-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.phase-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phase-icon {
  font-size: 1.2rem;
}

.phase-hint {
  font-size: 1.1rem;
  text-transform: uppercase;
}

.phase-watch {
  background: rgba(255, 200, 0, 0.15);
  border: 1px solid rgba(255, 200, 0, 0.5);
  color: #ffcc00;
  animation: watchPulse 0.6s ease-in-out infinite;
}

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

.phase-input {
  background: rgba(0, 255, 136, 0.2);
  border: 2px solid rgba(0, 255, 136, 0.7);
  color: #00ff88;
  animation: inputPulse 0.4s ease-in-out infinite;
  min-width: 200px;
}

@keyframes inputPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 136, 0.4); }
  50% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.8); }
}

.input-countdown {
  width: 100%;
  height: 4px;
  background: rgba(0, 255, 136, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.input-countdown-bar {
  height: 100%;
  background: #00ff88;
  transition: width 0.1s linear;
}

.phase-correct {
  background: rgba(0, 255, 136, 0.2);
  border: 1px solid #00ff88;
  color: #00ff88;
}

.phase-wrong {
  background: rgba(255, 68, 68, 0.2);
  border: 1px solid #ff4444;
  color: #ff4444;
  animation: wrongFlash 0.3s ease-in-out;
}

@keyframes wrongFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Grid */
.ice-grid-container {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.ice-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 1rem;
  background: rgba(0, 20, 40, 0.6);
  border-radius: 12px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 212, 255, 0.1);
  max-width: 400px;
  width: 100%;
  aspect-ratio: 1;
}

.ice-node {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.node-off {
  background: rgba(30, 50, 70, 0.5);
  border-color: rgba(100, 130, 160, 0.3);
}

.node-pattern {
  background: radial-gradient(circle, #00ffff 0%, #0088aa 100%);
  border-color: #00ffff;
  box-shadow: 
    0 0 15px rgba(0, 255, 255, 0.6),
    inset 0 0 10px rgba(255, 255, 255, 0.3);
  animation: patternGlow 0.5s ease-in-out infinite alternate;
}

@keyframes patternGlow {
  from { box-shadow: 0 0 15px rgba(0, 255, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.3); }
  to { box-shadow: 0 0 25px rgba(0, 255, 255, 0.9), inset 0 0 15px rgba(255, 255, 255, 0.5); }
}

/* Correct answer display - shown after wrong answer */
.node-correct-answer {
  background: radial-gradient(circle, #00ff88 0%, #00aa55 100%);
  border-color: #00ff88;
  box-shadow: 
    0 0 20px rgba(0, 255, 136, 0.8),
    inset 0 0 10px rgba(255, 255, 255, 0.4);
  animation: correctPulse 0.6s ease-in-out infinite alternate;
}

@keyframes correctPulse {
  from { 
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.4);
    transform: scale(1);
  }
  to { 
    box-shadow: 0 0 35px rgba(0, 255, 136, 1), inset 0 0 15px rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
  }
}

.node-selected {
  background: radial-gradient(circle, #00ff88 0%, #00aa55 100%);
  border-color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
}

.node-locked {
  background: rgba(60, 50, 70, 0.8);
  border-color: rgba(150, 100, 150, 0.5);
  cursor: not-allowed;
}

.node-interactive {
  cursor: pointer;
}

.node-interactive:hover {
  transform: scale(1.05);
  border-color: rgba(0, 212, 255, 0.6);
}

.node-interactive:active {
  transform: scale(0.95);
}

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

/* Mobile Controls */
.ice-mobile-controls {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  position: sticky;
  bottom: 0;
  background: rgba(0, 20, 40, 0.85);
}

.ice-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, #00aa55 0%, #00ff88 100%);
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: 1.1rem;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.ice-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 255, 136, 0.6);
}

.ice-confirm-btn:active {
  transform: translateY(0);
}

/* ==================== RESULT SCREENS ==================== */
.ice-result {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.ice-result-content {
  text-align: center;
  animation: resultSlide 0.5s ease-out;
}

@keyframes resultSlide {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.ice-result h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  letter-spacing: 3px;
}

.ice-success h1 {
  color: #00ff88;
  text-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
}

.ice-fail h1 {
  color: #ff4444;
  text-shadow: 0 0 30px rgba(255, 68, 68, 0.6);
}

.ice-result-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
  margin: 0 auto;
}

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

.stat-label {
  color: #889999;
  font-size: 0.9rem;
}

.stat-value {
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
}

.stat-performance {
  color: #ffcc00;
}

.error-value {
  color: #ff6b6b;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
  .ice-intro-content {
    padding: 1.5rem;
  }
  
  .ice-intro-header h1 {
    font-size: 1.2rem;
  }
  
  .ice-icon {
    font-size: 1.4rem;
  }
  
  .ice-intro-objective {
    font-size: 0.85rem;
  }
  
  .ice-rule {
    padding: 0.5rem 0.6rem;
  }
  
  .rule-icon {
    font-size: 1.1rem;
    min-width: 28px;
  }
  
  .rule-text strong {
    font-size: 0.8rem;
  }
  
  .rule-text span {
    font-size: 0.7rem;
  }
  
  .ice-warning {
    font-size: 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .ice-hud {
    padding: 0.4rem;
  }
  
  .timer-circle {
    width: 50px;
    height: 50px;
  }
  
  .timer-value {
    font-size: 1.1rem;
  }
  
  .ice-pattern-indicator {
    padding: 0.3rem 0.6rem;
  }
  
  .pattern-label {
    font-size: 0.75rem;
  }
  
  .ice-grid {
    gap: 6px;
    padding: 0.75rem;
  }
  
  .ice-node {
    border-radius: 6px;
  }
  
  .phase-badge {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .ice-result h1 {
    font-size: 1.5rem;
  }
  
  .result-icon {
    font-size: 3rem;
  }
}

@media (max-height: 600px) {
  .ice-playing {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .ice-hud {
    padding: 0.3rem;
  }
  
  .timer-circle {
    width: 45px;
    height: 45px;
  }
  
  .ice-phase-indicator {
    min-height: 40px;
  }
  
  .phase-badge {
    padding: 0.4rem 0.8rem;
  }
  
  .ice-grid-container {
    padding: 0.25rem;
  }
  
  .ice-mobile-controls {
    padding: 0.25rem;
  }
  
  .ice-confirm-btn {
    padding: 0.75rem 2rem;
  }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .ice-playing {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .ice-hud {
    width: 100%;
    order: 1;
  }
  
  .ice-phase-indicator {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
  }
  
  .ice-grid-container {
    flex: 1;
    order: 2;
  }
  
  .ice-mobile-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
  }
  
  .ice-grid {
    max-width: 280px;
  }
}
/* Quantum Disruption mini-game */

.quantum-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0f0f1e 100%);
  font-family: 'Courier New', monospace;
  overflow-x: hidden;
  overflow-y: auto;
}

.quantum-intro {
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.quantum-intro-content {
  max-width: 600px;
  background: rgba(15, 15, 30, 0.95);
  border: 2px solid #00ffff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
}

.quantum-intro h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: #00ffff;
  text-align: center;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.quantum-intro-text {
  color: #ddd;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.quantum-intro-text ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.quantum-intro-text li {
  margin: 0.7rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.quantum-intro-text li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #00ffff;
}

.quantum-intro-difficulty {
  font-size: 1.1rem;
  color: #ffaa00;
  text-align: center;
  margin-top: 1.5rem;
}

.quantum-start-button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(135deg, #0066cc 0%, #003399 100%);
  color: #fff;
  border: 2px solid #00ffff;
  border-radius: 8px;
  cursor: pointer;
}

.quantum-game {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.quantum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(0, 102, 204, 0.15);
  border: 1px solid #00ffff;
  border-radius: 8px;
  flex-shrink: 0;
}

.quantum-timer {
  font-size: 1.8rem;
  font-weight: bold;
  color: #00ff88;
}

.quantum-timer .critical {
  color: #ff0000;
}

.quantum-timer .warning {
  color: #ffaa00;
}

.quantum-score {
  font-size: 1.2rem;
  color: #00ffff;
}

.quantum-grid-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

.quantum-grid {
  --quantum-grid-size: min(92vw, 560px, max(220px, calc(100dvh - 260px)));
  width: var(--quantum-grid-size);
  height: var(--quantum-grid-size);
  display: grid;
  gap: 8px;
  padding: 10px;
  background: rgba(15, 15, 30, 0.8);
  border: 2px solid #00ffff;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.15);
}

@media (max-height: 700px) {
  .quantum-intro {
    padding: 1rem;
  }

  .quantum-intro-content {
    padding: 1.5rem;
  }

  .quantum-intro h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .quantum-game {
    padding: 0.9rem;
    gap: 1rem;
  }

  .quantum-header {
    padding: 0.75rem 1rem;
  }

  .quantum-timer {
    font-size: 1.4rem;
  }

  .quantum-score {
    font-size: 1rem;
  }
}

.quantum-cell {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
}

.quantum-cell.on {
  background: radial-gradient(circle at center, rgba(0, 255, 255, 0.95) 0%, rgba(0, 255, 255, 0.25) 65%, rgba(0, 0, 0, 0.2) 78%);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.35);
}

.quantum-cell.off {
  background: rgba(0, 0, 0, 0.35);
}

.quantum-cell:active {
  transform: scale(0.98);
}

.quantum-success,
.quantum-failure {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.quantum-result {
  max-width: 600px;
  background: rgba(15, 15, 30, 0.95);
  border: 2px solid #00ffff;
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}

.quantum-failure .quantum-result {
  border-color: rgba(231, 76, 60, 0.9);
}

.quantum-success .quantum-result {
  border-color: rgba(0, 255, 136, 0.85);
}

.quantum-result-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}
.corpinf-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem;
  background: radial-gradient(circle at 30% 20%, rgba(26, 26, 46, 0.9), rgba(10, 10, 20, 0.98));
  font-family: 'Courier New', monospace;
  overflow-x: hidden;
  overflow-y: auto;
}

.corpinf-panel {
  width: min(720px, 96vw);
  background: rgba(15, 15, 30, 0.95);
  border: 2px solid rgba(0, 255, 255, 0.55);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 0 35px rgba(0, 255, 255, 0.18);
  color: #e8e8e8;
}

.corpinf-panel h1,
.corpinf-panel h2 {
  margin: 0 0 1rem 0;
  color: #00ffff;
  text-align: center;
}

.corpinf-text {
  line-height: 1.8;
  color: #ddd;
}

.corpinf-text ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}

.corpinf-text li {
  margin: 0.5rem 0;
}

.corpinf-difficulty {
  margin-top: 1rem;
  text-align: center;
  color: #ffaa00;
}

.corpinf-button {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.9rem 1.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: rgba(0, 102, 204, 0.28);
  color: #fff;
  border: 2px solid rgba(0, 255, 255, 0.55);
  border-radius: 10px;
  cursor: pointer;
}

.corpinf-game {
  width: min(760px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.corpinf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(0, 102, 204, 0.14);
  color: #e8e8e8;
}

.corpinf-timer {
  font-size: 1.5rem;
  font-weight: 800;
  color: #00ff88;
}

.corpinf-timer.warn {
  color: #ffaa00;
}

.corpinf-timer.danger {
  color: #ff4d4d;
}

.corpinf-meta {
  color: #00ffff;
  font-size: 1rem;
}

.corpinf-keypad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.corpinf-key {
  padding: 1.2rem;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
}

.corpinf-key:active {
  transform: scale(0.99);
}

.corpinf-status {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(15, 15, 30, 0.85);
  color: #ddd;
  text-align: center;
}

.corpinf-seq {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.corpinf-seq-pill {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #bbb;
  font-weight: 800;
}

.corpinf-seq-pill.active {
  background: rgba(0, 255, 255, 0.25);
  color: #00ffff;
}

.corpinf-hint {
  text-align: center;
  color: #bdc3c7;
  opacity: 0.95;
}

.corpinf-result-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.corpinf-footer {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

@media (max-height: 700px) {
  .corpinf-container {
    padding: 1rem;
  }

  .corpinf-panel {
    padding: 1.25rem;
  }

  .corpinf-timer {
    font-size: 1.25rem;
  }

  .corpinf-key {
    padding: 0.9rem;
    font-size: 1.1rem;
  }

  .corpinf-footer {
    position: static;
    transform: none;
    margin-top: 0.75rem;
    text-align: center;
  }
}
.section-container {
  width: 100%;
  margin-top: 1.4rem;
  padding: 0;
}

.reward-toast {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.2), rgba(15, 118, 110, 0.15));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: #ecfdf5;
  position: relative;
}

.reward-toast.failure {
  border-color: rgba(248, 113, 113, 0.5);
  background: linear-gradient(120deg, rgba(248, 113, 113, 0.2), rgba(185, 28, 28, 0.15));
  color: #fef2f2;
}

.reward-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.reward-toast-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: #a7f3d0;
}

.reward-toast.failure .reward-toast-title {
  color: #fecaca;
}

.reward-toast-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ecfccb;
}

.reward-toast-message {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.reward-toast.failure .reward-toast-subtitle {
  color: #fee2e2;
}

.reward-toast-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.reward-toast-close:hover {
  opacity: 0.7;
}

.reward-resource-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.resource-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.35);
}

/* Light theme overrides */
body.theme-light .reward-toast {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}
body.theme-light .reward-toast .reward-toast-message { color: #334155; }
body.theme-light .reward-toast .reward-toast-subtitle { color: #166534; }
body.theme-light .reward-toast.failure .reward-toast-subtitle { color: #7f1d1d; }
body.theme-light .resource-chip {
  border-color: rgba(15, 23, 42, 0.15);
  background: rgba(226, 232, 240, 0.35);
  color: #0f172a;
}
body.theme-light .resource-chip .resource-label { color: #475569; }
body.theme-light .resource-chip .resource-value { color: #0f172a; }

.resource-chip .resource-icon {
  font-size: 1.2rem;
}

.resource-chip .resource-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #cbd5f5;
}

.resource-chip .resource-value {
  font-size: 1rem;
  color: #ffffff;
}

.resource-chip.credits {
  border-color: rgba(253, 224, 71, 0.6);
  background: rgba(253, 224, 71, 0.15);
  color: #fde047;
}

.resource-chip.data {
  border-color: rgba(129, 140, 248, 0.6);
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.resource-chip.energy {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(45, 212, 191, 0.2);
  color: #99f6e4;
}

.resource-chip.neutral {
  border-color: rgba(226, 232, 240, 0.3);
  background: rgba(226, 232, 240, 0.1);
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .reward-toast {
    padding: 1rem;
  }

  .reward-toast-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .reward-resource-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-bottom: -0.15rem;
    scroll-snap-type: x proximity;
  }

  .reward-resource-grid::-webkit-scrollbar {
    height: 4px;
  }

  .reward-resource-grid::-webkit-scrollbar-thumb {
    background: rgba(226, 232, 240, 0.35);
    border-radius: 999px;
  }

  .resource-chip {
    flex: 0 0 auto;
    scroll-snap-align: center;
  }
}
/* Inline error banner */
.inline-error-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(153, 27, 27, 0.15) 100%);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: slideIn 0.3s ease-out;
}

.inline-error-banner span:first-child {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.inline-error-banner button {
  transition: opacity 0.2s;
}

.inline-error-banner button:hover {
  opacity: 0.7;
}

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

/* Agent picker drawer */
.agent-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.agent-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
}

.agent-picker-drawer {
  position: relative;
  width: min(420px, 90vw);
  height: 100%;
  background: #0f172a;
  border-left: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: -15px 0 35px rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  padding: 24px;
  animation: drawer-slide-in 0.25s ease;
}

@media (max-width: 520px) {
  .agent-picker-drawer {
    width: 100%;
    border-left: none;
    border-radius: 0;
  }
}

@keyframes drawer-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.drawer-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.drawer-header h3 {
  margin: 4px 0;
  color: #e2e8f0;
}

.drawer-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
}

.drawer-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  height: 32px;
  width: 32px;
}

.drawer-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.drawer-controls input[type="search"] {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-chips {
  display: flex;
  gap: 8px;
}

.filter-chips .chip {
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
  cursor: pointer;
  font-size: 12px;
  text-transform: capitalize;
}

.filter-chips .chip.active {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

.drawer-controls select {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e2e8f0;
}

.drawer-agent-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
}

.drawer-agent-card {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 14px;
  background: rgba(15, 23, 42, 0.7);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, transform 0.2s;
}

.drawer-agent-card:hover:not(.disabled) {
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

.drawer-agent-card.selected {
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.drawer-agent-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.agent-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
}

.agent-card-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.agent-card-upkeep {
  color: #bfdbfe;
  font-size: 12px;
}

.agent-card-skills {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #e2e8f0;
  flex-wrap: wrap;
}

.agent-card-flags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.flag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.flag.busy {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.flag.training {
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.flag.selected {
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.drawer-empty {
  margin: auto;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

.drawer-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer-title {
  font-weight: 600;
  color: #f1f5f9;
}

.footer-meta {
  font-size: 12px;
  color: #94a3b8;
}

.footer-error {
  color: #f87171;
  font-size: 12px;
}

.footer-status {
  font-size: 12px;
  color: #93c5fd;
}

.footer-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.footer-actions button {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.5);
  color: #e2e8f0;
  padding: 8px 14px;
  cursor: pointer;
}

.footer-actions button.primary {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
}

.footer-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.contracts-container {
  width: 100%;
  margin-top: 1.4rem;
  padding: 0;
}

.subtab-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #333;
}

.subtab-selector button {
  padding: 10px 20px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.subtab-selector button:hover {
  color: #0ff;
}

.subtab-selector button.active {
  color: #0ff;
  border-bottom-color: #0ff;
}

.contracts-boost-chips {
  margin: 12px 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
}

/* Light theme overrides */
body.theme-light .agent-picker-backdrop {
  background: rgba(15, 23, 42, 0.2);
}
body.theme-light .agent-picker-drawer {
  background: #ffffff;
  border-left: 1px solid rgba(100, 116, 139, 0.25);
  box-shadow: -15px 0 35px rgba(0, 0, 0, 0.12);
}
body.theme-light .drawer-label { color: #64748b; }
body.theme-light .drawer-header h3 { color: #0f172a; }
body.theme-light .drawer-meta { color: #64748b; }
body.theme-light .drawer-close { color: #475569; }
body.theme-light .drawer-controls input[type="search"],
body.theme-light .drawer-controls select {
  background: #ffffff;
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: #0f172a;
}
body.theme-light .filter-chips .chip {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
body.theme-light .filter-chips .chip.active {
  background: rgba(59, 130, 246, 0.35);
  color: #0b1324;
}
body.theme-light .drawer-agent-card {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.25);
}
body.theme-light .agent-card-name { color: #0f172a; }
body.theme-light .agent-card-meta { color: #64748b; }
body.theme-light .agent-card-upkeep { color: #2563eb; }
body.theme-light .agent-card-skills { color: #0f172a; }
body.theme-light .drawer-empty { color: #64748b; }
body.theme-light .drawer-footer {
  border-top-color: rgba(100, 116, 139, 0.25);
}
body.theme-light .footer-title { color: #0f172a; }
body.theme-light .footer-meta { color: #64748b; }
body.theme-light .footer-actions button {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(100, 116, 139, 0.35);
}
body.theme-light .footer-actions button.primary {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.4);
}
body.theme-light .contracts-boost-chips {
  background: rgba(226, 232, 240, 0.45);
  border: 1px solid rgba(100, 116, 139, 0.3);
}
body.theme-light .contracts-boost-title { color: #334155; }
body.theme-light .subtab-selector { border-bottom-color: rgba(100, 116, 139, 0.3); }
body.theme-light .subtab-selector button { color: #64748b; }
body.theme-light .subtab-selector button:hover,
body.theme-light .subtab-selector button.active { color: #0891b2; }

.contracts-boost-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #cbd5f5;
  margin-bottom: 0.5rem;
}

.contracts-boost-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contracts-boost-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.contracts-boost-chip.reward {
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.contracts-boost-chip.heat {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.contracts-boost-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contracts-boost-value {
  font-size: 0.95rem;
}

.error-message {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid #f00;
  color: #f00;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.info-message {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #bfdbfe;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* Contracts Section */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-header h2 {
  color: #64748b;
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.contract-tab-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.contract-tab-selector button {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5f5;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.contract-tab-selector button.active {
  border-color: rgba(59, 130, 246, 0.9);
  background: rgba(59, 130, 246, 0.2);
  color: #e0f2fe;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

@media (max-width: 620px) {
  .contract-tab-selector {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    margin-bottom: 1.2rem;
    scroll-snap-type: x proximity;
  }

  .contract-tab-selector button {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .contract-tab-selector::-webkit-scrollbar {
    height: 4px;
  }

  .contract-tab-selector::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
  }
}

.contracts-count {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  color: #0ff;
  font-size: 14px;
  font-weight: 600;
}

.contract-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(94, 234, 212, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

@media (max-width: 720px) {
  .contract-status-summary {
    gap: 1rem;
    padding: 0.9rem 1rem;
  }
}

@media (max-width: 540px) {
  .contract-status-summary {
    flex-direction: column;
  }
}

.contract-status-summary > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contract-status-summary .label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.contract-status-summary strong {
  font-size: 1.5rem;
  color: #f8fafc;
}

.contract-card.contract-executed {
  opacity: 0.85;
  border-color: rgba(148, 163, 184, 0.5);
}

.contract-card.contract-in-progress {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 10px 35px rgba(59, 130, 246, 0.2);
}

.duration-badge {
  background: rgba(94, 234, 212, 0.12);
  color: #5eead4;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.no-contracts {
  text-align: center;
  color: #888;
  padding: 60px 40px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 2px dashed #333;
}

.no-contracts-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-contracts > div:nth-child(2) {
  font-size: 20px;
  margin-bottom: 8px;
}

.no-contracts-subtitle {
  font-size: 14px;
  color: #666;
}

.contracts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: clamp(1rem, 3vw, 1.75rem);
}

@media (max-width: 1180px) {
  .contracts-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 720px) {
  .contracts-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.contract-card {
  background: linear-gradient(145deg, #1a1a2e, #0f0f1e);
  border: 1px solid #333;
  border-radius: 12px;
  padding: clamp(1rem, 2.8vw, 1.5rem);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.contract-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ff, #00aaff);
  opacity: 0;
  transition: opacity 0.3s;
}

.contract-card:hover::before {
  opacity: 1;
}

.contract-card:hover {
  border-color: #0ff;
  box-shadow: 0 8px 32px rgba(0, 255, 255, 0.2);
  transform: translateY(-4px);
}

.contract-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

@media (max-width: 540px) {
  .contract-title-row {
    flex-direction: column;
  }
}

.contract-card h3 {
  color: #94a3b8;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  line-height: 1.3;
}

.difficulty-badge {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.difficulty-1, .difficulty-2 {
  background: rgba(0, 255, 100, 0.15);
  color: #0f0;
  border: 1px solid rgba(0, 255, 100, 0.4);
}

.difficulty-3, .difficulty-4 {
  background: rgba(255, 200, 0, 0.15);
  color: #ffb700;
  border: 1px solid rgba(255, 200, 0, 0.4);
}

.difficulty-5, .difficulty-6, .difficulty-7, .difficulty-8, .difficulty-9, .difficulty-10 {
  background: rgba(255, 50, 50, 0.15);
  color: #ff5555;
  border: 1px solid rgba(255, 50, 50, 0.4);
}

.contract-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .contract-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

.level-indicator {
  background: rgba(100, 100, 255, 0.15);
  color: #88f;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.expires-badge {
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.in-progress-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.result-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.result-badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.result-badge.failure {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.executed-summary {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  color: #cbd5f5;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contract-progress-panel {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 620px) {
  .contract-progress-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .contract-progress-panel .progress-countdown {
    text-align: left;
    width: 100%;
  }
}

.contract-progress-panel .progress-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: #bfdbfe;
}

.contract-progress-panel .progress-copy strong {
  font-size: 1rem;
  color: #e2e8f0;
}

.contract-progress-panel .progress-countdown {
  text-align: right;
}

.progress-countdown .countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
}

.progress-countdown .countdown-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e0f2fe;
}

.executed-summary small {
  color: #94a3b8;
  font-size: 0.75rem;
}

.contract-illustration {
  width: 100%;
  height: 140px;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.contract-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.contract-story {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(148, 163, 184, 0.4);
  border-radius: 6px;
}

.contract-story p {
  margin: 0 0 12px 0;
}

.contract-story p:last-child {
  margin-bottom: 0;
}

.contract-data-cost-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 147, 233, 0.1));
  border: 1px solid rgba(0, 229, 255, 0.4);
  font-size: 0.9rem;
}

.contract-data-cost-badge .icon {
  font-size: 1.2rem;
}

.contract-data-cost-badge .label {
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.contract-data-cost-badge strong {
  color: #00e5ff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-left: auto;
}

.contract-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 520px) {
  .contract-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

.stat-group {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid;
}

.rewards-group {
  background: linear-gradient(135deg, rgba(0, 255, 100, 0.05), rgba(0, 255, 100, 0.02));
  border-color: rgba(0, 255, 100, 0.3);
}

.risks-group {
  background: linear-gradient(135deg, rgba(255, 50, 50, 0.05), rgba(255, 50, 50, 0.02));
  border-color: rgba(255, 50, 50, 0.3);
}

.stat-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rewards-group .stat-group-header {
  color: #0f0;
}

.risks-group .stat-group-header {
  color: #ff5555;
}

.stat-group-header .icon {
  font-size: 16px;
}

.stat-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.stat-label {
  color: #aaa;
}

.stat-value {
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.stat-value.positive {
  color: #0f0;
}

.stat-value.negative {
  color: #ff5555;
}

.agent-selection {
  margin-bottom: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.08), rgba(0, 255, 255, 0.03));
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 8px;
}

.agent-selection-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0ff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-wrap: wrap;
}

.agent-selection-header .icon {
  font-size: 18px;
}

.agent-selection-header .busy-note {
  font-size: 11px;
  color: #fbbf24;
  text-transform: none;
  letter-spacing: normal;
}

.agent-availability-note {
  background: rgba(255, 166, 0, 0.08);
  border: 1px dashed rgba(255, 166, 0, 0.4);
  color: #fde68a;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 12px;
}

.agent-assignment-summary {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.9), rgba(8, 47, 73, 0.6));
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 10px 30px rgba(8, 145, 178, 0.15);
}

.summary-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.summary-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-title .icon {
  font-size: 20px;
}

.summary-label {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e0f2fe;
}

.summary-sub {
  font-size: 12px;
  color: #94a3b8;
}

.summary-status {
  display: flex;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
}

.summary-available {
  color: #34d399;
}

.summary-busy {
  color: #fbbf24;
}

.agent-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.agent-chip.filled {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.4);
}

.agent-chip.placeholder {
  opacity: 0.7;
  font-style: italic;
}

.agent-chip.overflow {
  background: rgba(148, 163, 184, 0.25);
  border-color: rgba(148, 163, 184, 0.5);
}

.chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #bae6fd;
  font-size: 13px;
}

.chip-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chip-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0f2fe;
}

.chip-meta {
  font-size: 11px;
  color: #94a3b8;
}

.chip-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
}

.chip-remove:hover {
  color: #fca5a5;
}

.summary-actions {
  display: flex;
  justify-content: flex-end;
}

.manage-agents-button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.1);
  color: #bfdbfe;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}

.manage-agents-button:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
}

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

.agent-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px;
  border-radius: 6px;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.agent-checkbox:hover {
  background: rgba(0, 255, 255, 0.08);
  border-color: rgba(0, 255, 255, 0.2);
}

.agent-checkbox.busy,
.agent-checkbox.training {
  opacity: 0.5;
  cursor: not-allowed;
}

.agent-checkbox.busy:hover,
.agent-checkbox.training:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
}

.agent-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #0ff;
}

.agent-checkbox.busy input[type="checkbox"],
.agent-checkbox.training input[type="checkbox"] {
  cursor: not-allowed;
}

.agent-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.agent-status-badge {
  font-size: 10px;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.agent-status-badge.training {
  color: #38bdf8;
}

.agent-skills-compact {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: #aaa;
}

.agent-skills-compact span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.success-preview {
  margin-bottom: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(100, 100, 255, 0.08), rgba(100, 100, 255, 0.03));
  border-radius: 8px;
  border: 1px solid rgba(100, 100, 255, 0.3);
}

.success-chance-bar {
  margin-bottom: 12px;
}

.success-label {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.chance-bar-container {
  background: rgba(0, 0, 0, 0.3);
  height: 32px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chance-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.4s ease, background 0.3s;
  position: relative;
}

.chance-bar.high {
  background: linear-gradient(90deg, #00ff00, #00cc00);
}

.chance-bar.medium {
  background: linear-gradient(90deg, #ffbb00, #ff9900);
}

.chance-bar.low {
  background: linear-gradient(90deg, #ff5555, #ff3333);
}

.chance-text {
  font-weight: 700;
  font-size: 14px;
  color: #000;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.bonuses {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bonus-chip {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.agent-deployed-tag {
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #facc15;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-block;
}

.bonus-chip.boost {
  background: rgba(0, 255, 100, 0.15);
  color: #0f0;
  border: 1px solid rgba(0, 255, 100, 0.3);
}

.bonus-chip.mitigation {
  background: rgba(100, 150, 255, 0.15);
  color: #88bbff;
  border: 1px solid rgba(100, 150, 255, 0.3);
}

.execute-button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0ff 0%, #00aaff 100%);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.execute-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #00aaff 0%, #0099dd 100%);
  box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

.execute-button:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

.no-agents-warning {
  text-align: center;
  padding: 24px;
  background: rgba(255, 200, 0, 0.05);
  border: 2px dashed rgba(255, 200, 0, 0.3);
  border-radius: 8px;
}

.warning-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.no-agents-warning > div:nth-child(2) {
  color: #ffbb00;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hire-agents-link {
  background: linear-gradient(135deg, #ffbb00, #ff9900);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.hire-agents-link:hover {
  background: linear-gradient(135deg, #ff9900, #ff7700);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 187, 0, 0.4);
}

/* Agents Section */
.agents-section h2 {
  color: #64748b;
  margin-bottom: 20px;
  font-size: 24px;
}

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.training-meta-banner {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 30px rgba(13, 42, 98, 0.35);
}

.training-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.training-meta-row strong {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.training-meta-row span {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f8fafc;
}

.training-capacity-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.training-capacity-pill.open {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.training-capacity-pill.full {
  background: rgba(248, 113, 113, 0.18);
  color: #fecdd3;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.training-meta-copy {
  font-size: 0.9rem;
  color: #cbd5f5;
}

.training-capacity-warning {
  font-size: 0.88rem;
  color: #fca5a5;
  border-top: 1px dashed rgba(248, 113, 113, 0.4);
  padding-top: 6px;
}
.agent-card {
  background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s;
}

.agent-card:hover {
  border-color: #0ff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.agent-card.hired {
  border-color: #0f0;
}

.agent-card h3 {
  color: #94a3b8;
  margin: 0 0 15px 0;
  font-size: 18px;
}

.agent-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.stat > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.stat-label {
  color: #888;
  font-size: 13px;
}

.stat-value {
  color: #0ff;
  font-weight: bold;
  font-size: 14px;
}

.skill-upgrade-btn {
  padding: 4px 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.3));
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.skill-upgrade-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(16, 185, 129, 0.5));
  border-color: rgba(59, 130, 246, 0.8);
  transform: translateY(-1px);
}

.skill-upgrade-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.skill-upgrade-btn.data {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(0, 147, 233, 0.3));
  border: 1px solid rgba(0, 229, 255, 0.6);
}

.skill-upgrade-btn.data:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.5), rgba(0, 147, 233, 0.5));
  border-color: rgba(0, 229, 255, 0.8);
}

.agent-cost {
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(255, 255, 0, 0.05);
  border: 1px solid rgba(255, 255, 0, 0.3);
  border-radius: 4px;
}

.agent-cost div {
  color: #ccc;
  font-size: 13px;
  margin-bottom: 4px;
}

.agent-cost div:last-child {
  margin-bottom: 0;
}

.hired-badge {
  text-align: center;
  padding: 10px;
  background: rgba(0, 255, 0, 0.2);
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 4px;
  font-weight: bold;
}

.hire-button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(145deg, #0ff, #0cc);
  color: #000;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.hire-button:hover:not(:disabled) {
  background: linear-gradient(145deg, #0cc, #0aa);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  transform: translateY(-2px);
}

.hire-button:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

.fire-button {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: linear-gradient(145deg, #7f1d1d, #b91c1c);
  color: #fee2e2;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fire-button:hover:not(:disabled) {
  background: linear-gradient(145deg, #991b1b, #dc2626);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.35);
}

.fire-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #3f3f46;
  color: #a1a1aa;
}

.fire-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.fire-modal-card {
  width: min(400px, 100%);
  background: linear-gradient(135deg, #0f172a, #111827);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  animation: slideUp 0.3s ease;
}

.fire-modal-card h3 {
  margin: 0 0 12px 0;
  font-size: 1.4rem;
  color: #fecaca;
}

.fire-modal-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #cbd5f5;
  margin-bottom: 18px;
}

.fire-modal-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(248, 113, 113, 0.25);
  margin-bottom: 20px;
}

.fire-modal-details span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.fire-modal-details strong {
  font-size: 1rem;
  color: #f8fafc;
}

.fire-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.fire-modal-actions button {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.fire-modal-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fire-modal-cancel {
  background: rgba(51, 65, 85, 0.8);
  color: #cbd5f5;
}

.fire-modal-cancel:hover:not(:disabled) {
  transform: translateY(-1px);
}

.fire-modal-confirm {
  background: linear-gradient(145deg, #dc2626, #b91c1c);
  color: #fee2e2;
  box-shadow: 0 10px 25px rgba(185, 28, 28, 0.4);
}

.fire-modal-confirm:hover:not(:disabled) {
  transform: translateY(-1px);
}

.agent-training-error {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

/* Execution Modal */
.execution-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

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

.modal-content {
  background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
  border: 2px solid;
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.execution-modal.success .modal-content {
  border-color: #0f0;
}

.execution-modal.failure .modal-content {
  border-color: #f00;
}

.modal-content h2 {
  margin: 0 0 15px 0;
  font-size: 28px;
  text-align: center;
}

.execution-modal.success h2 {
  color: #0f0;
}

.execution-modal.failure h2 {
  color: #f00;
}

.modal-content p {
  color: #ccc;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

.result-details {
  margin-bottom: 20px;
}

.result-rewards {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 4px;
}

.result-rewards div {
  color: #fff;
  font-size: 16px;
  margin-bottom: 8px;
  font-weight: bold;
}

.result-rewards div:last-child {
  margin-bottom: 0;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(145deg, #0ff, #0cc);
  color: #000;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.modal-content button:hover {
  background: linear-gradient(145deg, #0cc, #0aa);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Upgrade Error Popup */
.upgrade-error-popup {
  width: min(320px, 90%);
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(251, 191, 36, 0.15);
  color: #e2e8f0;
  text-align: center;
  animation: slideUp 0.3s ease;
}

.upgrade-error-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.upgrade-error-message {
  font-size: 1.1rem;
  line-height: 1.5;
  color: #fbbf24;
  margin-bottom: 20px;
  font-weight: 500;
}

.upgrade-error-close {
  padding: 10px 32px;
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upgrade-error-close:hover {
  background: linear-gradient(145deg, #f59e0b, #d97706);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
  transform: translateY(-2px);
}

/* Contract History Section */
.contract-history-section {
  margin-top: 1rem;
}

.loading-history {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  font-size: 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-entry {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(100, 200, 255, 0.15);
  transition: all 0.2s ease;
}

.history-entry:hover {
  border-color: rgba(100, 200, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.history-entry.success {
  border-left: 4px solid #10b981;
}

.history-entry.failure {
  border-left: 4px solid #ef4444;
}

.history-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.history-entry-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-entry-image {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(100, 200, 255, 0.2);
}

.history-entry-info h4 {
  margin: 0 0 0.25rem 0;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 600;
}

.history-difficulty {
  color: #94a3b8;
  font-size: 0.85rem;
}

.history-status {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.history-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.history-status.failure {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.history-entry-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-rewards {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.history-rewards .reward,
.history-rewards .loss,
.history-rewards .heat {
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.history-rewards .reward.credits {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.history-rewards .reward.data {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
}

.history-rewards .loss.credits {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.history-rewards .loss.data {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.history-rewards .heat.increase {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.history-rewards .heat.decrease {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.history-meta {
  display: flex;
  gap: 1rem;
  color: #64748b;
  font-size: 0.8rem;
}

.history-meta .agents-used {
  color: #94a3b8;
}

.history-meta .execution-date {
  color: #64748b;
}

.load-more-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.raid-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.raid-modal {
  position: relative;
  width: min(640px, calc(100% - 2rem));
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(6, 11, 25, 0.95), rgba(20, 9, 39, 0.92));
  border: 1px solid rgba(248, 113, 113, 0.4);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

.raid-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: none;
  color: #f8fafc;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.raid-modal-close:hover {
  background: rgba(248, 113, 113, 0.6);
}

.raid-modal-illustration {
  background: radial-gradient(circle at top, rgba(248, 113, 113, 0.35), transparent 70%);
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  text-align: center;
}

.raid-modal-illustration img {
  max-width: 100%;
  height: auto;
}

.raid-modal-content {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.raid-modal-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #fbbf24;
}

.raid-modal-content h2 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: 0.05em;
}

.raid-modal-copy {
  margin: 0;
  color: #cbd5f5;
  line-height: 1.6;
}

.raid-modal-losses {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: #fecaca;
  font-weight: 600;
}

.raid-modal-losses strong {
  color: #fee2e2;
}

.raid-modal-tip {
  font-size: 0.85rem;
  color: #94a3b8;
}

.raid-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.raid-modal-cta {
  background: linear-gradient(120deg, #f97316, #ef4444);
  color: #fff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.raid-modal-cta:hover {
  opacity: 0.9;
}

@media (min-width: 720px) {
  .raid-modal {
    grid-template-columns: 1fr 1fr;
  }

  .raid-modal-illustration {
    padding: 1.5rem;
    border-right: 1px solid rgba(248, 113, 113, 0.2);
  }
}

/* Light theme overrides */
body.theme-light .raid-modal-backdrop { background: rgba(15, 23, 42, 0.25); }
body.theme-light .raid-modal {
  background: #ffffff;
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 25px 80px rgba(0,0,0,0.18);
}
body.theme-light .raid-modal-close { background: rgba(0,0,0,0.05); color: #0f172a; }
body.theme-light .raid-modal-illustration { background: radial-gradient(circle at top, rgba(248,113,113,0.2), transparent 70%); }
body.theme-light .raid-modal-copy { color: #334155; }
body.theme-light .raid-modal-losses { color: #b91c1c; }
body.theme-light .raid-modal-losses strong { color: #7f1d1d; }
body.theme-light .raid-modal-tip { color: #64748b; }
/* ReputationInfoModal.css */

.rep-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 2rem;
  overflow-y: auto;
}

.rep-modal-content {
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border-radius: 1.5rem;
  border: 2px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.rep-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  position: sticky;
  top: 0;
  background: linear-gradient(145deg, #0f172a, #1e293b);
  z-index: 10;
}

.rep-modal-header h2 {
  margin: 0;
  font-size: 1.8rem;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rep-modal-close {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fb7185;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rep-modal-close:hover {
  background: rgba(248, 113, 113, 0.25);
  border-color: rgba(248, 113, 113, 0.6);
  transform: rotate(90deg);
}

.rep-modal-body {
  padding: 2rem;
}

.rep-modal-body section {
  margin-bottom: 3rem;
}

.rep-modal-body h3 {
  font-size: 1.4rem;
  margin: 0 0 1.5rem;
  color: #e2e8f0;
  border-left: 4px solid #6366f1;
  padding-left: 1rem;
}

/* Current Status */
.rep-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.rep-status-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rep-status-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.rep-status-value {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rep-status-icon {
  font-size: 2rem;
}

.rep-status-points {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.rep-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.rep-progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 999px;
}

.rep-next-tier {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}

/* Reputation Tiers */
.rep-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.rep-tier-card {
  background: rgba(15, 23, 42, 0.5);
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.rep-tier-card.locked {
  opacity: 0.6;
  filter: grayscale(0.5);
}

.rep-tier-card.current {
  border-width: 3px;
  box-shadow: 0 0 20px currentColor;
  transform: scale(1.02);
}

.rep-tier-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.rep-tier-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.rep-tier-icon {
  font-size: 1.8rem;
}

.rep-tier-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
}

.rep-tier-badge {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rep-tier-points {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.rep-tier-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.rep-tier-perks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rep-tier-perk {
  font-size: 0.75rem;
  color: #94a3b8;
  padding-left: 0.5rem;
}

/* Karma Section */
.rep-karma-explainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.rep-karma-mechanics,
.rep-karma-effects {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  padding: 1.5rem;
}

.rep-karma-mechanics h4,
.rep-karma-effects h4 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #a855f7;
}

.rep-karma-mechanics ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rep-karma-mechanics li {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.rep-karma-effect {
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.rep-karma-effect.good {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.rep-karma-effect.bad {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.rep-karma-effect strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.rep-karma-effect p {
  margin: 0;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.rep-karma-donation-card {
  margin-top: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 1rem;
  padding: 1.5rem;
  color: #e2e8f0;
}

.rep-karma-donation-card p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.rep-karma-donation-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #f8fafc;
}

/* Synergies */
.rep-synergies-intro {
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.rep-synergies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.rep-synergy-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: transform 0.2s;
}

.rep-synergy-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.rep-synergy-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rep-synergy-icon {
  font-size: 1.8rem;
}

.rep-synergy-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e9d5ff;
}

.rep-synergy-requirements {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.5rem;
}

.rep-synergy-effects {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rep-synergy-effect {
  font-size: 0.85rem;
  color: #cbd5e1;
  padding-left: 0.5rem;
}

/* Progress Section */
.rep-progress-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.rep-progress-section li {
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.75rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* Scrollbar styling */
.rep-modal-content::-webkit-scrollbar {
  width: 8px;
}

.rep-modal-content::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
}

.rep-modal-content::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.5);
  border-radius: 10px;
}

.rep-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}
/* Tutorial Overlay and Tooltip Styles */

.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  animation: tutorialFadeIn 0.3s ease-in;
  pointer-events: auto;
}

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

.tutorial-tooltip {
  position: fixed;
  width: 350px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid #00d4ff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.3);
  z-index: 10001;
  animation: tutorialSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  padding: 0;
  color: #fff;
  pointer-events: auto;
}

@keyframes tutorialSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tutorial-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.tutorial-tooltip-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.tutorial-close-btn {
  background: transparent;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.tutorial-close-btn:hover {
  background: rgba(255, 77, 77, 0.2);
  color: #ff4d4d;
  transform: rotate(90deg);
}

.tutorial-tooltip-body {
  padding: 20px;
  min-height: 80px;
}

.tutorial-tooltip-body p {
  margin: 0;
  line-height: 1.6;
  color: #e0e0e0;
  font-size: 15px;
}

.tutorial-tooltip-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tutorial-progress {
  font-size: 13px;
  color: #888;
}

.tutorial-buttons {
  display: flex;
  gap: 10px;
}

.tutorial-btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.tutorial-btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.tutorial-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 212, 255, 0.4);
  background: linear-gradient(135deg, #00e5ff 0%, #00aae5 100%);
}

.tutorial-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tutorial-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Highlight effect for target elements */
.tutorial-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.4),
              0 0 20px rgba(0, 212, 255, 0.6) !important;
  animation: tutorialPulse 2s infinite;
  border-radius: 8px;
}

@keyframes tutorialPulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.4),
                0 0 20px rgba(0, 212, 255, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 212, 255, 0.6),
                0 0 30px rgba(0, 212, 255, 0.8);
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .tutorial-tooltip {
    width: calc(100vw - 40px);
    left: 20px !important;
    right: 20px !important;
    bottom: 20px !important;
    top: auto !important;
  }

  .tutorial-tooltip-header h3 {
    font-size: 16px;
  }

  .tutorial-tooltip-body {
    padding: 16px;
  }

  .tutorial-tooltip-body p {
    font-size: 14px;
  }
}
/* LeaderboardPanel.css */
.leaderboard-panel {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  min-height: 300px;
  max-width: 100%;
  overflow: hidden;
}

.leaderboard-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 39, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
}

.leaderboard-loading-overlay p {
  color: #00e5ff;
  font-size: 1.1rem;
}

.leaderboard-error-message {
  text-align: center;
  padding: 3rem;
  color: #ff7043;
  background: rgba(255, 87, 34, 0.1);
  border: 1px solid rgba(255, 87, 34, 0.3);
  border-radius: 6px;
}

.leaderboard-header {
  margin-bottom: 1.5rem;
  display: none; /* Caché car le header est géré par la modale */
}

.leaderboard-header h2 {
  color: #00e5ff;
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.leaderboard-description {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin: 0;
}

.leaderboard-scoring-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(0, 229, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.leaderboard-scoring-info details {
  cursor: pointer;
}

.leaderboard-scoring-info summary {
  color: #00e5ff;
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leaderboard-scoring-info summary::-webkit-details-marker {
  display: none;
}

.scoring-details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  line-height: 1.6;
}

.scoring-details strong {
  color: #00e5ff;
}

.scoring-details ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.scoring-details li {
  margin: 0.25rem 0;
  color: rgba(255, 255, 255, 0.75);
}

.scoring-note {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 165, 0, 0.1);
  border-left: 3px solid #ffa500;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.leaderboard-empty {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.leaderboard-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leaderboard-table thead {
  border-bottom: 2px solid rgba(0, 229, 255, 0.3);
}

.leaderboard-table th {
  padding: 0.75rem 0.5rem;
  text-align: left;
  color: #00e5ff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.leaderboard-table th:nth-child(1) { width: 60px; text-align: center; }
.leaderboard-table th:nth-child(3) { width: 80px; }
.leaderboard-table th:nth-child(4),
.leaderboard-table th:nth-child(5),
.leaderboard-table th:nth-child(6),
.leaderboard-table th:nth-child(7),
.leaderboard-table th:nth-child(8),
.leaderboard-table th:nth-child(9) { text-align: right; }

.leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease;
}

.leaderboard-table tbody tr:hover {
  background-color: rgba(0, 229, 255, 0.05);
}

.leaderboard-table tbody tr.current-player {
  background-color: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.leaderboard-table td {
  padding: 0.75rem 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.leaderboard-table .rank {
  width: 60px;
  text-align: center;
  font-weight: bold;
}

.leaderboard-table .medal {
  font-size: 1.5rem;
}

.leaderboard-table .rank-number {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.leaderboard-table .corp-name {
  font-weight: 600;
  color: #00e5ff;
}

.leaderboard-table .you-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 4px;
  color: #ffd700;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.leaderboard-table .level {
  color: #00ff88;
  font-weight: 600;
  white-space: nowrap;
}

.leaderboard-table .credits,
.leaderboard-table .data,
.leaderboard-table .influence,
.leaderboard-table .districts,
.leaderboard-table .ops,
.leaderboard-table .score {
  text-align: right;
  font-family: "Courier New", monospace;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.leaderboard-table .score {
  color: #ffd700;
  font-weight: 600;
}

.rank-separator {
  background: transparent !important;
  border: none !important;
}

.rank-separator td {
  padding: 0.5rem !important;
}

.separator-line {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
}

@media (max-width: 768px) {
  .leaderboard-table {
    font-size: 0.8rem;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.5rem 0.3rem;
  }

  .leaderboard-header h2 {
    font-size: 1.25rem;
  }

  .leaderboard-description {
    font-size: 0.8rem;
  }
}
/* CityMapCanvas.css */
.city-map-canvas-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: #0a1628;
  border: 1px solid rgba(100, 150, 200, 0.25);
  border-radius: 4px;
  padding: 0.25rem;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.9),
    inset 0 0 60px rgba(0, 0, 0, 0.7);
}

.city-map-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

/* Reuse tooltip styles from CityMap */
.district-tooltip {
  position: absolute;
  min-width: 280px;
  background: linear-gradient(145deg, #0f1535 0%, #1a2045 100%);
  border: 2px solid rgba(0, 229, 255, 0.6);
  border-radius: 8px;
  padding: 0.75rem;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.3);
  animation: tooltip-fade-in 0.2s ease;
}

@keyframes tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
}

.tooltip-header h4 {
  margin: 0;
  color: #00e5ff;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contested-badge {
  background: rgba(255, 165, 0, 0.2);
  color: #ffa500;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 165, 0, 0.5);
}

.tooltip-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.tooltip-row .label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.tooltip-row .value {
  color: #ffffff;
  font-weight: 600;
}

.tooltip-top-players {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
}

.tooltip-top-players strong {
  color: #00e5ff;
  font-size: 0.8rem;
}

.tooltip-top-players ol {
  margin: 0.25rem 0 0 1.2rem;
  padding: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.tooltip-top-players li {
  margin: 0.15rem 0;
}

.tooltip-hint {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-style: italic;
}
/* ---- Clean version & new additions below ---- */
.controlled-districts-card {
  border:1px solid rgba(0,229,255,0.25);
  background:rgba(0,229,255,0.04);
  border-radius:10px;
  padding:1rem 1.25rem;
  margin-bottom:1.5rem;
}
.controlled-districts-header {
  margin-bottom:.75rem;
}
.controlled-districts-title {
  margin:0;
  font-size:.95rem;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:rgba(255,255,255,0.7);
}
.controlled-districts-description {
  margin:.25rem 0 0 0;
  font-size:.85rem;
  color:rgba(255,255,255,0.6);
}
.controlled-districts-info {
  margin:.2rem 0 0 0;
  font-size:.8rem;
  color:rgba(255,255,255,0.55);
  display:flex;
  gap:.35rem;
  align-items:center;
}
.controlled-districts-total {
  margin:.35rem 0 0 0;
  font-size:.85rem;
  color:#fef08a;
  font-weight:600;
}
.controlled-districts-list {
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:.5rem;
}
.controlled-district-item {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:.75rem;
  border-top:1px solid rgba(255,255,255,0.08);
  padding-top:.5rem;
}
.controlled-district-item:first-of-type {
  border-top:none;
  padding-top:0;
}
.controlled-district-info {
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
}
.controlled-district-name {
  font-weight:600;
  color:#e0f7ff;
}
.controlled-district-pill {
  font-size:.65rem;
  letter-spacing:.5px;
  text-transform:uppercase;
  border-radius:999px;
  padding:.15rem .45rem;
  border:1px solid rgba(147,197,253,0.45);
  background:rgba(147,197,253,0.15);
  color:#bfdbfe;
}
.controlled-district-pill.player {
  border-color:rgba(34,197,94,0.45);
  background:rgba(34,197,94,0.15);
  color:#86efac;
}
.controlled-district-pill.cartel {
  border-color:rgba(99,102,241,0.45);
  background:rgba(99,102,241,0.18);
  color:#c7d2fe;
}
.controlled-district-pill.contested {
  border-color:rgba(255,149,0,0.45);
  background:rgba(255,149,0,0.15);
  color:#ffbb85;
}
.controlled-district-bonus {
  font-size:.85rem;
  font-weight:600;
  color:#93c5fd;
  white-space:nowrap;
}
.controlled-district-yields {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:.25rem;
}
.controlled-district-revenue {
  font-size:.85rem;
  font-weight:600;
  color:#fef08a;
  white-space:nowrap;
}

.districts-cap-summary {
  margin:.5rem 0 0 0;
  font-size:.95rem;
  color:rgba(255,255,255,0.72);
  line-height:1.35;
}

.districts-description {
  margin:.25rem 0 0 0;
  font-size:1rem;
  color:rgba(255,255,255,0.72);
  line-height:1.4;
}

.districts-cap-note {
  color:rgba(255,255,255,0.55);
  font-size:.9rem;
}

@media (max-width:600px) {
  .controlled-district-item {
    flex-direction:column;
  }
  .controlled-district-bonus {
    white-space:normal;
  }
  .controlled-district-yields {
    align-items:flex-start;
  }
  .controlled-district-revenue {
    white-space:normal;
  }
}

.district-focus-card {
  border:1px solid rgba(0,229,255,0.25);
  background:rgba(0,229,255,0.05);
  border-radius:10px;
  padding:1rem 1.25rem;
  margin-bottom:1.5rem;
  display:flex;
  flex-direction:column;
  gap:.75rem;
}
.district-focus-card-header {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:1rem;
}
.district-focus-title {
  margin:0 0 .35rem 0;
  font-size:.85rem;
  letter-spacing:.5px;
  text-transform:uppercase;
  color:rgba(255,255,255,0.65);
}
.district-focus-description {
  margin:0;
  font-size:1rem;
  color:#e0f7ff;
}
.district-focus-pill {
  align-self:flex-start;
  padding:.35rem .9rem;
  border-radius:999px;
  border:1px solid rgba(0,229,255,0.45);
  background:rgba(0,229,255,0.12);
  color:#00e5ff;
  font-size:.75rem;
  letter-spacing:.5px;
  text-transform:uppercase;
}
.district-focus-hint {
  margin:0;
  font-size:.85rem;
  color:rgba(255,255,255,0.65);
}
.district-focus-hint.subtle {
  font-size:.75rem;
  color:rgba(255,255,255,0.5);
}
.district-focus-actions {
  display:flex;
  align-items:center;
  gap:.75rem;
}
.district-focus-button {
  padding:.5rem 1.25rem;
  border-radius:6px;
  border:1px solid rgba(0,229,255,0.5);
  background:linear-gradient(120deg,rgba(0,229,255,0.25),rgba(0,147,233,0.4));
  color:#e0f7ff;
  font-weight:600;
  letter-spacing:.5px;
  text-transform:uppercase;
  font-size:.75rem;
  cursor:pointer;
  transition:all .2s ease;
}
.district-focus-button:hover:not(:disabled) {
  box-shadow:0 0 12px rgba(0,229,255,0.4);
  transform:translateY(-1px);
}
.district-focus-button:disabled {
  opacity:.6;
  cursor:not-allowed;
}
.district-focus-button.ghost {
  background:transparent;
  border-color:rgba(0,229,255,0.35);
}
.district-focus-error {
  border:1px solid rgba(255,87,34,0.6);
  background:rgba(255,87,34,0.15);
  color:#ffab91;
  border-radius:6px;
  padding:.5rem .75rem;
  font-size:.85rem;
}
.district-focus-modal {
  border:1px dashed rgba(0,229,255,0.35);
  border-radius:10px;
  padding:1rem 1.25rem;
  margin-bottom:1.5rem;
  background:rgba(0,229,255,0.05);
}
.district-focus-modal-text {
  margin:0 0 .75rem 0;
  font-size:.95rem;
  color:rgba(255,255,255,0.8);
}
.district-focus-modal-actions {
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
}

/* Detailed view collapsible */
.districts-detailed-view {
  margin-top: 2rem;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
  padding-top: 1rem;
}

.districts-detailed-view summary {
  color: rgba(0, 229, 255, 0.8);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.districts-detailed-view summary:hover {
  background: rgba(0, 229, 255, 0.1);
}

.districts-detailed-view[open] summary {
  margin-bottom: 1rem;
  color: #00e5ff;
}

.district-bonus-row {
  display:flex;
}
.bonus-pill {
  background:linear-gradient(120deg,#143b4d,#0e2235);
  border:1px solid rgba(0,229,255,0.35);
  padding:.25rem .55rem;
  font-size:.6rem;
  border-radius:999px;
  letter-spacing:.5px;
  font-weight:600;
  color:#b9efff;
  text-transform:uppercase;
}
.district-badges {
  display:flex;
  gap:.4rem;
  align-items:center;
}
.district-contested-badge {
  background:rgba(255,87,34,0.2);
  border:1px solid rgba(255,87,34,0.5);
  padding:.2rem .45rem;
  border-radius:4px;
  font-size:.6rem;
  font-weight:700;
  letter-spacing:.5px;
  text-transform:uppercase;
  color:#ff7043;
}
.badge-cartel {
  background:rgba(99,102,241,0.2);
  border:1px solid rgba(99,102,241,0.45);
  color:#c7d2fe;
}
.badge-controller {
  background:rgba(16,185,129,0.2);
  border:1px solid rgba(16,185,129,0.45);
  color:#a7f3d0;
}
.district-threshold-bar {
  display:flex;
  align-items:center;
  gap:.5rem;
  margin-top:.4rem;
}
.threshold-track {
  flex:1;
  height:8px;
  background:rgba(255,255,255,0.1);
  border-radius:4px;
  position:relative;
  overflow:visible;
}
.threshold-fill {
  height:100%;
  background:linear-gradient(90deg,#00e5ff,#00b8d4);
  border-radius:4px;
  transition:width .3s;
}
.threshold-marker {
  position:absolute;
  top:-2px;
  width:2px;
  height:12px;
  background:#ffd700;
  border-radius:1px;
  box-shadow:0 0 4px rgba(255,215,0,0.6);
}
.threshold-label {
  font-size:.65rem;
  font-weight:600;
  color:#00e5ff;
  min-width:35px;
  text-align:right;
}

.corp-banner-card.has-photo {
  border-color: rgba(248, 250, 252, 0.6);
}

.corp-banner-card .corp-banner-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.55;
  filter: saturate(1.05);
  z-index: 0;
}

/* District Modal Styles */
.district-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

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

.district-modal {
  background: linear-gradient(135deg, #0a1828 0%, #1a2332 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 229, 255, 0.2), 0 0 40px rgba(0, 229, 255, 0.1);
  max-width: 650px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden; /* container guards; body will scroll */
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 100;
  line-height: 1;
}

.modal-close-btn:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: rgba(255, 0, 0, 0.6);
  transform: rotate(90deg);
}

.modal-illustration {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1828 0%, #1a2332 100%);
}

/* Allow scrolling inside the modal body */
.modal-body {
  max-height: calc(85vh - 220px - 90px); /* subtract illustration + header approx */
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.modal-header {
  padding: 0.75rem 1.25rem;
}

.modal-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.illustration-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 32px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.illustration-overlay h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 229, 255, 0.5);
  letter-spacing: 0.5px;
}

.modal-header {
  padding: 20px 32px;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.header-badges {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge-contested {
  background: rgba(255, 87, 34, 0.2);
  border: 1px solid rgba(255, 87, 34, 0.5);
  color: #ff7043;
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
}

.badge-difficulty {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.5);
  color: #ffc107;
}

.header-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #00b8d4, #0091ea);
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.control-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to { left: 100%; }
}

.control-label {
  font-size: 13px;
  font-weight: 600;
  color:#00e5ff;
  min-width:35px;
  text-align:right;
  color: rgba(0, 229, 255, 0.9);

.corp-banner-card.has-photo {
  border-color: rgba(248, 250, 252, 0.6);
}

.corp-banner-card .corp-banner-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.55;
  filter: saturate(1.05);
  z-index: 0;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

.district-controller-card {
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(2, 6, 23, 0.82);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.influencer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.influencer-banner-thumb {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.65);
  flex-shrink: 0;
  position: relative;
  display: inline-block;
}

.influencer-rarity-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
}

.controller-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.65);
}

.controller-value {
  font-size: 1rem;
  font-weight: 600;
  color: #e0f7ff;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.corp-banners-section {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(6, 11, 25, 0.9);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.corp-banners-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.corp-banners-header h3 {
  margin: 0;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #e0f2fe;
}

.corp-banners-header p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(224, 242, 254, 0.75);
}

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

.corp-banner-card {
  position: relative;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 14px;
  padding: 1rem 1rem 0.85rem;
  min-height: 160px;
  overflow: hidden;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.corp-banner-card .corp-banner-noise {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-size: 220% 220%;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 1;
}

.corp-banner-card:hover {
  transform: translateY(-2px);
}

.corp-banner-card.current-player {
  border-width: 1.5px;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.35);
}

.corp-banner-rank-line {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.75);
}

.corp-banner-body {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.corp-banner-emblem {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.15);
}

.corp-banner-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.corp-banner-name {
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.corp-banner-chip {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.corp-banner-influence {
  font-size: 0.8rem;
  color: rgba(248, 250, 252, 0.85);
}

.corp-banner-share {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.corp-banner-progress {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.corp-banner-progress-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease-out;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

@media (max-width: 520px) {
  .corp-banner-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .influencer-banner-thumb {
    width: 32px;
    height: 32px;
  }
}

.stat-card:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 229, 255, 0.2);
}

.stat-card.player-stat {
  border-color: rgba(255, 193, 7, 0.3);
  background: rgba(255, 193, 7, 0.05);
}

.stat-card.player-stat:hover {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 8px 16px rgba(255, 193, 7, 0.2);
}

.stat-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px currentColor);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #00e5ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-badge {
  font-size: 12px;
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.district-converter-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(52, 152, 219, 0.05);
  border: 2px solid rgba(52, 152, 219, 0.3);
  border-radius: 12px;
}

.converter-card {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.converter-btn {
  transition: all 0.3s ease;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

.converter-btn:not(:disabled):hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.converter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.leaderboard-section {
  margin-top: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.title-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px currentColor);
}

.influencers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.influencer-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.influencer-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(0, 229, 255, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.influencer-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateX(4px);
}

.influencer-item:hover::before {
  opacity: 1;
}

.influencer-item.rank-1 {
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(255, 215, 0, 0.05);
}

.influencer-item.rank-1 .influencer-rank {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.influencer-item.rank-2 {
  border-color: rgba(192, 192, 192, 0.4);
}

.influencer-item.rank-2 .influencer-rank {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: #000;
}

.influencer-item.rank-3 {
  border-color: rgba(205, 127, 50, 0.4);
}

.influencer-item.rank-3 .influencer-rank {
  background: linear-gradient(135deg, #cd7f32, #d89d6a);
  color: #000;
}

.influencer-rank {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.2);
  border: 1px solid rgba(0, 229, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #00e5ff;
}

.influencer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.influencer-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.influencer-stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.influence-points {
  color: #00e5ff;
  font-weight: 600;
}

.influence-percentage {
  color: rgba(255, 255, 255, 0.6);
}

.influencer-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #00b8d4);
  border-radius: 3px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.4);
  gap: 12px;
}

.empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.empty-text {
  font-size: 14px;
  font-weight: 500;
}

.error {
  background: rgba(255, 87, 34, 0.1);
  border: 1px solid rgba(255, 87, 34, 0.3);
  color: #ff7043;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

/* Light theme overrides */
body.theme-light .controlled-districts-card,
body.theme-light .district-focus-card,
body.theme-light .district-focus-modal {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.25);
}
body.theme-light .controlled-districts-title,
body.theme-light .district-focus-title { color: #64748b; }
body.theme-light .district-focus-description,
body.theme-light .controlled-district-name { color: #0f172a; }
body.theme-light .controlled-districts-description,
body.theme-light .controlled-districts-info,
body.theme-light .district-focus-hint { color: #475569; }
body.theme-light .controlled-district-item { border-top-color: rgba(100, 116, 139, 0.15); }
body.theme-light .district-focus-button { color: #0f172a; }
body.theme-light .districts-detailed-view { border-top-color: rgba(100, 116, 139, 0.25); }
body.theme-light .districts-detailed-view summary { color: #0ea5e9; }
body.theme-light .districts-detailed-view summary:hover { background: rgba(14, 165, 233, 0.08); }
body.theme-light .districts-detailed-view[open] summary { color: #0284c7; }
body.theme-light .bonus-pill { background: linear-gradient(120deg,#e2e8f0,#cbd5e1); color: #0f172a; border-color: rgba(14, 165, 233, 0.35); }
body.theme-light .district-threshold-bar .threshold-track { background: rgba(100, 116, 139, 0.2); }
body.theme-light .threshold-label { color: #0ea5e9; }
body.theme-light .district-modal-overlay { background: rgba(15, 23, 42, 0.25); }
body.theme-light .district-modal {
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}
body.theme-light .modal-close-btn {
  background: rgba(0,0,0,0.05);
  border-color: rgba(100,116,139,0.25);
  color: #0f172a;
}
body.theme-light .building-stat-section table thead { background: rgba(14, 165, 233, 0.08); }
body.theme-light .building-stat-section table th { color: #0284c7; border-bottom-color: rgba(14, 165, 233, 0.35); }.banner-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.banner-picker-slots-info {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.banner-picker-slots-info .slots-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.banner-picker-section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
}

.banner-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.banner-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.banner-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
}

.banner-card.selected {
  border-color: rgba(0, 255, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.25), 0 0 20px rgba(0, 255, 255, 0.12);
}

.banner-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.banner-card-image {
  height: 78px;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.18), rgba(255, 0, 153, 0.14));
  background-size: cover;
  background-position: center;
  position: relative;
}

.banner-rarity-badge {
  position: absolute;
  top: 6px;
  right: 6px;
}

.banner-card-footer {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.banner-card-name {
  font-weight: 600;
  font-size: 13px;
}

.banner-card-lock {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.banner-picker-actions {
  display: flex;
  justify-content: flex-end;
}

.banner-clear {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.banner-clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.banner-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.banner-modal {
  width: min(1100px, 96vw);
  max-height: min(82vh, 900px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 15, 18, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

.banner-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.banner-modal-title {
  margin: 0;
  font-size: 16px;
}

.banner-modal-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.banner-modal-close {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.banner-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.banner-modal-search {
  flex: 1;
  min-width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 10px;
  padding: 10px 12px;
}

.banner-modal-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  user-select: none;
}

.banner-modal-body {
  padding: 14px 16px 16px;
  overflow: auto;
}
/* Tooltip custom pour l'icône syndicat (défense absente) */
.syndicate-tooltip-icon {
  position: relative;
  display: inline-block;
  font-size: 1.1em;
  color: #b0b0b0;
  cursor: help;
}
.syndicate-tooltip-text {
  visibility: hidden;
  width: max-content;
  background: #222;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 3px 8px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.95em;
  pointer-events: none;
  white-space: nowrap;
}
.syndicate-tooltip-icon:hover .syndicate-tooltip-text {
  visibility: visible;
  opacity: 1;
}
.cartel-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #e0f7ff;
}

.cartel-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.cartel-modal-card {
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.75));
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.9), 0 0 40px rgba(0, 229, 255, 0.2);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cartel-modal-card h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: #ffcdd2;
  letter-spacing: 0.05em;
}

.cartel-modal-card p {
  margin: 0 0 1.5rem 0;
  color: rgba(224, 247, 255, 0.85);
  line-height: 1.6;
  font-size: 0.95rem;
}

.cartel-modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
}

.cartel-modal-actions .cartel-button {
  width: 100%;
}

.cartel-banner-hero {
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

.cartel-banner-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.15), rgba(2, 6, 23, 0.9));
}

.cartel-banner-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  gap: 0.35rem;
  z-index: 1;
  color: #f8fafc;
  text-shadow: 0 6px 30px rgba(2, 6, 23, 0.8);
}

.cartel-banner-chip {
  align-self: flex-start;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.45);
  background: rgba(15, 23, 42, 0.7);
  color: #bae6fd;
}

.cartel-banner-hero-overlay strong {
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}

.cartel-banner-rarity {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.cartel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.cartel-header h2 {
  margin: 0 0 0.2rem 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cartel-join-row {
  display: none;
}

.cartel-select-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  margin-bottom: 0.75rem;
  background:
    radial-gradient(1200px 260px at 30% -40%, rgba(0, 229, 255, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.82), rgba(15, 23, 42, 0.52));
  box-shadow:
    0 10px 26px rgba(2, 6, 23, 0.55),
    inset 0 1px 0 rgba(148, 163, 184, 0.18);
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.cartel-select {
  width: 100%;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.05rem 3.25rem 0.05rem 1rem;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: #e0f7ff;
  font-weight: 650;
  letter-spacing: 0.02em;
  outline: none;
  cursor: pointer;
}

.cartel-select option {
  color: #0b1220;
}

.cartel-select option:disabled {
  color: rgba(11, 18, 32, 0.55);
}

.cartel-select-wrap::after {
  content: "";
  position: absolute;
  right: 1.05rem;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(224, 247, 255, 0.9);
  border-bottom: 2px solid rgba(224, 247, 255, 0.9);
  transform: translateY(-55%) rotate(45deg);
  pointer-events: none;
}

.cartel-select-wrap:hover {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow:
    0 0 0 3px rgba(0, 229, 255, 0.12),
    0 14px 34px rgba(2, 6, 23, 0.6),
    inset 0 1px 0 rgba(148, 163, 184, 0.22);
  transform: translateY(-1px);
}

.cartel-select-wrap:focus-within {
  border-color: rgba(0, 229, 255, 0.78);
  box-shadow:
    0 0 0 4px rgba(0, 229, 255, 0.18),
    0 16px 40px rgba(2, 6, 23, 0.65),
    inset 0 1px 0 rgba(148, 163, 184, 0.22);
}

.cartel-join-meta {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.cartel-open-members {
  color: rgba(224, 247, 255, 0.78);
  font-size: 0.85rem;
}

.cartel-select:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.cartel-select-wrap:has(.cartel-select:disabled) {
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

@media (max-width: 560px) {
  .cartel-join-row {
    flex-direction: column;
    align-items: stretch;
  }
  .cartel-join-row > .cartel-button {
    width: 100%;
  }
}



.cartel-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  max-width: 520px;
}

.cartel-actions {
  display: flex;
  gap: 0.6rem;
}

.cartel-button {
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: linear-gradient(120deg, rgba(0, 229, 255, 0.28), rgba(0, 147, 233, 0.35));
  color: #e0f7ff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cartel-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.35);
}

.cartel-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cartel-button.ghost {
  background: transparent;
  border-color: rgba(0, 229, 255, 0.25);
}

.cartel-button.danger {
  border-color: rgba(255, 99, 71, 0.7);
  background: linear-gradient(120deg, rgba(244, 67, 54, 0.18), rgba(183, 28, 28, 0.4));
  color: #ffcdd2;
}

.cartel-button.danger:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(244, 67, 54, 0.35);
}

.cartel-alert {
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}

.cartel-alert.error {
  border: 1px solid rgba(255, 87, 34, 0.6);
  background: rgba(255, 87, 34, 0.15);
  color: #ffab91;
}

.cartel-alert.success {
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.15);
  color: #a7f3d0;
}

.cartel-alert.muted {
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.cartel-empty-state {
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 12px;
  padding: 1.25rem;
  background: rgba(0, 229, 255, 0.05);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.cartel-empty-copy h3 {
  margin: 0 0 0.35rem 0;
}

.cartel-empty-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.cartel-empty-warning {
  margin-top: 0.5rem;
  color: #ffd54f;
  font-size: 0.85rem;
}

.cartel-empty-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.cartel-form {
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cartel-form h4 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.cartel-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.7);
}

.cartel-form input,
.cartel-form textarea,
.cartel-chat-form input {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  color: #e0f7ff;
  font-size: 0.9rem;
}

.cartel-form input:focus,
.cartel-form textarea:focus,
.cartel-chat-form input:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.5);
}

.cartel-form textarea {
  resize: vertical;
}

.cartel-form-hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.cartel-hub {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Compact membership summary bar at top */
.cartel-top-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.06);
}

.cartel-top-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.member-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: #c7f9ff;
}

.cartel-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cartel-summary,
.cartel-membership-card,
.cartel-treasury-card,
.cartel-members-card,
.cartel-chat-card {
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  background: rgba(0, 229, 255, 0.04);

.cartel-treasury-actions {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
}
}

.cartel-treasury-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cartel-raid-card {
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 1.5rem;
  background: radial-gradient(circle at top right, rgba(45, 212, 191, 0.08), transparent 45%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(2, 6, 23, 0.95));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.45);
}

.cartel-raid-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}

.cartel-raid-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #f8fafc;
}

.raid-status-chip {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(248, 250, 252, 0.85);
}

.raid-status-chip.online {
  border-color: rgba(16, 185, 129, 0.5);
  color: #a7f3d0;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.raid-status-chip.locked {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.cartel-raid-hint {
  margin: 0;
  color: rgba(224, 247, 255, 0.75);
}

.cartel-raid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.raid-stat {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.raid-stat span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.65);
}

.raid-stat strong {
  font-size: 1.4rem;
  color: #f8fafc;
}

.raid-stat small {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.65);
}

.raid-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.raid-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #22d3ee);
}

.cartel-raid-targets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.raid-target {
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(2, 6, 23, 0.9));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.raid-target.danger {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(15, 23, 42, 0.9));
}

.raid-target.critical {
  border-color: rgba(248, 113, 113, 0.5);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.15), rgba(15, 23, 42, 0.92));
}

.raid-target-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.raid-target-title {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.raid-target-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.raid-target-chip {
  margin-left: 0;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(224, 247, 255, 0.35);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e0f7ff;
}

.raid-target-chip.subtle {
  border-color: rgba(224, 247, 255, 0.2);
  color: rgba(224, 247, 255, 0.7);
}

.raid-target-chip.defense-chip {
  border-color: rgba(76, 175, 80, 0.5);
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
}

.raid-target-grid .syndicate-defense {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
}

.raid-target-grid .syndicate-defense strong {
  color: #81c784;
}

.raid-target-risk span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(248, 250, 252, 0.55);
}

.raid-target-risk strong {
  font-size: 1.3rem;
  color: #fca5a5;
}

.raid-heat-chip {
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(248, 250, 252, 0.3);
  color: rgba(248, 250, 252, 0.85);
}

.raid-heat-chip.warning {
  border-color: rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

.raid-heat-chip.danger {
  border-color: rgba(249, 115, 22, 0.5);
  color: #fdba74;
}

.raid-heat-chip.critical {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.raid-target-reason {
  margin: 0.5rem 0 0;
  color: rgba(226, 232, 240, 0.75);
}

.raid-target-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.raid-target-grid span {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.raid-target-grid strong {
  display: block;
  font-size: 1.2rem;
  color: #f8fafc;
}

.raid-target-grid small {
  display: block;
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.6);
}

.cartel-treasury-balance {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(0, 147, 233, 0.06));
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.2);
}

.cartel-treasury-values {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.cartel-treasury-resource {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.cartel-treasury-balance strong {
  font-size: 2rem;
  color: #00e5ff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cartel-treasury-data strong {
  color: #ff9800;
}

.cartel-treasury-currency {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.5rem;
}

.cartel-treasury-form {
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(2, 6, 23, 0.9));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cartel-treasury-data-form {
  border-color: rgba(255, 152, 0, 0.3);
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.05), rgba(15, 23, 42, 0.8));
}

.cartel-treasury-data-form h4 {
  color: #ff9800;
}

.cartel-button-data {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border-color: rgba(255, 152, 0, 0.5);
}

.cartel-button-data:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffb74d, #ff9800);
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.4);
}

.cartel-treasury-form h4 {
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #00e5ff;
  font-weight: 600;
}

.cartel-form-row {
  display: grid;
  grid-template-columns: 1fr ;
  gap: 1rem;
}

.cartel-treasury-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.cartel-treasury-form select,
.cartel-treasury-form input[type="number"],
.cartel-treasury-form textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: #e0f7ff;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.cartel-treasury-form input[type="number"] {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cartel-treasury-form select:focus,
.cartel-treasury-form input[type="number"]:focus,
.cartel-treasury-form textarea:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.5);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.cartel-treasury-form textarea {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.cartel-treasury-ledger {
  margin-top: 0.5rem;
}

.cartel-treasury-ledger ul {
  list-style: none;
  margin: 0.75rem 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 17.5rem; /* ~3 ledger entries visible */
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.45) rgba(255, 255, 255, 0.08);
}

.cartel-treasury-ledger ul::-webkit-scrollbar {
  width: 6px;
}

.cartel-treasury-ledger ul::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.cartel-treasury-ledger ul::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.45);
  border-radius: 999px;
}

.cartel-treasury-ledger li {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.4), rgba(2, 6, 23, 0.6));
  transition: all 0.2s;
}

.cartel-treasury-ledger li:hover {
  border-color: rgba(0, 229, 255, 0.3);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.6), rgba(2, 6, 23, 0.8));
}

.cartel-treasury-ledger li > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.cartel-treasury-ledger li > div:first-child strong {
  color: #00e5ff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cartel-treasury-ledger li > div:first-child span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.cartel-treasury-ledger-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.cartel-treasury-ledger-meta span {
  color: rgba(255, 255, 255, 0.65);
}

.cartel-treasury-ledger-meta strong {
  font-size: 1.1rem;
  font-weight: 700;
}

.cartel-treasury-ledger-meta .credit {
  color: #10b981;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.cartel-treasury-ledger-meta .debit {
  color: #f87171;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.cartel-treasury-ledger li p {
  margin: 0.6rem 0 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.cartel-summary-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.cartel-summary h3 {
  margin: 0;
  font-size: 1.25rem;
}

.cartel-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.45px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.25rem;
}

.cartel-id {
  margin: 0.15rem 0 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.cartel-summary-stats {
  display: flex;
  gap: 1.25rem;
}

.cartel-summary-stats div {
  min-width: 100px;
  text-align: right;
}

.cartel-summary-stats strong {
  display: block;
  font-size: 1.2rem;
  color: #00e5ff;
}

.cartel-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.55);
}

.cartel-banner-upload {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.cartel-banner-actions {
  display: flex;
  gap: 0.5rem;
}

.cartel-banner-hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.cartel-banner-status {
  margin: 0;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
}

.cartel-banner-status.pending {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.cartel-banner-status.success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.cartel-banner-status.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.cartel-invite-code {
  margin-top: 0.5rem;
}

.cartel-invite-code-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.cartel-invite-code-row code {
  background: rgba(0, 229, 255, 0.1);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #00e5ff;
}

.cartel-recruitment-toggle {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
}

.cartel-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.cartel-toggle-switch {
  appearance: none;
  width: 44px;
  height: 24px;
  background: rgba(100, 116, 139, 0.4);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.cartel-toggle-switch:checked {
  background: rgba(0, 229, 255, 0.3);
  border-color: rgba(0, 229, 255, 0.5);
}

.cartel-toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cartel-toggle-switch:checked::after {
  transform: translateX(20px);
  background: #00e5ff;
}

.cartel-toggle-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cartel-toggle-status {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.cartel-description {
  margin: 0.8rem 0 0.4rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.cartel-strategy span {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.45px;
  color: rgba(255, 255, 255, 0.6);
}

.cartel-strategy p {
  margin: 0.3rem 0 0 0;
}

.cartel-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0 0;
}

.cartel-meta div {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
}

.cartel-meta dt {
  margin: 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.55);
}

.cartel-meta dd {
  margin: 0.2rem 0 0 0;
  font-weight: 600;
}

.cartel-membership-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.cartel-membership-card li {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.cartel-members-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cartel-members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cartel-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cartel-member-list li {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
}

.cartel-member-list li.self {
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.cartel-chip {
  margin-left: 0.45rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: #00e5ff;
}

.member-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.member-role-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 150, 150, 0.15));
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00d9ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.15);
  flex-shrink: 0;
}

.member-role {
  display: inline-block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.75rem;
  margin-top: 0.4rem;
  color: rgba(255, 255, 255, 0.65);
}

.cartel-member-actions {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cartel-member-actions label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: rgba(255, 255, 255, 0.6);
}

.cartel-role-select {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  color: #e0f7ff;
  font-size: 0.85rem;
}

.cartel-role-select:disabled {
  opacity: 0.6;
}

.cartel-chat-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cartel-roles-card {
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  background: rgba(0, 229, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cartel-role-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cartel-role-list li {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cartel-role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cartel-role-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
}

.cartel-role-hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0.2rem 0 0;
}

.cartel-role-hint.muted {
  color: rgba(255, 255, 255, 0.45);
}

.cartel-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cartel-chat-feed {
  max-height: 260px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.4rem;
}

.cartel-message {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.4);
}

.cartel-message header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.35rem;
}

.cartel-message p {
  margin: 0;
  font-size: 0.95rem;
  color: #f5fbff;
}

.cartel-chat-form {
  display: flex;
  gap: 0.5rem;
}

.cartel-chat-form input {
  flex: 1;
}

@media (min-width: 900px) {
  .cartel-hub {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .cartel-chat-card {
    grid-column: span 2;
  }
}

/* Raid Launch Modal Styles */
.raid-launch-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  margin: 1.5rem 0;
  padding: 0.5rem;
}

.raid-participant-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  padding: 1rem;
}

.raid-participant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
}

.raid-participant-header strong {
  color: #00e5ff;
  font-size: 0.95rem;
}

.raid-participant-header small {
  color: rgba(224, 247, 255, 0.6);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.raid-agents-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.raid-agent-item {
  background: rgba(0, 229, 255, 0.05);
  border: 2px solid rgba(0, 229, 255, 0.2);
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  user-select: none;
}

.raid-agent-item:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.4);
}

.raid-agent-item.selected {
  background: rgba(0, 229, 255, 0.3);
  border-color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.raid-agent-item .agent-name {
  font-size: 0.75rem;
  color: #e0f7ff;
  font-weight: 500;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raid-agent-item .agent-level {
  font-size: 0.7rem;
  color: rgba(0, 229, 255, 0.8);
}

.raid-agent-item.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(255, 100, 100, 0.3);
  background: rgba(255, 100, 100, 0.05);
}

.raid-agent-item.unavailable:hover {
  background: rgba(255, 100, 100, 0.08);
  border-color: rgba(255, 100, 100, 0.4);
}

.raid-agent-item.unavailable input[type="checkbox"] {
  cursor: not-allowed;
}

.agent-status-badge {
  display: inline-block;
  font-size: 0.6rem;
  padding: 2px 6px;
  margin-left: 4px;
  border-radius: 4px;
  background: rgba(255, 100, 100, 0.3);
  color: #ff9999;
  font-weight: 600;
  text-transform: uppercase;
}

.raid-agent-unavailable {
  text-align: center;
  padding: 1rem;
  color: rgba(224, 247, 255, 0.5);
  font-size: 0.85rem;
  font-style: italic;
}

.raid-target-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 229, 255, 0.1);
}

.raid-target-actions .cartel-button {
  flex: 1;
}

.cartel-modal-content {
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.75));
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.9), 0 0 40px rgba(0, 229, 255, 0.2);
}

.cartel-modal-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: #ffcdd2;
  letter-spacing: 0.05em;
}

.cartel-modal-subtitle {
  margin: 0 0 1.5rem 0;
  color: rgba(224, 247, 255, 0.7);
  font-size: 0.9rem;
}

.cartel-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.cartel-modal-actions .cartel-button {
  flex: 1;
}

/* Raid History Section */
.cartel-raid-history-card {
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.8), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  overflow: hidden;
}

.cartel-raid-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cartel-raid-history-header .cartel-label {
  margin: 0;
}

.raid-history-tabs {
  display: flex;
  gap: 0.5rem;
}

.raid-history-tab {
  background: transparent;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 6px;
  color: rgba(224, 247, 255, 0.7);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.raid-history-tab:hover {
  border-color: rgba(0, 229, 255, 0.6);
  color: #e0f7ff;
}

.raid-history-tab.active {
  background: rgba(0, 229, 255, 0.2);
  border-color: rgba(0, 229, 255, 0.8);
  color: #ffff00;
}

.raid-history-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.15);
  margin-bottom: 1rem;
}

.raid-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.raid-history-table thead {
  background: rgba(0, 229, 255, 0.08);
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.raid-history-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  color: #00e5ff;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.raid-history-table tbody tr {
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  transition: background-color 0.2s ease;
}

.raid-history-table tbody tr:hover {
  background: rgba(0, 229, 255, 0.05);
}

.raid-history-table td {
  padding: 0.75rem 1rem;
  color: rgba(224, 247, 255, 0.8);
}

.raid-status-badge {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.raid-status-badge.active {
  background: rgba(76, 175, 80, 0.3);
  color: #4caf50;
}

.raid-status-badge.completed {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
}

.raid-status-badge.expired {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.raid-status-badge.blocked {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.raid-loot {
  color: #ffeb3b;
  font-weight: 500;
}

.raid-heat {
  font-weight: 600;
}

.raid-heat.positive {
  color: #ff6b6b;
}

.raid-heat.negative {
  color: #4caf50;
}

.raid-history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 229, 255, 0.1);
}

.pagination-info {
  color: rgba(224, 247, 255, 0.6);
  font-size: 0.85rem;
  min-width: 60px;
  text-align: center;
}

.cartel-button.small {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

/* Raid Modal Improvements */
.cartel-modal-content.raid-modal {
  max-width: 900px;
  width: 90vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.raid-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.raid-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}

.raid-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #ffcdd2;
}

.raid-modal-close {
  background: transparent;
  border: none;
  color: rgba(224, 247, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.raid-modal-close:hover {
  color: #e0f7ff;
}

.raid-members-summary {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: rgba(224, 247, 255, 0.8);
  font-size: 0.9rem;
  text-align: center;
}

.raid-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  overflow-x: hidden;
  padding: 0.5rem;
  margin: -0.5rem;
}

/* Avoid nested scroll containers inside the raid modal: the modal body scrolls */
.cartel-modal-content.raid-modal .raid-launch-container {
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0;
}

.cartel-modal-content.raid-modal .raid-members-grid {
  max-height: none;
  overflow-y: visible;
  margin: 0;
  padding: 0.5rem 0;
}

@media (max-width: 640px) {
  .cartel-modal-content.raid-modal {
    width: 96vw;
    padding: 1rem;
  }

  .raid-members-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* On mobile, make preview collapsible to prioritize agent selection */
  .raid-preview-summary {
    display: flex;
  }

  .raid-preview-panel h4 {
    display: none;
  }
}

.raid-members-grid::-webkit-scrollbar {
  width: 8px;
}

.raid-members-grid::-webkit-scrollbar-track {
  background: rgba(0, 229, 255, 0.05);
  border-radius: 4px;
}

.raid-members-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 4px;
}

.raid-members-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

.raid-participant-card {
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  min-height: 200px;
}

.raid-participant-card:hover {
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.08);
}

.raid-participant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 229, 255, 0.1);
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  user-select: none;
}

.raid-member-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.raid-member-info strong {
  color: #e0f7ff;
  font-weight: 600;
  font-size: 0.95rem;
}

.raid-member-info small {
  color: rgba(224, 247, 255, 0.6);
  font-size: 0.8rem;
}

.raid-member-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.agents-selected {
  background: rgba(76, 175, 80, 0.3);
  color: #4caf50;
  border-radius: 10px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.expand-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  color: rgba(0, 229, 255, 0.6);
  font-size: 0.75rem;
}

.expand-icon.expanded {
  transform: rotate(180deg);
}

.raid-agents-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.raid-agents-list::-webkit-scrollbar {
  width: 6px;
}

.raid-agents-list::-webkit-scrollbar-track {
  background: transparent;
}

.raid-agents-list::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.2);
  border-radius: 3px;
}

.raid-agent-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.raid-agent-item:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.4);
}

.raid-agent-item.selected {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
}

.raid-agent-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #4caf50;
}

.agent-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.agent-name {
  color: #e0f7ff;
  font-weight: 500;
  font-size: 0.9rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-level {
  color: rgba(224, 247, 255, 0.6);
  font-size: 0.8rem;
  white-space: nowrap;
}

.raid-agent-unavailable {
  padding: 1rem;
  text-align: center;
  color: rgba(224, 247, 255, 0.5);
  font-style: italic;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin: 0.75rem 1rem;
}

/* Raid Preview Panel */
.raid-preview-details {
  margin-top: 1rem;
}

.raid-preview-summary {
  display: none;
  list-style: none;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  align-items: center;
  gap: 0.75rem;
  color: rgba(224, 247, 255, 0.85);
}

.raid-preview-summary::-webkit-details-marker {
  display: none;
}

.raid-preview-summary-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #00e5ff;
  font-weight: 700;
}

.raid-preview-summary-meta {
  margin-left: auto;
  font-size: 0.85rem;
  color: rgba(224, 247, 255, 0.7);
}

.raid-preview-details[open] > .raid-preview-summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.raid-preview-details[open] > .raid-preview-panel {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.raid-preview-panel {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(0, 147, 233, 0.04));
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
}

.raid-preview-panel h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #00e5ff;
}

.raid-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.raid-preview-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.raid-preview-stat span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.5);
}

.raid-preview-stat strong {
  font-size: 1rem;
  color: #e0f7ff;
}

.raid-preview-stat strong.positive {
  color: #4caf50;
}

.raid-preview-loot {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.raid-preview-loot > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.raid-preview-loot span {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.raid-preview-loot strong.credits {
  font-size: 1.1rem;
  color: #00e5ff;
}

.raid-preview-loot strong.data {
  font-size: 1.1rem;
  color: #ff9800;
}

.raid-preview-hint {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  margin: 0;
}

/* Raid Result Modal */
.raid-result-modal {
  max-width: 400px;
  text-align: center;
}

.raid-result-header h3 {
  color: #4caf50;
  font-size: 1.5rem;
  margin: 0 0 1rem 0;
}

.raid-result-modal .raid-result-header h3:has(+ .raid-result-target) {
  color: #4caf50;
}

.raid-result-target {
  margin-bottom: 1.5rem;
}

.raid-result-target span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.25rem;
}

.raid-result-target strong {
  font-size: 1.25rem;
  color: #e0f7ff;
}

.raid-result-loot {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.raid-result-loot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
}

.raid-result-loot-item span {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.25rem;
}

.raid-result-loot-item.credits strong {
  font-size: 1.5rem;
  color: #00e5ff;
}

.raid-result-loot-item.data strong {
  font-size: 1.5rem;
  color: #ff9800;
}

.raid-result-heat {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: #4caf50;
}

.raid-result-heat span {
  font-size: 0.8rem;
}

.raid-result-heat strong {
  font-size: 1.1rem;
}

.raid-result-summary {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
  font-style: italic;
}

@media (max-width: 480px) {
  .raid-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .raid-result-loot {
    flex-direction: column;
    gap: 0.75rem;
  }
}
/* Inline error banner */
.inline-error-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(153, 27, 27, 0.15) 100%);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: slideInError 0.3s ease-out;
}

.inline-error-banner span:first-child {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.inline-error-banner button {
  transition: opacity 0.2s;
}

.inline-error-banner button:hover {
  opacity: 0.7;
}

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

/* Sabotage Panel Styles */
.sabotage-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.sabotage-panel h2 {
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  margin-bottom: 20px;
  font-size: 2em;
  text-align: center;
}

.sabotage-panel h3 {
  color: #ff0080;
  text-shadow: 0 0 8px rgba(255, 0, 128, 0.5);
  margin: 20px 0 15px;
  font-size: 1.5em;
  border-bottom: 2px solid rgba(255, 0, 128, 0.3);
  padding-bottom: 10px;
}

/* Message and Warning */
.sabotage-panel .message {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid #00ffff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
  animation: pulse 2s infinite;
}

.sabotage-panel .warning {
  background: rgba(255, 0, 80, 0.1);
  border: 1px solid #ff0050;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

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

/* PvP Toggle Section */
.pvp-toggle-section {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1) 0%, rgba(75, 0, 130, 0.1) 100%);
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.pvp-toggle-section p {
  color: #bbb;
  margin: 10px 0;
}

.pvp-toggle-section button {
  background: linear-gradient(135deg, #8a2be2 0%, #4b0082 100%);
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin: 10px auto;
  display: block;
}

.pvp-toggle-section button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.pvp-toggle-section button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pvp-status {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  text-align: center;
}

/* Defense Section */
.defense-toggle {
  margin: 20px 0;
  text-align: center;
}

.defense-toggle button {
  background: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
  border: none;
  padding: 10px 25px;
  border-radius: 8px;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.defense-toggle button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
}

.defense-section {
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.defense-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.defense-stats > div {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid #00ffff;
}

.defense-subtext {
  opacity: 0.85;
  margin-top: 6px;
  font-size: 0.95em;
}

.defense-agents-list {
  display: grid;
  gap: 10px;
}

.defense-agent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #00ffff;
}

.defense-agent-main {
  min-width: 0;
}

.defense-agent-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.defense-agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 0.85;
  margin-top: 6px;
  font-size: 0.9em;
}

.defense-agent-btn {
  white-space: nowrap;
}

/* Sabotage Types */
.config-section {
  background: rgba(255, 0, 128, 0.05);
  border: 1px solid rgba(255, 0, 128, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.sabotage-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.type-card {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(40, 0, 60, 0.4) 100%);
  border: 2px solid rgba(255, 0, 128, 0.3);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 128, 0.2), transparent);
  transition: left 0.5s;
}

.type-card:hover::before {
  left: 100%;
}

.type-card:hover {
  transform: translateY(-5px);
  border-color: #ff0080;
  box-shadow: 0 8px 25px rgba(255, 0, 128, 0.4);
}

.type-card.selected {
  border-color: #00ffff;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 128, 255, 0.1) 100%);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.type-card h4 {
  color: #ff0080;
  margin: 0 0 15px 0;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.type-card.selected h4 {
  color: #00ffff;
}

.type-costs, .type-duration, .type-effect {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 0.95em;
}

.victim-effects {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.victim-effects > div {
  background: rgba(255, 0, 80, 0.1);
  padding: 8px;
  border-radius: 4px;
  margin: 5px 0;
  font-size: 0.9em;
}

.attacker-penalties {
  margin-top: 10px;
  padding: 8px;
  background: rgba(255, 165, 0, 0.1);
  border-radius: 4px;
}

.attacker-penalties small {
  color: #ffa500;
  font-size: 0.85em;
}

.config-limits {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin-top: 15px;
}

.config-limits > div {
  padding: 10px 20px;
  background: rgba(138, 43, 226, 0.2);
  border-radius: 6px;
}

/* Initiate Section */
.initiate-section {
  background: linear-gradient(135deg, rgba(0, 255, 0, 0.05) 0%, rgba(0, 128, 0, 0.05) 100%);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.initiate-form {
  margin-top: 15px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #4ade80;
  margin-bottom: 8px;
  font-weight: bold;
}

.form-group select {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 50, 0, 0.5) 100%);
  border: 2px solid rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  color: #4ade80;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.form-group select:hover {
  border-color: rgba(74, 222, 128, 0.6);
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.form-group select:focus {
  outline: none;
  border-color: #4ade80;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 80, 0, 0.6) 100%);
}

.form-group select option {
  background: #1a1a1a;
  color: #4ade80;
  padding: 10px;
}

.form-group select option:hover {
  background: rgba(74, 222, 128, 0.2);
}

.form-group select option:disabled {
  color: #666;
  background: #0a0a0a;
}

.agent-selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(74, 222, 128, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.agent-picker-hint {
  color: #86efac;
  font-size: 0.9em;
  margin: 0;
}

.agent-team-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 16px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 6px;
  color: #4ade80;
  font-size: 0.95em;
  font-weight: 600;
}

.agent-team-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.agent-picker .agent-multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.agent-card {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 40, 0, 0.4) 100%);
  border: 2px solid rgba(74, 222, 128, 0.3);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.agent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.1), transparent);
  transition: left 0.5s;
}

.agent-card:hover::before {
  left: 100%;
}

.agent-card:hover {
  border-color: rgba(74, 222, 128, 0.6);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(74, 222, 128, 0.3);
}

.agent-card.selected {
  border-color: #4ade80;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(34, 197, 94, 0.15) 100%);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(74, 222, 128, 0.2);
}

.agent-card-header input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #4ade80;
}

.agent-card-name {
  flex: 1;
  font-weight: 700;
  font-size: 1.1em;
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

.agent-card-level {
  padding: 4px 10px;
  background: rgba(74, 222, 128, 0.2);
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.agent-card-skills {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin-bottom: 12px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  flex: 1;
}

.skill-icon {
  font-size: 1.2em;
  filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.3));
}

.skill-value {
  font-weight: 700;
  font-size: 1.1em;
  color: #4ade80;
}

.agent-card-status {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.status-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.available {
  background: rgba(74, 222, 128, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.5);
  color: #4ade80;
}

.agent-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 0, 0, 0.05);
  border: 2px dashed rgba(255, 0, 0, 0.3);
  border-radius: 12px;
  color: #ff6b6b;
}

.empty-icon {
  font-size: 3em;
  margin-bottom: 16px;
  opacity: 0.5;
}

.agent-empty div:nth-child(2) {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ff8888;
}

.agent-empty small {
  display: block;
  color: #cc6666;
  font-size: 0.9em;
}

.initiate-form button {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  color: #000;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.initiate-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 222, 128, 0.4);
}

.initiate-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Tables */
.targets-table, .sabotages-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.targets-table thead, .sabotages-table thead {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.3) 0%, rgba(75, 0, 130, 0.3) 100%);
}

.targets-table th, .sabotages-table th {
  padding: 15px;
  text-align: left;
  color: #00ffff;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 1px;
}

.targets-table td, .sabotages-table td {
  padding: 12px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.targets-table tbody tr, .sabotages-table tbody tr {
  transition: all 0.3s;
}

.targets-table tbody tr:hover, .sabotages-table tbody tr:hover {
  background: rgba(138, 43, 226, 0.1);
  transform: scale(1.01);
}

.targets-table tbody tr.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.targets-table tbody tr.disabled:hover {
  background: transparent;
  transform: none;
}

/* Sections */
.targets-section, .initiated-section, .received-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .sabotage-types {
    grid-template-columns: 1fr;
  }
  
  .defense-stats {
    grid-template-columns: 1fr;
  }
  
  .config-limits {
    flex-direction: column;
    gap: 10px;
  }
  
  .targets-table, .sabotages-table {
    font-size: 0.85em;
  }
  
  .targets-table th, .sabotages-table th,
  .targets-table td, .sabotages-table td {
    padding: 8px;
  }
}

/* History Section */
.history-section {
  background: rgba(138, 43, 226, 0.05);
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.history-toggle {
  margin: 20px 0;
  text-align: center;
}

.history-toggle button {
  background: linear-gradient(135deg, #8a2be2 0%, #4b0082 100%);
  border: none;
  padding: 10px 25px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.history-toggle button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.history-table-wrapper {
  overflow-x: auto;
  margin-top: 15px;
  border-radius: 8px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
}

.history-table thead {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.3) 0%, rgba(75, 0, 130, 0.3) 100%);
}

.history-table th {
  padding: 15px 10px;
  text-align: left;
  color: #00ffff;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-table td {
  padding: 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 15%;
  min-width: 120px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 12%;
  min-width: 100px;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3),
.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: 15%;
  min-width: 100px;
}

.history-table th:nth-child(5),
.history-table td:nth-child(5) {
  width: 13%;
  min-width: 100px;
}

.history-table th:nth-child(6),
.history-table td:nth-child(6) {
  width: 10%;
  min-width: 80px;
}

.history-table th:nth-child(7),
.history-table td:nth-child(7) {
  width: 20%;
}

.history-table tbody tr {
  transition: all 0.3s;
}

.history-table tbody tr:hover {
  background: rgba(138, 43, 226, 0.1);
}

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-style: italic;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 50px;
  color: #00ffff;
  font-size: 1.5em;
  animation: pulse 2s infinite;
}
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.marketplace-item-card {
  background: rgba(30, 35, 50, 0.9);
  border: 2px solid;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.marketplace-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.marketplace-badge {
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  color: #ecf0f1;
}

.marketplace-badge--owned {
  border-color: rgba(39, 174, 96, 0.8);
  color: #2ecc71;
}

.marketplace-badge--locked {
  border-color: rgba(231, 76, 60, 0.6);
  color: #e74c3c;
}

.marketplace-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.marketplace-effect {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.marketplace-effect-label {
  color: #95a5a6;
  font-size: 0.9rem;
  font-weight: 600;
}

.marketplace-effect-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.marketplace-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.marketplace-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.marketplace-stat-label {
  color: #95a5a6;
  font-size: 0.85rem;
}

.marketplace-stat-value {
  color: #ecf0f1;
  font-weight: 600;
  font-size: 0.95rem;
}

.marketplace-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.marketplace-progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.marketplace-purchase-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.marketplace-purchase-btn:not(:disabled):hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.marketplace-purchase-btn:disabled {
  opacity: 0.6;
}

/* Light theme overrides */
body.theme-light .marketplace-item-card {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.25);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}
body.theme-light .marketplace-badge {
  background: rgba(2, 6, 23, 0.04);
  border-color: rgba(100, 116, 139, 0.25);
  color: #334155;
}
body.theme-light .marketplace-effect,
body.theme-light .marketplace-stats {
  background: rgba(241, 245, 249, 0.8);
}
body.theme-light .marketplace-effect-label,
body.theme-light .marketplace-stat-label { color: #64748b; }
body.theme-light .marketplace-stat-value { color: #0f172a; }
body.theme-light .marketplace-progress-bar { background: rgba(100, 116, 139, 0.2); }
.boosts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.boost-card {
  background: rgba(30, 35, 50, 0.9);
  border: 2px solid;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.boost-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.boost-active-card {
  background: rgba(46, 204, 113, 0.1);
  border: 2px solid;
  border-radius: 12px;
  padding: 1.25rem;
  animation: boost-pulse 2s ease-in-out infinite;
}

@keyframes boost-pulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
  }
}

.boost-timer {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 2px solid;
  background: rgba(0, 0, 0, 0.3);
  font-family: "Courier New", monospace;
}

.boost-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.boost-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.boost-stat-label {
  color: #95a5a6;
  font-size: 0.9rem;
}

.boost-stat-value {
  color: #ecf0f1;
  font-weight: 600;
  font-size: 1rem;
}

.boost-purchase-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.boost-purchase-btn:not(:disabled):hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.boost-purchase-btn:disabled {
  opacity: 0.6;
}
.package-trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-top: 18px;
  padding: 8px 0 0 0;
  border-top: 1.5px solid rgba(0,255,255,0.10);
}
.trust-icon {
  font-size: 1.3em;
  color: #22c55e;
  filter: drop-shadow(0 0 6px #22c55e44);
}
.trust-text {
  color: #4ade80;
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px #22c55e22;
}
/* Store Panel Styles */
.store-panel {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.store-header {
  text-align: center;
  margin-bottom: 40px;
}

.store-header h2 {
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  font-size: 2.5em;
  margin-bottom: 10px;
}

.store-subtitle {
  color: #bbb;
  font-size: 1.1em;
  margin-bottom: 20px;
}

.store-notice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255, 165, 0, 0.1);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 8px;
  color: #ffa500;
  font-size: 0.9em;
}

.notice-icon {
  font-size: 1.2em;
}

/* Messages */
.store-message {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

.store-message.success {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid #4caf50;
  color: #4caf50;
}

.store-message.error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
}

.wasted-resources {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9em;
}

.wasted-resources > span:first-child {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.wasted-resources > div {
  margin: 4px 0;
}

/* Packages Grid */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.package-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 50%, rgba(34, 197, 94, 0.08) 100%);
  border: 2px solid rgba(34, 197, 94, 0.25);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(34, 197, 94, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.package-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.package-card:hover::before {
  left: 100%;
}

.package-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 20px 60px rgba(34, 197, 94, 0.25), 0 0 0 1px rgba(34, 197, 94, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(15, 23, 42, 1) 0%, rgba(30, 41, 59, 1) 50%, rgba(34, 197, 94, 0.15) 100%);
}

.package-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(34, 197, 94, 0.15);
  padding-bottom: 1rem;
}

.package-header h3 {
  color: #4ade80;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
  letter-spacing: 0.02em;
}

.package-description {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
}

.package-contents {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
  flex: 1;
}

.content-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.5) 100%);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.content-item:hover {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.7) 100%);
  transform: translateX(4px);
  border-color: rgba(148, 163, 184, 0.2);
}

.content-item.credits {
  border-left: 4px solid #facc15;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.05) 0%, rgba(15, 23, 42, 0.7) 30%);
}

.content-item.data {
  border-left: 4px solid #a855f7;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(15, 23, 42, 0.7) 30%);
}

.content-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.2));
  line-height: 1;
}

.content-amount {
  font-size: 2rem;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.25);
  letter-spacing: -0.02em;
}

.content-label {
  font-size: 0.85rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: auto;
  font-weight: 600;
}

.storage-warning {
  background: rgba(255, 165, 0, 0.1);
  border: 1px solid rgba(255, 165, 0, 0.5);
  border-radius: 8px;
  padding: 12px;
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.storage-warning .warning-icon {
  font-size: 1.2em;
  margin-right: 8px;
}

.storage-warning span:first-child {
  color: #ffa500;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.storage-warning small {
  color: #ffb84d;
  font-size: 0.85em;
  margin-left: 28px;
}

.package-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(34, 197, 94, 0.15);
  gap: 1rem;
}

.package-price {
  font-size: 2.25rem;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 2px 16px rgba(74, 222, 128, 0.4);
  letter-spacing: -0.02em;
  line-height: 1;
}

.purchase-button {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  color: #0f172a;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.purchase-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.purchase-button:hover::before {
  left: 100%;
}

.purchase-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(74, 222, 128, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.purchase-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.purchase-button:disabled::before {
  display: none;
}

.package-requirements {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85em;
  color: #aaa;
}

/* Empty State */
.no-packages {
  text-align: center;
  padding: 60px 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  margin-top: 40px;
}

.no-packages .empty-icon {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-packages p {
  color: #888;
  font-size: 1.1em;
}

/* Loading State */
.store-panel.loading {
  text-align: center;
  padding: 100px 20px;
  color: #00ffff;
  font-size: 1.5em;
  animation: pulse 2s infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .packages-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .store-header h2 {
    font-size: 2em;
  }

  .package-footer {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .purchase-button {
    width: 100%;
  }

  .package-requirements {
    flex-direction: column;
    gap: 8px;
  }
}

/* Light theme overrides */
body.theme-light .store-subtitle { color: #475569; }
body.theme-light .store-notice {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #b45309;
}
body.theme-light .wasted-resources { border-top-color: rgba(100, 116, 139, 0.2); }
body.theme-light .package-card {
  background: linear-gradient(145deg, #ffffff 0%, #ffffff 50%, rgba(34, 197, 94, 0.05) 100%);
  border-color: rgba(34, 197, 94, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
body.theme-light .package-header { border-bottom-color: rgba(34, 197, 94, 0.15); }
body.theme-light .package-description { color: #475569; }
body.theme-light .content-item {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.7) 0%, rgba(226, 232, 240, 0.5) 100%);
  border-color: rgba(100, 116, 139, 0.2);
}
body.theme-light .content-amount { color: #0f172a; text-shadow: none; }
body.theme-light .content-label { color: #64748b; }
body.theme-light .package-footer { border-top-color: rgba(34, 197, 94, 0.15); }
body.theme-light .no-packages {
  background: rgba(2, 6, 23, 0.05);
  border-color: rgba(100, 116, 139, 0.2);
}
.quests-panel {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  animation: panelFadeIn 0.4s ease-out;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

.quests-header h2 {
  font-size: 32px;
  font-weight: bold;
  background: linear-gradient(135deg, #00ffff, #00aaff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  margin: 0;
}

.refresh-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #00ffff, #00aaff);
  border: none;
  border-radius: 8px;
  color: #0a0a0a;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.refresh-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.5);
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quests-filters {
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.6), rgba(40, 20, 60, 0.6));
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  display: block;
  color: #00ffff;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  color: #00ffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.filter-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: rgba(0, 255, 255, 0.6);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.3), rgba(0, 170, 255, 0.3));
  border-color: #00ffff;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
}

.quests-summary {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.5), rgba(40, 20, 60, 0.5));
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.summary-label {
  color: #00ffff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

.summary-value {
  font-size: 28px;
  font-weight: bold;
  color: #ffffff;
}

.summary-value.completed {
  color: #00ff00;
  text-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

.summary-value.claimed {
  color: #ffaa00;
  text-shadow: 0 0 8px rgba(255, 170, 0, 0.6);
}

.quests-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.quest-section h3 {
  font-size: 24px;
  color: #00ffff;
  margin-bottom: 16px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.quests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.quest-card {
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.8), rgba(40, 20, 60, 0.8));
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.quest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00ffff, #00aaff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quest-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(0, 255, 255, 0.3);
}

.quest-card:hover::before {
  opacity: 1;
}

.quest-card.quest-completed {
  border-color: rgba(0, 255, 0, 0.5);
  animation: questPulse 2s ease-in-out infinite;
}

.quest-card.quest-completed::before {
  background: linear-gradient(90deg, #00ff00, #00ff88);
  opacity: 1;
}

@keyframes questPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.6);
  }
}

.quest-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.quest-type-icon,
.quest-category-icon {
  font-size: 24px;
}

.quest-difficulty {
  margin-left: auto;
  font-size: 14px;
}

.quest-name {
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  margin: 0 0 8px 0;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.quest-description {
  font-size: 14px;
  color: #cccccc;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.quest-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 170, 0, 0.2);
  border: 1px solid rgba(255, 170, 0, 0.4);
  border-radius: 8px;
  color: #ffaa00;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 12px;
}

.quest-progress {
  margin: 16px 0;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 255, 0.3);
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #00aaff);
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.progress-fill.completed {
  background: linear-gradient(90deg, #00ff00, #00ff88);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
}

.progress-text {
  display: block;
  text-align: center;
  color: #00ffff;
  font-size: 13px;
  font-weight: bold;
}

.quest-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.reward-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
}

.claim-btn {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  background: linear-gradient(135deg, #00ff00, #00ff88);
  border: none;
  border-radius: 8px;
  color: #0a0a0a;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.claim-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 255, 0, 0.5);
}

.claim-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.no-quests {
  text-align: center;
  padding: 60px 20px;
  color: #888888;
  font-size: 18px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .quests-panel {
    padding: 12px;
  }

  .quests-header h2 {
    font-size: 24px;
  }

  .quests-grid {
    grid-template-columns: 1fr;
  }

  .quests-summary {
    flex-direction: column;
    gap: 12px;
  }

  .filter-buttons {
    gap: 8px;
  }

  .filter-btn {
    flex: 1;
    min-width: 100px;
  }
}
/* Achievements Panel Styles */

.achievements-panel {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.achievements-header {
  margin-bottom: 30px;
}

.achievements-header h2 {
  font-size: 32px;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.achievements-progress-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 153, 204, 0.1) 100%);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.progress-text {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
  min-width: 140px;
}

.progress-bar-container {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4ff 0%, #0099cc 100%);
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.progress-percentage {
  font-size: 18px;
  font-weight: 700;
  color: #00d4ff;
  min-width: 60px;
  text-align: right;
}

/* Categories */
.achievements-categories {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #b0b0b0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 600;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
}

.category-btn.active {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 153, 204, 0.2) 100%);
  border-color: #00d4ff;
  color: #00d4ff;
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.category-icon {
  font-size: 20px;
}

.category-name {
  flex: 1;
}

.category-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.achievement-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.achievement-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.achievement-card.locked {
  opacity: 0.6;
  filter: grayscale(0.5);
}

.achievement-card.unlocked {
  animation: achievementUnlock 0.6s ease-out;
}

@keyframes achievementUnlock {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.achievement-icon {
  font-size: 48px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  flex-shrink: 0;
  position: relative;
}

.achievement-checkmark {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  background: #00d4ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.5);
  animation: checkmarkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.achievement-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.achievement-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  flex: 1;
}

.achievement-tier {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.achievement-description {
  font-size: 14px;
  color: #b0b0b0;
  margin: 0;
  line-height: 1.5;
}

.achievement-progress {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.achievement-progress .progress-bar-container {
  height: 8px;
  flex: 1;
}

.achievement-progress .progress-text {
  font-size: 13px;
  min-width: auto;
  color: #888;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .achievements-panel {
    padding: 16px;
  }

  .achievements-header h2 {
    font-size: 24px;
  }

  .achievements-categories {
    gap: 8px;
  }

  .category-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .category-icon {
    font-size: 18px;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .achievement-card {
    padding: 16px;
  }

  .achievement-icon {
    font-size: 40px;
    width: 56px;
    height: 56px;
  }

  .achievement-name {
    font-size: 16px;
  }

  .achievement-description {
    font-size: 13px;
  }
}
/* Enhanced Logs Panel Styles */

.enhanced-logs-panel {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.logs-header h2 {
  font-size: 28px;
  margin: 0;
  color: #fff;
}

.mark-all-read-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mark-all-read-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

/* Filters */
.logs-filters {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-section label {
  font-size: 14px;
  font-weight: 600;
  color: #b0b0b0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #b0b0b0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 153, 204, 0.2) 100%);
  border-color: #00d4ff;
  color: #00d4ff;
}

.filter-icon {
  font-size: 16px;
}

.filter-name {
  font-weight: 600;
}

.filter-count {
  font-size: 11px;
  opacity: 0.7;
}

.importance-btn.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Logs List */
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.no-logs {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.no-logs-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-logs p {
  font-size: 16px;
  margin: 0;
}

/* Log Entry */
.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.log-entry::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #888;
  transition: background 0.2s ease;
}

.log-entry.log-high::before {
  background: linear-gradient(180deg, #ff6b6b 0%, #ff4757 100%);
}

.log-entry.log-medium::before {
  background: linear-gradient(180deg, #ffa500 0%, #ff8c00 100%);
}

.log-entry.log-low::before {
  background: linear-gradient(180deg, #51cf66 0%, #37b24d 100%);
}

.log-entry:hover {
  background: linear-gradient(135deg, #1e1e3f 0%, #1a2a4e 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.log-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  flex-shrink: 0;
}

.log-content {
  flex: 1;
  min-width: 0;
}

.log-message {
  font-size: 15px;
  color: #e0e0e0;
  line-height: 1.5;
  margin-bottom: 8px;
  word-wrap: break-word;
}

.log-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.log-timestamp {
  font-size: 12px;
  color: #888;
}

.log-category-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
  border-radius: 4px;
}

.log-importance-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}

.importance-high {
  background: #ff6b6b;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}

.importance-medium {
  background: #ffa500;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.6);
}

.importance-low {
  background: #51cf66;
  box-shadow: 0 0 10px rgba(81, 207, 102, 0.6);
}

/* Footer */
.logs-footer {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  color: #888;
  font-size: 14px;
  font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .enhanced-logs-panel {
    padding: 16px;
  }

  .logs-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .logs-header h2 {
    font-size: 24px;
  }

  .logs-filters {
    padding: 16px;
  }

  .filter-buttons {
    gap: 6px;
  }

  .filter-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .filter-icon {
    font-size: 14px;
  }

  .log-entry {
    padding: 12px;
    gap: 12px;
  }

  .log-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
  }

  .log-message {
    font-size: 14px;
  }

  .log-meta {
    gap: 8px;
  }
}
.pvp-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.95) 0%, rgba(20, 45, 75, 0.9) 100%);
  border: 1px solid rgba(100, 200, 255, 0.3);
  border-radius: 12px;
  color: #e0e0ff;
}

/* Header */
.pvp-header {
  text-align: center;
  border-bottom: 2px solid rgba(100, 200, 255, 0.2);
  padding-bottom: 1rem;
}

.pvp-header h2 {
  font-size: 1.8rem;
  color: #64c8ff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pvp-subtitle {
  color: #a0a0d0;
  margin: 0.5rem 0 0 0;
  font-size: 0.95rem;
}

.pvp-reputation-note {
  color: #fbbf24;
  margin: 0.75rem 0 0 0;
  font-size: 0.85rem;
  padding: 8px 14px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  display: inline-block;
}

/* Player Stats Bar */
.player-stats-bar {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background: rgba(30, 60, 100, 0.5);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-item .label {
  color: #a0a0d0;
  font-weight: 500;
}

.stat-item .value {
  color: #64c8ff;
  font-weight: bold;
  font-size: 1.1rem;
}

/* Error Banner */
.error-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.5);
  border-radius: 8px;
  color: #ff7f7f;
}

.error-banner p {
  margin: 0;
  flex: 1;
}

.error-banner .close-btn {
  background: none;
  border: none;
  color: #ff7f7f;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
}

/* Tabs */
.pvp-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(20, 40, 60, 0.5);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(100, 200, 255, 0.15);
}

.tab-button {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(100, 200, 255, 0.1);
  border: 1px solid rgba(100, 200, 255, 0.2);
  color: #a0a0d0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 500;
}

.tab-button:hover {
  background: rgba(100, 200, 255, 0.2);
  color: #64c8ff;
}

.tab-button.active {
  background: rgba(100, 200, 255, 0.3);
  color: #64c8ff;
  border-color: rgba(100, 200, 255, 0.5);
}

/* Content Area */
.pvp-content {
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.no-data {
  text-align: center;
  color: #a0a0d0;
  padding: 2rem;
  font-size: 1.1rem;
}

/* Find Opponent Section */
.find-opponent-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-box {
  display: flex;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(30, 60, 100, 0.8);
  border: 1px solid rgba(100, 200, 255, 0.3);
  border-radius: 8px;
  color: #e0e0ff;
  font-size: 1rem;
}

.search-input::placeholder {
  color: #707090;
}

.search-input:focus {
  outline: none;
  border-color: rgba(100, 200, 255, 0.7);
  background: rgba(30, 60, 100, 1);
}

/* Search Results */
.search-results {
  display: grid;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(40, 70, 110, 0.6);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.player-card:hover {
  background: rgba(40, 70, 110, 0.9);
  border-color: rgba(100, 200, 255, 0.4);
}

.player-info h4 {
  margin: 0 0 0.25rem 0;
  color: #64c8ff;
}

.player-meta {
  margin: 0;
  color: #a0a0d0;
  font-size: 0.9rem;
}

.challenge-btn {
  padding: 0.5rem 1rem;
  background: rgba(100, 200, 255, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.4);
  color: #64c8ff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.challenge-btn:hover {
  background: rgba(100, 200, 255, 0.4);
  border-color: rgba(100, 200, 255, 0.7);
}

.challenge-btn.disabled,
.challenge-btn.invited {
  background: rgba(100, 100, 100, 0.2);
  border-color: rgba(100, 100, 100, 0.4);
  color: #888;
  cursor: not-allowed;
}

.challenge-btn.invited:hover {
  background: rgba(100, 100, 100, 0.2);
  border-color: rgba(100, 100, 100, 0.4);
}

/* Sent Invitations */
.sent-invitations {
  padding: 1rem;
  background: rgba(80, 130, 50, 0.3);
  border: 1px solid rgba(100, 255, 100, 0.2);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.sent-invitations h3 {
  margin: 0 0 1rem 0;
  color: #7cfc00;
}

.invitation-card.sent {
  background: rgba(50, 80, 40, 0.6);
  border-color: rgba(100, 255, 100, 0.2);
}

.waiting-text {
  color: #7cfc00;
  font-size: 0.8rem;
  font-style: italic;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Success message */
.pvp-message.success {
  background: rgba(50, 100, 50, 0.9);
  border: 1px solid rgba(100, 255, 100, 0.4);
}

.pvp-message.success p {
  color: #7cfc00;
}

/* Pending Invitations */
.pending-invitations {
  padding: 1rem;
  background: rgba(50, 80, 130, 0.5);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
}

.pending-invitations h3 {
  margin: 0 0 1rem 0;
  color: #64c8ff;
}

.your-resources {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(30, 60, 100, 0.8);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.your-resources .resource-label {
  color: #a0c4e8;
  font-weight: 500;
}

.your-resources .resource-item {
  font-weight: 600;
}

.your-resources .resource-item.credits {
  color: #fbbf24;
}

.your-resources .resource-item.data {
  color: #a78bfa;
}

.invitation-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(30, 60, 100, 0.8);
  border: 1px solid rgba(100, 200, 255, 0.15);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.invitation-info h4 {
  margin: 0 0 0.25rem 0;
  color: #64c8ff;
}

.game-type {
  color: #64c8ff;
  margin: 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.bet-info {
  color: #a0a0d0;
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
}

.invitation-actions {
  display: flex;
  gap: 0.5rem;
}

.accept-btn,
.decline-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.accept-btn {
  background: rgba(100, 255, 100, 0.2);
  color: #64ff64;
}

.accept-btn:hover:not(:disabled) {
  background: rgba(100, 255, 100, 0.4);
}

.decline-btn {
  background: rgba(255, 100, 100, 0.2);
  color: #ff7f7f;
}

.decline-btn:hover:not(:disabled) {
  background: rgba(255, 100, 100, 0.4);
}

/* Active Matches Section */
.active-matches-section {
  display: grid;
  gap: 0.75rem;
}

.match-card {
  padding: 1rem;
  background: rgba(40, 70, 110, 0.6);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.match-card:hover {
  background: rgba(40, 70, 110, 0.9);
  border-color: rgba(100, 200, 255, 0.4);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.match-header h4 {
  margin: 0;
  color: #64c8ff;
}

.status {
  padding: 0.25rem 0.75rem;
  background: rgba(100, 200, 255, 0.2);
  border-radius: 4px;
  font-size: 0.8rem;
  color: #64c8ff;
}

.play-btn {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.75rem;
  background: rgba(100, 200, 255, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.4);
  color: #64c8ff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.play-btn:hover {
  background: rgba(100, 200, 255, 0.4);
  border-color: rgba(100, 200, 255, 0.7);
}

/* History Section */
.history-section {
  display: grid;
  gap: 0.75rem;
}

.history-card {
  padding: 1rem;
  background: rgba(40, 70, 110, 0.6);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.match-result {
  min-width: 100px;
}

.result {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
}

.result.won {
  background: rgba(100, 255, 100, 0.2);
  color: #64ff64;
}

.result.lost {
  background: rgba(255, 100, 100, 0.2);
  color: #ff7f7f;
}

/* Stats Section */
.stats-section {
  padding: 2rem;
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  padding: 1.5rem;
  background: rgba(40, 70, 110, 0.6);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.stat-box:hover {
  background: rgba(40, 70, 110, 0.9);
  border-color: rgba(100, 200, 255, 0.4);
}

.stat-box h4 {
  margin: 0 0 0.5rem 0;
  color: #a0a0d0;
}

.big-number {
  margin: 0;
  font-size: 2.5rem;
  color: #64c8ff;
  font-weight: bold;
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.pvp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pvp-game-modal {
  width: 95vw;
  height: 90vh;
  background: rgba(0, 20, 40, 0.95);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 12px;
  overflow: auto;
  padding: 1rem 1.5rem;
}

/* Invitation Popup */
.pvp-modal {
  width: 520px;
  max-width: 92vw;
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.98) 0%, rgba(20, 45, 75, 0.95) 100%);
  border: 2px solid rgba(0, 255, 255, 0.35);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.25s ease;
  text-align: center;
}

.pvp-modal h3 {
  margin: 0 0 0.5rem 0;
  color: #64c8ff;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.pvp-modal p {
  margin: 0.25rem 0;
  color: #c6d6ff;
}

.pvp-modal .invitation-player-resources {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(30, 60, 100, 0.6);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

.pvp-modal .invitation-player-resources .resource-label {
  color: #a0c4e8;
  font-weight: 500;
}

.pvp-modal .invitation-player-resources .resource-item {
  font-weight: 600;
}

.pvp-modal .invitation-player-resources .resource-item.credits {
  color: #fbbf24;
}

.pvp-modal .invitation-player-resources .resource-item.data {
  color: #a78bfa;
}

.pvp-modal .invitation-details {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  text-align: left;
}

.pvp-modal .invitation-details p {
  display: flex;
  justify-content: space-between;
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.pvp-modal .invitation-details strong {
  color: #a0c4e8;
}

.pvp-modal .modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.game-result-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.game-result-modal .result-text {
  margin: 1rem 0 2rem;
}

.close-result-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(0, 255, 255, 0.2);
  border: 2px solid rgba(0, 255, 255, 0.4);
  color: #00ffff;
  border-radius: 8px;
}

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

.bet-dialog {
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.98) 0%, rgba(20, 45, 75, 0.95) 100%);
  border: 2px solid rgba(100, 200, 255, 0.4);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(100, 200, 255, 0.2);
  padding-bottom: 1rem;
}

.dialog-header h3 {
  margin: 0;
  color: #64c8ff;
  font-size: 1.3rem;
}

.dialog-header .close-btn {
  background: none;
  border: none;
  color: #a0a0d0;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  transition: color 0.3s ease;
}

.dialog-header .close-btn:hover {
  color: #64c8ff;
}

/* Form Groups */
.dialog-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  color: #a0a0d0;
  font-weight: 500;
}

.form-control {
  padding: 0.75rem;
  background: rgba(30, 60, 100, 0.8);
  border: 1px solid rgba(100, 200, 255, 0.3);
  border-radius: 6px;
  color: #e0e0ff;
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: rgba(100, 200, 255, 0.7);
  background: rgba(30, 60, 100, 1);
}

.form-control.input-error {
  border-color: #ff6b6b;
  background: rgba(100, 30, 30, 0.8);
}

.game-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-select-wrapper .form-control {
  flex: 1;
}

.game-rules-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
}

.game-rules-info .rules-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.game-rules-info .rules-text {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.4;
}

.form-group small {
  margin-top: 0.25rem;
  color: #707090;
  font-size: 0.85rem;
}

.bet-warning {
  margin-top: 0.5rem;
  color: #ff6b6b;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Dialog Actions */
.dialog-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.cancel-btn,
.send-btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.cancel-btn {
  background: rgba(100, 100, 100, 0.2);
  color: #a0a0d0;
  border: 1px solid rgba(100, 100, 100, 0.4);
}

.cancel-btn:hover {
  background: rgba(100, 100, 100, 0.4);
  color: #e0e0ff;
}

.send-btn {
  background: rgba(100, 200, 255, 0.2);
  color: #64c8ff;
  border: 1px solid rgba(100, 200, 255, 0.4);
}

.send-btn:hover:not(:disabled) {
  background: rgba(100, 200, 255, 0.4);
  border-color: rgba(100, 200, 255, 0.7);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scrollbar Styling */
.search-results::-webkit-scrollbar,
.pending-invitations::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track,
.pending-invitations::-webkit-scrollbar-track {
  background: rgba(30, 60, 100, 0.5);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb,
.pending-invitations::-webkit-scrollbar-thumb {
  background: rgba(100, 200, 255, 0.3);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover,
.pending-invitations::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 200, 255, 0.5);
}
.roulette-game {
  padding: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0, 255, 255, 0.3);
  flex-shrink: 0;
}

.game-header h2 {
  font-size: 1.5rem;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
  flex: 1;
}

.bet-display {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 255, 0.3);
}

.bet-label {
  color: #888;
  font-size: 0.85rem;
}

.bet-value {
  color: #00ffff;
  font-weight: bold;
  font-size: 1rem;
}

.player-status {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-left: 1.5rem;
}

.player-connection {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-dot.connected {
  background: #00ff00;
  box-shadow: 0 0 8px #00ff00;
}

.status-dot.disconnected {
  background: #ff4444;
  box-shadow: 0 0 8px #ff4444;
  animation: none;
}

.status-label {
  color: #ccc;
  font-size: 0.8rem;
}

.revolver-display {
  text-align: center;
  margin: 2rem 0 1.5rem;
  position: relative;
}

.revolver-cylinder {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding: 2rem;
  background: radial-gradient(circle, rgba(60, 60, 60, 0.4) 0%, transparent 70%);
}

.chamber {
  width: 45px;
  height: 45px;
  border: 3px solid rgba(139, 69, 19, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  background: radial-gradient(circle, rgba(40, 40, 40, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chamber::after {
  content: "💥";
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.chamber.active {
  border-color: #ffd700;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, rgba(139, 69, 19, 0.3) 100%);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8), inset 0 0 15px rgba(255, 215, 0, 0.4);
  transform: scale(1.25);
  animation: chamberGlow 1.5s infinite;
}

.chamber.active::after {
  opacity: 0.4;
}

.chamber.fired {
  border-color: rgba(80, 80, 80, 0.4);
  color: #555;
  background: radial-gradient(circle, rgba(30, 30, 30, 0.6) 0%, rgba(10, 10, 10, 0.8) 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes chamberGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 0 10px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.9), inset 0 0 20px rgba(255, 215, 0, 0.5); }
}

.chamber-info p {
  font-size: 0.95rem;
  color: #00ffff;
  margin-top: 0.5rem;
}

.shot-result {
  padding: 0.75rem 1.5rem;
  margin: 1rem 0;
  border-radius: 8px;
  text-align: center;
  animation: slideIn 0.4s ease;
}

.shot-result.survived {
  background: rgba(0, 255, 0, 0.15);
  border: 2px solid rgba(0, 255, 0, 0.5);
}

.shot-result.eliminated {
  background: rgba(255, 0, 0, 0.15);
  border: 2px solid rgba(255, 0, 0, 0.5);
}

.result-icon {
  font-size: 1.5rem;
  display: inline-block;
  margin-right: 0.5rem;
}

.shot-result p {
  font-size: 1rem;
  font-weight: bold;
}

.game-over {
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 12px;
  text-align: center;
  animation: fadeIn 0.8s ease;
}

.game-over.victory {
  background: linear-gradient(135deg, rgba(0, 255, 0, 0.3), rgba(0, 200, 0, 0.2));
  border: 3px solid #0f0;
}

.game-over.defeat {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.3), rgba(200, 0, 0, 0.2));
  border: 3px solid #f00;
}

.game-over h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.game-actions {
  text-align: center;
  margin: 1.5rem 0;
}

.shoot-btn {
  padding: 0.75rem 2.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  background: linear-gradient(135deg, #ff0000, #cc0000);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.shoot-btn::before {
  content: "🎯 ";
}

.shoot-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff3333, #ee0000);
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.6);
}

.shoot-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.waiting-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
}

.waiting-message p {
  font-size: 0.95rem;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ffff;
  animation: pulse 1.5s infinite;
}

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

.shots-history {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  max-height: 180px;
  overflow-y: auto;
  flex-shrink: 0;
}

.shots-history h4 {
  color: #00ffff;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shot-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.85rem;
}

.shot-item .result.survived {
  color: #0f0;
}

.shot-item .result.eliminated {
  color: #ff4444;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.shot-item .result.eliminated {
  color: #f00;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.loader {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 255, 255, 0.2);
  border-top-color: #00ffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* AFK Timer styles */
.afk-timer {
  margin-left: 0.5rem;
  color: #ffcc00;
  font-weight: bold;
  font-size: 0.9rem;
}

.afk-timer.warning {
  color: #ff3333;
  animation: pulse-afk 1s ease-in-out infinite;
}

@keyframes pulse-afk {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.battleship-game {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: hidden;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0, 255, 255, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.game-header h2 {
  font-size: 1.8rem;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
  flex: 1;
}

.bet-display {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
}

.bet-label {
  color: #888;
  font-size: 0.9rem;
}

.bet-value {
  color: #00ffff;
  font-weight: bold;
  font-size: 1.1rem;
}

.player-status {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-left: 2rem;
}

.player-connection {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.9rem;
}

.status-text.online { color: #00ff7f; }
.status-text.offline { color: #ff6b6b; }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-dot.connected {
  background: #00ff00;
  box-shadow: 0 0 10px #00ff00;
}

.status-dot.disconnected {
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444;
  animation: none;
}

.status-label {
  color: #ccc;
}

.setup-phase {
  max-width: 800px;
}

.setup-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.ship-selector {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ship-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  color: #00ffff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ship-btn:hover:not(:disabled) {
  background: rgba(0, 255, 255, 0.2);
  border-color: #00ffff;
  transform: translateY(-2px);
}

.ship-btn.selected {
  background: rgba(0, 255, 255, 0.3);
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.ship-btn.placed {
  background: rgba(0, 255, 0, 0.2);
  border-color: #0f0;
  opacity: 0.7;
  cursor: not-allowed;
}

.orientation-btn {
  align-self: flex-start;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 0, 0.2);
  border: 2px solid rgba(255, 255, 0, 0.5);
  border-radius: 8px;
  color: #ff0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.orientation-btn:hover {
  background: rgba(255, 255, 0, 0.3);
  transform: translateY(-2px);
}

.battleship-board {
  display: inline-block;
  border: 3px solid rgba(0, 255, 255, 0.5);
  background: rgba(0, 30, 60, 0.8);
  padding: 0.5rem;
  border-radius: 8px;
  max-width: 100%;
}

.board-header {
  display: flex;
  margin-left: 0; /* corner-cell occupe la largeur du label de ligne */
  margin-bottom: 4px;
}

.header-cell,
.row-label,
.corner-cell {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a3e4ff;
  font-weight: 700;
  opacity: 0.8;
  box-sizing: border-box;
}

.row-label { }

.board-row {
  display: flex;
}

.board-cell {
  width: 35px;
  height: 35px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.setup-board .board-cell {
  cursor: pointer;
}

.setup-board .board-cell:hover {
  background: rgba(0, 255, 255, 0.1);
}

.setup-board .board-cell.hover {
  background: rgba(0, 255, 0, 0.3);
  border-color: #0f0;
}

.board-cell.ship {
  background: rgba(0, 150, 255, 0.4);
}

.ship-segment {
  width: 80%;
  height: 80%;
  background: linear-gradient(135deg, #0080ff, #0050cc);
  border-radius: 3px;
  border: 1px solid #00aaff;
}

.game-board .board-cell.hit {
  background: #d60000;
  max-width: 100%; /* Ensure the board does not exceed the container width */
}

.game-board .board-cell.miss {
  background: #0b0b0b;
  border-color: #333;
}

.game-board .board-cell.sunk-ship {
  background: repeating-linear-gradient(
    45deg,
    #ff3333,
    #ff3333 4px,
    #cc0000 4px,
    #cc0000 8px
  );
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
  animation: sunk-pulse 1s infinite;
}

.opponent-board .board-cell.targetable {
  cursor: crosshair;
}

.opponent-board .board-cell.targetable:hover {
  background: rgba(255, 255, 0, 0.2);
  border-color: #ff0;
}


.setup-actions {
  margin-top: 2rem;
  text-align: center;
}

.submit-btn {
  padding: 1rem 3rem;
  background: linear-gradient(135deg, #00ff00, #00cc00);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 255, 0, 0.4);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #00ff33, #00ee00);
  flex: 1 1 auto;
  transform: scale(1.05);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.waiting-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 1000;
}

.boards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.board-section {
  text-align: center;
}

.board-section h3 {
  color: #00ffff;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.turn-indicator {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.turn-indicator.active {
  background: rgba(255, 255, 0, 0.2);
  border: 2px solid #ff0;
  color: #ff0;
  font-weight: bold;
}

.ships-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.status-section h4 {
  color: #00ffff;
  margin-bottom: 1rem;
}

.ships-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ship-status {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border-left: 3px solid #00ffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ship-status.sunk {
  border-left-color: #f00;
  color: #f00;
  opacity: 0.6;
}

.ship-status.unknown {
  border-left-color: #888;
  color: #888;
}

.ship-status.active {
  border-left-color: #0f0;
}

.ship-name {
  color: #cdefff;
}

.ship-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.ship-pill.active {
  background: rgba(0, 255, 0, 0.15);
  border: 1px solid rgba(0, 255, 0, 0.5);
  color: #8dff8d;
}
.ship-pill.sunk {
  background: rgba(255, 0, 0, 0.15);
  border: 1px solid rgba(255, 0, 0, 0.5);
  color: #ff8d8d;
}
.ship-pill.unknown {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #cccccc;
}

@media (max-width: 1200px) {
  .boards-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .ships-status {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .game-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .player-status {
    margin-left: 0;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .header-left {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 800px) {
  .header-cell,
  .row-label,
  .corner-cell,
  .board-cell {
    width: 30px;
    height: 30px;
  }
  .battleship-board {
    padding: 0.25rem;
  }
  .boards-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .header-cell,
  .row-label,
  .corner-cell,
  .board-cell {
    width: 26px;
    height: 26px;
  }
}

@keyframes sunk-pulse {
  0%, 100% {
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(255, 51, 51, 0.5);
  }
  50% {
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6), 0 0 8px 2px rgba(255, 51, 51, 0.3);
  }
}
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* AFK Timer styles */
.afk-timer {
  margin-left: 0.5rem;
  color: #ffcc00;
  font-weight: bold;
  font-size: 0.9rem;
}

.afk-timer.warning {
  color: #ff3333;
  animation: pulse-afk 1s ease-in-out infinite;
}

@keyframes pulse-afk {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}.checkers-game {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  width: 100%;
  flex-wrap: wrap;
  gap: 12px;
}

.bet-display {
  font-size: 14px;
}

.turn-indicator {
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 16px;
}

.error-banner {
  margin: 8px 0;
  padding: 8px;
  color: #b00020;
  background: rgba(176, 0, 32, 0.1);
  border-radius: 4px;
}

.board {
  /* Responsive sizing: 8 cells * 11vw ~= 88vw, capped at desktop size */
  --cell-size: min(11vw, 50px);
  display: inline-block;
  border: 2px solid #222;
  margin: 16px 0;
  max-width: 100%;
}

.row {
  display: flex;
}

.checkers-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: calc(var(--cell-size) * 0.48);
  position: relative;
}

.checkers-cell.light {
  background: #f0d9b5;
}

.checkers-cell.dark {
  background: #b58863;
}

.checkers-cell.selected {
  outline: 3px solid #4caf50;
  outline-offset: -3px;
}

.piece {
  width: calc(var(--cell-size) * 0.84);
  height: calc(var(--cell-size) * 0.84);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: calc(var(--cell-size) * 0.40);
  pointer-events: none;
}

.piece.p1 {
  background: linear-gradient(135deg, #333 0%, #555 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.piece.p2 {
  background: linear-gradient(135deg, #eee 0%, #fff 100%);
  color: #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.piece.king {
  border: 2px solid gold;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* Player connection status */
.player-status {
  display: flex;
  gap: 16px;
  margin-left: 16px;
}

.player-connection {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.status-dot.connected {
  background-color: #4caf50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.status-dot.disconnected {
  background-color: #f44336;
  box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
  animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-label {
  color: #aaa;
}

.afk-timer {
  font-size: 14px;
  color: #ffc107;
  margin-left: 8px;
}

.afk-timer.warning {
  color: #f44336;
  font-weight: bold;
  animation: pulse-red 0.5s infinite;
}
.ttt-game {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ttt-game .game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 300px;
  margin-bottom: 16px;
}

.ttt-game .bet-display {
  font-size: 14px;
}

.ttt-game .player-info {
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 300px;
  align-items: center;
}

.ttt-game .round-indicator {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #ffd93d;
  background: rgba(255, 217, 61, 0.1);
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 217, 61, 0.3);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 217, 61, 0.3); }
  50% { box-shadow: 0 0 15px rgba(255, 217, 61, 0.6); }
}

.ttt-game .opponent-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.ttt-game .opponent-status.online {
  background: rgba(0, 200, 0, 0.2);
  color: #00ff00;
}

.ttt-game .opponent-status.offline {
  background: rgba(255, 0, 0, 0.2);
  color: #ff6b6b;
}

.ttt-game .turn-indicator {
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 18px;
}

.ttt-game .error-banner {
  margin: 8px 0;
  padding: 8px;
  color: #b00020;
  background: rgba(176, 0, 32, 0.1);
  border-radius: 4px;
}

.ttt-board {
  display: flex;
  flex-direction: column;
  border: 3px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

.ttt-row {
  display: flex;
}

.ttt-cell {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  background: #1a1a2e;
  border: 1px solid #333;
  transition: background 0.2s;
}

.ttt-cell:hover {
  background: #252545;
}

.ttt-cell.x {
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.ttt-cell.o {
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.ttt-game .afk-timer {
  font-size: 14px;
  color: #ffc107;
  margin-left: 8px;
}

.ttt-game .afk-timer.warning {
  color: #f44336;
  font-weight: bold;
  animation: pulse-afk 0.5s infinite;
}

@keyframes pulse-afk {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.blackjack-game {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 400px;
}

.blackjack-game .game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  margin-bottom: 16px;
}

.blackjack-game .game-header h2 {
  margin: 0;
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.blackjack-game .bet-display {
  font-size: 14px;
  background: rgba(0, 212, 255, 0.1);
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.blackjack-game .turn-indicator {
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 18px;
  color: #ffd93d;
}

.blackjack-game .afk-timer {
  font-size: 14px;
  color: #888;
}

.blackjack-game .afk-timer.warning {
  color: #ff4757;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.blackjack-game .error-banner {
  margin: 8px 0;
  padding: 8px 16px;
  color: #ff4757;
  background: rgba(255, 71, 87, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(255, 71, 87, 0.3);
}

/* Hand containers */
.hand-container {
  margin: 12px 0;
  text-align: center;
}

.hand-label {
  font-size: 14px;
  color: #888;
  margin-bottom: 8px;
}

.hand-value {
  color: #00d4ff;
  font-weight: bold;
}

.bust-label {
  color: #ff4757;
  font-weight: bold;
  animation: shake 0.5s ease-in-out;
}

.stood-label {
  color: #ffd93d;
  font-weight: bold;
}

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

.cards-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Playing cards */
.playing-card {
  width: 70px;
  height: 100px;
  background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 212, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.playing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.3);
}

.playing-card.hidden {
  background: linear-gradient(145deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 2px solid #00d4ff;
}

.playing-card.hidden .card-back {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 36px;
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card-corner.top-left {
  top: 4px;
  left: 6px;
}

.card-corner.bottom-right {
  bottom: 4px;
  right: 6px;
  transform: rotate(180deg);
}

.card-rank {
  font-size: 16px;
  font-weight: bold;
  color: var(--suit-color, #2f3542);
}

.card-suit {
  font-size: 14px;
  color: var(--suit-color, #2f3542);
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.card-suit-large {
  font-size: 32px;
  color: var(--suit-color, #2f3542);
}

/* Table divider */
.table-divider {
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  margin: 16px 0;
}

.table-divider::before,
.table-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), transparent);
}

.divider-text {
  padding: 0 16px;
  color: #888;
  font-size: 14px;
  text-transform: uppercase;
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.action-btn {
  padding: 12px 32px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hit-btn {
  background: linear-gradient(145deg, #00d4ff, #0099cc);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.hit-btn:hover:not(:disabled) {
  background: linear-gradient(145deg, #33ddff, #00aadd);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.stand-btn {
  background: linear-gradient(145deg, #ffd93d, #cc9900);
  color: #000;
  box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
}

.stand-btn:hover:not(:disabled) {
  background: linear-gradient(145deg, #ffe066, #ddaa00);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 217, 61, 0.4);
}

/* Waiting message */
.waiting-message {
  margin-top: 20px;
  padding: 12px 24px;
  background: rgba(255, 217, 61, 0.1);
  border: 1px solid rgba(255, 217, 61, 0.3);
  border-radius: 8px;
  color: #ffd93d;
  animation: pulse 2s infinite;
}

/* Last round summary */
.last-round-summary {
  margin-top: 16px;
  margin-bottom: 8px;
  padding: 16px 24px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(100, 200, 255, 0.2);
  text-align: center;
}

.last-round-header {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.last-round-scores {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.player-final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.player-final-score .score-label {
  font-size: 0.85rem;
  color: #94a3b8;
}

.player-final-score .score-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
}

.player-final-score.bust .score-value {
  color: #ef4444;
}

.vs-separator {
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
}

.last-round-outcome {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
}

.last-round-outcome.won {
  background: rgba(0, 200, 83, 0.15);
  color: #00c853;
}

.last-round-outcome.lost {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.last-round-outcome.draw {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

/* Game result */
.game-result {
  margin-top: 24px;
  padding: 20px 32px;
  border-radius: 12px;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.game-result.won {
  background: linear-gradient(145deg, rgba(0, 200, 83, 0.2), rgba(0, 150, 60, 0.1));
  border: 2px solid #00c853;
  box-shadow: 0 0 30px rgba(0, 200, 83, 0.3);
}

.game-result.lost {
  background: linear-gradient(145deg, rgba(255, 71, 87, 0.2), rgba(200, 50, 60, 0.1));
  border: 2px solid #ff4757;
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.3);
}

.game-result.draw {
  background: linear-gradient(145deg, rgba(255, 217, 61, 0.2), rgba(200, 170, 50, 0.1));
  border: 2px solid #ffd93d;
  box-shadow: 0 0 30px rgba(255, 217, 61, 0.3);
}

.result-text {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
}

.game-result.won .result-text {
  color: #00c853;
}

.game-result.lost .result-text {
  color: #ff4757;
}

.game-result.draw .result-text {
  color: #ffd93d;
}

.result-details {
  font-size: 18px;
  color: #ccc;
}

/* Sections */
.opponent-section {
  background: rgba(255, 71, 87, 0.05);
  border: 1px solid rgba(255, 71, 87, 0.2);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 400px;
}

.player-section {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 400px;
}

/* Round & Score Display */
.round-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.round-indicator {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.score-indicator {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
}

.your-score {
  color: #00d4ff;
}

.opponent-score {
  color: #ff4757;
}

.score-separator {
  color: #666;
  margin: 0 8px;
}

.first-to-win {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

/* Next Round Section */
.next-round-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.round-result-summary {
  font-size: 16px;
  color: #ffd93d;
  margin-bottom: 12px;
  font-weight: 600;
}

.next-round-btn {
  background: linear-gradient(145deg, #00d4ff, #0099cc) !important;
  color: #000 !important;
  font-weight: bold;
  padding: 12px 32px !important;
  font-size: 16px !important;
  animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); }
  50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.8); }
}
.cf-game {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cf-game .game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
  margin-bottom: 16px;
}

.cf-game .bet-display {
  font-size: 14px;
}

.cf-game .turn-indicator {
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 18px;
}

.cf-game .error-banner {
  margin: 8px 0;
  padding: 8px;
  color: #b00020;
  background: rgba(176, 0, 32, 0.1);
  border-radius: 4px;
}

.cf-board {
  display: flex;
  flex-direction: column;
  border: 3px solid #333;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a2e;
}

.cf-row {
  display: flex;
}

.cf-cell {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #333;
  cursor: default;
}

.cf-cell.clickable {
  cursor: pointer;
}

.cf-cell.clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.cf-disc {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.cf-disc.player1 {
  background: #00d4ff;
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.35);
}

.cf-disc.player2 {
  background: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.5);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.35);
}

.cf-game .afk-timer {
  font-size: 14px;
  color: #ffc107;
  margin-left: 8px;
}

.cf-game .afk-timer.warning {
  color: #f44336;
  font-weight: bold;
  animation: pulse-afk 0.5s infinite;
}

@keyframes pulse-afk {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.cf-hint {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.8;
}
@keyframes heatBarPulse {
  0% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(1.25);
  }
}

@keyframes sabotageGlowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 77, 79, 0.8), 0 10px 28px rgba(0,0,0,0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 77, 79, 1), 0 10px 40px rgba(0,0,0,0.6);
    transform: scale(1.05);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.2);
  }
  50% {
    opacity: 0.9;
    box-shadow: 0 0 30px rgba(0, 255, 170, 0.4);
  }
}

@keyframes numberPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
    filter: brightness(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.animating-number {
  display: inline-block;
  animation: numberPulse 0.6s ease-out;
}

.heat-bar-inner.heat-bar-animate {
  animation: heatBarPulse 1.2s infinite alternate;
}
.contracts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

@media (max-width: 1180px) {
  .contracts-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 720px) {
  .contracts-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.log-card {
  background: linear-gradient(120deg, #1e293b 60%, #334155 100%);
  border-radius: 18px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.12);
  padding: 1.2rem 1.4rem 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid #334155;
  transition: box-shadow 0.2s, border 0.2s, transform 0.2s;
  animation: fadeInCard 0.7s cubic-bezier(.4,0,.2,1);
}
.log-card:hover {
  box-shadow: 0 4px 24px 0 rgba(34,197,94,0.12);
  border: 1.5px solid #22c55e;
  transform: translateY(-2px) scale(1.02);
}
.log-entry {
  font-size: 0.98rem;
  color: #e5e7eb;
  margin-bottom: 0.2rem;
  animation: fadeInCard 0.7s cubic-bezier(.4,0,.2,1);
}
/* Global / full width */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --credits-color: #facc15;
  --credits-color-dark: #f59e0b;

  --data-color: #a855f7;
  --data-color-dark: #7e22ce;

  --energy-color: #22c55e;
  --energy-color-dark: #15803d;

  --shell-padding-inline: clamp(1rem, 3vw, 2.75rem);
  --shell-padding-block: clamp(1rem, 2vw, 2rem);
  --section-gap: clamp(1rem, 2.5vw, 2rem);
  --card-min-width: 220px;
}

@media (max-width: 900px) {
  :root {
    --card-min-width: 200px;
  }
}

@media (max-width: 640px) {
  :root {
    --card-min-width: 175px;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
}

body {
  background: #020617;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  overflow-x: hidden;
}

/* Light theme base overrides */
body.theme-light {
  background: #f8fafc; /* slate-50 */
  color: #0f172a; /* slate-900 */
}

/* Generic card overrides for light theme (keep gradients but brighten) */
body.theme-light .log-card {
  background: linear-gradient(120deg, #ffffff 60%, #e5e7eb 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
body.theme-light .log-card:hover {
  border: 1.5px solid #22c55e;
  box-shadow: 0 6px 24px rgba(34,197,94,0.12);
}
body.theme-light .log-entry {
  color: #1f2937;
}

/* Utility / header action buttons */
body.theme-light .action-icon-btn {
  border-color: rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.7) 0%, rgba(203, 213, 225, 0.45) 100%);
  color: #0f172a;
}
body.theme-light .action-icon-btn:hover {
  border-color: rgba(100, 116, 139, 0.6);
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.9) 0%, rgba(203, 213, 225, 0.65) 100%);
  color: #0b1220;
}

/* Utility dropdown */
body.theme-light .utility-menu-dropdown {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(226, 232, 240, 0.9) 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(148, 163, 184, 0.2);
}
body.theme-light .utility-menu-item {
  color: #0f172a;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
body.theme-light .utility-menu-item:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
  color: #0b1220;
}

/* Buttons base */
body.theme-light button {
  background-color: #f9fafb;
  color: #0f172a;
  border-color: rgba(148,163,184,0.45);
}
body.theme-light button:hover {
  border-color: #94a3b8;
}

/* Root layout */

.app-root {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: var(--shell-padding-block) var(--shell-padding-inline);
  padding-left: 260px; /* Account for sidebar width + spacing */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-root.sidebar-collapsed {
  padding-left: 80px; /* Account for collapsed sidebar */
}

@media (max-width: 1400px) {
  .app-root {
    padding-left: var(--shell-padding-inline);
  }
  
  .app-root.sidebar-collapsed {
    padding-left: var(--shell-padding-inline);
  }
}

/* Header */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
}

@media (max-width: 900px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .app-header-right {
    width: 100%;
    flex-direction: column;
  }
}

.app-header-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.app-header-left > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-header-right {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* Header Actions Wrapper - Container for all utility buttons */
.header-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

/* Desktop View: Inline icon buttons */
.header-actions-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row;
}

/* Action Icon Button (Desktop) */
.action-icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 8px;
  border: 1.5px solid;
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(71, 85, 105, 0.08) 100%);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  position: relative;
  backdrop-filter: blur(10px);
  font-weight: 500;
}

.action-icon-btn:hover {
  border-color: rgba(148, 163, 184, 0.7);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.25) 0%, rgba(100, 116, 139, 0.15) 100%);
  box-shadow: 0 0 20px rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  transform: translateY(-2px);
}

/* Color variations for different buttons */
.leaderboard-btn {
  border-color: rgba(250, 204, 21, 0.4);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(250, 204, 21, 0.08) 100%);
  color: #fcd34d;
}

.leaderboard-btn:hover {
  border-color: rgba(250, 204, 21, 0.7);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(250, 204, 21, 0.15) 100%);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.2);
  color: #fef3c7;
}

.notifications-btn {
  border-color: rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.08) 100%);
  color: #93c5fd;
}

.notifications-btn:hover {
  border-color: rgba(59, 130, 246, 0.7);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.15) 100%);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
  color: #dbeafe;
}

.settings-btn {
  border-color: rgba(148, 163, 184, 0.4);
}

.settings-btn:hover {
  border-color: rgba(148, 163, 184, 0.7);
}

.help-btn {
  border-color: rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(147, 51, 234, 0.08) 100%);
  color: #c084fc;
}

.help-btn:hover {
  border-color: rgba(168, 85, 247, 0.7);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(147, 51, 234, 0.15) 100%);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
}

/* Unread notification dot */
.unread-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.3);
  animation: pulse 2s infinite;
}

/* Mobile View: Hamburger menu (hidden on desktop) */
.header-actions-mobile {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
}

.utility-menu-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(71, 85, 105, 0.08) 100%);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  backdrop-filter: blur(10px);
}

.utility-menu-toggle:hover {
  border-color: rgba(148, 163, 184, 0.7);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.25) 0%, rgba(100, 116, 139, 0.15) 100%);
  box-shadow: 0 0 20px rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
}

.utility-menu-dropdown {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 85, 0.7) 100%);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.2);
  z-index: 998;
  min-width: 240px;
  overflow: hidden;
}

.utility-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.utility-menu-item:last-child {
  border-bottom: none;
}

.utility-menu-item:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
  color: #f1f5f9;
}

.utility-menu-item span:first-child {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.unread-badge {
  margin-left: auto;
  background: #ff6b6b;
  color: white;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Responsive: Mobile breakpoint */
@media (max-width: 768px) {
  .header-actions-desktop {
    display: none;
  }

  .header-actions-mobile {
    display: flex;
  }
}



.contact-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.contact-launcher:hover {
  border-color: rgba(96, 165, 250, 0.85);
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.18);
}

.store-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 2.1rem;
  border-radius: 999px;
  border: 1.5px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 3.2rem;
  min-width: 3.2rem;
  transition: box-shadow 0.18s, border 0.18s, background 0.18s, color 0.18s;
  border-color: rgba(74, 222, 128, 0.55);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.22) 0%, rgba(34, 197, 94, 0.18) 100%);
  color: #4ade80;
  font-size: 1.18rem;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.08);
}

.store-launcher-header {
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  min-height: auto;
}

.store-launcher:hover {
  border-color: rgba(74, 222, 128, 0.9);
  color: #22c55e;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.28) 0%, rgba(34, 197, 94, 0.22) 100%);
  box-shadow: 0 0 22px 0 rgba(74, 222, 128, 0.22);
  transform: scale(1.04);
}

.store-launcher:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}



.app-header h1 {
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e5e7eb;
  text-align: center;
}

.app-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #64748b;
}

.player-meta-card {
  min-width: 260px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(135deg, rgba(15,23,42,0.85), rgba(15,23,42,0.5));
  box-shadow: 0 8px 30px rgba(15,23,42,0.35);
  overflow: hidden;
  position: relative;
}

.player-meta-card.has-banner {
  background: rgba(2, 6, 23, 0.78);
}

.player-card-banner {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.player-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
  opacity: 0.45;
}

.player-card-banner-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.85) 55%, rgba(2, 6, 23, 0.95));
}

.player-banner-rarity {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.player-meta-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  z-index: 1;
}

@media (max-width: 640px) {
  .player-meta-card {
    min-width: 0;
    width: 100%;
  }
}

.player-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #94a3b8;
}

.meta-label.meta-label-secondary {
  margin-top: 0.35rem;
  color: #7dd3fc;
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
}

.meta-value.meta-value-secondary {
  font-size: 0.95rem;
  font-weight: 500;
  color: #bae6fd;
}

.meta-subtle {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fbbf24;
}

.logout-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.logout-pill:hover {
  border-color: rgba(248, 113, 113, 0.8);
  color: #fecdd3;
}

.player-meta-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .player-meta-bottom {
    flex-wrap: wrap;
  }
}

.sse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}

.sse-dot.connected { background: #22c55e; }
.sse-dot.connecting { background: #facc15; }
.sse-dot.disconnected { background: #ef4444; }

.sse-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sse-icon {
  display: inline-flex;
  align-items: center;
  color: #cbd5f5;
}

.sse-last {
  margin-left: auto;
  font-size: 0.7rem;
  color: #cbd5f5;
}

.player-topline {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem 1.3rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(2,6,23,0.8));
  box-shadow: 0 20px 50px rgba(2,6,23,0.45);
}

@media (max-width: 640px) {
  .player-topline {
    padding: 0.9rem;
  }
}

.player-topline-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .player-topline-header {
    flex-direction: column;
  }
}

.player-level-card {
  flex: 0 0 220px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: linear-gradient(145deg, rgba(34,197,94,0.12), rgba(15,23,42,0.85));
  box-shadow: 0 10px 30px rgba(34,197,94,0.25);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

@media (max-width: 640px) {
  .player-level-card {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.player-level-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.level-pill-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
}

.player-level-foot {
  font-size: 0.75rem;
  color: #c7d2fe;
}

.player-topline-explainer {
  flex: 1;
  min-width: 220px;
  background: rgba(15,23,42,0.55);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 0.85rem 1rem;
  color: #cbd5f5;
}

@media (max-width: 640px) {
  .player-topline-explainer {
    min-width: 0;
  }
}

.player-topline-explainer p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
}

.language-settings-card {
  min-width: 220px;
  max-width: 260px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  padding: 0.85rem 1rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .language-settings-card {
    width: 100%;
    max-width: none;
  }
}

.language-settings-copy {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.language-select-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.language-settings-card select {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(2, 6, 23, 0.6);
  color: #e5e7eb;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.language-saving-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #34d399;
}

.heading-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #94a3b8;
}

.resource-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr));
  gap: clamp(0.75rem, 2vw, 1.1rem);
  margin-top: 0.75rem;
}

@media (max-width: 520px) {
  .resource-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.resource-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.75);
  padding: 0.7rem 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.resource-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.3rem;
}

.sse-toast-banner {
  margin: 0.6rem 0;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(248, 187, 69, 0.7);
  background: rgba(248, 187, 69, 0.15);
  color: #fffbeb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.sse-toast-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.research-card-note {
  font-size: 0.8rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #d7e3f4;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin-top: 0.75rem;
}

/* Top-right resources */

.header-resources {
  display: flex;
  gap: 0.7rem;
  align-items: stretch;
  flex-wrap: wrap;
}

@media (max-width: 540px) {
  .header-resources {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-bottom: 0.45rem;
    scroll-snap-type: x proximity;
  }

  .header-resources .resource-pill {
    flex: 0 0 auto;
    min-width: min(260px, 80vw);
    scroll-snap-align: start;
  }

  .header-resources::-webkit-scrollbar {
    height: 4px;
  }

  .header-resources::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
  }
}

.header-resources .resource-pill {
  min-width: 180px;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: radial-gradient(circle at top left, #020617, #020617);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

/* Generic resource pill + bars */

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

.resource-pill {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Ligne dédiée aux infos de boost d'énergie pour éviter l'overflow */
.energy-boost-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: #3498db;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.energy-boost-line .energy-boost-percent,
.energy-boost-line .energy-boost-kwh,
.energy-boost-line .energy-boost-countdown {
  line-height: 1.2;
}
.energy-boost-line .energy-boost-countdown {
  opacity: 0.9;
}

.resource-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.resource-pill .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
}

.resource-pill .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
}

.resource-pill .cap {
  font-size: 0.7rem;
  color: #9ca3af;
}

.header-resources .resource-pill .label {
  font-size: 0.65rem;
}
.header-resources .resource-pill .value {
  font-size: 0.85rem;
}
.header-resources .resource-pill .cap {
  font-size: 0.65rem;
}

.resource-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.9);
  overflow: hidden;
}

.header-resources .resource-bar {
  height: 3px;
}

/* Reputation as a resource card */
.resource-card.resource-pill.reputation {
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(79, 70, 229, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.2);
}
.resource-pill.reputation .label {
  color: #94a3b8;
}
.resource-pill.reputation .value {
  color: #c7d2fe;
}
.resource-bar-fill.reputation {
  background: linear-gradient(90deg, #6366f1, #22c55e);
}
.rep-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.rep-tag.trusted {
  color: #16a34a;
  border-color: #22c55e44;
  background: #052e1640;
}
.rep-tag.neutral {
  color: #64748b;
  border-color: #94a3b844;
  background: #1f293740;
}
.rep-tag.shady {
  color: #e11d48;
  border-color: #fb718544;
  background: #2a0b1240;
}

.rep-status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  gap: 0.5rem;
}

/* Karma pill */
.resource-card.resource-pill.karma {
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
  min-width: 200px;
}
.resource-pill.karma .label {
  color: #94a3b8;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.resource-pill.karma .value {
  color: #e9d5ff;
  font-weight: 700;
}
.karma-status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  gap: 0.5rem;
}

.karma-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
}
.karma-legend {
  font-size: 0.6rem;
  color: #64748b;
  margin-top: 0.2rem;
  text-align: center;
  letter-spacing: 0.04em;
}
.karma-donation-block {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.karma-donation-description {
  font-size: 0.8rem;
  color: #e0e7ff;
  margin: 0;
}
.karma-donation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: #94a3b8;
  justify-content: space-between;
}
.karma-donation-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.karma-donation-summary {
  font-size: 0.78rem;
  color: #e2e8f0;
  line-height: 1.35;
}
.karma-donation-form button {
  align-self: flex-start;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.6);
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.85), rgba(236, 72, 153, 0.8));
  color: #fdf4ff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.karma-donation-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.karma-donation-preview {
  font-size: 0.75rem;
  color: #c4b5fd;
}
.karma-donation-cap {
  font-size: 0.7rem;
  color: #fcd34d;
}
.karma-donation-alert {
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}
.karma-donation-alert.error {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}
.karma-donation-alert.success {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}
.resource-bar-fill.karma {
  background: linear-gradient(90deg, #a855f7, #22d3ee);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

/* Resource bar fills */

.resource-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s ease-out;
  opacity: 0.9;
}

.resource-bar-fill.credits {
  background: linear-gradient(
    to right,
    var(--credits-color),
    var(--credits-color-dark)
  );
}

.resource-bar-fill.data {
  background: linear-gradient(
    to right,
    var(--data-color),
    var(--data-color-dark)
  );
}

.resource-bar-fill.energy {
  background: linear-gradient(
    to right,
    var(--energy-color),
    var(--energy-color-dark)
  );
}

.heat-pill {
  min-width: 220px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.9));
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.12);
  overflow: hidden;
}

.heat-pill .resource-line {
  flex-wrap: wrap;
}

.heat-pill .heat-state {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.heat-pill-warning {
  font-size: 0.68rem;
  margin-top: 0.15rem;
}

.heat-pill-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
  margin-top: 0.35rem;
}

.heat-pill-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, #1e293b, #fb7185);
}

.heat-pill-fill.critical {
  animation: heatBarPulse 1.2s infinite alternate;
}

/* Resource text coloring */

.resource-pill.credits .value {
  color: var(--credits-color);
}

.resource-pill.data .value {
  color: var(--data-color);
}

.resource-pill.energy .value {
  color: var(--energy-color);
}

.label.credits,
.value.credits {
  color: var(--credits-color);
}

.label.data,
.value.data {
  color: var(--data-color);
}

/* Colors for energy lines */
.label.energy,
.value.energy {
  color: #38bdf8; /* cyan-ish for energy production */
}

.label.energy-cost,
.value.energy-cost {
  color: #f97373; /* soft red for energy consumption */
}

/* Section header explainer */
.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.section-explainer {
  font-size: 0.8rem;
  opacity: 0.8;
  max-width: 60rem;
}

/* resource tick pulse */

@keyframes resourceTickPulse {
  0% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(251, 191, 36, 0);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(251, 191, 36, 0);
  }
}

.resource-tick {
  animation: resourceTickPulse 0.25s ease-out;
}
.resource-tick.credits {
  box-shadow: 0 0 10px var(--credits-color);
}

.resource-tick.data {
  box-shadow: 0 0 10px var(--data-color);
}

.resource-tick.energy {
  box-shadow: 0 0 10px var(--energy-color);
}

/* Reputation tick pulse */
.resource-tick.reputation {
  box-shadow: 0 0 10px #6366f1;
}

.rep-legend {
  margin-top: 4px;
  font-size: 0.65rem;
  color: #94a3b8;
  opacity: 0.85;
}

.rep-info-btn {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 0.25rem 0.4rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  font-size: 0.9rem;
}

.rep-info-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
  transform: scale(1.1);
}

/* Cards, sections */

.resources-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.9rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Global production collapse button */
.global-production-toggle {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 999px;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  width: 40px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.global-production-toggle-icon {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.global-production-toggle:hover {
  background: #0ea5e9;
  border-color: #0284c7;
  transform: scale(1.04);
}

.global-production-toggle:active {
  transform: scale(0.98);
}

.global-production-toggle:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.buildings-section {
  margin-top: 1.4rem;
  width: 100%;
}

.buildings-section h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
  margin-bottom: 0.7rem;
}

.buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.building-card {
  background: linear-gradient(120deg, #1e293b 60%, #334155 100%);
  border-radius: 18px;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.12);
  padding: 1.2rem 1.4rem 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid #334155;
  transition: box-shadow 0.2s, border 0.2s;
}
.building-card:hover {
  box-shadow: 0 4px 24px 0 rgba(34,197,94,0.12);
  border: 1.5px solid #22c55e;
}

/* Collapsed state - minimal view */
.building-card.collapsed {
  padding: 0.85rem 1rem;
  gap: 0.35rem;
}
.building-card.collapsed h3 {
  font-size: 0.95rem;
  margin-bottom: 0 !important;
}
/* Hide all detail sections when collapsed */
.building-card.collapsed .building-card-detail {
  display: none !important;
}

.building-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.2rem 0;
  color: #e5e7eb;
  letter-spacing: 0.04em;
}
.building-description {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}
.building-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.building-stats .label {
  color: #a3e635;
  font-size: 0.98rem;
  font-weight: 500;
  margin-right: 0.5rem;
}
.building-stats .value {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e5e7eb;
}
.upgrade-button {
  margin-top: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 60%, #a3e635 100%);
  color: #1e293b;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.upgrade-button:disabled {
  background: #64748b;
  color: #e5e7eb;
  cursor: not-allowed;
}
.requirement-text {
  color: #f87171;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}
.building-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(75, 85, 99, 0.9);
  box-shadow: 0 0 18px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  min-height: 210px;
}

.building-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
  color: #e5e7eb;
}

.building-key {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.building-description {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
}

.building-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
  width: 100%;
}

.building-stats .label {
  font-size: 0.7rem;
  color: #9ca3af;
}

.building-stats .value {
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* Buttons */

.upgrade-button {
  width: 100%;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  outline: none;
  background: linear-gradient(to right, #0ea5e9, #22c55e);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: transform 0.08s ease-out, box-shadow 0.12s ease-out,
    filter 0.12s ease-out, opacity 0.12s ease-out;
  align-self: stretch;
}

.upgrade-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.7);
  filter: brightness(1.05);
}

.upgrade-button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Tabs */

.tab-bar {
  margin-top: 0.6rem;
  margin-bottom: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.25rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.8);
}

.tab-bar-desktop {
  display: flex;
  flex-wrap: wrap;
}

.tab-bar-mobile {
  display: none;
  margin-top: 0.6rem;
  margin-bottom: 1.2rem;
  position: relative;
}

.tab-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.8);
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-dropdown-trigger:hover {
  background: rgba(31, 41, 55, 0.9);
  border-color: #0ea5e9;
}

.tab-dropdown-label {
  flex: 1;
  text-align: left;
}

.tab-dropdown-icon {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.tab-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(55, 65, 81, 0.8);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  animation: slideDown 0.2s ease;
}

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

.tab-dropdown-menu button {
  width: 100%;
  display: block;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(55, 65, 81, 0.3);
}

.tab-dropdown-menu button:last-child {
  border-bottom: none;
}

.tab-dropdown-menu button:hover {
  background: rgba(31, 41, 55, 0.6);
  color: #e5e7eb;
}

.tab-dropdown-menu button.active {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  font-weight: 600;
}

.tab-bar::-webkit-scrollbar {
  height: 4px;
}

.tab-bar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  border: none;
  outline: none;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease,
    transform 0.1s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-button:hover {
  background: rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
}

.tab-button.active {
  background: radial-gradient(circle at top, #0ea5e9, #0369a1);
  color: #f9fafb;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
}

@media (max-width: 1400px) {
  .tab-bar-desktop {
    display: none;
  }
  
  .tab-bar-mobile {
    display: block;
  }
}

@media (max-width: 768px) {
  .tab-dropdown-trigger {
    font-size: 0.85rem;
    padding: 0.65rem 0.9rem;
  }
  
  .tab-dropdown-menu button {
    font-size: 0.8rem;
    padding: 0.65rem 0.9rem;
  }
}

@media (max-width: 520px) {
  .tab-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tab-button {
    padding: 0.4rem 0.5rem;
    letter-spacing: 0.08em;
    font-size: 0.65rem;
  }

  .tab-badge {
    margin-left: 0.2rem;
  }
}

/* Operations count badge */

.tab-badge {
  margin-left: 0.4rem;
  min-width: 1.2rem;
  padding: 0 0.3rem;
  height: 1.1rem;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #e0f2fe;
}

/* Unread highlight for log tab */

.tab-button.unread {
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.9);
  color: #facc15;
}

/* little dot for unread */

.tab-dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.9);
}

/* Tab tooltips */

.tab-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  bottom: 120%;
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: 0 0 10px rgba(15, 23, 42, 0.8);
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
  z-index: 20;
}

.tab-button[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-label {
  display: inline-flex;
  align-items: center;
}

/* Sidebar Navigation */
.sidebar-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 240px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(25, 40, 70, 0.93) 100%);
  border-right: 2px solid rgba(59, 130, 246, 0.3);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
}

.sidebar-nav.collapsed {
  width: 60px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

.sidebar-toggle {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.98);
  border: none;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  color: #9ca3af;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.sidebar-toggle:hover {
  background: rgba(31, 41, 55, 0.98);
  color: #e5e7eb;
}

.sidebar-section {
  margin: 0.5rem 0;
}

.sidebar-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: none;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-section-header:hover {
  background: rgba(31, 41, 55, 0.6);
  color: #9ca3af;
}

.sidebar-section-title {
  flex: 1;
  text-align: left;
}

.sidebar-section-icon {
  font-size: 0.7rem;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.sidebar-section-items {
  display: flex;
  flex-direction: column;
  animation: slideDown 0.2s ease;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: #9ca3af;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-item:hover {
  background: rgba(31, 41, 55, 0.5);
  border-left-color: rgba(59, 130, 246, 0.5);
  color: #e5e7eb;
}

.sidebar-item.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.2) 0%, transparent 100%);
  border-left-color: #0ea5e9;
  color: #38bdf8;
  font-weight: 600;
}

.sidebar-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.sidebar-notification-dot {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: pulse 2s infinite;
}

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

.sidebar-nav.collapsed .sidebar-section-title,
.sidebar-nav.collapsed .sidebar-item span:not(.sidebar-icon) {
  display: none;
}

.sidebar-nav.collapsed .sidebar-section-header {
  justify-content: center;
  padding: 0.75rem 0.5rem;
}

.sidebar-nav.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.7rem 0.5rem;
}

.sidebar-nav.collapsed .sidebar-notification-dot {
  right: 50%;
  transform: translateX(12px);
}

@media (max-width: 1400px) {
  .sidebar-nav {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar-nav.mobile-open {
    transform: translateX(0);
  }
}

/* Mobile Hamburger Menu */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 150;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%);
  border: 2px solid rgba(59, 130, 246, 0.5);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

@media (max-width: 1400px) {
  .mobile-menu-btn {
    display: block;
  }
}

/* Mobile Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 90;
}

.mobile-menu-overlay.active {
  display: block;
}

/* Sticky Feedback Button */
.sticky-feedback-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 2px solid rgba(251, 191, 36, 0.5);
  border-radius: 8px 0 0 8px;
  padding: 1rem 0.75rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  writing-mode: vertical-rl;
}

.sticky-feedback-btn:hover {
  right: 5px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: -4px 4px 16px rgba(251, 191, 36, 0.4);
  transform: translateY(-50%) scale(1.05);
}

.feedback-icon {
  font-size: 1.2rem;
}

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

@media (max-width: 1400px) {
  .sticky-feedback-btn {
    padding: 0.85rem 0.65rem;
    font-size: 0.85rem;
  }
}

.leaderboard-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1400;
}

.leaderboard-modal {
  width: min(960px, 95vw);
  max-width: 95vw;
  max-height: 90vh;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.leaderboard-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.leaderboard-modal-header h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.9rem;
  color: #f8fafc;
}

.leaderboard-modal-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.leaderboard-modal-close:hover {
  color: #f1f5f9;
}

.leaderboard-modal-body {
  padding: 1rem 1.25rem 1.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  max-width: 100%;
}

/* Operations layout */

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

.op-card {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.op-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.op-title {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.op-list {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
  padding-left: 1.1rem;
  margin-bottom: 0.8rem;
  flex: 1 1 auto;
}

/* Activity log */

.logs-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  max-height: 240px;
  overflow-y: auto;
  font-size: 0.8rem;
}

.log-entry {
  display: flex;
  gap: 0.7rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed rgba(55, 65, 81, 0.6);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  flex-shrink: 0;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
}

.log-message {
  color: #e5e7eb;
}

.log-empty {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Requirement / missing resource hints */

.requirement-text {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Misc */

.inline-error-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(153, 27, 27, 0.15) 100%);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: slideIn 0.3s ease-out;
}

.inline-error-banner span:first-child {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.inline-error-banner button {
  transition: opacity 0.2s;
}

.inline-error-banner button:hover {
  opacity: 0.7;
}

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

.error-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
  backdrop-filter: blur(4px);
  padding: 3rem 0;
}

.error-modal {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(220, 38, 38, 0.6), 0 0 100px rgba(220, 38, 38, 0.3);
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  animation: scaleIn 0.3s ease-out;
  border: 3px solid #fca5a5;
}

.error-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.error-modal-icon {
  font-size: 3rem;
  animation: shake 0.5s ease-in-out;
}

.error-modal-header h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.error-modal-content {
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-weight: 500;
}

.error-modal-close {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  color: #dc2626;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.error-modal-close:hover {
  background: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Responsive tweak */

@media (max-width: 768px) {
  .app-root {
    padding: 1rem;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-resources {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .buildings-grid {
    grid-template-columns: 1fr;
  }

  .operations-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Tech tree mini-map --- */

.tech-tree-card {
  margin-bottom: 1.5rem;
  padding: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border: 2px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  max-width: 100%;
}

.tech-tree-card h3 {
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Tech tree container with tier layout */
.tech-tree-container {
  position: relative;
  width: 100%;
  min-height: 650px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2.5rem 1rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(20, 30, 55, 0.9));
  border-radius: 8px;
  scroll-behavior: smooth;
}

.tech-tree-connectors {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.tech-connection-path {
  stroke: rgba(59, 130, 246, 0.35);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.15));
  transition: all 0.3s ease;
}

.tech-connection-path:hover {
  stroke: rgba(59, 130, 246, 0.8);
  stroke-width: 3;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

.tech-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.tech-node-prereq-label {
  font-size: 0.7rem;
  color: rgba(59, 130, 246, 0.8);
  text-align: center;
  max-width: 160px;
  word-break: break-word;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-weight: 500;
}

.tech-tree-tiers {
  display: flex;
  gap: 4rem;
  min-width: max-content;
  position: relative;
  z-index: 1;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0 2rem;
}

.tech-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 210px;
  flex-shrink: 0;
  position: relative;
}

/* Vertical line above tier nodes to show connection */
.tech-tier::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -2rem;
  width: 2px;
  height: 2rem;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.1));
  transform: translateX(-1px);
}

.tech-tier-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(59, 130, 246, 0.4);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(59, 130, 246, 0.9);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  width: 100%;
}

.tech-tier-nodes {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  width: 100%;
}

.tech-branch {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition: all 0.2s ease;
}

.tech-branch:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(30, 41, 59, 0.75);
}

.tech-branch-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.tech-branch-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 260px;
  align-items: start;
  gap: 12px;
}

.tech-branch-viewport {
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

.tech-branch-content {
  will-change: transform;
}

.tech-tier-column {
  display: flex;
  flex-direction: column;
}

.tech-node-mini {
  height: 68px;
  padding: 0.75rem;
  border-radius: 10px;
  border: 2px solid rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(20, 35, 70, 0.85));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  transition: all 0.25s ease;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2), inset 0 0 8px rgba(59, 130, 246, 0.1);
}

.tech-node-mini:hover {
  transform: translateX(4px) scale(1.02);
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), inset 0 0 12px rgba(59, 130, 246, 0.2);
  background: linear-gradient(135deg, rgba(20, 35, 70, 0.95), rgba(30, 50, 100, 0.9));
}

.tech-node-mini-owned {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(15, 23, 42, 0.85));
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.4), inset 0 0 8px rgba(34, 197, 94, 0.15);
}

.tech-node-mini-owned:hover {
  transform: scale(1.05);
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.6), inset 0 0 12px rgba(34, 197, 94, 0.25);
}

.tech-node-mini-locked {
  border-color: rgba(248, 113, 113, 0.6);
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.2), inset 0 0 8px rgba(248, 113, 113, 0.1);
}

.tech-node-mini-locked:hover {
  transform: none;
}

.tech-node-mini,
.tech-node-mini-owned,
.tech-node-mini-locked,
.tech-node-icon,
.tech-node-header,
.tech-node-effect,
.tech-node-chip,
.tech-node-effect-label,
.tech-node-effect-value {
  display: none;
}

/* Tech Node Card - Hierarchical tree version */
.tech-node-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 160px;
  min-height: 140px;
  padding: 0.875rem 0.875rem 2rem 0.875rem;
  border: 2px solid rgba(59, 130, 246, 0.6);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(20, 35, 70, 0.92));
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.25), inset 0 0 12px rgba(59, 130, 246, 0.12);
  position: relative;
}

.tech-node-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  pointer-events: none;
}

.tech-node-card:hover {
  transform: translateY(-8px) scale(1.1);
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.5), 
              inset 0 0 16px rgba(59, 130, 246, 0.2),
              0 12px 35px rgba(59, 130, 246, 0.2);
  background: linear-gradient(135deg, rgba(20, 35, 70, 0.98), rgba(30, 50, 100, 0.96));
}

.tech-node-card-owned {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.92));
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.35), inset 0 0 12px rgba(34, 197, 94, 0.15);
}

.tech-node-card-owned:hover {
  transform: translateY(-8px) scale(1.12);
  border-color: #22c55e;
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.55), 
              inset 0 0 18px rgba(34, 197, 94, 0.25),
              0 12px 35px rgba(34, 197, 94, 0.2);
}

.tech-node-card-available {
  /* Default styling inherited */
}

.tech-node-card-progress {
  border-color: rgba(34, 197, 94, 0.7);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(15, 23, 42, 0.92));
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.4), inset 0 0 12px rgba(34, 197, 94, 0.15);
  animation: progressPulse 2s ease-in-out infinite;
}

.tech-node-card-progress:hover {
  border-color: #22c55e;
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.6), 
              inset 0 0 18px rgba(34, 197, 94, 0.25),
              0 12px 35px rgba(34, 197, 94, 0.25);
}

@keyframes progressPulse {
  0%, 100% {
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.4), inset 0 0 12px rgba(34, 197, 94, 0.15);
  }
  50% {
    box-shadow: 0 0 32px rgba(34, 197, 94, 0.6), inset 0 0 16px rgba(34, 197, 94, 0.2);
  }
}

.tech-node-card-status-timer {
  color: #22c55e !important;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  animation: timerBlink 1s ease-in-out infinite;
}

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

.tech-node-card-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0 0 12px 12px;
}

.tech-node-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
  border-radius: inherit;
  animation: progressBar 1s ease-in-out infinite;
  transition: width 0.5s ease-out;
}

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

.tech-node-card-locked {
  border-color: rgba(248, 113, 113, 0.5);
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.2), inset 0 0 10px rgba(248, 113, 113, 0.1);
}

.tech-node-card-locked:hover {
  transform: none;
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.2), inset 0 0 10px rgba(248, 113, 113, 0.1);
}

.tech-node-card-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.35));
  position: relative;
  z-index: 1;
}

.tech-node-card-owned .tech-node-card-icon {
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.45));
}

.tech-node-card-content {
  text-align: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.tech-node-card-content h4 {
  margin: 0 0 0.6rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  word-break: break-word;
}

.tech-node-card-status {
  font-size: 0.78rem;
  color: #93c5fd;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.tech-node-card-owned .tech-node-card-status {
  color: #22c55e;
}

.tech-node-card-locked .tech-node-card-status {
  color: rgba(248, 113, 113, 0.8);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .tech-tree-container {
    min-height: 600px;
    padding: 2rem 0.75rem;
  }

  .tech-tree-tiers {
    gap: 3rem;
    padding: 0 1rem;
  }

  .tech-tier {
    min-width: 190px;
  }

  .tech-node-card {
    width: 150px;
    min-height: 130px;
  }

  .tech-node-card-icon {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
  }

  .tech-node-card-content h4 {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .tech-tree-container {
    min-height: 500px;
    padding: 1.5rem 0.5rem;
  }

  .tech-tree-tiers {
    gap: 2rem;
    padding: 0 0.5rem;
  }

  .tech-tier {
    min-width: 160px;
  }

  .tech-node-card {
    width: 140px;
    min-height: 120px;
    padding: 0.75rem;
  }

  .tech-node-card-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
  }

  .tech-node-card-content h4 {
    font-size: 0.75rem;
  }

  .tech-tier-header {
    font-size: 0.75rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .tech-tree-container {
    min-height: 400px;
    padding: 1rem 0.25rem;
  }

  .tech-tree-tiers {
    gap: 1.5rem;
    padding: 0;
  }

  .tech-tier {
    min-width: 130px;
  }

  .tech-node-card {
    width: 125px;
    min-height: 110px;
    padding: 0.6rem;
  }

  .tech-node-card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
  }

  .tech-node-card-content h4 {
    font-size: 0.7rem;
    margin-bottom: 0.4rem;
  }

  .tech-node-card-status {
    font-size: 0.65rem;
  }

  .tech-tier-header {
    font-size: 0.65rem;
    margin-bottom: 0.75rem;
  }
}

.tech-node-mini {
  flex: 1;
  min-width: 0;
}

.tech-name-mini {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tech-status-mini {
  font-size: 0.7rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tech-node-chip {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-weight: 600;
  border: none;
  display: inline-block;
}

.tech-node-chip.status-complete {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.tech-node-chip.status-locked {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

.tech-node-chip.status-available {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.tech-node-effect {
  display: none;
}

.tech-prereq-list {
  display: none;
}

.tech-tree-svg {
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.5));
}

.tech-tree-svg path {
  animation: flowPulse 3s ease-in-out infinite;
}

@keyframes flowPulse {
  0%, 100% { opacity: 0.6; stroke-width: 2; }
  50% { opacity: 0.9; stroke-width: 2.5; }
}

.tech-tree-hint {
  padding: 1rem 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tech-tree-icon-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.7rem;
}

.tech-tree-icon-chip {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  white-space: nowrap;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.research-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.research-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.research-card-locked {
  opacity: 0.6;
  border-color: rgba(248, 113, 113, 0.4);
}

.research-card-locked:hover {
  border-color: rgba(248, 113, 113, 0.6);
  transform: none;
}

.research-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06));
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  cursor: pointer;
  transition: background 0.2s;
}

.research-card-header:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.1));
}

.research-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.research-card-title > div {
  min-width: 0;
  flex: 1;
}

.research-icon-bubble {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.research-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-level-chip {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #86efac;
  margin-top: 0.25rem;
}

.research-card-expand-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #cbd5e1;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.research-card-expand-icon.expanded {
  transform: rotate(180deg);
}

.research-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.research-description {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #94a3b8;
}

.research-quick-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 8px;
  font-size: 0.75rem;
}

.research-quick-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #cbd5e1;
}

.research-quick-stat-value {
  font-weight: 600;
  color: #fbbf24;
}

.research-effect-block {
  padding: 0.75rem;
  border-radius: 8px;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.08), rgba(49, 196, 141, 0.06));
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.effect-title {
  margin: 0 0 0.3rem 0;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7dd3fc;
  font-weight: 600;
}

.effect-desc {
  display: none;
}

.effect-value-main {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fcd34d;
  margin-bottom: 0.2rem;
}

.effect-value-sub {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
}

.research-cost-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.research-cost {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.75rem;
  flex: 1;
  min-width: 0;
}

.research-cost strong {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
}

.cost-credits {
  background: rgba(250, 204, 21, 0.2);
  color: #fbbf24;
}

.cost-data {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.cost-energy {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.cost-label {
  display: none;
}

.research-prereqs {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 0.65rem;
  font-size: 0.75rem;
}

.research-prereqs .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.research-prereqs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.research-prereqs li {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.3);
}

.research-prereqs .value {
  color: #94a3b8;
  font-size: 0.75rem;
}

.research-prereqs li.met {
  color: #4ade80;
}

.research-prereqs li.missing {
  color: #f87171;
}

.research-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.research-warning {
  margin: 0;
  font-size: 0.7rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.research-upgrade-button {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.research-upgrade-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.research-upgrade-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.research-progress {
  padding: 0.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.research-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #86efac;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.research-progress-time {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: #f8fafc;
  font-weight: 700;
}

.research-progress-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.research-progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  border-radius: inherit;
}

.text-danger {
  color: #f87171;
}

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

/* Level pill with XP bar */
.player-level-pill {
  padding: 0.35rem 0.7rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at top left, #3dd68c22, #15161f);
  color: #f7f7ff;
  box-shadow: 0 0 10px rgba(61, 214, 140, 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 90px;
}

.player-level-main {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.player-level-xp-bar {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.player-level-xp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3dd68c, #4f46e5);
  transform-origin: left;
}

/* Reputation pill */
.player-reputation-pill {
  padding: 0.35rem 0.7rem 0.45rem;
  border-radius: 999px;
  border: 1.5px solid #64748b;
  background: radial-gradient(circle at top left, #e0e7ff 10%, #15161f 90%);
  color: #e5e7eb;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 120px;
  align-items: stretch;
  position: relative;
  transition: border 0.2s, box-shadow 0.2s;
}
.player-reputation-pill .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.player-reputation-pill .rep-icon {
  font-size: 0.9rem;
  color: #6366f1;
  filter: drop-shadow(0 0 6px rgba(99,102,241,0.35));
}
.player-reputation-pill .value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c7d2fe;
  letter-spacing: 0.04em;
}
.player-reputation-pill .resource-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.player-reputation-pill .rep-bar {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}
.player-reputation-pill .rep-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width 0.25s ease-out;
}
.player-reputation-pill .rep-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 8px;
  background: #94a3b8;
  opacity: 0.9;
}
.player-reputation-pill[data-rep-high="true"] {
  border-color: #3dd68c;
  box-shadow: 0 0 12px rgba(61, 214, 140, 0.22);
  background: radial-gradient(circle at top left, #bbf7d0 20%, #0b1220 90%);
}
.player-reputation-pill[data-rep-low="true"] {
  border-color: #fb7185;
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.22);
  background: radial-gradient(circle at top left, #fee2e2 20%, #0b1220 90%);
}
.player-reputation-pill:hover {
  box-shadow: 0 0 24px #6366f144;
  border-color: #6366f1;
}

/* Footer */
.app-footer {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 229, 255, 0.03) 100%);
  border-top: 1px solid rgba(0, 229, 255, 0.15);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(148, 163, 184, 0.7);
  font-size: 0.875rem;
}

.footer-row,
.footer-support {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.paypal-donate-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.paypal-donate-button,
.footer-support-button {
  text-align: center;
  border: none;
  border-radius: 0.25rem;
  min-width: 11.625rem;
  padding: 0.55rem 1.05rem;
  height: 2.625rem;
  font-weight: 700;
  background-color: var(--credits-color);
  color: #000000;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.25rem;
  cursor: pointer;
}

.footer-support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.paypal-donate-button:hover,
.footer-support-button:hover {
  background-color: var(--credits-color-dark);
}

.paypal-donate-button:active,
.footer-support-button:active {
  transform: translateY(1px);
}

.paypal-donate-button:focus-visible,
.footer-support-button:focus-visible {
  outline: 2px solid rgba(0, 229, 255, 0.55);
  outline-offset: 2px;
}


.footer-made-by {
  font-weight: 500;
}

.footer-separator {
  color: rgba(148, 163, 184, 0.4);
  font-weight: 300;
}


.modal-content {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  padding: 2rem;
  max-width: 95vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(34, 197, 94, 0.1);
  animation: modalSlideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Global close button (×) for app modals */
.app-modal-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  z-index: 20;
}

.app-modal-close-btn:hover {
  color: #e2e8f0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

/* Must not inherit generic `.modal-content button` styles (some component CSS sets width: 100%) */
.modal-content .app-modal-close-btn {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

.modal-content .app-modal-close-btn:hover {
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.modal-leaderboard {
  width: min(960px, 95vw);
  max-width: 95vw;
  max-height: 80vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.footer-version {
  color: rgba(0, 229, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 4px;
}

.footer-version-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.footer-version-clickable:hover {
  color: rgba(0, 240, 255, 1);
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.5);
  transform: scale(1.05);
}

.footer-contact {
  color: rgba(96, 165, 250, 0.85);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact:hover {
  color: rgba(147, 197, 253, 1);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer-content {
    gap: 0.5rem;
  }

  .footer-row,
  .footer-support {
    gap: 0.5rem;
  }
}

/* Auth Page */
.auth-page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem;
}

.auth-page-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
  overflow: hidden;
}

.auth-grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridSlide 20s linear infinite;
}

@keyframes gridSlide {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: glowPulse 8s ease-in-out infinite;
}

.auth-glow-1 {
  width: 500px;
  height: 500px;
  background: #00e5ff;
  top: -250px;
  left: -250px;
}

.auth-glow-2 {
  width: 400px;
  height: 400px;
  background: #7c3aed;
  bottom: -200px;
  right: -200px;
  animation-delay: 4s;
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.15;
    transform: scale(1);
  }
  50% {
    opacity: 0.25;
    transform: scale(1.1);
  }
}

.auth-form-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  animation: authSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form-card {
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(0, 229, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-form-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Auth header row: tagline + language selector */
.auth-header-row {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.06), rgba(124, 58, 237, 0.06));
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 18px rgba(0, 229, 255, 0.08);
}

.auth-language-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #00e5ff 50%),
    linear-gradient(135deg, #00e5ff 50%, transparent 50%),
    linear-gradient(to right, rgba(255,255,255,0.06), rgba(255,255,255,0.06));
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px),
    calc(100% - 2.5rem) 0.25rem;
  background-size: 6px 6px, 6px 6px, 1px 70%;
  background-repeat: no-repeat;
  padding-right: 2rem;
  min-width: 180px;
}

.auth-language-select:hover {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

.auth-language-select:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

/* Tiny flag/icon slot next to selector (using emoji) */
.auth-header-row span[role="img"][aria-label="language"] {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  font-size: 18px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #00e5ff, #7c3aed);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.3);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.auth-logo h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #00e5ff, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-tagline {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  margin: 0;
  letter-spacing: 0.3px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-input-group label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 4px;
}

.auth-input {
  background: rgba(0, 229, 255, 0.03);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.auth-input:focus {
  background: rgba(0, 229, 255, 0.05);
  border-color: #00e5ff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
  transform: translateY(-1px);
}

.auth-error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  color: #fca5a5;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: errorShake 0.4s ease;
}

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

.auth-error-icon {
  font-size: 1.25rem;
}

.auth-submit-btn {
  background: linear-gradient(135deg, #00e5ff, #0091ea);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.3);
  margin-top: 0.5rem;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 229, 255, 0.4);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-btn-arrow {
  transition: transform 0.3s ease;
}

.auth-submit-btn:hover .auth-btn-arrow {
  transform: translateX(3px);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
}

.auth-divider span {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-switch-btn {
  background: transparent;
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  padding: 0.875rem 1.5rem;
  color: #00e5ff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-switch-btn:hover {
  background: rgba(0, 229, 255, 0.05);
  border-color: #00e5ff;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .auth-form-card {
    padding: 2rem 1.5rem;
  }
  
  .auth-logo h1 {
    font-size: 1.5rem;
  }
  
  .auth-logo-icon {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* ============================================ */
/* SECTOR SELECTION OVERLAY                     */
/* ============================================ */

.sector-selection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  background: radial-gradient(ellipse at top, #0f172a 0%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  animation: sectorFadeIn 0.6s ease-out;
}

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

.sector-selection-bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: sectorGridSlide 20s linear infinite;
  pointer-events: none;
}

@keyframes sectorGridSlide {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(40px, 40px);
  }
}

.sector-selection-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sector-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  animation: sectorOrbFloat 8s ease-in-out infinite;
}

.sector-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #00e5ff 0%, transparent 70%);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
  animation-duration: 10s;
}

.sector-orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  bottom: -5%;
  left: 10%;
  animation-delay: 2s;
  animation-duration: 12s;
}

.sector-orb-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  top: 40%;
  left: -5%;
  animation-delay: 4s;
  animation-duration: 14s;
}

@keyframes sectorOrbFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

.sector-selection-card {
  position: relative;
  z-index: 10;
  max-width: 600px;
  width: 90%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 229, 255, 0.1) inset,
    0 2px 4px rgba(0, 229, 255, 0.1) inset;
  animation: sectorSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sectorSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sector-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.sector-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #00e5ff 0%, #a855f7 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  animation: sectorTitleGlow 3s ease-in-out infinite;
}

@keyframes sectorTitleGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.5));
  }
}

.sector-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

.sector-selection-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sector-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sector-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.label-icon {
  font-size: 1rem;
  filter: drop-shadow(0 0 4px currentColor);
}

.sector-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}

.sector-input:focus {
  background: rgba(15, 23, 42, 0.8);
  border-color: #00e5ff;
  box-shadow: 
    0 0 0 3px rgba(0, 229, 255, 0.1),
    0 4px 12px rgba(0, 229, 255, 0.15);
}

.sector-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.sector-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300e5ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.sector-select option {
  background: #0f172a;
  color: #fff;
  padding: 0.5rem;
}

.sector-select-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.sector-select-wrapper .sector-select {
  flex: 1;
}

.sector-refresh-btn {
  padding: 0 1rem;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  color: #00e5ff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}

.sector-refresh-btn:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  transform: rotate(90deg);
}

.sector-refresh-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sector-form-row {
  display: flex;
  gap: 1rem;
}

.sector-form-half {
  flex: 1;
}

.sector-error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: #fca5a5;
  font-size: 0.9rem;
  animation: sectorErrorShake 0.5s ease;
}

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

.error-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 4px currentColor);
}

.sector-submit-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #00e5ff 0%, #06b6d4 100%);
  border: none;
  border-radius: 12px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  box-shadow: 
    0 4px 12px rgba(0, 229, 255, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.sector-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #06b6d4 0%, #00e5ff 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(0, 229, 255, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.sector-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.sector-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 4px currentColor);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15, 23, 42, 0.3);
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

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

@media (max-width: 640px) {
  .sector-selection-card {
    padding: 2rem 1.5rem;
    width: 95%;
  }

  .sector-title {
    font-size: 1.5rem;
  }

  .sector-subtitle {
    font-size: 0.85rem;
  }

  .sector-form-row {
    flex-direction: column;
    gap: 1.5rem;
  }

  .sector-select-wrapper {
    flex-direction: column;
  }

  .sector-refresh-btn {
    width: 100%;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(34, 197, 94, 0.1);
  animation: modalSlideIn 0.3s ease-out;
}

.modal-leaderboard {
  width: 1200px;
  max-width: 90vw;
}

.modal-close {
  position: fixed;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 2px solid rgba(148, 163, 184, 0.5);
  color: #e2e8f0;
  font-size: 2rem;
  font-weight: 300;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

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

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

/* --- Tech Tree Research Modal --- */

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

.modal-research-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(25, 40, 70, 0.96) 100%);
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 20px;
  padding: 2rem;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(25, 40, 70, 0.96) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  padding: 2rem;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  border-top: 1px solid rgba(59, 130, 246, 0.5);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(25, 40, 70, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  z-index: 1001;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.modal-close:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  transform: scale(1.12) rotate(90deg);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.tech-research-modal {
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2rem 1.5rem 1.75rem;
}

.tech-research-modal .modal-close {
  top: 0.65rem;
  right: 0.65rem;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.research-detail-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.research-detail-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1.1rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
}

.research-detail-icon {
  font-size: 3.5rem;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.15));
  border-radius: 16px;
  flex-shrink: 0;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.research-detail-title-block {
  flex: 1;
  min-width: 0;
  padding-right: 1.25rem;
}

.research-detail-title-block h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.research-detail-level {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0.12));
  color: #86efac;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(34, 197, 94, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.research-detail-description {
  color: #cbd5e1;
  line-height: 1.7;
  margin: 0;
  font-size: 0.95rem;
  padding: 1.15rem 1.5rem 1.35rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.research-detail-effect {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(59, 130, 246, 0.05));
  border-left: 4px solid rgba(56, 189, 248, 0.6);
  padding: 1.1rem 1.35rem;
  margin: 1rem 1.5rem 0;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.research-detail-effect strong {
  display: block;
  color: #7dd3fc;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.research-detail-effect div {
  color: #fcd34d;
  font-weight: 700;
  font-size: 1.1rem;
}

.research-detail-prereqs {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.1), rgba(239, 68, 68, 0.05));
  border-left: 4px solid rgba(248, 113, 113, 0.6);
  padding: 1.25rem 1.5rem;
  margin: 1rem 2rem;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.research-detail-prereqs strong {
  display: block;
  color: #fca5a5;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.research-detail-prereqs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.research-detail-prereqs li {
  font-size: 0.9rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.4);
}

.research-detail-prereqs li::before {
  content: '→';
  color: rgba(148, 163, 184, 0.5);
  font-weight: 700;
}

.research-detail-prereqs li.met {
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
}

.research-detail-prereqs li.met::before {
  content: '✓';
  color: #86efac;
}

.research-detail-prereqs li.missing {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
}

.research-detail-prereqs li.missing::before {
  content: '✗';
  color: #fca5a5;
}

.research-detail-costs {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(20, 30, 50, 0.4));
  border: 1px solid rgba(59, 130, 246, 0.15);
  padding: 1.5rem;
  margin: 1rem 2rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: #cbd5e1;
  padding: 0.6rem;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.4);
}

.cost-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fcd34d;
  font-family: 'Courier New', monospace;
}

.research-detail-button {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.7));
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #f8fafc;
  padding: 1rem 1.5rem;
  margin: 1.5rem 2rem 2rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.research-detail-button:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 1), rgba(139, 92, 246, 0.9));
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.research-detail-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}.research-detail-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

/* --- Tech Node Card (simple grid version) --- */

.tech-node-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid rgba(59, 130, 246, 0.5);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(20, 35, 70, 0.85));
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2), inset 0 0 8px rgba(59, 130, 246, 0.1);
  min-height: 100px;
}

.tech-node-card:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), inset 0 0 12px rgba(59, 130, 246, 0.2);
  background: linear-gradient(135deg, rgba(20, 35, 70, 0.95), rgba(30, 50, 100, 0.9));
}

.tech-node-card-owned {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(15, 23, 42, 0.85));
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.4), inset 0 0 8px rgba(34, 197, 94, 0.15);
}

.tech-node-card-owned:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.6), inset 0 0 12px rgba(34, 197, 94, 0.25);
}

.tech-node-card-available {
  /* Default styling */
}

.tech-node-card-locked {
  border-color: rgba(248, 113, 113, 0.6);
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.2), inset 0 0 8px rgba(248, 113, 113, 0.1);
}

.tech-node-card-locked:hover {
  transform: none;
}

.tech-node-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.tech-node-card-content {
  text-align: center;
  width: 100%;
}

.tech-node-card-content h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
  word-break: break-word;
}

.tech-node-card-status {
  font-size: 0.7rem;
  color: #93c5fd;
  font-weight: 600;
}
/* BuildingDetailModal.css */

.building-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.building-modal {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  color: #e0e0e0;
}

.building-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.building-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.building-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.building-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: #00e5ff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.building-level-badge {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.building-modal-body {
  padding: 20px 24px;
}

.building-status-banner {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  text-align: center;
  color: #fbbf24;
  font-weight: 500;
}

.building-stat-section {
  margin-bottom: 24px;
}

.building-stat-section h3 {
  font-size: 16px;
  color: #00e5ff;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.building-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.building-stat {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.building-stat.consumption {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #00e5ff;
}

.building-stat.consumption .stat-value {
  color: #ef4444;
}

.building-upgrade-cost {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cost-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.cost-value {
  font-size: 18px;
  font-weight: bold;
  color: #22c55e;
}

.building-upgrade-warning {
  margin-top: 8px;
  padding: 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  font-size: 13px;
  color: #fbbf24;
}

.building-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.building-action-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.building-action-btn.upgrade {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.building-action-btn.upgrade:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.6);
}

.building-action-btn.downgrade {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.building-action-btn.downgrade:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
}

.building-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scrollbar styling */
.building-modal::-webkit-scrollbar {
  width: 8px;
}

.building-modal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.building-modal::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 4px;
}

.building-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

/* Table styling for BuildingLocksTooltip */
.building-stat-section table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.building-stat-section table thead {
  background: rgba(0, 229, 255, 0.1);
}

.building-stat-section table th {
  padding: 8px;
  font-size: 12px;
  color: #00e5ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
}

/* Light theme overrides */
body.theme-light .building-modal-overlay { background: rgba(15, 23, 42, 0.25); }
body.theme-light .building-modal {
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.35);
  color: #0f172a;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
body.theme-light .building-modal-close { background: rgba(0,0,0,0.05); color: #0f172a; }
body.theme-light .building-modal-header { border-bottom-color: rgba(14,165,233,0.25); }
body.theme-light .building-status-banner {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #b45309;
}
body.theme-light .building-stat { background: rgba(2, 6, 23, 0.05); border-color: rgba(14, 165, 233, 0.25); }
body.theme-light .stat-label { color: #64748b; }
body.theme-light .building-upgrade-cost { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.35); }
body.theme-light .cost-label { color: #475569; }
body.theme-light .building-upgrade-warning { background: rgba(251, 191, 36, 0.08); border-color: rgba(251,191,36,0.3); color: #b45309; }
body.theme-light .building-modal-footer { border-top-color: rgba(14,165,233,0.25); }
body.theme-light .building-stat-section table thead { background: rgba(14,165,233,0.08); }
body.theme-light .building-stat-section table th { color: #0284c7; border-bottom-color: rgba(14,165,233,0.35); }

.building-stat-section table td {
  padding: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.building-stat-section table tbody tr:hover {
  background: rgba(0, 229, 255, 0.05);
}
/* Time Projection Component Styles */

.time-projection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 153, 204, 0.1) 100%);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  font-size: 13px;
  color: #e0e0e0;
  margin-top: 8px;
  animation: projectionFadeIn 0.3s ease-in;
}

@keyframes projectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.time-projection-never {
  background: linear-gradient(135deg, rgba(255, 107, 129, 0.1) 0%, rgba(255, 71, 87, 0.1) 100%);
  border-color: rgba(255, 107, 129, 0.3);
}

.projection-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.projection-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.projection-label {
  color: #b0b0b0;
  font-weight: 500;
}

.projection-divider {
  color: rgba(255, 255, 255, 0.3);
  margin: 0 2px;
}

.projection-time {
  color: #00d4ff;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.time-projection-never .projection-text {
  color: #ff6b81;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .time-projection {
    font-size: 12px;
    padding: 5px 10px;
  }

  .projection-icon {
    font-size: 14px;
  }
}
.bug-report-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.bug-report-modal {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
  border: 1px solid rgba(0, 168, 204, 0.3);
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.bug-report-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 168, 204, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bug-report-header h2 {
  margin: 0;
  color: #00e5ff;
  font-size: 1.5rem;
  font-weight: 600;
}

.bug-report-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.bug-report-close:hover {
  color: #00e5ff;
}

.bug-report-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.bug-report-description {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
  line-height: 1.5;
}

.bug-report-field {
  margin-bottom: 20px;
}

.bug-report-field label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  font-weight: 500;
}

.bug-report-textarea {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 168, 204, 0.3);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s;
}

.bug-report-textarea:focus {
  outline: none;
  border-color: #00a8cc;
}

.bug-report-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.bug-report-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.bug-report-checkbox label {
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.bug-report-info {
  padding: 12px;
  background: rgba(0, 168, 204, 0.1);
  border: 1px solid rgba(0, 168, 204, 0.2);
  border-radius: 6px;
  margin-bottom: 16px;
}

.bug-report-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.bug-report-preview {
  margin-top: 20px;
}

.bug-report-preview h3 {
  color: #00e5ff;
  margin-bottom: 12px;
  font-size: 1rem;
}

.bug-report-preview-content {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 168, 204, 0.2);
  border-radius: 6px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Courier New', monospace;
}

.bug-report-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 168, 204, 0.2);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.bug-report-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.bug-report-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.bug-report-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.bug-report-btn.primary {
  background: linear-gradient(135deg, #00a8cc 0%, #00e5ff 100%);
  color: #0a0e1a;
}

.bug-report-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

.bug-report-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.settings-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 2rem;
  z-index: 1050;
}

.settings-panel {
  width: min(420px, 95%);
  background: #030712;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 20px;
  padding: 0 1.5rem 1.5rem;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.75);
  animation: slideInSettings 0.25s ease-out;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.settings-panel::-webkit-scrollbar {
  width: 6px;
}

.settings-panel::-webkit-scrollbar-track {
  background: transparent;
}

.settings-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.settings-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

@keyframes slideInSettings {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.settings-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  position: sticky;
  top: 0;
  margin: 0;
  padding: 1.35rem 0 0.85rem;
  background: #030712;
  z-index: 2;
  box-shadow: 0 12px 25px rgba(2, 6, 23, 0.55);
}

.settings-panel-header > div {
  padding-right: 44px;
}

.settings-panel-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.settings-panel-title {
  margin: 0;
  font-size: 1.35rem;
  color: #f8fafc;
}

.settings-panel-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.settings-close-btn {
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  color: #fecdd3;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.65);
  font-size: 1rem;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.settings-close-btn:hover {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fee2e2;
  background: rgba(30, 41, 59, 0.98);
}

.settings-close-btn svg {
  pointer-events: none;
  width: 14px;
  height: 14px;
}

.settings-section {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.settings-section-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
}

.settings-section-description {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.settings-section-body select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(2, 6, 23, 0.65);
  color: #e5e7eb;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.settings-helper-text {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #fbbf24;
}

.future-section {
  background: rgba(15, 23, 42, 0.35);
  border-style: dashed;
}

.identity-section {
  gap: 1.5rem;
}

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

.identity-card {
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.identity-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.identity-card-title {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.identity-card-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.75);
}

.identity-preview {
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(15, 23, 42, 0.35);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

/* Light theme overrides */
body.theme-light .settings-panel-overlay {
  background: rgba(203, 213, 225, 0.65);
}
body.theme-light .settings-panel {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.15);
}
body.theme-light .settings-panel-header {
  background: #ffffff;
  box-shadow: 0 12px 25px rgba(2, 6, 23, 0.05);
}
body.theme-light .settings-panel-title { color: #0f172a; }
body.theme-light .settings-panel-subtitle { color: #334155; }
body.theme-light .settings-panel-label { color: #64748b; }
body.theme-light .settings-close-btn {
  background: #f1f5f9;
  color: #be123c;
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}
body.theme-light .settings-close-btn:hover {
  background: #e2e8f0;
}
body.theme-light .settings-section {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.3);
}
body.theme-light .settings-section-description { color: #334155; }
body.theme-light .settings-section-body select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.5);
}
body.theme-light .identity-card {
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.25);
}
body.theme-light .identity-preview {
  background: rgba(226, 232, 240, 0.35);
  color: #334155;
}
body.theme-light .identity-preview::after,
body.theme-light .identity-preview.is-preview::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(226, 232, 240, 0.6));
}

.identity-preview.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.6));
  z-index: 0;
}

.identity-preview span {
  position: relative;
  z-index: 1;
}

.identity-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.identity-preview.is-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.7));
  z-index: 0;
}

.identity-preview-pill {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5f5;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  z-index: 2;
}

.identity-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.identity-select {
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.5);
  background: rgba(2, 6, 23, 0.25);
  color: #5eead4;
  padding: 0.35rem 0.95rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.identity-select.disabled,
.identity-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.identity-upload {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.5);
  padding: 0.35rem 0.95rem;
  font-size: 0.8rem;
  color: #5eead4;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.identity-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.identity-upload.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.identity-remove {
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: transparent;
  color: #fecaca;
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.identity-hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.identity-locked {
  margin: 0;
  font-size: 0.75rem;
  color: #fbbf24;
}

.identity-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  align-self: flex-start;
}

.identity-status.pending {
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
}

.identity-status.success {
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
}

.identity-status.error {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
}

.bug-report-trigger-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.15) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fecaca;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.bug-report-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.2) 100%);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.bug-report-trigger-btn svg {
  font-size: 1.1rem;
}

@media (max-width: 640px) {
  .settings-panel-overlay {
    padding: 1rem;
    justify-content: center;
  }
  .settings-panel {
    width: 100%;
  }
}
.event-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.event-modal {
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.15), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(94, 234, 212, 0.12), transparent 35%),
    linear-gradient(140deg, #0b1222 0%, #0f1a2d 45%, #0b1222 100%);
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 16px;
  padding: 28px;
  max-width: 620px;
  width: 92%;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02);
  animation: slideIn 0.3s ease-out;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.event-pill {
  align-self: flex-start;
  padding: 6px 12px;
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #67e8f9;
}

.event-pill.karma {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.4);
  color: #c4b5fd;
}

.event-modal.karma {
  border-color: rgba(167, 139, 250, 0.35);
}

.resolution-pill.karma {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.4);
  color: #c4b5fd;
}

.event-modal.resolution.karma {
  border-color: rgba(167, 139, 250, 0.35);
}

.karma-deltas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 14px 0 6px;
}

.karma-delta-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.karma-delta-card.positive {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.06);
}

.karma-delta-card.negative {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.06);
}

.event-modal h2 {
  color: #e2e8f0;
  font-size: 26px;
  margin: 0;
  line-height: 1.2;
}

.event-story {
  color: #a5b4fc;
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  opacity: 0.9;
}

.event-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-button {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.choice-button:hover:not(:disabled) {
  background: rgba(94, 234, 212, 0.06);
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 8px 25px rgba(94, 234, 212, 0.08);
  transform: translateY(-1px);
}

.choice-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.choice-label {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.choice-caret {
  color: #67e8f9;
  font-weight: 700;
}

/* Resolution screen styles */
.event-modal.resolution {
  border: 1px solid rgba(255, 215, 0, 0.28);
}

.resolution-header {
  text-align: center;
  margin-bottom: 18px;
}

.resolution-pill {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffe27a;
}

.resolution h2 {
  color: #e2e8f0;
  font-size: 24px;
  margin: 12px 0 6px;
}

.resolution-subtitle {
  color: #cbd5e1;
  font-size: 14px;
  margin: 0;
}

.resolution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.resolution-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.resolution-card.rewards {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.06);
}

.resolution-card.penalties {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.06);
}

.card-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}

.delta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #e2e8f0;
}

.delta-label {
  text-transform: capitalize;
  color: #cbd5e1;
}

.delta-value.positive {
  color: #4ade80;
  font-weight: 700;
}

.delta-value.negative {
  color: #f87171;
  font-weight: 700;
}

.resolution-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.close-button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #ffe27a;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-weight: 700;
}

.close-button:hover {
  background: rgba(255, 215, 0, 0.08);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.15);
}
.beta-comment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.beta-comment-modal {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  animation: slideUp 0.3s ease-out;
}

.beta-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.beta-comment-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.beta-comment-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.beta-comment-close:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

.beta-comment-content {
  padding: 24px;
}

.beta-comment-description {
  margin: 0 0 20px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.6;
}

.beta-comment-field {
  margin-bottom: 20px;
}

.beta-comment-field label {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 14px;
}

.beta-comment-select,
.beta-comment-textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  box-sizing: border-box;
}

.beta-comment-select:focus,
.beta-comment-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.beta-comment-textarea {
  resize: vertical;
  min-height: 120px;
}

.beta-comment-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.beta-comment-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.beta-comment-checkbox label {
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  margin: 0;
}

.beta-comment-info {
  margin-top: 16px;
  padding: 12px;
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
}

.beta-comment-info p {
  margin: 0;
  color: #93c5fd;
  font-size: 13px;
  line-height: 1.5;
}

.beta-comment-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.beta-comment-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.beta-comment-btn.secondary {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.beta-comment-btn.secondary:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.beta-comment-btn.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.beta-comment-btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.beta-comment-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Light theme overrides */
body.theme-light .beta-comment-overlay { background: rgba(15, 23, 42, 0.25); }
body.theme-light .beta-comment-modal {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
}
body.theme-light .beta-comment-header { border-bottom-color: rgba(100, 116, 139, 0.2); }
body.theme-light .beta-comment-close { color: #475569; }
body.theme-light .beta-comment-description { color: #475569; }
body.theme-light .beta-comment-field label { color: #0f172a; }
body.theme-light .beta-comment-select,
body.theme-light .beta-comment-textarea {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.35);
  color: #0f172a;
}
body.theme-light .beta-comment-checkbox label { color: #334155; }
body.theme-light .beta-comment-info {
  background: rgba(59, 130, 246, 0.08);
  border-left-color: #3b82f6;
}
body.theme-light .beta-comment-info p { color: #1d4ed8; }
body.theme-light .beta-comment-btn.secondary { background: rgba(100, 116, 139, 0.12); color: #334155; }
body.theme-light .beta-comment-btn.secondary:hover { background: rgba(100, 116, 139, 0.2); color: #0f172a; }
@keyframes toastSlideIn {
  from {
    transform: translateX(450px) rotateY(15deg);
    opacity: 0;
  }
  to {
    transform: translateX(0) rotateY(0);
    opacity: 1;
  }
}

@keyframes toastPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
}

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

.toast-container {
  position: fixed;
  top: 100px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  min-width: 320px;
  max-width: 440px;
  animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.toast:hover {
  transform: translateX(-6px) translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.6);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(20, 83, 45, 0.35) 100%);
}

.toast-success .toast-icon {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(34, 197, 94, 0.1) 100%);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.3), inset 0 0 8px rgba(34, 197, 94, 0.2);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(127, 29, 29, 0.35) 100%);
}

.toast-error .toast-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.1) 100%);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3), inset 0 0 8px rgba(239, 68, 68, 0.2);
}

.toast-warning {
  border-color: rgba(251, 191, 36, 0.6);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(120, 84, 0, 0.35) 100%);
}

.toast-warning .toast-icon {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(251, 191, 36, 0.1) 100%);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.3), inset 0 0 8px rgba(251, 191, 36, 0.2);
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.6);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 64, 175, 0.35) 100%);
}

.toast-info .toast-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.3), inset 0 0 8px rgba(59, 130, 246, 0.2);
}


.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid;
  animation: iconBounce 0.6s ease-in-out;
}

.toast-message {
  flex: 1;
  font-size: 0.96rem;
  color: #f1f5f9;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.toast-close {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1.4rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  transform: rotate(90deg);
}

@media (max-width: 640px) {
  .toast-container {
    right: 12px;
    left: 12px;
    top: 90px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
    padding: 14px 16px;
    gap: 12px;
  }

  .toast-icon {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
  }

  .toast-message {
    font-size: 0.92rem;
  }
}
.version-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

.version-modal {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid #00f0ff33;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 240, 255, 0.2);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.version-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #00f0ff22;
  background: rgba(0, 240, 255, 0.05);
}

.version-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #00f0ff;
}

.version-modal-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.version-modal-close:hover {
  color: #ff4444;
}

.version-modal-content {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.version-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.version-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 12px;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.version-tab:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: #00f0ff44;
  color: #ccc;
}

.version-tab.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00f0ff;
  color: #00f0ff;
}

.current-badge {
  background: #00f0ff;
  color: #000;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
}

.version-details {
  animation: fadeIn 0.2s ease-out;
}

.version-date {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.change-category {
  margin-bottom: 16px;
}

.change-category h3 {
  font-size: 0.95rem;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.change-category ul {
  margin: 0;
  padding-left: 20px;
}

.change-category li {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 4px;
  line-height: 1.4;
}

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