/* =============================================================================
   RAKUN DOJO - MAIN STYLES
   Core styling for the modular Rakun Dojo application
   ============================================================================= */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Zen+Kaku+Gothic+Antique:wght@400;700&display=swap');

/* =============================================================================
   CSS CUSTOM PROPERTIES (DESIGN SYSTEM)
   ============================================================================= */

:root {
  /* Color Palette */
  --color-primary-900: #0c1426;
  --color-primary-800: #111827;
  --color-primary-700: #1f2937;
  --color-primary-600: #374151;
  --color-primary-500: #4b5563;
  --color-primary-400: #6b7280;
  --color-primary-300: #9ca3af;
  --color-primary-200: #d1d5db;
  --color-primary-100: #e5e7eb;
  --color-primary-50: #f9fafb;

  /* Accent Colors */
  --color-accent-blue: #3b82f6;
  --color-accent-blue-dark: #2563eb;
  --color-accent-green: #10b981;
  --color-accent-green-dark: #059669;
  --color-accent-yellow: #f59e0b;
  --color-accent-yellow-dark: #d97706;
  --color-accent-red: #ef4444;
  --color-accent-red-dark: #dc2626;
  --color-accent-purple: #8b5cf6;
  --color-accent-purple-dark: #7c3aed;

  /* Semantic Colors */
  --color-success: var(--color-accent-green);
  --color-success-dark: var(--color-accent-green-dark);
  --color-warning: var(--color-accent-yellow);
  --color-warning-dark: var(--color-accent-yellow-dark);
  --color-error: var(--color-accent-red);
  --color-error-dark: var(--color-accent-red-dark);
  --color-info: var(--color-accent-blue);
  --color-info-dark: var(--color-accent-blue-dark);

  /* Background Colors */
  --bg-primary: var(--color-primary-800);
  --bg-secondary: var(--color-primary-700);
  --bg-tertiary: var(--color-primary-600);
  --bg-overlay: rgba(0, 0, 0, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.1);

  /* Text Colors */
  --text-primary: var(--color-primary-100);
  --text-secondary: var(--color-primary-300);
  --text-muted: var(--color-primary-400);
  --text-inverse: var(--color-primary-800);

  /* Border Colors */
  --border-primary: var(--color-primary-600);
  --border-secondary: var(--color-primary-500);
  --border-accent: var(--color-accent-blue);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2), 0 6px 10px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.25), 0 10px 20px rgba(0, 0, 0, 0.2);

  /* Typography */
  --font-family-base: 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-display: 'Zen Kaku Gothic Antique', sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */

  /* Spacing System */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */

  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.25rem;  /* 20px */
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-header: 1030; 
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* =============================================================================
   RESET & BASE STYLES
   ============================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-4);
}

/* =============================================================================
   HEADER VISIBILITY CONTROL
   ============================================================================= */

/* =============================================================================
   HEADER VISIBILITY CONTROL
   ============================================================================= */

.app-header {
  display: block;
  opacity: 1;
  visibility: visible;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-1) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

/* Hide header when wallet is not connected */
body:not(.wallet-connected) .app-header {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Show header when wallet is connected */
body.wallet-connected .app-header {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* =============================================================================
   GAME INTERFACE INITIAL STATE - PREVENT FLASH DURING LOADING
   ============================================================================= */

#gameInterface {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

/* Only show when explicitly activated */
#gameInterface.interface-showing {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  transition: all 0.3s ease;
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

.title-font {
  font-family: var(--font-family-display);
  font-weight: 700;
}

.mono-font {
  font-family: var(--font-family-mono);
}

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* =============================================================================
   LAYOUT COMPONENTS
   ============================================================================= */

.app-container {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-2);    /* SMALLER horizontal padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);          /* SMALLER gap */
}

/* =============================================================================
   HAMBURGER MENU BUTTON
   ============================================================================= */

.hamburger-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;                      /* SMALLER gap */
  background: none;
  border: none;
  padding: 4px;                  /* SMALLER padding */
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
  width: 16px;                   /* SMALLER - was 20px */
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-base);
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* =============================================================================
   HAMBURGER MENU OVERLAY
   ============================================================================= */

.hamburger-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
}

/* ADD THIS CLASS - this is what was missing! */
.hamburger-overlay.show {
  opacity: 1;
  visibility: visible;
}

.hamburger-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-primary);
  padding: 0;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

/* ALSO ADD THIS - to slide the content in when shown */
.hamburger-overlay.show .hamburger-content {
  transform: translateX(0);
}

.hamburger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.menu-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.menu-section {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-primary);
}

