@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;900&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
  /* Core palette - Dark gaming theme */
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --bg-input: #0d0d14;
  
  /* Accent colors */
  --accent-gold: #ffd700;
  --accent-orange: #ff6b35;
  --accent-green: #2ed573;
  --accent-blue: #3742fa;
  --accent-cyan: #00d4ff;
  --accent-red: #ff4757;
  --accent-purple: #7c3aed;
  
  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #64748b;
  
  /* Borders & effects */
  --border-color: #2a2a3a;
  --border-active: rgba(255, 215, 0, 0.3);
  --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
  --glow-green: 0 0 20px rgba(46, 213, 115, 0.3);
  --glow-red: 0 0 20px rgba(255, 71, 87, 0.3);
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
  
  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 16px;
  background-image: 
    radial-gradient(ellipse at top, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(255, 107, 53, 0.03) 0%, transparent 50%);
}

/* Animated grid background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 215, 0, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 215, 0, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(18, 18, 26, 0.98) 0%, rgba(18, 18, 26, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0.5;
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  gap: 20px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.navbar-brand-icon {
  font-size: 2rem;
}

.navbar-brand-text {
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-balance {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 10px;
  padding: 10px 16px;
  margin-right: 10px;
}

.navbar-balance-icon {
  font-size: 1.2rem;
}

.navbar-balance-amount {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.container-narrow {
  max-width: 600px;
}

/* ========================================
   HEADER / HERO
   ======================================== */
.hero {
  text-align: center;
  padding: 50px 20px 40px;
}

.hero-title {
  font-family: 'Orbitron', monospace;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange), var(--accent-gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
  animation: shimmer 3s ease-in-out infinite;
  letter-spacing: 2px;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.3rem;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto;
}

.hero-cta {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* ========================================
   SECTION TITLES
   ======================================== */
.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 28px;
  background: linear-gradient(180deg, var(--accent-gold), var(--accent-orange));
  border-radius: 2px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.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;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: #000;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-gold);
}

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

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

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #22a35f);
  color: #000;
}

.btn-success:hover {
  box-shadow: var(--glow-green);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--accent-red);
  color: #fff;
}

.btn-danger:hover {
  box-shadow: var(--glow-red);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 18px 32px;
  font-size: 1.1rem;
}

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

.btn-icon {
  padding: 12px;
  min-width: 46px;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-orange));
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.card-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ========================================
   CHEST GRID
   ======================================== */
.chests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.chest-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid var(--border-color);
  padding: 20px 15px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.chest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-orange));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chest-card:hover:not(.locked)::before {
  opacity: 1;
}

.chest-card:hover:not(.locked) {
  transform: translateY(-5px);
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}

.chest-card.selected {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 107, 53, 0.1));
}

.chest-card.selected::before {
  opacity: 1;
}

.chest-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--accent-red);
}

.chest-card.locked::before {
  background: var(--accent-red);
  opacity: 1;
}

.chest-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.chest-name {
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--accent-gold);
}

.chest-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.chest-status {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  font-weight: 600;
}

.chest-status.available {
  background: rgba(46, 213, 115, 0.15);
  color: var(--accent-green);
}

.chest-status.locked {
  background: rgba(255, 71, 87, 0.15);
  color: var(--accent-red);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1), var(--glow-gold);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================
   BUY SECTION
   ======================================== */
.buy-section {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 25px;
  margin-top: 30px;
}

.buy-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.buy-chest {
  display: flex;
  align-items: center;
  gap: 15px;
}

.buy-chest-icon {
  font-size: 2.5rem;
}

.buy-chest-name {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
}

.buy-chest-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.buy-price {
  font-family: 'Orbitron', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: var(--glow-gold);
}

.buy-btn {
  width: 100%;
  padding: 18px;
  font-size: 1.2rem;
}

/* ========================================
   STATUS LOG
   ======================================== */
.status-section {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-top: 30px;
}

.status-log {
  background: var(--bg-dark);
  border-radius: 10px;
  padding: 15px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--accent-green);
  min-height: 50px;
  white-space: pre-wrap;
}

/* ========================================
   INFO BOX
   ======================================== */
.info-box {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 20px;
}

.info-box-title {
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.info-box-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========================================
   CHEST CONTENTS SECTION
   ======================================== */
.chest-contents-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  margin-top: 35px;
  position: relative;
  overflow: hidden;
}

.chest-contents-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan), var(--accent-gold));
}

.chest-contents-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 25px;
  margin-top: -10px;
}

.chest-contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.content-item {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 15px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.content-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.content-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.content-item:hover::before {
  opacity: 1;
}

.content-item-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

.content-item-name {
  font-family: 'Orbitron', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.content-item-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ========================================
   STAT DISPLAY
   ======================================== */
.stat-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.stat-icon {
  font-size: 1.5rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toasts {
  position: fixed;
  top: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-hover);
  animation: toastIn 0.4s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

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

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success {
  border-color: rgba(46, 213, 115, 0.3);
}

.toast-success::before {
  background: var(--accent-green);
}

.toast-error {
  border-color: rgba(255, 71, 87, 0.3);
}

.toast-error::before {
  background: var(--accent-red);
}

.toast-info {
  border-color: rgba(0, 212, 255, 0.3);
}

.toast-info::before {
  background: var(--accent-cyan);
}

/* ========================================
   OVERLAY / MODAL
   ======================================== */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
}

.overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: 20px;
  padding: 32px 40px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--glow-gold), var(--shadow-hover);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ========================================
   SPINNER
   ======================================== */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 215, 0, 0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-gold { color: var(--accent-gold); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-muted { color: var(--text-secondary); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }

/* Link styles */
a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-orange);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .navbar-brand {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .container {
    padding: 20px 15px 40px;
  }
  
  .chests-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .chest-card {
    padding: 15px 10px;
  }
  
  .chest-name {
    font-size: 1.4rem;
  }
  
  .buy-info {
    flex-direction: column;
    text-align: center;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .toasts {
    left: 15px;
    right: 15px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
  
  .chest-contents-section {
    padding: 20px 15px;
  }
  
  .chest-contents-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .content-item {
    padding: 15px 10px;
  }
  
  .content-item-icon {
    font-size: 2rem;
  }
  
  .content-item-name {
    font-size: 0.85rem;
  }
  
  .content-item-desc {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }
  
  .chests-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .btn {
    padding: 12px 18px;
    font-size: 0.9rem;
  }
  
  .navbar-balance {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: 5px;
  border: 2px solid var(--bg-dark);
}

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

* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-card-hover) var(--bg-dark);
}

::selection {
  background: var(--accent-gold);
  color: var(--bg-dark);
}
