/* ============================================
   DRAGON VAULT — Dark Fantasy Theme
   Lava + Gold palette, glowing cave UI
   ============================================ */

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

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0a0f;
  --bg-cave: #0d0d14;
  --bg-card: rgba(20, 16, 12, 0.85);
  --bg-card-hover: rgba(30, 24, 16, 0.95);
  --gold: #f0a500;
  --gold-light: #ffd54f;
  --gold-dim: #b8860b;
  --lava: #ff4500;
  --lava-glow: #ff6b35;
  --lava-dark: #c41e00;
  --ember: #ff8c00;
  --fire: #ff6347;
  --ash: #2a2a35;
  --stone: #3a3a48;
  --text: #e8e0d4;
  --text-dim: #8a8078;
  --text-muted: #5a5550;
  --green: #4ade80;
  --red: #f87171;
  --border: rgba(240, 165, 0, 0.15);
  --border-hover: rgba(240, 165, 0, 0.35);
  --glow-gold: 0 0 20px rgba(240, 165, 0, 0.3);
  --glow-lava: 0 0 20px rgba(255, 69, 0, 0.3);
  --glow-fire: 0 0 30px rgba(255, 99, 71, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Background cave texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(255, 69, 0, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(240, 165, 0, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(255, 140, 0, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Custom Background ── */
.custom-bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  display: none;
}

.custom-bg.loaded {
  display: block;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.15), rgba(255, 140, 0, 0.2), rgba(255, 69, 0, 0.15));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 165, 0, 0.3);
  padding: 0 24px;
  box-shadow: 0 4px 20px rgba(255, 165, 0, 0.1);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-right: auto; /* This pushes the logo to the left */
  margin-left: -40px; /* Move further left */
  transform: translateY(1.5%); /* Move 6.5% up from 8% to 1.5% */
}

.logo-image {
  height: 162px; /* 180px - 10% = 162px */
  width: auto;
  max-width: 540px; /* 600px - 10% = 540px */
  object-fit: contain;
  transition: opacity 0.1s ease, filter 0.1s ease, transform 0.1s ease;
}

.logo-dragon {
  font-size: 1.8rem;
  transition: opacity 0.1s ease, filter 0.1s ease, transform 0.1s ease;
}

.logo-text {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--gold), var(--lava-glow), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Connect Wallet Button ── */
.connect-btn {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}

.connect-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-gold);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

/* ── Wallet Info ── */
.wallet-info {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.wallet-addr {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: monospace;
}

.wallet-bal {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}

.wallet-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-demo {
  background: rgba(240, 165, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(240, 165, 0, 0.3);
}

.disconnect-btn {
  background: none;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--red);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
}

.disconnect-btn:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* ── Sound Toggle ── */
.sound-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.sound-btn:hover,
.sound-btn.active {
  color: var(--gold);
  border-color: var(--border-hover);
}

/* ── Main Layout ── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding: 48px 0 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-dragon {
  font-size: 5rem;
  margin-bottom: 16px;
  display: block;
  animation: dragonFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(255, 69, 0, 0.5));
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  align-self: center;
}

/* ── Screen Shake Animation ── */
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5px, -5px); }
  20% { transform: translate(5px, -5px); }
  30% { transform: translate(-5px, 5px); }
  40% { transform: translate(5px, 5px); }
  50% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, -3px); }
  70% { transform: translate(-3px, 3px); }
  80% { transform: translate(3px, 3px); }
  90% { transform: translate(-1px, -1px); }
}

.screen-shake {
  animation: screenShake 0.6s ease-in-out;
}

/* ── Dragon Fire Burst Animation ── */
@keyframes dragonFireBurst {
  0% { 
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 30px rgba(255, 69, 0, 0.5));
  }
  25% { 
    transform: scale(1.2) rotate(-5deg);
    filter: drop-shadow(0 0 50px rgba(255, 69, 0, 0.8));
  }
  50% { 
    transform: scale(1.3) rotate(5deg);
    filter: drop-shadow(0 0 80px rgba(255, 140, 0, 1));
  }
  75% { 
    transform: scale(1.2) rotate(-3deg);
    filter: drop-shadow(0 0 60px rgba(255, 69, 0, 0.9));
  }
  100% { 
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 30px rgba(255, 69, 0, 0.5));
  }
}

.dragon-fire-burst {
  animation: dragonFireBurst 1s ease-in-out;
}

/* ── Fire Particles Burst ── */
.fire-particle-burst {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lava-glow), var(--lava));
  box-shadow: 0 0 10px var(--lava-glow);
  pointer-events: none;
  animation: fireParticleBurst 1.5s ease-out forwards;
}

@keyframes fireParticleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--lava-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── Stats Bar ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glow-gold);
}

.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ── Game Grid ── */
.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Deposit Card ── */
.deposit-card {
  border-color: rgba(240, 165, 0, 0.2);
}

.deposit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--lava-glow), var(--gold));
}

.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s;
  outline: none;
}

.input-field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.1);
}

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

