/* CSS Reset and Variables */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #2a2f3e;
  --accent-primary: #4a5ab4;
  --accent-secondary: #32c8a0;
  --text-primary: #ffffff;
  --text-secondary: #b8c5d1;
  --text-muted: #7a8a9a;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.3);
  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Base Styles */
body {
  margin: 0;
  background-color: var(--bg-primary);
  background-image: linear-gradient(140% 140% at 15% 15%, rgba(70, 90, 180, 0.28), transparent 55%), 
                    linear-gradient(120% 120% at 85% 20%, rgba(50, 200, 160, 0.24), transparent 60%), 
                    linear-gradient(180deg, rgba(5, 7, 13, 0.68), rgba(5, 7, 13, 0.82)), 
                    url("images/backgrounds/mainbackground.png");
  background-size: cover, cover, cover, cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: 100vh;
  overflow: hidden;
}

#app {
  height: 100vh;
  display: flex;
  position: relative;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px; /* Hidden by default */
  width: 280px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  z-index: 1000;
  transition: left var(--transition-normal);
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
}

.sidebar.open + .main-content {
  margin-left: 280px; /* Add margin when sidebar is open */
}

/* Mobile: Hide sidebar by default */
@media (max-width: 768px) {
  .sidebar {
    left: -280px;
  }
  
  .sidebar.open {
    left: 0;
  }
}

.sidebar-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Server Clock */
.sidebar-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

.clock-time {
  font-size: 18px;
  font-weight: 600;
  color: #3498db;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.clock-date {
  font-size: 12px;
  color: #bdc3c7;
  font-family: 'Courier New', monospace;
  opacity: 0.8;
}

.sidebar-title-img {
  height: auto;
}

/* Mobile logo size restriction */
@media (max-width: 768px) {
  .sidebar-title-img {
    max-width: 120px;
  }
}

/* ========================================
   ADMIN PANEL STYLES
   ======================================== */

/* Admin Panel Container */
.admin-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow-x: auto;
}

.admin-tab {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-weight: 500;
  font-size: 0.95rem;
}

.admin-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: rgba(74, 90, 180, 0.1);
}

/* Admin Tab Content */
.admin-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.admin-tab-content.active {
  display: block;
}

/* Admin Section Headers */
.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-section-header h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

/* Admin Search */
.admin-search {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.admin-search input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  min-width: 300px;
  transition: all 0.3s ease;
}

.admin-search input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 90, 180, 0.2);
}

.admin-search button {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-search button:hover {
  background: #3a4a9c;
  transform: translateY(-1px);
}

/* Admin Cards */
.admin-user-card,
.admin-guild-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-user-card:hover,
.admin-guild-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-primary);
}

/* Admin Card Info */
.admin-user-info,
.admin-guild-info {
  flex: 1;
  margin-right: 1.5rem;
}

.admin-user-header,
.admin-guild-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-user-header h4,
.admin-guild-header h4 {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.admin-user-id,
.admin-guild-id {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
}

.admin-user-details,
.admin-guild-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.admin-user-details p,
.admin-guild-details p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.admin-user-details strong,
.admin-guild-details strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Admin Actions */
.admin-user-actions,
.admin-guild-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 120px;
}

/* Admin Buttons */
.admin-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.admin-btn-primary {
  background: var(--accent-primary);
  color: white;
}

.admin-btn-primary:hover {
  background: #3a4a9c;
  transform: translateY(-1px);
}

.admin-btn-warning {
  background: var(--warning);
  color: white;
}

.admin-btn-warning:hover {
  background: #e68900;
  transform: translateY(-1px);
}

.admin-btn-danger {
  background: var(--error);
  color: white;
}

.admin-btn-danger:hover {
  background: #d32f2f;
  transform: translateY(-1px);
}

.admin-btn-info {
  background: #17a2b8;
  color: white;
}

.admin-btn-info:hover {
  background: #138496;
  transform: translateY(-1px);
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* System Actions */
.admin-system-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.admin-action-group {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.admin-action-group h4 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-action-group .admin-btn {
  width: 100%;
  margin-bottom: 0.75rem;
}

.admin-action-group .admin-btn:last-child {
  margin-bottom: 0;
}

/* Chat Controls */
.admin-chat-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.admin-broadcast {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-broadcast input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.admin-broadcast input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 90, 180, 0.2);
}

/* System Chat Messages */
.chat-message.system-message {
  background: rgba(74, 90, 180, 0.1);
  border-left: 3px solid var(--accent-primary);
  margin: 0.5rem 0;
  padding: 0.75rem;
  border-radius: 0 6px 6px 0;
}

.system-username {
  color: var(--accent-primary) !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.system-text {
  color: var(--text-primary) !important;
  font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .admin-section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .admin-search {
    flex-direction: column;
  }
  
  .admin-search input {
    min-width: auto;
    width: 100%;
  }
  
  .admin-user-card,
  .admin-guild-card {
    flex-direction: column;
    gap: 1rem;
  }
  
  .admin-user-info,
  .admin-guild-info {
    margin-right: 0;
  }
  
  .admin-user-actions,
  .admin-guild-actions {
    flex-direction: row;
    min-width: auto;
  }
  
  .admin-user-details,
  .admin-guild-details {
    grid-template-columns: 1fr;
  }
  
  .admin-system-actions,
  .admin-chat-controls {
    grid-template-columns: 1fr;
  }
  
  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .admin-tab {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.sidebar-close:hover {
  background: var(--bg-tertiary);
}

.sidebar-nav {
  padding: var(--spacing-md);
}

.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: none;
  border: none;
  color: var(--text-secondary);
  text-align: left;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-sm);
}

.sidebar-nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-nav-item.is-active {
  background: var(--accent-primary);
  color: var(--text-primary);
}

.sidebar-nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.sidebar-nav-text {
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin-left: 0; /* No margin by default */
  transition: margin-left var(--transition-normal);
}

/* Mobile: No margin when sidebar is closed */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }
  
  .sidebar.open + .main-content {
    margin-left: 0;
  }
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 60px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--bg-tertiary);
}

.header-profile {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.profile-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.profile-details {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.profile-level {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.xp-bar {
  width: 60px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: var(--accent-secondary);
  transition: width var(--transition-normal);
}

.xp-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.current-mine,
.active-pickaxe,
.mine-rate,
.mine-power {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--spacing-xs);
}

.mine-label,
.pickaxe-label,
.rate-label,
.power-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mine-name,
.pickaxe-name {
  font-size: 0.8rem;
  font-weight: 500;
}

.rate-value,
.power-value {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

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

.user-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.user-menu-toggle:hover {
  background: var(--bg-tertiary);
}

.user-menu-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  min-width: 200px;
  z-index: 100;
}

.user-menu-details {
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border);
}

.user-menu-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-menu-email {
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  margin-top: var(--spacing-xs);
}

.user-menu-logout {
  width: 100%;
  background: var(--error);
  color: var(--text-primary);
  border: none;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color var(--transition-fast);
}

.user-menu-logout:hover {
  background: #d32f2f;
}

/* Content Container */
.content-container {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: var(--spacing-md);
  padding-bottom: 60px; /* space for bottom panel when closed */
  display: block;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
  scroll-behavior: smooth;
  position: relative;
  height: calc(100vh - 200px); /* Fixed height to ensure scrolling works */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.content-container::-webkit-scrollbar {
  display: none;
}

/* Panels */
.panel {
  background: linear-gradient(145deg, #1a1f2e, #2a2f3e);
  border: 2px solid #3a4a5c;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #4a5ab4, #32c8a0, #4a5ab4, transparent);
  opacity: 0.8;
}

.panel-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.panel-sub {
  font-size: 0.95rem;
  color: #b8c5d1;
  font-style: italic;
}

.panel-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.panel-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.panel-body {
  /* Content will be added here */
}

/* Auth Panel */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.auth-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.auth-title-img {
  max-width: 200px;
  height: auto;
  margin-bottom: var(--spacing-lg);
}

.auth-tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  line-height: 1.5;
}

.form-group {
  margin-bottom: var(--spacing-md);
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.form-actions button {
  flex: 1;
  padding: var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-help {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
}

.form-group input:invalid {
  border-color: var(--error);
}

.form-group input:valid {
  border-color: var(--success);
}

#btn-login {
  background: var(--accent-primary);
  color: var(--text-primary);
}

#btn-login:hover {
  background: #3a4a94;
}

#btn-register {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

#btn-register:hover {
  background: var(--bg-secondary);
}

.auth-message {
  font-size: 0.9rem;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  text-align: center;
}

.auth-message.success {
  background: rgba(76, 175, 80, 0.1);
  color: var(--success);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.auth-message.error {
  background: rgba(244, 67, 54, 0.1);
  color: var(--error);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.auth-message.warning {
  background: rgba(255, 152, 0, 0.1);
  color: var(--warning);
  border: 1px solid rgba(255, 152, 0, 0.3);
}

/* Rarity Tabs - moved to workshop controls */

/* Workshop Controls */
.workshop-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  gap: 1rem;
  flex-wrap: wrap;
}

.rarity-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.rarity-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rarity-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--accent);
}

.rarity-tab.is-active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
  font-weight: 600;
}

/* Rarity-specific tab colors */
.rarity-tab[data-rarity="Common"] {
  border-left: 3px solid #8a8a8a;
}

.rarity-tab[data-rarity="Uncommon"] {
  border-left: 3px solid #1eff00;
}

.rarity-tab[data-rarity="Rare"] {
  border-left: 3px solid #0070dd;
}

.rarity-tab[data-rarity="Epic"] {
  border-left: 3px solid #a335ee;
}

.rarity-tab[data-rarity="Legendary"] {
  border-left: 3px solid #ff8000;
}

.rarity-tab[data-rarity="Mythic"] {
  border-left: 3px solid #ff1744;
}

/* Toggle styling */
.workshop-toggle {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.toggle-checkbox {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-checkbox:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-checkbox:checked + .toggle-slider::before {
  transform: translateX(26px);
  background: var(--bg-primary);
}

.toggle-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Mobile responsiveness for workshop controls */
@media (max-width: 768px) {
  .workshop-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .rarity-tabs {
    justify-content: center;
  }
  
  .workshop-toggle {
    justify-content: center;
  }
}

/* Comparison info styling */
.comparison-info {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.4rem;
  border-radius: 4px;
  border-left: 3px solid #4a5ab4;
  font-weight: 500;
  text-align: center;
}

/* Grids */
.mine-list,
.inventory-grid,
.pickaxe-grid {
  display: grid;
  gap: 1rem;
}

.mine-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.inventory-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.pickaxe-grid {
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
}

/* Card Buttons */
.mine-card button,
.inventory-card button,
.pickaxe-card button,
.mine-card .secondary,
.inventory-card .secondary,
.pickaxe-card .secondary,
.mine-card .btn-craft,
.inventory-card .btn-craft,
.pickaxe-card .btn-craft {
  background: linear-gradient(145deg, #4a5ab4, #3a4a94);
  border: 1px solid #5a6ac4;
  border-radius: 6px;
  color: #ffffff;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  margin-top: auto;
  align-self: flex-start;
  width: 100%;
}

/* Only inventory cards have button hover effects */
.inventory-card button:hover,
.inventory-card .secondary:hover,
.inventory-card .btn-craft:hover {
  background: linear-gradient(145deg, #5a6ac4, #4a5ab4);
  border-color: #6a7ad4;
  transform: translateY(-1px);
  box-shadow: 
    0 3px 6px rgba(74, 90, 180, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* Sell All and Sell Selected button styling */
#btn-sell-all,
#btn-sell-selection {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52, #e74c3c) !important;
  border: 2px solid #ff8e8e !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  padding: 0.5rem 1rem !important;
  border-radius: 6px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 
    0 4px 15px rgba(231, 76, 60, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2) !important;
}

#btn-sell-all::before,
#btn-sell-selection::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent) !important;
  transition: left 0.6s ease !important;
}

#btn-sell-all:hover,
#btn-sell-selection:hover {
  background: linear-gradient(135deg, #ff8e8e, #ff6b6b, #ff5252) !important;
  border-color: #ffb3b3 !important;
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 
    0 8px 25px rgba(231, 76, 60, 0.4),
    0 4px 15px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
}

#btn-sell-all:hover::before,
#btn-sell-selection:hover::before {
  left: 100% !important;
}

#btn-sell-all:active,
#btn-sell-selection:active {
  transform: translateY(-1px) scale(1.01) !important;
  box-shadow: 
    0 4px 15px rgba(231, 76, 60, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2) !important;
}

#btn-sell-all:disabled,
#btn-sell-selection:disabled {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d, #6c7b7d) !important;
  border-color: #bdc3c7 !important;
  color: #ecf0f1 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
}

#btn-sell-all:disabled::before,
#btn-sell-selection:disabled::before {
  display: none !important;
}