.hamburger-header h3 {
  margin: 0;
  font-size: var(--text-lg);     /* SMALLER heading */
  color: var(--text-primary);
}

.hamburger-section {
  margin-bottom: var(--space-6);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

/* =============================================================================
   WALLET STATUS - CONSISTENT ACROSS ALL DEVICES
   ============================================================================= */
/* =============================================================================
   WALLET STATUS - CONSISTENT ACROSS ALL DEVICES
   ============================================================================= */

.wallet-status {
  padding: 16px !important;
  border-radius: 12px !important;
  border: 1px solid var(--border-primary) !important;
  background: var(--bg-tertiary) !important;
  margin-bottom: 16px !important;
  box-sizing: border-box !important;
  transition: all 0.3s ease !important;
}

.wallet-status.disconnected {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.wallet-status.connected {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.status-icon {
  font-size: var(--text-lg);
}

.status-text {
  font-weight: 500;
  color: var(--text-primary);
}

.wallet-details {
  margin: var(--space-4) 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.detail-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-family-mono);
}

/* Address row special styling */
.detail-row.address {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.address-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

.address-value {
  font-family: var(--font-family-mono);
  font-size: 10px;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
/* =============================================================================
   HAMBURGER ACTIONS SECTION
   ============================================================================= */

.hamburger-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hamburger-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
  width: 100%;
  font-size: var(--text-sm);
}

.hamburger-action-btn:hover {
  background: var(--bg-primary);
  border-color: var(--border-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.hamburger-action-btn .action-icon {
  font-size: var(--text-lg);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.hamburger-action-btn .action-text {
  font-weight: 500;
  font-size: var(--text-sm);
}

/* =============================================================================
   RESPONSIVE BREAKPOINTS FOR CONSISTENCY
   ============================================================================= */

/* Mobile Phones (Portrait) */
@media (max-width: 480px) {
  .hamburger-content {
    width: 280px;
    padding: var(--space-3);
  }
  
  .wallet-status {
    padding: var(--space-3);
  }
  
  .detail-row {
    min-height: 32px;
    padding: var(--space-2) 0;
  }
  
  .detail-label,
  .detail-value {
    font-size: 11px;
  }
  
  .address-container {
    padding: var(--space-2);
  }
  
  .hamburger-action-btn {
    padding: var(--space-3);
    font-size: var(--text-xs);
  }
}

/* Mobile Phones (Landscape) and Small Tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .hamburger-content {
    width: 300px;
  }
}

/* Tablets and Small Desktops */
@media (min-width: 769px) and (max-width: 1024px) {
  .hamburger-content {
    width: 320px;
  }
}

/* Large Desktops */
@media (min-width: 1025px) {
  .hamburger-content {
    width: 340px;
  }
}

/* iPhone Specific (Safari) */
@media (max-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
  .hamburger-overlay {
    -webkit-backdrop-filter: blur(4px);
  }
  
  .hamburger-content {
    -webkit-overflow-scrolling: touch;
  }
  
  .wallet-status {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Android Specific */
@media (max-width: 480px) and (orientation: portrait) {
  .hamburger-content {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .hamburger-content::-webkit-scrollbar {
    display: none;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .wallet-status {
    border-width: 0.5px;
  }
  
  .detail-row {
    border-bottom-width: 0.5px;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .hamburger-content {
    background: var(--bg-primary);
    border-right-color: var(--border-primary);
  }
  
  .wallet-status {
    background: var(--bg-tertiary);
  }
}

/* =============================================================================
   LOGO AND HEADER UPDATES
   ============================================================================= */

.logo-section {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-title {
  font-size: var(--text-base);   /* SMALLER - was var(--text-lg) */
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  font-family: var(--font-family-display);
  display: flex;
  align-items: center;
  gap: var(--space-1);          /* SMALLER gap */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-icon {
  font-size: var(--text-lg);     /* SMALLER - was var(--text-xl) */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.edition-badge {
  background: linear-gradient(135deg, var(--color-accent-blue) 0%, var(--color-accent-purple) 100%);
  color: white;
  padding: 1px 4px;             /* MUCH SMALLER padding */
  border-radius: var(--radius-sm);
  font-size: 10px;              /* MUCH SMALLER font */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 4px;             /* SMALLER spacing */
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* =============================================================================
   BUTTON SYSTEM
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

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

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-blue) 0%, var(--color-accent-blue-dark) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-primary);
  border-color: var(--border-secondary);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent-blue);
  border: 1px solid var(--color-accent-blue);
}

.btn-outline:hover:not(:disabled) {
  background: var(--color-accent-blue);
  color: white;
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.btn-text:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-1);       /* REDUCED padding */
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-icon svg {
  width: 14px;                   /* REDUCED from 20px */
  height: 14px;
}

.btn-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

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

/* =============================================================================
   WALLET SECTION (INITIAL CONNECTION ONLY)
   ============================================================================= */

.wallet-section {
  padding: var(--space-6);
}

.wallet-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  transition: all var(--transition-base);
}

.wallet-card.connected {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.wallet-status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.balance-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.balance-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.balance-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.balance-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
}

.balance-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-family-mono);
}

.address-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.address-text {
  font-family: var(--font-family-mono);
  font-size: var(--text-xs);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.wallet-disconnected {
  background: linear-gradient(135deg, var(--color-accent-blue) 0%, var(--color-accent-blue-dark) 100%);
  color: white;
  text-align: center;
}

.wallet-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-4);
}

.wallet-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
}

.wallet-subtitle {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.wallet-providers {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.wallet-provider-btn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  color: white;
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
}

.wallet-provider-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.provider-icon {
  font-size: var(--text-2xl);
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.provider-name {
  font-size: var(--text-lg);
  font-weight: 600;
}

.provider-desc {
  font-size: var(--text-sm);
  opacity: 0.8;
}

.network-info {
  margin-top: var(--space-6);
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
}

.network-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* =============================================================================
   GAME SECTION UPDATES
   ============================================================================= */

.game-section {
  padding: var(--space-6);
}

.rakun-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  text-align: center;
}

.rakun-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.rakun-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Level and Gil side by side */
.rakun-level-gil {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.rakun-level, .rakun-gil {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.level-label, .gil-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.level-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-accent-blue);
}

.gil-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-accent-yellow);
  font-family: var(--font-family-mono);
}

/* =============================================================================
   MODAL SYSTEM UPDATES
   ============================================================================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: pointer;
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-2xl);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: var(--space-6);
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-6);
  border-top: 1px solid var(--border-primary);
}

/* Gil Purchase Modal Specific */
.current-gil-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--color-accent-yellow) 0%, var(--color-accent-yellow-dark) 100%);
  color: var(--color-primary-800);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.gil-packages {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.gil-package {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.gil-package:hover {
  border-color: var(--color-accent-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gil-package.recommended {
  border-color: var(--color-accent-yellow);
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.gil-package.recommended::before {
  content: "⭐ Best Value";
  position: absolute;
  top: -8px;
  right: var(--space-4);
  background: var(--color-accent-yellow);
  color: var(--color-primary-800);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.package-info {
  display: flex;
  flex-direction: column;
}

.package-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.package-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.package-cost .kensei-cost {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-accent-blue);
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* =============================================================================
   LOADING & ERROR OVERLAYS
   ============================================================================= */

.loading-overlay,
.error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal);
}

.loading-content,
.error-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  max-width: 400px;
  margin: var(--space-4);
}

.dojo-logo {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5));
}

.loading-title,
.error-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.loading-status {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-4);
}

.error-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* =============================================================================
   LOADING SPINNER
   ============================================================================= */

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--color-accent-blue);
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* =============================================================================
   MESSAGE AREA
   ============================================================================= */

.message-area {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  pointer-events: none;
  max-width: 350px;
}

.message {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

.message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--border-primary);
}

.message.success::before {
  background: var(--color-success);
}

.message.error::before {
  background: var(--color-error);
}

.message.warning::before {
  background: var(--color-warning);
}

.message.info::before {
  background: var(--color-info);
}

.message.success {
  border-color: var(--color-success);
  background: rgba(16, 185, 129, 0.1);
}

.message.error {
  border-color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.message.warning {
  border-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.1);
}

.message.info {
  border-color: var(--color-info);
  background: rgba(59, 130, 246, 0.1);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 640px) {
  body {
    padding: var(--space-2);
  }
  
  .app-container {
    max-width: 100%;
  }
  
  .app-header {
    padding: 2px 0;  
  }

  .header-content {
    padding: 0 var(--space-1);    /* SMALLER mobile padding */
    gap: var(--space-1);          /* SMALLER mobile gap */
  }  
  
  .app-title {
    font-size: var(--text-sm);    /* SMALLER on mobile */
  }

  .logo-icon {
    font-size: var(--text-base);  /* SMALLER mobile icon */
  }
  
  .edition-badge {
    font-size: 8px;               /* TINY on mobile */
    padding: 1px 3px;
  }  
  
  .hamburger-line {
    width: 14px;                  /* SMALLER mobile hamburger */
  }
  
  .btn-icon svg {
    width: 12px;                  /* SMALLER mobile icons */
    height: 12px;
  }

  .wallet-section,
  .game-section {
    padding: var(--space-4);
  }
  
  .hamburger-content {
    width: 280px;
  }
  
  .rakun-level-gil {
    gap: var(--space-2);
  }
}

@media (max-width: 480px) {

  .app-header {
    padding: 1px 0;               /* MINIMAL on tiny screens */
  }
  
  .app-title {
    font-size: var(--text-xs);    /* SMALLEST title */
  }
  
  .logo-icon {
    font-size: var(--text-sm);    /* SMALLEST icon */
  }
  
  .edition-badge {
    display: none;                /* Hide badge on tiny screens */
  }
  
  .hamburger-content {
    width: 100%;
    max-width: 300px;
  }
  
  .loading-content,
  .error-content {
    padding: var(--space-6);
    margin: var(--space-2);
  }
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f6;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.action-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-btn:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.animate {
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-10px,0);
    }
    70% {
        transform: translate3d(0,-5px,0);
    }
    90% {
        transform: translate3d(0,-2px,0);
    }
}

