/* ================================================
   Space Colonies Idle Game - Complete Stylesheet
   Dark/Light Theme Support mit modernem Design
   Layout: Option 1 - Sticky Top Action Button
   FIXED: Badge overlap issue
   ================================================ */

/* Globale Variablen - Dark Theme (Standard) */
:root {
  --bg-main: #05060b;
  --bg-panel: #111320;
  --bg-panel-soft: #171a2a;
  --bg-card: #1a1f35;
  --accent: #38d6ff;
  --accent-soft: #38d6ff33;
  --accent-glow: #38d6ff88;
  --text-main: #f5f7ff;
  --text-muted: #9ca3c7;
  --border-soft: #2a3045;
  --danger: #ff4b6a;
  --success: #4ade80;
  --warning: #fbbf24;
  --info: #60a5fa;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-main: #f5f7fa;
  --bg-panel: #ffffff;
  --bg-panel-soft: #f0f2f5;
  --bg-card: #fafbfc;
  --accent: #0088cc;
  --accent-soft: #0088cc22;
  --accent-glow: #0088cc66;
  --text-main: #1a202c;
  --text-muted: #4a5568;
  --border-soft: #e2e8f0;
  --danger: #e53e3e;
  --success: #38a169;
  --warning: #d69e2e;
  --info: #3b82f6;
}

/* Reset & Basics */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 20% 20%, #1b1f33 0, transparent 55%),
    radial-gradient(circle at 80% 80%, #101425 0, transparent 55%),
    linear-gradient(135deg, #02040a 0%, #05060b 40%, #02030a 100%);
  background-attachment: fixed;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 20% 20%, #e8eef5 0, transparent 55%),
    radial-gradient(circle at 80% 80%, #f0f4f8 0, transparent 55%),
    linear-gradient(135deg, #f5f7fa 0%, #ffffff 40%, #f8f9fb 100%);
}

/* Hauptlayout - OPTION 1: Keine Spalten mehr, alles vertikal */
#app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

/* ================================================
   Theme Toggle Button
   ================================================ */

.theme-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 8px;
  font-size: 20px;
  background: var(--bg-panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.theme-toggle:hover {
  background: var(--bg-card);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ================================================
   Stats-Bar (Resource Display)
   ================================================ */

.stats-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--bg-main), var(--bg-panel));
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-panel-soft);
  border: 1px solid var(--border-soft);
  font-size: 13px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-soft);
}

.stat-pill .label {
  font-weight: 600;
  color: var(--text-main);
}

.stat-pill .details {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.stat-pill.stat-space {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.stat-meta {
  margin-left: auto;
  align-self: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ================================================
   Actions - OPTION 1: Sticky Top, horizontal layout
   ================================================ */

.actions {
  position: sticky;
  top: 80px; /* Below stats bar */
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--bg-panel), var(--bg-panel-soft));
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.action-btn {
  flex: 1;
  min-width: 200px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  border: 2px solid var(--accent-soft);
  box-shadow: 0 0 20px var(--accent-soft);
  color: var(--bg-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-btn:hover {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent));
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

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

/* ================================================
   Buttons (Global)
   ================================================ */

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-panel-soft));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--bg-panel-soft), var(--bg-card));
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

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

/* ================================================
   Upgrades Panel - OPTION 1: Full width
   ================================================ */

.upgrades-panel {
  width: 100%;
  padding: 10px;
  background: var(--bg-panel);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

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

.tab-btn {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}

.tab-btn.active {
  background: var(--accent-soft);
  color: var(--text-main);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-soft);
}

/* ================================================
   Upgrade Grids & Columns
   ================================================ */

.upgrade-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.upgrade-col {
  flex: 1 1 280px;
  min-width: 260px;
  max-width: 400px;
}

.upgrade-col h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================================================
   Cards (Upgrade/Building/Research/Prestige)
   ================================================ */

.card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border-color: var(--accent-soft);
}

/* 🎯 Size Indicator Badge - FIXED: Positioned to avoid overlap */
.card .size-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.card .size-badge.size-1 { border-color: #4ade80; color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.card .size-badge.size-2 { border-color: #fbbf24; color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.card .size-badge.size-3 { border-color: #ff4b6a; color: #ff4b6a; background: rgba(255, 75, 106, 0.1); }

/* 💰 Affordability States */
.card.affordable {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--bg-card), rgba(74, 222, 128, 0.03));
}

.card.partially-affordable {
  border-color: var(--warning);
  background: linear-gradient(135deg, var(--bg-card), rgba(251, 191, 36, 0.03));
}