.quick-amounts {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.quick-btn {
  background: rgba(240, 165, 0, 0.1);
  border: 1px solid rgba(240, 165, 0, 0.2);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.quick-btn:hover {
  background: rgba(240, 165, 0, 0.2);
  border-color: var(--gold);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  width: 100%;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}

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

.btn-deposit {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #000;
  box-shadow: 0 4px 16px rgba(240, 165, 0, 0.3);
}

.btn-deposit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(240, 165, 0, 0.5);
}

.btn-withdraw {
  background: linear-gradient(135deg, var(--lava-dark), var(--lava));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 69, 0, 0.3);
}

.btn-withdraw:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 69, 0, 0.5);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: #000;
  margin-top: 16px;
}

/* ── Withdraw Card ── */
.withdraw-card {
  border-color: rgba(255, 69, 0, 0.2);
}

.withdraw-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--lava), var(--fire), var(--lava));
}

/* ── Active Deposit Panel ── */
.deposit-info {
  margin-bottom: 20px;
}

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

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

.label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.burn-danger {
  color: var(--lava) !important;
  font-weight: 700;
}

.burn-safe {
  color: var(--green) !important;
  font-weight: 700;
}

/* ── Dragon Anger Bar ── */
.anger-section {
  margin-bottom: 20px;
}

.anger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.anger-title {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.anger-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.anger-bar {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  transition: width 1s ease, background 1s ease;
  box-shadow: 0 0 10px currentColor;
}

/* ── No Deposit State ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.5;
}

/* ── History Section ── */
.history-section {
  margin-top: 32px;
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.3s;
}

.history-row:hover {
  border-color: var(--border-hover);
}

.row-burned {
  border-left: 3px solid var(--lava);
}

.row-safe {
  border-left: 3px solid var(--green);
}

.history-num {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 36px;
  font-size: 0.85rem;
}

.history-details {
  flex: 1;
}

.history-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.history-deposit {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
}

.history-arrow {
  color: var(--text-muted);
}

.history-payout {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
}

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

.tag {
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-burn {
  background: rgba(255, 69, 0, 0.15);
  color: var(--lava);
  border: 1px solid rgba(255, 69, 0, 0.3);
}

.tag-safe {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

/* ── Fire Particles ── */
.fire-particles {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.fire-particle {
  position: absolute;
  bottom: -10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #4a9eff, #2563eb);
  animation: fireRise linear forwards;
  box-shadow: 0 0 12px #4a9eff;
}

@keyframes fireRise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-200px) scale(0);
    opacity: 0;
  }
}

/* ── Cave Glow ── */
.cave-glow {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 200px;
  background: radial-gradient(ellipse at center bottom, rgba(255, 69, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: all 0.5s;
}

.cave-burn {
  background: radial-gradient(ellipse at center bottom, rgba(255, 69, 0, 0.4) 0%, transparent 70%) !important;
  animation: caveBurnPulse 0.5s ease 4;
}

.cave-gold {
  background: radial-gradient(ellipse at center bottom, rgba(240, 165, 0, 0.4) 0%, transparent 70%) !important;
  animation: caveGoldPulse 0.5s ease 4;
}

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

@keyframes caveGoldPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Dragon Sprite Animations ── */
.dragon-sprite {
  transition: all 0.3s;
}

.dragon-feed {
  animation: dragonFeedAnim 1.5s ease;
}

@keyframes dragonFeedAnim {
  0% { transform: scale(1); }
  30% { transform: scale(1.2) rotate(5deg); }
  60% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1); }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-cave);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.3s;
}

.modal-close:hover {
  color: var(--text);
}

/* ── Result Modal ── */
.result-modal {
  padding: 32px;
  text-align: center;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

.result-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.result-burned .result-title {
  color: var(--lava);
}

.result-safe .result-title {
  color: var(--gold);
}

.result-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.result-label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

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

.burn-highlight {
  background: rgba(255, 69, 0, 0.1) !important;
}

.burn-highlight .result-value {
  color: var(--lava);
}

.result-total {
  background: rgba(240, 165, 0, 0.1) !important;
  border: 1px solid rgba(240, 165, 0, 0.2);
}

.result-total .result-value {
  color: var(--gold);
  font-size: 1.1rem;
}

.profit-positive {
  color: var(--green) !important;
}

.profit-negative {
  color: var(--red) !important;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  transition: transform 0.4s ease;
  max-width: 500px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.toast-error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.toast-warning {
  background: rgba(255, 140, 0, 0.15);
  color: var(--ember);
  border: 1px solid rgba(255, 140, 0, 0.3);
}

.toast-info {
  background: rgba(240, 165, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(240, 165, 0, 0.3);
}

/* ── Game Math Section ── */
.math-section {
  margin-top: 48px;
}

.math-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.math-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.math-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.formula {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--gold-light);
  margin-bottom: 12px;
  overflow-x: auto;
  border: 1px solid rgba(240, 165, 0, 0.1);
}

.math-text {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
}

.math-example {
  background: rgba(74, 222, 128, 0.05);
  border: 1px solid rgba(74, 222, 128, 0.15);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--green);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.footer a {
  color: var(--gold-dim);
  text-decoration: none;
}

.footer a:hover {
  color: var(--gold);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-dragon {
    font-size: 3.5rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .math-grid {
    grid-template-columns: 1fr;
  }

  .history-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 16px 12px 60px;
  }

  .card {
    padding: 20px;
  }

  .hero {
    padding: 32px 0 24px;
  }

  .quick-amounts {
    justify-content: center;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