.bounce {
    animation-name: bounce;
}

/* =============================================================================
   MOBILE WALLET CONNECTION STYLES
   ============================================================================= */

.mobile-instructions {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-lg);
}

.instruction-card h3 {
  color: var(--color-accent-blue);
  margin-bottom: var(--space-4);
  text-align: center;
  font-size: var(--text-lg);
}

.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-accent-blue);
  color: white;
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.step-text {
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.instruction-note {
  padding: var(--space-3);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-align: center;
}

.instruction-note strong {
  color: rgb(245, 158, 11);
}

/* Enhanced wallet provider button for mobile */
.wallet-provider-btn {
  position: relative;
  overflow: hidden;
}

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

.wallet-provider-btn:active::after {
  width: 300px;
  height: 300px;
}

/* Mobile-specific responsive adjustments */
@media (max-width: 768px) {
  .wallet-section {
    padding: var(--space-4);
  }
  
  .wallet-card {
    padding: var(--space-4);
  }
  
  .wallet-providers {
    gap: var(--space-3);
  }
  
  .wallet-provider-btn {
    padding: var(--space-4);
    min-height: 60px;
  }
  
  .provider-icon {
    font-size: 24px;
  }
  
  .provider-name {
    font-size: var(--text-base);
    font-weight: 600;
  }
  
  .provider-desc {
    font-size: var(--text-sm);
  }
  
  .mobile-instructions {
    margin-top: var(--space-4);
    padding: var(--space-3);
  }
  
  .instruction-steps {
    gap: var(--space-2);
  }
  
  .step {
    padding: var(--space-2);
  }
  
  .step-text {
    font-size: var(--text-xs);
  }
}

@media (max-width: 480px) {

  .hamburger-content {
    width: 300px;
  }
  
  .action-grid {
    grid-template-columns: 1fr;
  }

  .wallet-header {
    text-align: center;
    margin-bottom: var(--space-4);
  }
  
  .wallet-title {
    font-size: var(--text-xl);
  }
  
  .wallet-subtitle {
    font-size: var(--text-sm);
  }
  
  .wallet-provider-btn {
    padding: var(--space-3);
    min-height: 56px;
  }
  
  .provider-info {
    gap: var(--space-1);
  }
  
  .mobile-instructions {
    margin-top: var(--space-3);
    padding: var(--space-2);
  }
  
  .instruction-card h3 {
    font-size: var(--text-base);
    margin-bottom: var(--space-3);
  }
  
  .step-number {
    width: 20px;
    height: 20px;
    font-size: var(--text-xs);
  }
  
  .instruction-note {
    padding: var(--space-2);
    font-size: var(--text-xs);
  }
}

/* Loading states for mobile connection */
.connecting-mobile {
  position: relative;
}

.connecting-mobile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: inherit;
  z-index: 1;
}