.card.not-affordable {
  border-color: var(--border-soft);
  opacity: 0.7;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text-main);
  padding-right: 80px; /* FIXED: More space for both badges */
  display: flex;
  align-items: center;
  gap: 6px;
}

.card p {
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

.card p.muted {
  font-size: 12px;
  color: var(--text-muted);
}

/* 📈 Production Info with Highlighting */
.card .production-info {
  color: var(--success);
  font-weight: 600;
  font-size: 13px;
  background: rgba(74, 222, 128, 0.08);
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid var(--success);
  margin-top: 6px;
}

/* 💸 Cost Display with Color Coding */
.card .cost-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.card .cost-item {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}

.card .cost-item.affordable {
  background: rgba(74, 222, 128, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.card .cost-item.not-affordable {
  background: rgba(255, 75, 106, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

/* Research Cards */
.research-card {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}

/* Prestige Cards */
.prestige-card {
  border-left: 3px solid var(--warning);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.05), transparent);
}

.prestige-card h3 {
  color: var(--warning);
}

/* Completed Research */
.card.completed {
  opacity: 0.6;
  background: var(--bg-panel-soft);
}

/* 🔄 Building Count Badge - FIXED: Inline in title to avoid overlap */
.card .count-badge {
  display: inline-flex;
  align-items: center;
  background: var(--info);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  flex-shrink: 0;
}

/* Buy Button in Cards */
.buy-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  border: 1px solid var(--accent-soft);
  color: var(--bg-main);
  position: relative;
  overflow: hidden;
}

.buy-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.buy-btn:hover:not(:disabled)::before {
  width: 300px;
  height: 300px;
}

.buy-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent));
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-2px);
}

.buy-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* 💥 Demolish Button */
.demolish-btn {
  width: 40px;
  padding: 8px;
  background: linear-gradient(135deg, var(--danger), #d32f2f);
  border: 1px solid rgba(255, 75, 106, 0.3);
  color: white;
  cursor: pointer;
  font-size: 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.demolish-btn:hover {
  background: linear-gradient(135deg, #ff1744, var(--danger));
  box-shadow: 0 0 12px rgba(255, 75, 106, 0.5);
  transform: scale(1.05);
}

/* ================================================
   Progress Bars
   ================================================ */

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  transition: width 0.3s ease;
  border-radius: 3px;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ================================================
   Statistics Container
   ================================================ */

#statisticsContainer {
  padding: 16px;
}

.stats-section {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  padding: 16px;
  margin-bottom: 16px;
}

.stats-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--accent);
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 8px;
}

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

.stat-item {
  background: var(--bg-panel-soft);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

.stat-item .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-item .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-item .stat-value.accent {
  color: var(--accent);
}

.stat-item .stat-value.success {
  color: var(--success);
}

.stat-item .stat-value.warning {
  color: var(--warning);
}

.prestige-history {
  max-height: 200px;
  overflow-y: auto;
}

.prestige-history-item {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  margin-bottom: 4px;
  background: var(--bg-panel-soft);
  border-radius: 6px;
  font-size: 13px;
}

.prestige-history-item .date {
  color: var(--text-muted);
}

.prestige-history-item .points {
  color: var(--warning);
  font-weight: 600;
}

/* ================================================
   Prestige Container
   ================================================ */

#prestigeContainer {
  padding: 16px;
  background: var(--bg-panel);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  margin-bottom: 16px;
}

#prestigeContainer h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--warning);
}

.prestige-info {
  background: rgba(251, 191, 36, 0.05);
  border-left: 3px solid var(--warning);
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}

.prestige-info p {
  margin: 6px 0;
}

.prestige-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #b8860b, var(--warning));
  color: #000;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.prestige-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--warning), #fcd34d);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
}

.prestige-btn:disabled {
  background: var(--bg-panel-soft);
  color: var(--text-muted);
  box-shadow: none;
}

#prestigeUpgrades {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* ================================================
   Hotkey Help Overlay
   ================================================ */

.hotkey-help {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.hotkey-help-content {
  background: var(--bg-panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 32px;
  max-width: 700px;
  width: 90%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8);
}

.hotkey-help-content h2 {
  margin: 0 0 24px;
  font-size: 28px;
  color: var(--accent);
  text-align: center;
}

.hotkey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.hotkey-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-soft);
  padding-bottom: 6px;
}

.hotkey-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  padding: 4px 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-help-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: var(--accent);
  color: var(--bg-main);
  font-weight: 600;
}

