/* === HELLOVPN PREMIUM: OBSIDIAN EDITION (v6) === */

:root {
  /* Palette - Luxury Dark */
  --bg-deep: #000000;
  --bg-subtle: #0a0a0a;
  
  /* Materials */
  --glass-heavy: rgba(20, 20, 20, 0.6);
  --glass-light: rgba(255, 255, 255, 0.03);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-highlight: rgba(255, 255, 255, 0.15);
  
  /* Accents */
  --accent-gold: #D4AF37; /* Metallic Gold */
  --accent-gold-glow: rgba(212, 175, 55, 0.4);
  --accent-platinum: #E5E4E2;
  --accent-error: #FF453A;
  --accent-success: #32D74B;

  /* Typography */
  --font-primary: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', monospace;
  
  /* Dimensions */
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  
  --btn-height-primary: 56px;
  --btn-height-secondary: 44px;
  --btn-height-compact: 36px;
  
  --card-action-height: 96px;
  --card-hero-height: 96px;
  
  --tabbar-height: 84px;
}

/* === BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
  background: var(--bg-deep);
  color: var(--accent-platinum);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden; /* App handles scroll */
  height: 100vh;
  width: 100vw;
}

/* === LAYOUT === */
#webgl-container {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  pointer-events: all; /* WebGL handles interactions */
}

#ui-layer {
  position: relative;
  z-index: 10;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: max(env(safe-area-inset-top), 20px);
  padding-bottom: calc(20px + env(safe-area-inset-bottom)); /* Fix: Safe Area */
  pointer-events: none; /* Let clicks pass to WebGL where needed */
  box-sizing: border-box;
}

/* Allow pointer events on interactive UI elements */
.interactive { pointer-events: auto; }

/* === TYPOGRAPHY === */
h1, h2, h3 { color: #fff; font-weight: 700; letter-spacing: -0.5px; }
.text-gold { color: var(--accent-gold); }
.text-mono { font-family: var(--font-mono); letter-spacing: -0.5px; }
.text-label { 
  font-size: 12px; /* Fix: Increased from 11px */
  text-transform: uppercase; 
  letter-spacing: 1.5px; 
  color: rgba(255,255,255,0.4); 
  font-weight: 600;
}

/* === COMPONENTS === */

/* 1. Glass Cards (Premium) */
.glass-panel {
  background: var(--glass-heavy);
  backdrop-filter: blur(40px) saturate(120%);
  -webkit-backdrop-filter: blur(40px) saturate(120%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin: 0 var(--spacing-md) var(--spacing-md); /* Fix: 16px margins */
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto; /* FIX: Allow interactions */
}

.glass-panel:active { transform: scale(0.98); }

/* 2. The "Gold" Button */
.btn-primary {
  background: linear-gradient(135deg, #F2D06B 0%, #B88A18 100%);
  color: #000;
  border: none;
  height: var(--btn-height-primary);
  padding: 0 var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 16px;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(255,255,255,0.4), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:active { transform: scale(0.96); box-shadow: 0 5px 15px rgba(212, 175, 55, 0.1); }
.btn-primary:active::after { opacity: 1; }

/* Payment Modal Grid */
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.btn-amount {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.2s;
}

.btn-amount:active {
  background: var(--accent-gold);
  color: #000;
  transform: scale(0.95);
}

.btn-amount span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 4px;
}

/* 4. Profile Card (Credit Card Style) */
.profile-card {
  background: linear-gradient(145deg, #1a1a1a, #000000);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.chip {
  width: 40px; height: 30px;
  background: linear-gradient(135deg, #d4af37 0%, #f2d06b 50%, #b88a18 100%);
  border-radius: 6px;
  margin-bottom: 20px;
  opacity: 0.8;
}

/* 5. Game Container (Invisible, handled by WebGL) */
#game-ui-overlay {
  position: absolute;
  bottom: 120px;
  left: 0;
  width: 100%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

#game-ui-overlay.visible { opacity: 1; pointer-events: auto; }

/* 6. Modal (Win Screen) */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.3s;
}

.modal-content {
  background: #111;
  border: 1px solid var(--accent-gold);
  padding: 40px;
  border-radius: 30px;
  text-align: center;
  box-shadow: 0 0 50px var(--accent-gold-glow);
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === SETUP WIZARD (Mobile First) === */
.setup-container {
  padding: 0 var(--spacing-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.setup-header {
  text-align: center;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.setup-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-xs);
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.1));
  animation: float 4s ease-in-out infinite;
}

.setup-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  color: #fff;
}

.setup-subtitle {
  opacity: 0.5;
  font-size: 13px;
  font-weight: 500;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}

.step-card {
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  height: 96px;
}

.step-number {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 14px;
  color: #fff;
}

.step-desc {
  font-size: 12px;
  opacity: 0.5;
  color: #fff;
}

.step-btn {
  width: auto;
  padding: 0 var(--spacing-md);
  font-size: 12px;
  height: var(--btn-height-compact);
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  font-weight: 600;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.setup-footer {
  text-align: center;
  margin-top: var(--spacing-md);
}

.setup-footer-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  text-decoration: none;
  padding: 10px;
  cursor: pointer;
}

/* Status Colors */
.step-card.success {
  border-color: var(--accent-success);
  background: rgba(46, 204, 113, 0.1);
}

.step-text-success { color: var(--accent-success); }
.step-text-error { color: var(--accent-error); }
.step-btn-success { background: var(--accent-success); color: #fff; }