.inventory-card button:active,
.inventory-card .secondary:active,
.inventory-card .btn-craft:active {
  transform: translateY(0);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Button Variants */
.mine-card .btn-mine {
  background: linear-gradient(145deg, #f7d660, #d7b640);
  border-color: #ffd660;
  color: #1a1a1a;
}

.mine-card .btn-mine:hover {
  background: linear-gradient(145deg, #ffd660, #f7d660);
  border-color: #ffd660;
}

.pickaxe-card .btn-craft {
  background: linear-gradient(145deg, #32c8a0, #22a880);
  border-color: #42d8b0;
}

.pickaxe-card .btn-craft:hover {
  background: linear-gradient(145deg, #42d8b0, #32c8a0);
  border-color: #52e8c0;
}

.pickaxe-card .btn-craft:disabled {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border-color: #444444;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Retro RPG Buttons */
.btn-primary,
.btn-secondary,
.btn-craft,
.btn-mine {
  background: linear-gradient(145deg, #4a5ab4, #3a4a94);
  border: 2px solid #5a6ac4;
  border-radius: 8px;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-craft:hover,
.btn-mine:hover {
  background: linear-gradient(145deg, #5a6ac4, #4a5ab4);
  border-color: #6a7ad4;
  transform: translateY(-2px);
  box-shadow: 
    0 6px 12px rgba(74, 90, 180, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: linear-gradient(145deg, #2a2f3e, #1a1f2e);
  border-color: #3a4a5c;
}

.btn-secondary:hover {
  background: linear-gradient(145deg, #3a4a5c, #2a2f3e);
  border-color: #4a5a6c;
}

.btn-craft {
  background: linear-gradient(145deg, #32c8a0, #22a880);
  border-color: #42d8b0;
}

.btn-craft:hover {
  background: linear-gradient(145deg, #42d8b0, #32c8a0);
  border-color: #52e8c0;
}

.btn-mine {
  background: linear-gradient(145deg, #f7d660, #d7b640);
  border-color: #ffd660;
  color: #1a1a1a;
}

.btn-mine:hover {
  background: linear-gradient(145deg, #ffd660, #f7d660);
  border-color: #ffd660;
}

/* Disabled Button State */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-craft:disabled,
.btn-mine:disabled {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border-color: #444444;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Cards - Retro RPG Design */
.mine-card,
.inventory-card,
.pickaxe-card {
  background: 
    linear-gradient(135deg, #1a1f2e 0%, #2a2f3e 50%, #1a1f2e 100%),
    radial-gradient(circle at 20% 20%, rgba(74, 90, 180, 0.1) 0%, transparent 50%);
  border: 2px solid #4a5a6c;
  border-radius: 6px;
  padding: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(74, 90, 180, 0.1);
  display: flex;
  flex-direction: column;
  min-height: 100px;
  font-family: 'Courier New', monospace;
}

/* Inventory sell controls */
.inventory-card .sell-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  justify-content: center;
}

.inventory-card .sell-controls input[type="number"] {
  width: 90px;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
}

/* removed +/- and max buttons */

.inventory-card .price-preview {
  margin-left: auto;
  font-weight: 700;
  color: #b8c5d1;
}

/* Retro RPG Decorative Elements */
.mine-card::before,
.inventory-card::before,
.pickaxe-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4a5ab4, #32c8a0, #4a5ab4, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 6px 6px 0 0;
}

.mine-card::after,
.inventory-card::after,
.pickaxe-card::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border: 1px solid rgba(74, 90, 180, 0.2);
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Only inventory cards have hover effects */
.inventory-card:hover {
  background: 
    linear-gradient(135deg, #2a2f3e 0%, #3a4a5c 50%, #2a2f3e 100%),
    radial-gradient(circle at 20% 20%, rgba(74, 90, 180, 0.15) 0%, transparent 50%);
  border-color: #6a7ad4;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(74, 90, 180, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(74, 90, 180, 0.3);
}

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

.inventory-card:hover::after {
  opacity: 1;
}

/* Card Headers - Clean Typography */
.mine-card h3,
.inventory-card h3,
.pickaxe-card h3,
.mine-card .mine-title,
.inventory-card .title,
.pickaxe-card .title {
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.3rem 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.2px;
  line-height: 1.2;
  font-family: var(--font-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.2rem;
}

/* Card Content - Readable Typography */
.mine-card p,
.inventory-card p,
.pickaxe-card p,
.mine-card .mine-requirement,
.inventory-card .amount,
.pickaxe-card .rarity,
.pickaxe-card .panel-sub {
  color: #b8c5d1;
  font-size: 0.7rem;
  line-height: 1.5;
  margin: 0.2rem 0;
  flex-grow: 1;
  font-family: var(--font-main);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  word-wrap: break-word;
  hyphens: auto;
}

/* Mine-specific elements */
.mine-card .mine-yield {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.3rem 0;
  padding: 0.3rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid #f7d660;
}

.mine-card .mine-yield span {
  background: rgba(247, 214, 96, 0.2);
  color: #f7d660;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 500;
}

/* Inventory-specific elements */
.inventory-card .amount {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.3rem;
  border-radius: 4px;
  border-left: 3px solid #32c8a0;
  margin: 0.3rem 0;
}

/* Pickaxe-specific elements */
.pickaxe-card .stats {
  display: flex;
  justify-content: space-between;
  margin: 0.3rem 0;
  padding: 0.3rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid #8a4fc7;
}

.pickaxe-card .stats span {
  font-size: 0.65rem;
  color: #8a4fc7;
  font-weight: 500;
}

.pickaxe-card .requirements {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid #8a4fc7;
  padding: 0.3rem;
}

.pickaxe-card .requirements li {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
  font-size: 0.65rem;
  color: #b8c5d1;
}

/* Upgrade level badge on pickaxe title */
.pickaxe-card .title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pickaxe-card .upgrade-badge {
  background: #2f3b6b;
  color: #fff;
  border: 1px solid #4a5ab4;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
}

/* Card action buttons row */
.pickaxe-card .card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

/* Unified button styles for card actions */
.pickaxe-card .btn {
  background: linear-gradient(145deg, #4a5ab4, #3a4a94);
  border: 1px solid #5a6ac4;
  border-radius: 6px;
  color: #ffffff;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pickaxe-card .btn.secondary {
  background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
  border-color: #555;
}
.pickaxe-card .btn.accent {
  background: linear-gradient(145deg, #32c8a0, #22a880);
  border-color: #42d8b0;
}
.pickaxe-card .btn.needs-resources {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border-color: #444;
  color: #666;
  cursor: not-allowed;
}

.pickaxe-card .requirements .missing {
  color: #ff6b6b;
  font-weight: 600;
}

/* Card Stats - Clean Style */
.mine-card .mine-stats,
.inventory-card .inventory-stats,
.pickaxe-card .pickaxe-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.3rem 0;
  padding: 0.3rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  font-family: var(--font-main);
}

.mine-card .stat,
.inventory-card .stat,
.pickaxe-card .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  background: rgba(74, 90, 180, 0.1);
  border-radius: 3px;
  border: 1px solid rgba(74, 90, 180, 0.2);
  min-width: 45px;
  text-align: center;
}

.mine-card .stat-label,
.inventory-card .stat-label,
.pickaxe-card .stat-label {
  font-size: 0.65rem;
  color: #a0b0c0;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
}

.mine-card .stat-value,
.inventory-card .stat-value,
.pickaxe-card .stat-value {
  font-size: 0.75rem;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  line-height: 1.1;
}

/* Card Type Variations */
.mine-card {
  border-left: 3px solid #f7d660;
}

.mine-card .card-header {
  border-left: 2px solid #f7d660;
}

.inventory-card {
  border-left: 3px solid #32c8a0;
}

/* Mineral name rarity colors in inventory */
.inventory-card .mineral-name.rarity-common {
  color: #8a8a8a !important; /* Gray */
}

.inventory-card .mineral-name.rarity-uncommon {
  color: #1eff00 !important; /* Green */
}

.inventory-card .mineral-name.rarity-rare {
  color: #0070dd !important; /* Blue */
}

.inventory-card .mineral-name.rarity-epic {
  color: #a335ee !important; /* Purple */
}

.inventory-card .mineral-name.rarity-legendary {
  color: #ff8000 !important; /* Orange */
}

.inventory-card .mineral-name.rarity-mythic {
  color: #ff1744 !important; /* Deep Vibrant Red */
}

/* Workshop pickaxe material color coding */
.pickaxe-card .mineral-name.rarity-common {
  color: #8a8a8a !important; /* Gray */
}

.pickaxe-card .mineral-name.rarity-uncommon {
  color: #1eff00 !important; /* Green */
}

.pickaxe-card .mineral-name.rarity-rare {
  color: #0070dd !important; /* Blue */
}

.pickaxe-card .mineral-name.rarity-epic {
  color: #a335ee !important; /* Purple */
}

.pickaxe-card .mineral-name.rarity-legendary {
  color: #ff8000 !important; /* Orange */
}

.pickaxe-card .mineral-name.rarity-mythic {
  color: #ff1744 !important; /* Deep Vibrant Red */
}

/* Pickaxe card title rarity colors */
.pickaxe-card .title.rarity-common {
  color: #8a8a8a !important; /* Gray */
}

.pickaxe-card .title.rarity-uncommon {
  color: #1eff00 !important; /* Green */
}

.pickaxe-card .title.rarity-rare {
  color: #0070dd !important; /* Blue */
}

.pickaxe-card .title.rarity-epic {
  color: #a335ee !important; /* Purple */
}

.pickaxe-card .title.rarity-legendary {
  color: #ff8000 !important; /* Orange */
}

.pickaxe-card .title.rarity-mythic {
  color: #ff1744 !important; /* Deep Vibrant Red */
}

/* Collapsible pickaxe details */
.pickaxe-details {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.details-toggle {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #b8c5d1;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.details-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.details-toggle:active {
  transform: translateY(1px);
}

/* Mines controls */
.mines-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mines-controls .btn {
  background: linear-gradient(135deg, #32c8a0 0%, #2a9d8f 100%);
  border: 1px solid #32c8a0;
  color: #ffffff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(50, 200, 160, 0.3);
  position: relative;
  overflow: hidden;
}

.mines-controls .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.mines-controls .btn:hover::before {
  left: 100%;
}

.mines-controls .btn:hover {
  background: linear-gradient(135deg, #2a9d8f 0%, #32c8a0 100%);
  border-color: #2a9d8f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(50, 200, 160, 0.4);
}

.mines-controls .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(50, 200, 160, 0.3);
}

/* Mobile responsiveness for mines controls */
@media (max-width: 768px) {
  .mines-controls {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .current-power {
    justify-content: center;
  }
  
  .mines-controls .btn {
    width: 100%;
    text-align: center;
  }
}

.current-power {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.power-label {
  color: #b8c5d1;
  font-size: 0.9rem;
}

.power-value {
  color: #32c8a0;
  font-weight: bold;
  font-size: 1rem;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  margin: 5% auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: #b8c5d1;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* Mineral chart styles */
.mineral-chart {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #b8c5d1;
  font-size: 0.9rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-color.can-mine {
  background: #32c8a0;
}

.legend-color.cannot-mine {
  background: #ff6b6b;
}

.mineral-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.mineral-chart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mineral-chart-item.can-mine {
  border-color: #32c8a0;
  background: rgba(50, 200, 160, 0.1);
}

.mineral-chart-item.cannot-mine {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.mineral-chart-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mineral-chart-info {
  flex: 1;
  min-width: 0;
}

.mineral-chart-name {
  color: #ffffff;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.mineral-chart-hardness {
  color: #b8c5d1;
  font-size: 0.8rem;
}

.mineral-chart-status {
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.mineral-chart-status.can-mine {
  color: #32c8a0;
  background: rgba(50, 200, 160, 0.2);
}

.mineral-chart-status.cannot-mine {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.2);
}

.inventory-card .card-header {
  border-left: 2px solid #32c8a0;
}

.pickaxe-card {
  border-left: 3px solid #8a4fc7;
}

.pickaxe-card .card-header {
  border-left: 2px solid #8a4fc7;
}

/* Special Card States */
.mine-card.locked {
  opacity: 0.6;
  background: 
    linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%),
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 0, 0, 0.1) 2px, rgba(255, 0, 0, 0.1) 4px);
  border-color: #666666;
}

.pickaxe-card.craftable {
  border-color: #32c8a0;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(50, 200, 160, 0.3),
    0 0 10px rgba(50, 200, 160, 0.2);
}

.pickaxe-card.crafted {
  border-color: #f7d660;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(247, 214, 96, 0.3),
    0 0 10px rgba(247, 214, 96, 0.2);
}

/* Card Icons - Raw/Original size */
.mine-card .pixel-icon,
.inventory-card .pixel-icon,
.pickaxe-card .pixel-icon {
  width: auto !important;
  height: auto !important;
  border-radius: 2px;
  background: rgba(74, 90, 180, 0.15);
  border: 1px solid rgba(74, 90, 180, 0.3);
  display: block;
  margin: 0 auto 0.5rem auto;
  flex-shrink: 0;
}

/* Card Layout - Match JavaScript Structure */
.mine-card,
.inventory-card,
.pickaxe-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  gap: 0.5rem;
  text-align: center;
}

/* Mine Card Specific Structure */
.mine-card {
  text-align: left;
}

.mine-card .pixel-icon {
  margin: 0 0 0.5rem 0;
  align-self: flex-start;
}

/* Inventory Card Specific Structure */
.inventory-card {
  text-align: center;
}

.inventory-card .pixel-icon {
  margin: 0 auto 0.5rem auto;
}

/* Pickaxe Card Specific Structure */
.pickaxe-card {
  text-align: left;
}

.pickaxe-card .pixel-icon {
  margin: 0 0 0.5rem 0;
  align-self: flex-start;
}

.mine-card .stat,
.inventory-card .stat,
.pickaxe-card .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.mine-card .stat-label,
.inventory-card .stat-label,
.pickaxe-card .stat-label {
  font-size: 0.75rem;
  color: #7a8a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.mine-card .stat-value,
.inventory-card .stat-value,
.pickaxe-card .stat-value {
  font-size: 1rem;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Special Card States */
.mine-card.locked {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border-color: #444444;
  opacity: 0.6;
  cursor: not-allowed;
}

.mine-card.locked:hover {
  transform: none;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.mine-card.unlocked {
  border-color: #32c8a0;
}

.mine-card.unlocked::before {
  background: linear-gradient(90deg, transparent, #32c8a0, #4a5ab4, #32c8a0, transparent);
  opacity: 0.7;
}

/* Inventory Card Specific */
.inventory-card.selected {
  border-color: #f7d660;
  background: linear-gradient(145deg, #2a2a1a, #3a3a2a);
}

.inventory-card.selected::before {
  background: linear-gradient(90deg, transparent, #f7d660, #ffb54e, #f7d660, transparent);
  opacity: 1;
}

/* Pickaxe Card Specific */
.pickaxe-card.craftable {
  border-color: #32c8a0;
}

.pickaxe-card.craftable::before {
  background: linear-gradient(90deg, transparent, #32c8a0, #4a5ab4, #32c8a0, transparent);
  opacity: 0.7;
}

.pickaxe-card.crafted {
  border-color: #f7d660;
  background: linear-gradient(145deg, #2a2a1a, #3a3a2a);
}

.pickaxe-card.crafted::before {
  background: linear-gradient(90deg, transparent, #f7d660, #ffb54e, #f7d660, transparent);
  opacity: 1;
}

/* Bottom Panel */
.bottom-panel {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  height: 60px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  transition: height 0.6s ease, min-height 0.6s ease;
}

.bottom-panel.open {
  height: 50vh;
  min-height: 50vh;
}

.chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.chat-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.chat-tab:last-child {
  border-right: none;
}

.chat-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.chat-tab.is-active {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}

/* Sidebar Logout Item */
.sidebar-nav-item.logout-item {
  background: linear-gradient(145deg, #dc3545, #c82333);
  color: white;
  font-weight: 600;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav-item.logout-item:hover {
  background: linear-gradient(145deg, #c82333, #bd2130);
  color: white;
  transform: translateX(4px);
}

.chat-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
  pointer-events: none;
}

.bottom-panel.open .chat-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-content::-webkit-scrollbar {
  display: none;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.chat-message {
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.chat-timestamp {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.log-output {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-input {
  display: flex;
  padding: var(--spacing-md);
  border-top: 1px solid var(--border);
  gap: var(--spacing-sm);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
  pointer-events: none;
}

.bottom-panel.open .chat-input {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-input input {
  flex: 1;
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.chat-input input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

#chat-send {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--accent-primary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color var(--transition-fast);
}

#chat-send:hover {
  background: #3a4a94;
}

/* Inventory Actions */
.inventory-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.inventory-actions .btn-secondary {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* Mine Yield Display */
.mine-yield {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.mine-yield span {
  background: rgba(74, 90, 180, 0.2);
  border: 1px solid rgba(74, 90, 180, 0.4);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: #b8c5d1;
  font-weight: 500;
}

/* Craft Requirements */
.craft-cost {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.craft-cost .missing {
  color: #f44336;
  font-weight: 600;
}

.craft-cost .available {
  color: #32c8a0;
  font-weight: 600;
}

/* Level Requirements */
.level-req {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 6px;
  font-size: 0.85rem;
  color: #ff9800;
}

.level-req.met {
  background: rgba(50, 200, 160, 0.1);
  border-color: rgba(50, 200, 160, 0.3);
  color: #32c8a0;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Chest and Key System */
/* Shop System Styles */
.shop-gold-display {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Key Icons */
.key-icon {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 40px;
  height: 40px;
}

.bronze-key-icon {
  background-image: url('images/icons/bronze_chest_key.png') !important;
}

.silver-key-icon {
  background-image: url('images/icons/silver_chest_key.png') !important;
}

.gold-key-icon {
  background-image: url('images/icons/gold_chest_key.png') !important;
}

/* Guild Store Item Icons */
.guild-store-item .store-item-icon {
  width: 40px;
  height: 40px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.shop-gold-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.shop-gold-amount {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-primary);
}

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

.shop-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.shop-item-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Key icons in shop - use background images */
.shop-item-icon.key-icon {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 40px !important;
  height: 40px !important;
}

.shop-item-info {
  flex: 1;
}

.shop-item-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.shop-item-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.shop-item-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.shop-item-price::before {
  content: '💰';
  margin-right: 0.2rem;
  font-size: 0.8rem;
}

.shop-item .btn {
  width: 100%;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.shop-item .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.shop-item .btn:hover::before {
  left: 100%;
}

.shop-item .btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
  transform: translateY(-1px);
}

  .shop-item .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  }

/* Toast Notification Styles */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 400px;
  animation: toastSlideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-primary);
}

.toast.error::before {
  background: #ef4444;
}

.toast.success::before {
  background: #10b981;
}

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

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.toast-message {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

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

.toast.removing {
  animation: toastSlideOut 0.3s ease-in forwards;
}

.chests-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.chest-with-key {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.connected-key {
  background: linear-gradient(145deg, #1a2a1a, #2a3a2a);
  border: 2px solid #2d5a3d;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: -0.25rem;
  position: relative;
  box-shadow: 0 2px 10px rgba(45, 90, 61, 0.2);
}

.connected-key::before {
  content: '';
  position: absolute;
  top: -0.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #2d5a3d;
}

.chest-item {
  background: linear-gradient(145deg, #0f2a1a, #1a3a2a);
  border: 2px solid #2d5a3d;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(45, 90, 61, 0.3);
}

.chest-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(45, 90, 61, 0.5);
  border-color: #3d6a4d;
  background: linear-gradient(145deg, #1a3a2a, #2a4a3a);
}

.chest-icon {
  width: 120px;
  height: 120px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.chest-icon.wooden {
  background-image: url('images/icons/wooden_treasure_chest.png');
}

.chest-icon.iron {
  background-image: url('images/icons/iron_treasure_chest.png');
}

.chest-icon.golden {
  background-image: url('images/icons/golden_treasure_chest.png');
}

.chest-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.chest-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.chest-requirement {
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.chest-open-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chest-open-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.chest-open-btn:hover::before {
  left: 100%;
}

.chest-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 124, 89, 0.4);
}

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

.chest-open-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.rewards-info-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.rewards-info-btn:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.key-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: all 0.2s ease;
}

.key-item:hover {
  transform: none;
  box-shadow: none;
}

.key-icon {
  width: 32px;
  height: 32px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.key-info {
  flex: 1;
  min-width: 0;
}

.key-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.key-count {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Chest Rewards List */
.chest-rewards-list {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: none;
}

.chest-rewards-list.show {
  display: block;
}

.rewards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.rewards-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.rewards-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.rewards-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.rewards-grid {
  display: grid;
  gap: 0.75rem;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
}

/* Tier-based color coding for reward items */
.reward-item.tier-common {
  border-left-color: #9ca3af;
}

.reward-item.tier-uncommon {
  border-left-color: #10b981;
}

.reward-item.tier-rare {
  border-left-color: #3b82f6;
}

.reward-item.tier-epic {
  border-left-color: #8b5cf6;
}

.reward-item.tier-legendary {
  border-left-color: #f59e0b;
}

.reward-item.tier-mythic {
  border-left-color: #ef4444;
}

.reward-item.tier-gold {
  border-left-color: #fbbf24;
}

.reward-item.tier-key {
  border-left-color: #6b7280;
}

.reward-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.reward-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reward-info {
  flex: 1;
  min-width: 0;
}

.reward-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

/* Rarity color classes for reward info popup mineral names */
.reward-name.rarity-common {
  color: #9ca3af !important; /* Gray */
}

.reward-name.rarity-uncommon {
  color: #10b981 !important; /* Green */
}

.reward-name.rarity-rare {
  color: #3b82f6 !important; /* Blue */
}

.reward-name.rarity-epic {
  color: #8b5cf6 !important; /* Purple */
}

.reward-name.rarity-legendary {
  color: #f59e0b !important; /* Orange */
}

.reward-name.rarity-mythic {
  color: #ef4444 !important; /* Red */
}

.reward-amount {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.reward-chance {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 500;
}

.chest-item {
  position: relative;
}

.rewards-info-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.rewards-info-btn:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.chest-item .btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.chest-item .btn:hover {
  transform: scale(1.02);
}

.chest-item .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Chest Reward Popup */
.chest-reward-content {
  max-width: 500px;
  width: 90vw;
  max-height: 500px;
  text-align: center;
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border: 2px solid #444;
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: chestRewardSlideIn 0.4s ease-out;
}

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

.chest-reward-header {
  padding: 1rem 1.5rem 0.5rem;
  background: linear-gradient(135deg, #2a4a3a, #1e3a2a);
  border-bottom: 1px solid #4a7c59;
}

.chest-reward-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: chestRewardBounce 0.6s ease-out;
}

@keyframes chestRewardBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.chest-reward-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.chest-reward-subtitle {
  font-size: 0.9rem;
  color: #a8d4a8;
  margin: 0;
  font-weight: 500;
}

.chest-reward-items {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
}

/* CS:GO Style Case Opening Animation */
.chest-reward-spinner {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 200px;
  justify-content: center;
}

.chest-reward-reel {
  display: flex;
  gap: 1rem;
  overflow: hidden;
  width: 100%;
  max-width: 450px;
  height: 120px;
  position: relative;
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border: 2px solid #444;
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.chest-reward-reel-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.1s linear;
  height: 100%;
  align-items: center;
}

.chest-reward-reel-item {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
  border: 1px solid #444;
  border-radius: var(--radius-sm);
  position: relative;
  opacity: 0.6;
  transition: all 0.1s ease;
}

.chest-reward-reel-item.center {
  opacity: 1;
  transform: scale(1.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(74, 124, 89, 0.5);
  z-index: 2;
}

.chest-reward-reel-item img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.chest-reward-reel-item .emoji {
  font-size: 1.5rem;
}

.chest-reward-spinner-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  animation: chestRewardPulse 1s ease-in-out infinite;
}

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

.chest-reward-spinner-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.chest-reward-spinner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: chestRewardDotBounce 1.4s ease-in-out infinite both;
}

.chest-reward-spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.chest-reward-spinner-dot:nth-child(2) { animation-delay: -0.16s; }
.chest-reward-spinner-dot:nth-child(3) { animation-delay: 0s; }

@keyframes chestRewardDotBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.chest-reward-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
  border: 1px solid #444;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  animation: chestRewardItemSlideIn 0.3s ease-out;
}

.chest-reward-item:hover {
  transform: translateX(5px);
  border-color: #666;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes chestRewardItemSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chest-reward-item-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #444, #333);
  border: 2px solid #666;
  overflow: hidden;
  position: relative;
}

.chest-reward-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: all 0.2s ease;
}

.chest-reward-item:hover .chest-reward-item-icon img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transform: scale(1.05);
}

.chest-reward-item-info {
  flex: 1;
  text-align: left;
}

.chest-reward-item-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

/* Rarity color classes for chest reward mineral names */
.chest-reward-item-name.rarity-common {
  color: #9ca3af !important; /* Gray */
}

.chest-reward-item-name.rarity-uncommon {
  color: #10b981 !important; /* Green */
}

.chest-reward-item-name.rarity-rare {
  color: #3b82f6 !important; /* Blue */
}

.chest-reward-item-name.rarity-epic {
  color: #8b5cf6 !important; /* Purple */
}

.chest-reward-item-name.rarity-legendary {
  color: #f59e0b !important; /* Orange */
}

.chest-reward-item-name.rarity-mythic {
  color: #ef4444 !important; /* Red */
}

.chest-reward-item-amount {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 0;
}

.chest-reward-item-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.chest-reward-footer {
  padding: 0.75rem 1.5rem 1rem;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  border-top: 1px solid #444;
}

.chest-reward-footer .btn {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.chest-reward-footer .btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile App Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 0;
    height: 100vh;
    overflow: hidden;
  }

  #app {
    height: 100vh;
    width: 100vw;
    max-width: none;
  }

  .sidebar {
    width: 50vw;
    left: -50vw;
  }
  
  .sidebar.open + .main-content {
    margin-left: 0;
  }
  
  .main-content {
    height: 100vh;
    width: 100vw;
  }

  .header {
    padding: 0.5rem;
    min-height: 50px;
    flex-wrap: nowrap;
  }
  
  .profile-stats {
    gap: 0.5rem;
  }
  
  .stat-item {
    min-width: 50px;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
  
  .stat-value {
    font-size: 0.8rem;
  }
  
  .header-right {
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 280px;
    justify-content: flex-end;
  }
  
  .current-mine,
  .active-pickaxe {
    display: none;
  }

  .mine-rate,
  .mine-power {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .rate-label,
  .power-label {
    font-size: 0.65rem;
    font-weight: 500;
  }
  
  .rate-value,
  .power-value {
    font-size: 0.75rem;
    font-weight: 600;
  }
  
  .content-container {
    padding: 0.5rem;
    padding-bottom: 60px; /* space for bottom panel when closed */
    height: calc(100vh - 100px); /* Account for header and bottom panel */
  }
  
  .mine-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
  }
  
  .pickaxe-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Smaller cards on mobile */
  .mine-card,
  .inventory-card,
  .pickaxe-card {
    padding: 0.5rem;
    min-height: 90px;
    gap: 0.3rem;
  }

  .mine-card h3,
  .inventory-card h3,
  .pickaxe-card h3 {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
  }

  .mine-card p,
  .inventory-card p,
  .pickaxe-card p {
    font-size: 0.65rem;
    line-height: 1.4;
  }

  .mine-card button,
  .inventory-card button,
  .pickaxe-card button {
    padding: 0.25rem 0.5rem;
    font-size: 0.6rem;
  }

  .mine-card .pixel-icon,
  .inventory-card .pixel-icon,
  .pickaxe-card .pixel-icon {
    /* Raw size on mobile too */
  }
  
  .bottom-panel {
    height: 50px;
    min-height: 50px;
  }

  .bottom-panel.open {
    height: 50vh;
    min-height: 50vh;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .bottom-panel.open .chat-input {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Force chat input to always be visible on mobile */
  .bottom-panel .chat-input {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    flex-shrink: 0 !important;
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border) !important;
  }
  
  
  /* Ensure chat tabs are always visible on mobile */
  .chat-tabs {
    display: flex !important;
    height: 50px;
    min-height: 50px;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .chat-tab {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 100%;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Ensure chat messages use full available space */
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    max-height: calc(50vh - 150px); /* 50vh for panel - 50px for tabs - 100px for input */
  }
  
  .log-output {
    flex: 1;
    overflow-y: auto;
    max-height: calc(50vh - 150px); /* 50vh for panel - 50px for tabs - 100px for input */
  }
  
  /* Ensure chat input is visible and properly sized */
  .chat-input {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
    height: auto !important;
    min-height: 50px !important;
  }
  
  .chat-input input {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
  }
  
  #chat-send {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    border-radius: 4px;
  }
  
  /* Force bottom panel to be visible on mobile */
  .bottom-panel {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
    flex-direction: column !important;
  }
  
  /* When panel is closed, show only tabs */
  .bottom-panel:not(.open) {
    height: 50px !important; /* Only tabs visible */
    min-height: 50px !important;
  }
  
  .bottom-panel:not(.open) .chat-tabs {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .bottom-panel:not(.open) .chat-content,
  .bottom-panel:not(.open) .chat-input {
    display: none !important;
  }

  /* Make cards more compact on mobile */
  .mine-card,
  .inventory-card,
  .pickaxe-card {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .mine-card h3,
  .inventory-card h3,
  .pickaxe-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .mine-card p,
  .inventory-card p,
  .pickaxe-card p {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  /* Compact panels */
  .panel {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .panel-header h2 {
    font-size: 1.1rem;
  }

  .panel-sub {
    font-size: 0.8rem;
  }

  /* Compact buttons */
  .btn-primary,
  .btn-secondary,
  .btn-craft,
  .btn-mine {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .inventory-actions .btn-secondary {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
  }

  /* Mobile chat/log styling */
  .chat-content {
    min-height: calc(50vh - 100px); /* 50vh for panel - 50px for tabs - 50px for input */
    max-height: calc(50vh - 100px);
    height: calc(50vh - 100px);
    padding: 0.5rem;
    flex: 1;
    overflow-y: auto;
  }

  .chat-tab {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .chat-input {
    padding: 0.5rem;
  }

  .chat-input input {
    font-size: 0.8rem;
    padding: 0.4rem;
  }

  #chat-send {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.4rem;
    min-height: 45px;
  }
  
  .profile-stats {
    gap: 0.4rem;
  }
  
  .stat-item {
    min-width: 45px;
  }
  
  .content-container {
    padding: 0.4rem;
    padding-bottom: 60px; /* space for bottom panel when closed */
    height: calc(100vh - 90px);
  }
  
  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .pickaxe-grid {
    grid-template-columns: 1fr;
  }

  .bottom-panel {
    height: 45px;
    min-height: 45px;
  }

  .bottom-panel.open {
    height: 50vh;
    min-height: 50vh;
  }

  /* When bottom panel is open, add extra bottom padding so content isn't obscured */
  .bottom-panel.open ~ .content-container,
  .content-container.has-bottom-open {
    padding-bottom: 50vh !important;
  }

  /* Even more compact for small phones */
  .mine-card,
  .inventory-card,
  .pickaxe-card {
    padding: 0.5rem;
  }

  .panel {
    padding: 0.75rem;
  }

  .btn-primary,
  .btn-secondary,
  .btn-craft,
  .btn-mine {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .header {
    min-height: 40px;
    padding: 0.3rem;
  }

  .content-container {
    height: calc(100vh - 80px);
    padding: 0.3rem;
    padding-bottom: 50px; /* space for bottom panel when closed */
  }

  .bottom-panel {
    height: 40px;
    min-height: 40px;
  }

  .bottom-panel.open {
    height: 50vh;
    min-height: 50vh;
  }

  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Pickaxe tier-based borders */
.pickaxe-card.tier-1 {
  border-left: 4px solid #8a8a8a; /* Common - Gray */
}

.pickaxe-card.tier-2 {
  border-left: 4px solid #1eff00; /* Uncommon - Green */
}

.pickaxe-card.tier-3 {
  border-left: 4px solid #0070dd; /* Rare - Blue */
}

.pickaxe-card.tier-4 {
  border-left: 4px solid #a335ee; /* Epic - Purple */
}

.pickaxe-card.tier-5 {
  border-left: 4px solid #ff8000; /* Legendary - Orange */
}

.pickaxe-card.tier-6 {
  border-left: 4px solid #ff1744; /* Mythic - Deep Vibrant Red */
}

/* Inventory card rarity-based borders */
.inventory-card.rarity-common {
  border-left: 4px solid #8a8a8a; /* Common - Gray */
}

.inventory-card.rarity-uncommon {
  border-left: 4px solid #1eff00; /* Uncommon - Green */
}

.inventory-card.rarity-rare {
  border-left: 4px solid #0070dd; /* Rare - Blue */
}

.inventory-card.rarity-epic {
  border-left: 4px solid #a335ee; /* Epic - Purple */
}

.inventory-card.rarity-legendary {
  border-left: 4px solid #ff8000; /* Legendary - Orange */
}

.inventory-card.rarity-mythic {
  border-left: 4px solid #ff1744; /* Mythic - Deep Vibrant Red */
}

/* Chest System Mobile */
@media (max-width: 768px) {
  .keys-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .key-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .key-icon {
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .key-count {
    font-size: 1.25rem;
  }
  
  .chests-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .chest-item {
    padding: 1rem;
  }
  
  .chest-icon {
    font-size: 2.5rem;
  }
  
  .chest-name {
    font-size: 1.1rem;
  }
  
  .chest-description {
    font-size: 0.85rem;
  }
  
  .chest-requirement {
    font-size: 0.8rem;
  }
  
  /* Chest Reward Popup Mobile */
  .chest-reward-content {
    width: 95vw;
    max-width: 400px;
  }
  
  .chest-reward-header {
    padding: 1.5rem 1.5rem 1rem;
  }
  
  .chest-reward-icon {
    font-size: 3rem;
  }
  
  .chest-reward-title {
    font-size: 1.5rem;
  }
  
  .chest-reward-subtitle {
    font-size: 1rem;
  }
  
  .chest-reward-items {
    padding: 1.5rem;
    gap: 0.75rem;
  }
  
  .chest-reward-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .chest-reward-item-icon {
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .chest-reward-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  .chest-reward-item-name {
    font-size: 1rem;
  }
  
  .chest-reward-item-amount {
    font-size: 1.1rem;
  }
  
  .chest-reward-item-value {
    font-size: 0.8rem;
  }
  
  .chest-reward-footer {
    padding: 1rem 1.5rem 1.5rem;
  }
  
  .chest-reward-footer .btn {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
  }
  
  /* CS:GO Style Spinner Mobile */
  .chest-reward-spinner {
    padding: 1.5rem;
    min-height: 250px;
  }
  
  .chest-reward-reel {
    max-width: 350px;
    height: 70px;
  }
  
  .chest-reward-reel-item {
    width: 50px;
    height: 50px;
  }
  
  .chest-reward-reel-item img {
    width: 75%;
    height: 75%;
  }
  
  .chest-reward-reel-item .emoji {
    font-size: 1.2rem;
  }
  
  .chest-reward-spinner-text {
    font-size: 1rem;
  }
}

/* Mineral name rarity colors - more specific to override mine-yield span */
.mine-card .mine-yield .mineral-name.rarity-common {
  color: #8a8a8a !important; /* Gray */
}

.mine-card .mine-yield .mineral-name.rarity-uncommon {
  color: #1eff00 !important; /* Green */
}

.mine-card .mine-yield .mineral-name.rarity-rare {
  color: #0070dd !important; /* Blue */
}

.mine-card .mine-yield .mineral-name.rarity-epic {
  color: #a335ee !important; /* Purple */
}

.mine-card .mine-yield .mineral-name.rarity-legendary {
  color: #ff8000 !important; /* Orange */
}

.mine-card .mine-yield .mineral-name.rarity-mythic {
  color: #ff1744 !important; /* Deep Vibrant Red */
}

/* Pickaxe abilities styling */
.pickaxe-abilities {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 4px;
  border-left: 3px solid var(--accent);
  margin: 0.5rem 0;
}

.abilities-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.3rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ability-item {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin: 0.2rem 0;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
}

/* Hide auth-required elements when not signed in */
body:not(.signed-in) [data-auth-required] {
  display: none !important;
}

/* Override auth hiding for bottom panel on mobile */
@media (max-width: 768px) {
  /* Force bottom panel to always be visible on mobile */
  .bottom-panel {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
  }
  
  body:not(.signed-in) .bottom-panel {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  body:not(.signed-in) .chat-tabs {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  body:not(.signed-in) .chat-tab {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Ensure chat tabs are always visible */
  .chat-tabs {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 50px !important;
    min-height: 50px !important;
  }
  
  .chat-tab {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 1 !important;
    height: 100% !important;
  }
}

/* Chat Username Styling */
.chat-username {
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.chat-username:hover {
  color: var(--accent-secondary);
}

/* Own message styling */
.chat-message.own-message .chat-username {
  color: var(--accent-secondary);
  font-weight: 700;
}

.chat-message.own-message .chat-username:hover {
  color: var(--accent-primary);
}

.chat-message.own-message {
  background: rgba(74, 90, 180, 0.1);
  border-left: 3px solid var(--accent-secondary);
  padding-left: 0.5rem;
  margin: 0.25rem 0;
  border-radius: 0 4px 4px 0;
}

.chat-timestamp {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.chat-text {
  color: var(--text-primary);
}

/* User Profile Popup */
.user-profile-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.user-profile-content {
  background: var(--bg-secondary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.user-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-sm);
}

.user-profile-header h3 {
  margin: 0;
  color: var(--accent-primary);
  font-size: 1.2rem;
}

.user-profile-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.user-profile-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.user-profile-stats {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.user-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.user-stat-label {
  color: var(--text-muted);
  font-weight: 500;
}

.user-stat-value {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Enhanced Profile Layout */
.user-profile-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-profile-pickaxe-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}

.user-pickaxe-icon {
  width: 70px;
  height: 70px;
  background: var(--bg-tertiary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Pickaxe rarity color coding */
.user-pickaxe-icon.tier-common {
  border-color: #8B8B8B; /* Gray for common */
}

.user-pickaxe-icon.tier-uncommon {
  border-color: #4CAF50; /* Green for uncommon */
}

.user-pickaxe-icon.tier-rare {
  border-color: #2196F3; /* Blue for rare */
}

.user-pickaxe-icon.tier-epic {
  border-color: #9C27B0; /* Purple for epic */
}

.user-pickaxe-icon.tier-legendary {
  border-color: #FF9800; /* Orange for legendary */
}

.user-pickaxe-icon.tier-mythic {
  border-color: #E91E63; /* Pink for mythic */
}

.user-pickaxe-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.user-pickaxe-info {
  flex: 1;
}

.user-pickaxe-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.user-pickaxe-level {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 1rem;
}

.user-profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}

.user-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
}

.user-stat-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.user-stat-value {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 1.2rem;
}

/* Badge Section */
.user-profile-badge {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.user-badge-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge-icon {
  flex-shrink: 0;
}

.user-badge-icon .badge-icon {
  width: 48px;
  height: 48px;
}

.user-badge-details {
  flex: 1;
}

.user-badge-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.user-badge-status {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Guild Section */
.user-profile-guild {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.user-guild-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-guild-icon {
  width: 50px;
  height: 50px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.user-guild-details {
  flex: 1;
}

.user-guild-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.user-guild-status {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  font-style: italic;
}

/* Rankings Page */
.rankings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 1rem;
}

.ranking-tab {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ranking-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ranking-tab.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.rankings-content {
  min-height: 400px;
}

.ranking-tab-content {
  display: none;
}

.ranking-tab-content.active {
  display: block;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  gap: 1rem;
}

.ranking-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.ranking-item.current-user {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-color: var(--accent-primary);
}

.ranking-position {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.ranking-item.current-user .ranking-position {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.ranking-position.top-3 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
}

.ranking-position.position-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
}

.ranking-position.position-2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #333;
}

.ranking-position.position-3 {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
  color: white;
}

.ranking-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.ranking-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 120px;
  text-align: right;
}

.ranking-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1.2;
}

.ranking-username {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.ranking-username.clickable-username {
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: underline;
  transition: all 0.2s ease;
}

.ranking-username.clickable-username:hover {
  color: var(--accent-secondary);
  text-decoration: none;
  transform: translateY(-1px);
}

.ranking-item.current-user .ranking-username {
  color: white;
}

.ranking-item.current-user .ranking-username.clickable-username {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

.ranking-item.current-user .ranking-username.clickable-username:hover {
  color: white;
  text-decoration: none;
}


.ranking-user-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ranking-item.current-user .ranking-user-details {
  color: rgba(255, 255, 255, 0.8);
}

.ranking-item.current-user .ranking-stat-value {
  color: white;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  margin-top: 1.5rem;
}

.pagination-btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 100px;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pagination-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pagination-info {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 120px;
  text-align: center;
}

/* Badge System */
.badge-selection {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.current-badge h3,
.badge-collection h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.equipped-badge {
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-badge {
  color: var(--text-secondary);
  font-style: italic;
}

.equipped-badge-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

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

.badge-item {
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.badge-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.badge-item.equipped {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.badge-item.locked {
  opacity: 0.6;
  background: var(--bg-primary);
}

.badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.badge-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-icon.rarity-common {
  border: 3px solid #8B8B8B;
}

.badge-icon.rarity-uncommon {
  border: 3px solid #4CAF50;
}

.badge-icon.rarity-rare {
  border: 3px solid #2196F3;
}

.badge-icon.rarity-epic {
  border: 3px solid #9C27B0;
}

.badge-icon.rarity-legendary {
  border: 3px solid #FF9800;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}

.badge-icon.rarity-mythic {
  border: 3px solid #F44336;
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
}

.badge-icon.locked {
  border-color: #666;
  background: #333;
}

.badge-info {
  flex: 1;
  min-width: 0;
}

.badge-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.badge-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.3;
}

.badge-equip-btn,
.badge-unequip-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-primary);
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.badge-equip-btn:hover {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
}

.badge-unequip-btn {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.badge-unequip-btn:hover {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.badge-locked {
  color: var(--text-secondary);
  font-style: italic;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}

/* Header badge display */
.badge-display {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-display .badge-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

#header-badge {
  cursor: pointer;
  transition: transform 0.2s ease;
}

#header-badge:hover {
  transform: scale(1.1);
}

/* News Panel Styles */
.news-content {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* News Tabs */
.news-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.news-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.news-tab:hover {
  background: var(--hover-bg);
  border-color: var(--accent-color);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.news-tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.news-tab .tab-icon {
  font-size: 1.1rem;
}

.news-tab .tab-text {
  font-weight: 600;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Mobile responsive for news tabs */
@media (max-width: 768px) {
  .news-tabs {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .news-tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .news-tab .tab-text {
    font-size: 0.8rem;
  }
}

/* Boost system styles */
.boost-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.boost-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hover-bg);
  border-radius: 0.5rem;
}

.boost-info {
  flex: 1;
}

.boost-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.boost-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.boost-timer {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 500;
}

.no-boosts {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem;
}

.boosts-container {
  max-height: 400px;
  overflow-y: auto;
}

.clickable-username {
  cursor: pointer;
  transition: color 0.2s ease;
}

.clickable-username:hover {
  color: var(--accent-color);
}

/* Boost icon styling to match key icons */
.boost-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px solid var(--border-color);
}

.speed-boost-icon {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}

.power-boost-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.key-boost-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
}

/* Boost popup styling */
.boosts-container h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.boosts-container h3:first-child {
  margin-top: 0;
}

.active-boost {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, var(--card-bg), rgba(99, 102, 241, 0.1));
}

.stored-boost {
  border-color: var(--border-color);
  background: var(--card-bg);
}

.boost-count {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 500;
}

.boost-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.boost-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.news-section {
  margin-bottom: 3rem;
}

.news-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
}

.news-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.news-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.news-item h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.news-item p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.news-item ul {
  margin-left: 1.5rem;
  margin-bottom: 0;
}

.news-item li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.feature-card h4 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--accent-color);
}

.feature-card p {
  margin-bottom: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.feature-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
}

/* Tutorial Steps */
.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.step-number {
  background: var(--accent-color);
  color: white;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.step-content p {
  margin: 0;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Tips Grid */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.tip-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.tip-card:hover {
  transform: translateY(-1px);
}

.tip-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.tip-card p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-actions .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .news-content {
    padding: 1rem;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .tutorial-step {
    flex-direction: column;
    text-align: center;
  }
  
  .step-number {
    align-self: center;
  }
  
  .tips-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-actions {
    flex-direction: column;
  }
  
  .quick-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.default-avatar {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

/* Badge Toggle */
.badge-toggle {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .rankings-tabs {
    flex-direction: column;
  }
  
  .ranking-tab {
    text-align: center;
  }
  
  .ranking-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .ranking-position {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .ranking-stat {
    min-width: 100px;
  }
  
  .ranking-stat-value {
    font-size: 1.1rem;
  }
  
  .pagination-controls {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .pagination-btn {
    width: 100%;
    min-width: auto;
  }
  
  .pagination-info {
    min-width: auto;
  }
  
  .badge-grid {
    grid-template-columns: 1fr;
  }
  
  .badge-item {
    padding: 0.75rem;
  }
  
  .badge-icon {
    width: 40px;
    height: 40px;
  }
}

/* Offline Progress Popup */
.offline-progress-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.offline-progress-content {
  background: var(--bg-secondary);
  border: 3px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  min-width: 400px;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  animation: slideInFromTop 0.5s ease-out;
}

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

.offline-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--accent-primary);
  padding-bottom: var(--spacing-sm);
}

.offline-progress-header h3 {
  margin: 0;
  color: var(--accent-primary);
  font-size: 1.4rem;
  text-shadow: 0 0 10px rgba(74, 90, 180, 0.5);
}

.offline-progress-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.offline-progress-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.offline-progress-time {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  color: white;
}

.offline-time-label {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.offline-time-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.offline-progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.offline-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.offline-stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.offline-stat-value {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 1.3rem;
}

.offline-progress-minerals {
  margin-bottom: var(--spacing-lg);
}

.offline-progress-minerals h4 {
  color: var(--accent-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 1.1rem;
}

.offline-minerals-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.offline-mineral-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.offline-mineral-item:last-child {
  border-bottom: none;
}

.offline-mineral-name {
  color: var(--text-primary);
  font-weight: 500;
}

.offline-mineral-count {
  color: var(--accent-primary);
  font-weight: 600;
  background: rgba(74, 90, 180, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.offline-progress-footer {
  text-align: center;
}

.offline-progress-ok {
  background: linear-gradient(145deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.offline-progress-ok:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Mobile optimizations for offline progress popup */
@media (max-width: 768px) {
  .offline-progress-content {
    min-width: 90vw;
    max-width: 95vw;
    margin: 10px;
    padding: 15px;
  }
  
  .offline-progress-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .offline-progress-header h3 {
    font-size: 1.2rem;
  }
  
  .offline-time-value {
    font-size: 1.8rem;
  }
}

/* Mobile optimizations for chest page */
@media (max-width: 768px) {
  .chests-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .chest-with-key {
    gap: 0.5rem;
  }
  
  .chest-icon {
    width: 80px;
    height: 80px;
  }
  
  .chest-name {
    font-size: 1rem;
  }
  
  .chest-description {
    font-size: 0.8rem;
  }
  
  .chest-open-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .connected-key {
    padding: 0.6rem;
  }
  
  .key-icon {
    width: 28px;
    height: 28px;
  }
  
  .key-name {
    font-size: 0.85rem;
  }
  
  .key-count {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .chests-container {
    gap: 1rem;
  }
  
  .chest-icon {
    width: 60px;
    height: 60px;
  }
  
  .chest-name {
    font-size: 0.95rem;
  }
  
  .chest-description {
    font-size: 0.75rem;
  }
  
  .chest-open-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
  }
  
  .connected-key {
    padding: 0.5rem;
  }
  
  .key-icon {
    width: 24px;
    height: 24px;
  }
  
  .key-name {
    font-size: 0.8rem;
  }
  
  .key-count {
    font-size: 1rem;
  }
}

/* Mineral Rush Game */
.mineral-rush-stats {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mineral-rush-stats.tiers {
  justify-content: space-between;
}

.tier-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.6rem 0.4rem;
  border-radius: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -2px 0 rgba(0,0,0,0.25);
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.tier-box:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 18px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.16);
  filter: brightness(1.05);
}

/* Rarity-themed borders and glow */
.tier-box.tier-1 { border-color: rgba(158,167,179,0.65); box-shadow: 0 0 10px rgba(158,167,179,0.25), inset 0 1px 0 rgba(255,255,255,0.1); }
.tier-box.tier-2 { border-color: rgba(30,255,0,0.65);  box-shadow: 0 0 10px rgba(30,255,0,0.25),  inset 0 1px 0 rgba(255,255,255,0.1); }
.tier-box.tier-3 { border-color: rgba(0,112,221,0.65); box-shadow: 0 0 12px rgba(0,112,221,0.25), inset 0 1px 0 rgba(255,255,255,0.1); }
.tier-box.tier-4 { border-color: rgba(163,53,238,0.65); box-shadow: 0 0 12px rgba(163,53,238,0.25), inset 0 1px 0 rgba(255,255,255,0.1); }
.tier-box.tier-5 { border-color: rgba(255,128,0,0.7);  box-shadow: 0 0 14px rgba(255,128,0,0.28),  inset 0 1px 0 rgba(255,255,255,0.1); }
.tier-box.tier-6 { border-color: rgba(255,23,68,0.7);  box-shadow: 0 0 16px rgba(255,23,68,0.30), inset 0 1px 0 rgba(255,255,255,0.1); }

/* Subtle background tint per tier */
.tier-box.tier-1 { background: linear-gradient(145deg, rgba(158,167,179,0.28), rgba(20,24,32,0.25)); }
.tier-box.tier-2 { background: linear-gradient(145deg, rgba(30,255,0,0.22),   rgba(20,24,32,0.25)); }
.tier-box.tier-3 { background: linear-gradient(145deg, rgba(0,112,221,0.22),  rgba(20,24,32,0.25)); }
.tier-box.tier-4 { background: linear-gradient(145deg, rgba(163,53,238,0.22), rgba(20,24,32,0.25)); }
.tier-box.tier-5 { background: linear-gradient(145deg, rgba(255,128,0,0.22),  rgba(20,24,32,0.25)); }
.tier-box.tier-6 { background: linear-gradient(145deg, rgba(255,23,68,0.22),  rgba(20,24,32,0.25)); }

/* Tiny tier label */
.tier-box::after {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.8;
}
.tier-box.tier-1::after { content: "T1"; }
.tier-box.tier-2::after { content: "T2"; }
.tier-box.tier-3::after { content: "T3"; }
.tier-box.tier-4::after { content: "T4"; }
.tier-box.tier-5::after { content: "T5"; }
.tier-box.tier-6::after { content: "T6"; }

@media (max-width: 768px) {
  .tier-box {
    padding: 0.45rem 0.3rem;
    border-radius: 8px;
    font-size: 0.95rem;
  }
}

.rush-stat { display: none; }

.rush-stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.rush-stat-value {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 1.3rem;
}

.mineral-rush-game {
  position: relative;
  min-height: 400px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  overflow: hidden;
}


.mineral-rush-mineral {
  position: absolute;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  animation: mineralAppear 0.5s ease-out;
  border-radius: 8px;
  padding: 4px;
}

.mineral-rush-mineral:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.mineral-rush-mineral.collected {
  animation: mineralCollect 0.3s ease-out forwards;
}

.mineral-rush-mineral.expired {
  animation: mineralExpire 0.3s ease-out forwards;
}

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

@keyframes mineralCollect {
  to {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes mineralExpire {
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}

.mineral-rush-mineral img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.floating-text {
  color: #4caf50;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  user-select: none;
}

/* Mineral Rush Boosts - Compact */
.mineral-rush-boosts-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.mineral-rush-boosts-compact .btn.compact {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-width: 110px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Frenzy Boost Button */
#buy-frenzy-boost {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: 2px solid #e74c3c;
}

#buy-frenzy-boost:hover:not(:disabled) {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

#buy-frenzy-boost:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Rarity Boost Button */
#buy-rarity-boost {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border: 2px solid #9b59b6;
}

#buy-rarity-boost:hover:not(:disabled) {
  background: linear-gradient(135deg, #8e44ad, #7d3c98);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

#buy-rarity-boost:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.mineral-rush-boosts-compact .btn.compact:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(135deg, #7f8c8d, #95a5a6);
  border-color: #7f8c8d;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.mineral-rush-boosts-compact .btn.compact:disabled:hover {
  transform: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Add glow effect for active state */
.mineral-rush-boosts-compact .btn.compact:not(:disabled)::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.mineral-rush-boosts-compact .btn.compact:not(:disabled):hover::before {
  left: 100%;
}

/* Boost Confirmation Modal */
.boost-confirmation-content {
  max-width: 450px;
  text-align: center;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.boost-confirmation-info {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 0;
  margin-bottom: 15px;
  flex: 1;
}

.boost-confirmation-icon {
  font-size: 48px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3498db, #2980b9);
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  flex-shrink: 0;
}

.boost-confirmation-details {
  flex: 1;
  text-align: left;
}

.boost-confirmation-details h3 {
  color: #ecf0f1;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.boost-confirmation-details p {
  color: #bdc3c7;
  font-size: 14px;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.boost-confirmation-cost {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(241, 196, 15, 0.1);
  border: 1px solid rgba(241, 196, 15, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
}

.cost-label {
  color: #f1c40f;
  font-size: 14px;
  font-weight: 500;
}

.cost-amount {
  color: #f1c40f;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* Frenzy boost specific styling */
.boost-confirmation-icon.frenzy {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* Rarity boost specific styling */
.boost-confirmation-icon.rarity {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .boost-confirmation-info {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .boost-confirmation-details {
    text-align: center;
  }
  
  .boost-confirmation-icon {
    width: 60px;
    height: 60px;
    font-size: 36px;
  }
}

/* Ad Modal */
.ad-modal-content {
  max-width: 450px;
  text-align: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid #4CAF50;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* Force ad modal content to be visible */
#ad-modal .ad-content,
#ad-modal .ad-buttons,
#ad-modal .ad-rewards,
#ad-modal .ad-timer,
#ad-modal .modal-body {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#ad-modal .ad-buttons {
  display: flex !important;
}

#ad-modal .ad-rewards {
  display: flex !important;
}

.ad-content {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border-radius: 8px;
  margin: 0.25rem;
}


.ad-content h3 {
  color: #4CAF50;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.ad-content p {
  color: #e0e0e0;
  margin-bottom: 1rem;
  line-height: 1.3;
  font-size: 0.9rem;
}

.ad-rewards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
  border-radius: 8px;
  border: 2px solid rgba(76, 175, 80, 0.3);
  backdrop-filter: blur(10px);
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.reward-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.2);
  border-color: #4CAF50;
}

.reward-icon {
  font-size: 1.2rem;
  width: 1.5rem;
  text-align: center;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.reward-text {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.85rem;
}

.ad-timer {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  border-radius: 6px;
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 25px rgba(255,107,107,0.3);
}

.ad-timer p {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

#ad-countdown {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 15px rgba(255,255,255,0.8);
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 15px rgba(255,255,255,0.8); }
  to { text-shadow: 0 0 25px rgba(255,255,255,1), 0 0 35px rgba(255,255,255,0.8); }
}

.ad-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.ad-buttons .btn {
  min-width: 120px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.ad-buttons .btn.primary {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  border: 2px solid #4CAF50;
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.ad-buttons .btn.secondary {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  border: 2px solid #6c757d;
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.ad-buttons .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #555;
  color: #999;
  box-shadow: none;
}

.ad-buttons .btn:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.ad-buttons .btn:not(:disabled):active {
  transform: translateY(-1px);
}

.btn-icon {
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

/* Ad Container */
.ad-container {
  margin: 1rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.1));
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-loading {
  text-align: center;
  color: #e0e0e0;
}

.ad-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(76, 175, 80, 0.3);
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ad-display {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-display iframe {
  width: 100%;
  height: 200px;
  border: none;
  border-radius: 8px;
}

/* Mobile optimizations for ads */
@media (max-width: 768px) {
  .ad-container {
    min-height: 150px;
    padding: 0.75rem;
    margin: 0.75rem 0;
  }
  
  .ad-display iframe {
    height: 150px;
    max-width: 100%;
  }
  
  .ad-buttons .btn {
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .ad-buttons {
    gap: 0.5rem;
  }
  
  .ad-buttons .btn {
    min-width: 140px;
  }
}

/* Ad Rewards Summary Modal */
.ad-rewards-content {
  max-width: 500px;
  text-align: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid #FFD700;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.rewards-summary {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border-radius: 8px;
  margin: 0.25rem;
}


.rewards-summary h3 {
  color: #FFD700;
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.rewards-summary p {
  color: #e0e0e0;
  margin-bottom: 0.8rem;
  line-height: 1.2;
  font-size: 0.8rem;
}

.rewards-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  padding-right: 0.5rem;
}

.reward-summary-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
  border-radius: 5px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.reward-summary-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
  border-color: #FFD700;
}

.reward-summary-icon {
  font-size: 1.2rem;
  width: 1.5rem;
  text-align: center;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.reward-summary-details {
  flex: 1;
  text-align: left;
}

.reward-summary-name {
  font-weight: 700;
  color: #FFD700;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.reward-summary-amount {
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

.reward-summary-xp {
  color: #4CAF50;
  font-size: 0.75rem;
  font-weight: 600;
}

.rewards-footer {
  margin-top: 0.8rem;
}

.rewards-footer .btn {
  min-width: 100px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: 2px solid #FFD700;
  color: #1a1a2e;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.rewards-footer .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
  background: linear-gradient(135deg, #FFA500, #FFD700);
}

/* Mobile responsiveness for Ad Modal */
@media (max-width: 768px) {
  .ad-content {
    padding: 1rem;
  }
  
  .ad-icon {
    font-size: 3rem;
  }
  
  .ad-rewards {
    padding: 1rem;
  }
  
  .ad-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .ad-buttons .btn {
    min-width: auto;
    width: 100%;
  }
}

.active-boosts-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.active-boost-compact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: linear-gradient(145deg, #2a4a3a, #1e3a2a);
  border: 1px solid #4a7c59;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.active-boost-compact .boost-timer {
  color: #7dd3fc;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Guild System Styles */
#guild-panel {
  position: relative;
  z-index: 1;
}

.guild-tabs {
  display: flex;
  border-bottom: 2px solid #34495e;
  margin-bottom: 20px;
  overflow-x: auto;
}

.guild-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  color: #bdc3c7;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.guild-tab:hover {
  color: #ecf0f1;
  background: rgba(52, 73, 94, 0.3);
}

.guild-tab.active {
  color: #3498db;
  border-bottom-color: #3498db;
  background: rgba(52, 152, 219, 0.1);
}

.guild-content {
  min-height: 400px;
  padding: 20px;
}

.guild-tab-content {
  display: none !important;
}

.guild-tab-content.active {
  display: block !important;
}

/* Guild Storage Styles */
.guild-storage {
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.guild-storage h4 {
  margin: 0 0 15px 0;
  color: #ffd700;
  font-size: 16px;
  font-weight: 600;
}

.storage-resources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.storage-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 2px solid;
  min-height: 80px;
  transition: all 0.2s ease;
  position: relative;
}

.storage-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.storage-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.storage-amount {
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  text-align: center;
  line-height: 1.2;
}

/* Rarity-based border colors */
.storage-item.rarity-common {
  border-color: #9ca3af; /* Gray */
}

.storage-item.rarity-uncommon {
  border-color: #10b981; /* Green */
}

.storage-item.rarity-rare {
  border-color: #3b82f6; /* Blue */
}

.storage-item.rarity-epic {
  border-color: #8b5cf6; /* Purple */
}

.storage-item.rarity-legendary {
  border-color: #f59e0b; /* Orange */
}

.storage-item.rarity-mythic {
  border-color: #fbbf24; /* Gold */
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.storage-item.rarity-mythic:hover {
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

/* Guild Donations Styles */
.guild-donations {
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.guild-donations h4 {
  margin: 0 0 15px 0;
  color: #4CAF50;
  font-size: 16px;
  font-weight: 600;
}

.donation-options {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.donation-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.donation-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

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

.donation-icon {
  font-size: 16px;
}

.donation-text {
  font-weight: 500;
}

/* Donation Modal Styles */
.donation-form {
  padding: 10px 0;
}

.donation-info {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
}

.donation-info p {
  margin: 5px 0;
  color: #e0e0e0;
  font-size: 14px;
}

.donation-info strong {
  color: #ffd700;
  font-weight: 600;
}

.donation-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.donation-buttons .btn {
  padding: 6px 12px;
  font-size: 12px;
  min-width: auto;
}

.donation-preview {
  margin-top: 15px;
  padding: 10px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.donation-preview p {
  margin: 0;
  color: #4CAF50;
  font-weight: 500;
  font-size: 14px;
}

.donation-preview span {
  color: #ffd700;
  font-weight: 600;
}

/* Guild Benefits Styles */
.guild-benefits {
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.guild-benefits h4 {
  margin: 0 0 15px 0;
  color: #3498db;
  font-size: 16px;
  font-weight: 600;
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefits-list li {
  padding: 8px 0;
  color: #e0e0e0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.benefits-list li:before {
  content: "✓";
  color: #4CAF50;
  font-weight: bold;
  font-size: 16px;
}

/* Clickable guild stats */
.guild-stat.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  padding: 8px;
}

.guild-stat.clickable:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Guild Members Modal Styles */
.guild-members-list {
  max-height: 400px;
  overflow-y: auto;
}

.guild-member-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  min-height: 60px;
}

.guild-member-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.guild-member-item.current-user {
  background: rgba(52, 152, 219, 0.1);
  border-color: rgba(52, 152, 219, 0.3);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.avatar-icon {
  font-size: 20px;
}

.member-details {
  flex: 1;
}

.member-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 15px;
  margin-bottom: 2px;
}

.member-rank {
  color: #3498db;
  font-size: 12px;
  font-weight: 500;
}

.member-stats {
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin-right: 15px;
}

.member-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stat-label {
  font-size: 12px;
  color: #bdc3c7;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 14px;
  color: #ffffff;
  font-weight: 500;
}

.member-actions {
  display: flex;
  gap: 8px;
}

.member-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
  min-width: auto;
}

.guild-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.guild-status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guild-status-badge.in-guild {
  background: #27ae60;
  color: white;
}

.guild-status-badge.no-guild {
  background: #95a5a6;
  color: white;
}

.guild-info {
  background: #2c3e50;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #34495e;
}

.guild-info-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.guild-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.guild-details h3 {
  margin: 0 0 5px 0;
  color: #ecf0f1;
  font-size: 20px;
}

.guild-details p {
  margin: 0;
  color: #bdc3c7;
  font-size: 14px;
}

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

.guild-stat {
  text-align: center;
  padding: 10px;
  background: rgba(52, 73, 94, 0.5);
  border-radius: 8px;
}

.guild-stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #3498db;
  display: block;
}

.guild-stat-label {
  font-size: 12px;
  color: #bdc3c7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guild-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guild-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 14px;
}

.guild-btn-primary {
  background: #3498db;
  color: white;
}

.guild-btn-primary:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.guild-btn-success {
  background: #27ae60;
  color: white;
}

.guild-btn-success:hover {
  background: #229954;
  transform: translateY(-2px);
}

.guild-btn-danger {
  background: #e74c3c;
  color: white;
}

.guild-btn-danger:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

.guild-btn-secondary {
  background: #95a5a6;
  color: white;
}

.guild-btn-secondary:hover {
  background: #7f8c8d;
  transform: translateY(-2px);
}

.guild-members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.guild-members-header h4 {
  margin: 0;
  color: #fbbf24;
  font-size: 18px;
}

.guild-members-list {
  display: grid;
  gap: 10px;
}

.guild-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: #2c3e50;
  border-radius: 8px;
  border: 1px solid #34495e;
  gap: 15px;
}

.guild-member-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.guild-member-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.guild-member-details h4 {
  margin: 0 0 4px 0;
  color: #ecf0f1;
  font-size: 16px;
}

.guild-member-details p {
  margin: 0;
  color: #bdc3c7;
  font-size: 12px;
}

.guild-member-rank {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guild-member-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.guild-member-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.guild-upgrades-list {
  display: grid;
  gap: 15px;
}

.guild-upgrade {
  background: #2c3e50;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #34495e;
}

.guild-upgrade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.guild-upgrade-name {
  font-size: 18px;
  font-weight: 600;
  color: #ecf0f1;
  margin: 0;
}

.guild-upgrade-level {
  background: #3498db;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.guild-upgrade-description {
  color: #bdc3c7;
  margin-bottom: 15px;
  font-size: 14px;
}

.guild-upgrade-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.guild-upgrade-stat {
  text-align: center;
  padding: 8px;
  background: rgba(52, 73, 94, 0.5);
  border-radius: 6px;
}

.guild-upgrade-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #3498db;
  display: block;
}

.guild-upgrade-stat-label {
  font-size: 11px;
  color: #bdc3c7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guild-requests-list {
  display: grid;
  gap: 10px;
}

.guild-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: #2c3e50;
  border-radius: 8px;
  border: 1px solid #34495e;
}

.guild-request-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guild-request-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.guild-request-details h4 {
  margin: 0 0 4px 0;
  color: #ecf0f1;
  font-size: 16px;
}

.guild-request-details p {
  margin: 0;
  color: #bdc3c7;
  font-size: 12px;
}

.guild-request-actions {
  display: flex;
  gap: 8px;
}

.guild-search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.guild-search input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #34495e;
  border-radius: 8px;
  background: #2c3e50;
  color: #ecf0f1;
  font-size: 14px;
}

.guild-search input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.guild-search button {
  padding: 10px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.guild-search button:hover {
  background: #2980b9;
}

.guilds-list {
  display: grid;
  gap: 15px;
}

.guild-card {
  background: #2c3e50;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #34495e;
  transition: all 0.3s ease;
}

.guild-card:hover {
  border-color: #3498db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.guild-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.guild-card-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.guild-card-details h3 {
  margin: 0 0 5px 0;
  color: #ecf0f1;
  font-size: 18px;
}

.guild-card-details p {
  margin: 0;
  color: #bdc3c7;
  font-size: 14px;
}

.guild-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.guild-card-stat {
  text-align: center;
  padding: 8px;
  background: rgba(52, 73, 94, 0.5);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.guild-card-stat.clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.guild-card-stat.clickable:hover {
  background: rgba(52, 152, 219, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.guild-card-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #3498db;
  display: block;
}

.guild-card-stat-label {
  font-size: 11px;
  color: #bdc3c7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

/* Guild Modal Styles */
#create-guild-modal .modal-content {
  max-width: 500px;
  width: 90%;
}

#create-guild-modal .form-group {
  margin-bottom: 1rem;
}

#create-guild-modal label {
  display: block;
  margin-bottom: 0.5rem;
  color: #ecf0f1;
  font-weight: 600;
}

#create-guild-modal input,
#create-guild-modal textarea,
#create-guild-modal select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #34495e;
  border-radius: 8px;
  background: #2c3e50;
  color: #ecf0f1;
  font-size: 14px;
}

#create-guild-modal input:focus,
#create-guild-modal textarea:focus,
#create-guild-modal select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#create-guild-modal textarea {
  resize: vertical;
  min-height: 80px;
}

#create-guild-modal .form-help {
  display: block;
  margin-top: 0.25rem;
  color: #bdc3c7;
  font-size: 12px;
}

#create-guild-modal .modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.25rem 1.5rem;
}

/* Mobile Responsiveness for Guild System */
@media (max-width: 768px) {
  .guild-tabs {
    flex-wrap: wrap;
  }
  
  .guild-tab {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    font-size: 12px;
  }
  
  .guild-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .guild-member {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .guild-member-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .guild-actions {
    flex-direction: column;
  }
  
  .guild-btn {
    width: 100%;
  }
  
  .guild-search {
    flex-direction: column;
  }
  
  .guild-card-header {
    flex-direction: column;
    text-align: center;
  }
  
  .guild-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Guild Level Progress */
.guild-level-progress {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.guild-level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.guild-level-text {
  font-weight: bold;
  font-size: 16px;
  color: #fbbf24;
}

.guild-xp-text {
  font-size: 14px;
  color: #9ca3af;
}

.guild-xp-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.guild-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.guild-xp-progress-text {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

.guild-max-level {
  text-align: center;
  font-weight: bold;
  color: #fbbf24;
  font-size: 16px;
}

/* Guild Store Styles */
.guild-store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.guild-store-header h3 {
  margin: 0;
  color: #fbbf24;
  font-size: 20px;
}

.guild-store-currency {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-label {
  color: #9ca3af;
  font-size: 14px;
}

.currency-amount {
  color: #fbbf24;
  font-weight: bold;
  font-size: 16px;
}

.guild-store-items {
  display: grid;
  gap: 15px;
}

.guild-store-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.guild-store-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.store-item-icon {
  font-size: 32px;
  margin-right: 15px;
  min-width: 40px;
  text-align: center;
}

.store-item-info {
  flex: 1;
  margin-right: 15px;
}

.store-item-name {
  margin: 0 0 5px 0;
  color: #ecf0f1;
  font-size: 16px;
  font-weight: 600;
}

.store-item-description {
  margin: 0 0 8px 0;
  color: #bdc3c7;
  font-size: 14px;
}

.store-item-cost {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cost-amount {
  color: #fbbf24;
  font-weight: bold;
  font-size: 16px;
}

.cost-currency {
  color: #9ca3af;
  font-size: 14px;
}

/* Rarity-based store item borders */
.guild-store-item.rarity-common {
  border-color: #9ca3af;
}

.guild-store-item.rarity-uncommon {
  border-color: #10b981;
}

.guild-store-item.rarity-rare {
  border-color: #3b82f6;
}

.guild-store-item.rarity-epic {
  border-color: #8b5cf6;
}

.guild-store-item.rarity-legendary {
  border-color: #f59e0b;
}

.guild-store-item.rarity-mythic {
  border-color: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* Guild Promotion Modal Styles */
.promotion-info {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.promotion-info h4 {
  margin: 0 0 10px 0;
  color: #fbbf24;
}

.promotion-info p {
  margin: 0;
  color: #bdc3c7;
}

.rank-selection {
  margin-bottom: 20px;
}

.rank-selection h5 {
  margin: 0 0 15px 0;
  color: #ecf0f1;
}

.rank-option {
  display: flex;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rank-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rank-option input[type="radio"] {
  margin-right: 10px;
  accent-color: #fbbf24;
}

.rank-name {
  font-weight: 600;
  font-size: 16px;
}

/* Mobile Optimizations for Guild System */
@media (max-width: 768px) {
  /* Guild Panel Mobile Layout */
  .guild-content {
    padding: 10px;
    min-height: 300px;
  }
  
  .guild-tabs {
    margin-bottom: 15px;
    padding: 0 5px;
  }
  
  .guild-tab {
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
    min-width: auto;
  }
  
  /* Guild Info Mobile */
  .guild-info {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .guild-info-header {
    gap: 10px;
    margin-bottom: 12px;
  }
  
  .guild-icon {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  
  .guild-details h3 {
    font-size: 16px;
  }
  
  .guild-details p {
    font-size: 12px;
  }
  
  /* Guild Stats Mobile Grid */
  .guild-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
  }
  
  .guild-stat {
    padding: 8px;
  }
  
  .guild-stat-value {
    font-size: 14px;
  }
  
  .guild-stat-label {
    font-size: 10px;
  }
  
  /* Guild Actions Mobile */
  .guild-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .guild-btn {
    padding: 8px 16px;
    font-size: 14px;
    width: 100%;
    text-align: center;
  }
  
  /* Guild Storage Mobile */
  .guild-storage,
  .guild-donations,
  .guild-benefits {
    margin: 15px 0;
    padding: 12px;
  }
  
  .guild-storage h4,
  .guild-donations h4,
  .guild-benefits h4 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .storage-resources {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .storage-item {
    padding: 8px;
    min-height: 60px;
  }
  
  .storage-icon {
    width: 24px;
    height: 24px;
  }
  
  .storage-amount {
    font-size: 11px;
    margin-top: 4px;
  }
  
  /* Guild Members Mobile */
  .guild-members-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
  }
  
  .guild-members-header h4 {
    font-size: 16px;
  }
  
  .guild-member {
    padding: 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  
  .guild-member-info {
    flex: 1;
    gap: 12px;
  }
  
  .guild-member-avatar {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  .guild-member-details h4 {
    font-size: 14px;
  }
  
  .guild-member-details p {
    font-size: 11px;
  }
  
  .guild-member-actions {
    flex-shrink: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .guild-member-btn {
    padding: 4px 8px;
    font-size: 11px;
    min-width: 60px;
  }
  
  /* Guild Upgrades Mobile */
  .guild-upgrade {
    padding: 15px;
  }
  
  .guild-upgrade-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .guild-upgrade-name {
    font-size: 16px;
  }
  
  .guild-upgrade-level {
    font-size: 11px;
    padding: 3px 6px;
  }
  
  .guild-upgrade-description {
    font-size: 12px;
    margin-bottom: 12px;
  }
  
  .guild-upgrade-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
  
  .guild-upgrade-stat {
    padding: 6px;
  }
  
  .guild-upgrade-stat-value {
    font-size: 14px;
  }
  
  .guild-upgrade-stat-label {
    font-size: 10px;
  }
  
  /* Guild Requests Mobile */
  .guild-request {
    padding: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .guild-request-info {
    width: 100%;
    gap: 8px;
  }
  
  .guild-request-avatar {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  .guild-request-details h4 {
    font-size: 14px;
  }
  
  .guild-request-details p {
    font-size: 11px;
  }
  
  .guild-request-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  
  .guild-request-btn {
    padding: 4px 8px;
    font-size: 11px;
    flex: 1;
    min-width: 60px;
  }
  
  /* Guild Store Mobile */
  .guild-store-header {
    padding: 12px;
    margin-bottom: 15px;
  }
  
  .guild-store-currency {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .currency-label {
    font-size: 12px;
  }
  
  .currency-amount {
    font-size: 16px;
  }
  
  .guild-store-items {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .guild-store-item {
    padding: 12px;
  }
  
  .store-item-icon {
    width: 35px;
    height: 35px;
  }
  
  .store-item-name {
    font-size: 14px;
  }
  
  .store-item-description {
    font-size: 11px;
  }
  
  .store-item-cost {
    font-size: 12px;
  }
  
  .cost-amount {
    font-size: 14px;
  }
  
  /* Guild Level Progress Mobile */
  .guild-level-progress {
    margin: 15px 0;
    padding: 12px;
  }
  
  .guild-level-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .guild-level-text {
    font-size: 14px;
  }
  
  .guild-xp-text {
    font-size: 12px;
  }
  
  .guild-xp-bar {
    height: 8px;
    margin-top: 8px;
  }
  
  /* Guild Modals Mobile */
  .guild-members-modal .modal-content {
    max-width: 95vw;
    max-height: 90vh;
    margin: 2.5vh auto;
  }
}

/* Donation Modal Styles */
.donation-form {
  padding: 20px 0;
}

.donation-info {
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.donation-info p {
  margin: 0 0 10px 0;
  color: #ecf0f1;
  font-size: 14px;
}

.donation-info p:last-child {
  margin-bottom: 0;
}

.donation-info strong {
  color: #f39c12;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #ecf0f1;
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ecf0f1;
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group select option {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 8px;
}

/* Rarity color coding for mineral dropdown options */
.form-group select option.rarity-common {
  color: #95a5a6;
}

.form-group select option.rarity-uncommon {
  color: #2ecc71;
}

.form-group select option.rarity-rare {
  color: #3498db;
}

.form-group select option.rarity-epic {
  color: #9b59b6;
}

.form-group select option.rarity-legendary {
  color: #f39c12;
}

.form-group select option.rarity-mythic {
  color: #e74c3c;
  font-weight: 600;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-group input::placeholder {
  color: rgba(236, 240, 241, 0.6);
}

.donation-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.donation-buttons .btn {
  flex: 1;
  min-width: 60px;
  padding: 8px 12px;
  font-size: 12px;
  background: rgba(52, 152, 219, 0.2);
  border: 1px solid rgba(52, 152, 219, 0.4);
  color: #3498db;
  transition: all 0.3s ease;
}

.donation-buttons .btn:hover {
  background: rgba(52, 152, 219, 0.3);
  border-color: rgba(52, 152, 219, 0.6);
  transform: translateY(-1px);
}

.donation-preview {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.donation-preview p {
  margin: 0;
  color: #ecf0f1;
  font-size: 16px;
  font-weight: 500;
}

.donation-preview span {
  color: #2ecc71;
  font-weight: 600;
  font-size: 18px;
}

/* Modal Footer Button Styles */
.modal-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 20px;
}

.modal-footer .btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  min-width: 100px;
}

.modal-footer .btn.primary {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.modal-footer .btn.primary:hover {
  background: linear-gradient(135deg, #2980b9, #1f4e79);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.modal-footer .btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #bdc3c7;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-footer .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ecf0f1;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile optimizations for modal footer */
@media (max-width: 768px) {
  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-footer .btn {
    width: 100%;
    min-width: auto;
  }
}

/* Guild Storage Styles */
.guild-storage-content {
  padding: 20px 0;
}

.guild-storage-header {
  text-align: center;
  margin-bottom: 30px;
}

.guild-storage-header h3 {
  color: #f39c12;
  font-size: 24px;
  margin: 0 0 10px 0;
}

.guild-storage-header p {
  color: #bdc3c7;
  font-size: 14px;
  margin: 0;
}

.guild-storage-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.storage-summary-item {
  text-align: center;
}

.storage-summary-label {
  display: block;
  color: #bdc3c7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.storage-summary-value {
  display: block;
  color: #ecf0f1;
  font-size: 18px;
  font-weight: 600;
}

/* Mobile optimizations for donation modal */
@media (max-width: 768px) {
  .donation-buttons {
    flex-direction: column;
  }
  
  .donation-buttons .btn {
    flex: none;
  }
  
  .guild-storage-summary {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .form-group input,
  .form-group select {
    padding: 10px 12px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .guild-member-item {
    padding: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  
  .member-info {
    flex: 1;
    gap: 12px;
  }
  
  .member-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  
  .member-name {
    font-size: 13px;
  }
  
  .member-rank {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  .member-stats {
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .member-stat-item {
    font-size: 11px;
  }
  
  .member-actions {
    flex-shrink: 0;
    gap: 4px;
    flex-wrap: wrap;
  }
  
  .member-btn {
    padding: 3px 6px;
    font-size: 10px;
    min-width: 50px;
  }
  
  /* Guild Promotion Modal Mobile */
  .guild-promotion-modal .modal-content {
    max-width: 90vw;
    padding: 15px;
  }
  
  .promotion-info h4 {
    font-size: 16px;
  }
  
  .promotion-info p {
    font-size: 12px;
  }
  
  .rank-selection h5 {
    font-size: 14px;
  }
  
  .rank-option {
    padding: 8px;
  }
  
  .rank-name {
    font-size: 14px;
  }
  
  /* Guild Search Mobile */
  .guild-search {
    flex-direction: column;
    gap: 8px;
  }
  
  .guild-search input {
    padding: 8px;
    font-size: 14px;
  }
  
  .guild-search select {
    padding: 8px;
    font-size: 14px;
  }
  
  /* Guild Browse Mobile */
  .guild-browse-list {
    gap: 10px;
  }
  
  .guild-browse-item {
    padding: 12px;
  }
  
  .guild-browse-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .guild-browse-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .guild-browse-details h4 {
    font-size: 14px;
  }
  
  .guild-browse-details p {
    font-size: 11px;
  }
  
  .guild-browse-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 8px 0;
  }
  
  .guild-browse-stat {
    padding: 6px;
  }
  
  .guild-browse-stat-value {
    font-size: 12px;
  }
  
  .guild-browse-stat-label {
    font-size: 9px;
  }
  
  .guild-browse-actions {
    flex-direction: column;
    gap: 6px;
  }
  
  .guild-browse-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .guild-stats {
    grid-template-columns: 1fr;
  }
  
  .storage-resources {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .guild-upgrade-stats {
    grid-template-columns: 1fr;
  }
  
  .guild-browse-stats {
    grid-template-columns: 1fr;
  }
  
  .guild-tab {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .guild-request-actions {
    flex-direction: column;
  }
}