.close-help-btn:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ================================================
   Achievements
   ================================================ */

#achievementsContainer {
  padding: 16px;
}

.achievement-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(56, 214, 255, 0.1));
  border-radius: 12px;
  border: 1px solid var(--accent-soft);
}

.achievement-header h2 {
  margin: 0 0 12px;
  font-size: 28px;
  color: var(--accent);
}

.achievement-stats {
  margin-bottom: 12px;
}

.stat-highlight {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}

.stat-label {
  font-size: 16px;
  color: var(--text-muted);
}

.achievement-progress-bar {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin: 0 auto;
  overflow: hidden;
}

.achievement-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.5s ease;
}

.achievement-category {
  margin-bottom: 24px;
}

.achievement-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-panel-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 12px;
}

.achievement-category-header h3 {
  margin: 0;
  font-size: 18px;
}

.category-progress {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.achievement-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  transition: all 0.2s ease;
}

.achievement-card.unlocked {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.05), var(--bg-card));
}

.achievement-card.locked {
  opacity: 0.5;
}

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

.achievement-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.achievement-content {
  flex: 1;
}

.achievement-content h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-main);
}

.achievement-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.achievement-time {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* ================================================
   Enhanced Notification System
   ================================================ */

/* Generische Notification (alle Typen) */
.notification {
  position: fixed;
  top: 80px;
  right: -400px;
  width: 320px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-panel-soft));
  border: 2px solid;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  z-index: 1000;
  transition: right 0.3s ease;
}

.notification.show {
  right: 20px;
}

.notification-content {
  display: flex;
  gap: 12px;
  padding: 16px;
  align-items: center;
}

.notification-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.notification-text {
  flex: 1;
}

.notification-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.notification-message {
  margin: 0;
  font-size: 16px;
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.3;
}

.notification-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Typ-spezifische Styles */
.notification-achievement {
  border-color: var(--success);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 40px rgba(74, 222, 128, 0.3);
}

.notification-research {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 40px var(--accent-glow);
}

.notification-milestone {
  border-color: var(--warning);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 40px rgba(251, 191, 36, 0.3);
}

.notification-warning {
  border-color: var(--danger);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 75, 106, 0.3);
}

.notification-info {
  border-color: var(--text-muted);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 40px rgba(156, 163, 199, 0.2);
}

.notification-success {
  border-color: var(--success);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 40px rgba(74, 222, 128, 0.3);
}

/* Legacy Achievement Notification Support (für Abwärtskompatibilität) */
.achievement-notification {
  position: fixed;
  top: 80px;
  right: -400px;
  width: 320px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-panel-soft));
  border: 2px solid var(--success);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 40px rgba(74, 222, 128, 0.3);
  z-index: 1000;
  transition: right 0.3s ease;
}

.achievement-notification.show {
  right: 20px;
}

.achievement-notification-content {
  display: flex;
  gap: 12px;
  padding: 16px;
  align-items: center;
}

.achievement-notification-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.achievement-notification-text strong {
  display: block;
  color: var(--success);
  font-size: 14px;
  margin-bottom: 4px;
}

.achievement-notification-text p {
  margin: 0;
  font-size: 16px;
  color: var(--text-main);
  font-weight: 600;
}

/* ================================================
   Save/Load Panel
   ================================================ */

.save-panel {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-panel-soft);
  border-radius: 10px;
  border: 1px dashed var(--border-soft);
}

.save-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.save-btn {
  padding: 8px 12px;
  font-size: 13px;
}

#saveString {
  width: 100%;
  resize: vertical;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
}

#saveString:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent-soft),
    0 0 12px var(--accent-soft);
}

/* ================================================
   Animations
   ================================================ */

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

.pulse {
  animation: pulse 1s ease-in-out infinite;
}

/* ================================================
   Responsive Design - OPTION 1: Simplified
   ================================================ */

@media (max-width: 900px) {
  .actions {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
  }
  
  .upgrade-col {
    flex: 1 1 100%;
    max-width: 100%;
  }
  
  .achievement-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .hotkey-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  #app {
    padding: 8px;
  }
  
  .stats-bar {
    font-size: 12px;
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    width: 100%;
  }
  
  .notification,
  .achievement-notification {
    width: calc(100% - 32px);
    right: -100%;
  }
  
  .notification.show,
  .achievement-notification.show {
    right: 16px;
  }
  
  .hotkey-help-content {
    padding: 20px;
  }
}

/* ================================================
   Utilities & Helpers
   ================================================ */

.muted {
  color: var(--text-muted) !important;
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-soft);
}