.connecting-mobile::after {
  content: '📱';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Message styles for mobile feedback */
.message.mobile-connection {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
  border-left: 4px solid var(--color-accent-blue);
}

.message.mobile-connection::before {
  content: '📱 ';
}

/* Network info adjustments */
.network-info {
  margin-top: var(--space-4);
  text-align: center;
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-full);
  color: rgb(34, 197, 94);
  font-size: var(--text-sm);
  font-weight: 500;
}

.network-dot {
  width: 8px;
  height: 8px;
  background: rgb(34, 197, 94);
  border-radius: 50%;
  animation: networkPulse 2s ease-in-out infinite;
}

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

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .wallet-provider-btn {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
  }
  
  .mobile-instructions {
    -webkit-overflow-scrolling: touch;
  }
}

/* Dark mode adjustments for mobile */
@media (prefers-color-scheme: dark) {
  .mobile-instructions {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.1);
  }
  
  .instruction-note {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.1);
  }
  
  .step {
    background: rgba(255, 255, 255, 0.02);
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .wallet-provider-btn::after {
    transition: none;
  }
  
  .connecting-mobile::after {
    animation: none;
  }
  
  .network-dot {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mobile-instructions {
    border-width: 2px;
  }
  
  .instruction-note {
    border-width: 2px;
  }
  
  .step-number {
    border: 2px solid white;
  }
}

/* Mobile Connection Recovery Fixes */

/* Ensure game elements remain interactive after connection */
.game-connected {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Force enable hamburger menu on mobile after connection */
@media (max-width: 768px) {
    .hamburger-btn,
    #hamburgerBtn,
    .menu-toggle {
        pointer-events: auto !important;
        opacity: 1 !important;
        z-index: 9999;
    }
    
    /* Ensure main game area is scrollable and interactive */
    .game-container,
    #gameContainer,
    main {
        touch-action: auto !important;
        pointer-events: auto !important;
        overflow-y: auto !important;
    }
    
    /* Remove any overlay that might block interaction */
    .connection-overlay,
    .modal-overlay.connecting {
        display: none !important;
    }
}

/* Mobile wallet return state */
.mobile-wallet-connected {
    animation: mobileConnectSuccess 0.5s ease-out;
}

@keyframes mobileConnectSuccess {
    0% {
        opacity: 0.5;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fix for frozen mobile UI */
.mobile-connection-recovery {
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

/* Ensure buttons remain clickable after mobile connection */
button:not(:disabled) {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Mobile-specific connection status indicator */
@media (max-width: 768px) {
    .wallet-status {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 10000;
        background: rgba(34, 197, 94, 0.9);
        color: white;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
        backdrop-filter: blur(10px);
    }
    
    .wallet-status.disconnected {
        background: rgba(239, 68, 68, 0.9);
    }
}

/* =============================================================================
   SIMPLIFIED HAMBURGER MENU
   ============================================================================= */

.hamburger-content {
  width: 280px;
  max-width: 85vw;
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.menu-option-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
  width: 100%;
}

.menu-option-btn:hover {
  background: var(--bg-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.option-icon {
  font-size: var(--text-lg);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.option-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-title {
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.option-subtitle {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.option-arrow {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* =============================================================================
   MODAL STYLES
   ============================================================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.modal-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-4);
}

.modal-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

/* =============================================================================
   THEME MODAL STYLES
   ============================================================================= */

.theme-modal {
  width: 480px;
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.theme-option:hover {
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

.theme-option.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.5);
}

.theme-option.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.theme-preview {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-primary);
}

.theme-preview.midnight-dojo {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.theme-preview.cherry-blossom {
  background: linear-gradient(135deg, #fce7f3 0%, #f9a8d4 100%);
}

.theme-preview.golden-temple {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.theme-preview.legendary-master {
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
}

/* =============================================================================
   BURN STATS MODAL STYLES
   ============================================================================= */

.burn-stats-modal {
  width: 400px;
}

.stats-overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.stat-card.primary {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  border-color: rgba(239, 68, 68, 0.3);
  padding: var(--space-4);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.burn-actions {
  margin-top: var(--space-4);
  text-align: center;
}

.burn-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.burn-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 480px) {
  .theme-modal {
    width: 95vw;
  }
  
  .theme-grid {
    grid-template-columns: 1fr;
  }
  
  .burn-stats-modal {
    width: 95vw;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }


}


/* Settings Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.setting-group {
    margin-bottom: 16px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Shop and Inventory Animations */
.item-icon-container {
    position: relative;
    display: inline-block;
}

.item-icon {
    font-size: 2rem;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.item-quantity {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Purchase animation */
@keyframes purchase-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1); }
}

.item-icon.purchased {
    animation: purchase-bounce 0.6s ease;
}

/* Use item animation */
@keyframes item-use-float {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-30px) scale(1.2); opacity: 0.8; }
    100% { transform: translateY(-60px) scale(0.8); opacity: 0; }
}

.item-icon.used {
    animation: item-use-float 1s ease forwards;
}

/* Food eating animation */
@keyframes eating-nom {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
}

.item-icon[data-animation="eatingNomNom"].animating {
    animation: eating-nom 0.8s ease 3;
}

/* Shop modal styles */
.shop-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-4);
}

.shop-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all 0.2s ease;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.effect.positive {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.effect.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}