/* ============================================================
   TRUE GAME UI OVERRIDE (Chunky 3D Glossy + Carved Wood & Parchment)
   Zero "web-app / vibecoding" look — 100% real mobile/Steam game UI!
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@600;700&family=Rubik:wght@700;800;900&display=swap');

:root {
  --wood-dark: #2a160c;
  --wood-mid: #4a2816;
  --wood-light: #6e3d21;
  --gold-rim: #f59e0b;
  --gold-hi: #fef08a;
  --parchment: #f8e3be;
  --parchment-deep: #e8c794;
  --outline: #1e0f08;
}

body {
  background: radial-gradient(circle at 50% 0%, #311d3f 0%, #1c1026 55%, #110918 100%) !important;
  font-family: "Rubik", "Fredoka", "Segoe UI", system-ui, sans-serif !important;
}

.gg-coin-ico {
  width: 22px;
  height: 22px;
  vertical-align: -5px;
  object-fit: contain;
  display: inline-block;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.7));
}

/* ===== CHUNKY CARVED WOOD + GOLD TOP HUD ===== */
.hud-bar {
  background: linear-gradient(180deg, #5a321b 0%, #3d2010 55%, #2b150a 100%) !important;
  border: 3px solid var(--outline) !important;
  border-radius: 18px !important;
  padding: 10px 14px !important;
  box-shadow:
    0 6px 0 #160a04,
    0 12px 24px rgba(0, 0, 0, 0.6),
    inset 0 3px 0 rgba(255, 214, 153, 0.35),
    inset 0 -3px 0 rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: none !important;
}

/* GAME TITLE RIBBON */
.logo-pill {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 60%, #d97706 100%) !important;
  border: 3px solid var(--outline) !important;
  border-radius: 14px !important;
  padding: 7px 16px !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  letter-spacing: 0.05em !important;
  text-shadow:
    0 2px 0 #78350f,
    -1.5px -1.5px 0 #451a03,
    1.5px -1.5px 0 #451a03,
    -1.5px 1.5px 0 #451a03,
    1.5px 1.5px 0 #451a03 !important;
  box-shadow:
    0 4px 0 #92400e,
    inset 0 3px 0 rgba(255, 255, 255, 0.6) !important;
}

/* RECESSED WOODEN RESOURCE SLOTS */
.stat-pill {
  background: linear-gradient(180deg, #1d0e07 0%, #2c160c 100%) !important;
  border: 2.5px solid #8a512a !important;
  border-radius: 999px !important;
  padding: 5px 13px !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  color: #fff7ed !important;
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.75),
    0 2px 0 rgba(255, 214, 153, 0.2) !important;
  gap: 6px !important;
}
.stat-pill b {
  color: #ffffff !important;
  text-shadow: 0 2px 0 #000 !important;
}
.stat-pill.stat-gg {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, #2b1806 0%, #422408 100%) !important;
}
.stat-pill.stat-gg .gg-label {
  font-size: 10px !important;
  font-weight: 900 !important;
  color: #fde047 !important;
  text-shadow: 0 1.5px 0 #000 !important;
}
.stat-gem {
  border-color: #38bdf8 !important;
  background: linear-gradient(180deg, #0b2239 0%, #103354 100%) !important;
}
.stat-boss {
  border-color: #ef4444 !important;
  background: linear-gradient(180deg, #360c0c 0%, #4c1111 100%) !important;
  color: #fecaca !important;
}

/* CHUNKY 3D '+' BUTTON */
.plus-btn {
  width: 22px !important;
  height: 22px !important;
  border-radius: 7px !important;
  border: 2px solid var(--outline) !important;
  background: linear-gradient(180deg, #86efac 0%, #22c55e 55%, #16a34a 100%) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 15px !important;
  text-shadow: 0 1.5px 0 #14532d !important;
  box-shadow: 0 2px 0 #14532d, inset 0 2px 0 rgba(255, 255, 255, 0.55) !important;
}

/* ===== GLOSSY 3D GAME BUTTONS (Candy/Clash/Fantasy Style) ===== */
.hud-btn,
.btn-drop,
.btn-spin,
.btn-volley,
.btn-gold-spin,
.btn-autodrop,
.btn-autospin,
.btn-next-wave,
.btn-buy,
.btn-reroll,
.daily-chest-btn {
  position: relative;
  border: 3px solid var(--outline) !important;
  border-radius: 14px !important;
  font-family: "Rubik", "Fredoka", sans-serif !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.75),
    -1px -1px 0 rgba(0, 0, 0, 0.65),
    1px -1px 0 rgba(0, 0, 0, 0.65),
    -1px 1px 0 rgba(0, 0, 0, 0.65),
    1px 1px 0 rgba(0, 0, 0, 0.65) !important;
  transition: transform 0.08s ease, filter 0.12s ease !important;
}

/* Top glossy highlight pill on buttons */
.hud-btn::before,
.btn-drop::before,
.btn-spin::before,
.btn-volley::before,
.btn-gold-spin::before,
.btn-next-wave::before,
.btn-buy::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 3px;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.05));
  pointer-events: none;
}

.hud-btn {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 60%, #1d4ed8 100%) !important;
  padding: 7px 13px !important;
  font-size: 13px !important;
  box-shadow: 0 4px 0 #1e3a8a, inset 0 -2px 0 rgba(0, 0, 0, 0.25) !important;
}
.hud-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hud-btn:active { transform: translateY(3px) !important; box-shadow: 0 1px 0 #1e3a8a !important; }

/* GOLD DONATE BUTTON */
.hud-btn-donate {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 55%, #d97706 100%) !important;
  box-shadow: 0 4px 0 #92400e, 0 0 16px rgba(250, 204, 21, 0.45) !important;
}
.hud-btn-donate:active { box-shadow: 0 1px 0 #92400e !important; }

/* GREEN MAIN ACTION BUTTONS (SPIN / DROP / ROLL / BUY) */
.btn-spin,
.btn-drop,
.btn-buy {
  background: linear-gradient(180deg, #84f037 0%, #3bbf15 55%, #239109 100%) !important;
  box-shadow: 0 5px 0 #155c04, inset 0 -3px 0 rgba(0, 0, 0, 0.22) !important;
}
.btn-spin:active,
.btn-drop:active,
.btn-buy:active {
  transform: translateY(4px) !important;
  box-shadow: 0 1px 0 #155c04 !important;
}

/* BLUE PREMIUM / GEM BUTTONS */
.btn-gold-spin,
.btn-volley,
.btn-buy-gem {
  background: linear-gradient(180deg, #5ce1ff 0%, #0ea5e9 55%, #0369a1 100%) !important;
  box-shadow: 0 4px 0 #0c4a6e, inset 0 -2px 0 rgba(0, 0, 0, 0.22) !important;
}
.btn-gold-spin:active,
.btn-volley:active,
.btn-buy-gem:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #0c4a6e !important;
}

/* PURPLE AUTO / VIP / REROLL BUTTONS */
.btn-autospin,
.btn-autodrop,
.btn-reroll {
  background: linear-gradient(180deg, #d8b4fe 0%, #9333ea 55%, #6b21a8 100%) !important;
  box-shadow: 0 4px 0 #4c1d95 !important;
}

/* RED BATTLE / NEXT WAVE BUTTON */
.btn-next-wave {
  background: linear-gradient(180deg, #ff6b6b 0%, #ef4444 55%, #b91c1c 100%) !important;
  box-shadow: 0 5px 0 #7f1d1d, 0 0 16px rgba(239, 68, 68, 0.4) !important;
  padding: 11px 22px !important;
  font-size: 14.5px !important;
}
.btn-next-wave:active {
  transform: translateY(4px) !important;
  box-shadow: 0 1px 0 #7f1d1d !important;
}

/* DAILY CHEST ORANGE BUTTON */
.daily-chest-btn {
  background: linear-gradient(180deg, #fbbf24 0%, #ea580c 100%) !important;
  box-shadow: 0 4px 0 #7c2d12 !important;
}

/* ===== WOODEN ARENA FRAME & BOTTOM SKILL BAR ===== */
.arena-frame {
  background: linear-gradient(180deg, #4a2816 0%, #2a160c 100%) !important;
  border: 4px solid var(--outline) !important;
  border-radius: 18px !important;
  box-shadow:
    0 8px 0 #140904,
    0 16px 34px rgba(0, 0, 0, 0.65),
    inset 0 3px 0 rgba(255, 214, 153, 0.3) !important;
}
.world-banner {
  background: linear-gradient(180deg, #5a321b 0%, #3a1e0f 100%) !important;
  border-bottom: 3px solid var(--outline) !important;
  padding: 9px 16px !important;
  color: #fef3c7 !important;
  text-shadow: 0 2px 0 #1a0b04 !important;
}
.wave-badge {
  background: linear-gradient(180deg, #fde047, #f59e0b) !important;
  border: 2px solid var(--outline) !important;
  color: #451a03 !important;
  font-weight: 900 !important;
  padding: 3px 11px !important;
  box-shadow: 0 2px 0 #78350f !important;
}
.wave-badge.combat {
  background: linear-gradient(180deg, #ff6b6b, #dc2626) !important;
  color: #ffffff !important;
  text-shadow: 0 1.5px 0 #450a0a !important;
}

.arena-footer {
  background: linear-gradient(180deg, #462514 0%, #2b150a 100%) !important;
  border-top: 3px solid var(--outline) !important;
  padding: 12px 14px !important;
}

/* CHUNKY 3D SKILL GROUPS */
.skill-group {
  display: inline-flex !important;
  background: linear-gradient(180deg, #3b2011 0%, #241209 100%) !important;
  border: 3px solid var(--outline) !important;
  border-radius: 13px !important;
  box-shadow: 0 4px 0 #140904, inset 0 2px 0 rgba(255, 214, 153, 0.25) !important;
  overflow: hidden;
}
.skill-btn {
  background: linear-gradient(180deg, #6b3b20 0%, #492512 100%) !important;
  border: none !important;
  padding: 8px 11px !important;
  font-family: "Rubik", sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  color: #fff7ed !important;
  text-shadow: 0 1.5px 0 #000 !important;
}
.skill-btn:hover { filter: brightness(1.12); }
.skill-lv {
  background: #f59e0b !important;
  color: #1e0f08 !important;
  border: 1.5px solid #1e0f08 !important;
  border-radius: 6px !important;
  padding: 1px 5px !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}
.skill-up-btn {
  background: linear-gradient(180deg, #84f037 0%, #2ea80e 100%) !important;
  border: none !important;
  border-left: 2.5px solid var(--outline) !important;
  color: #ffffff !important;
  font-family: "Rubik", sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 900 !important;
  padding: 0 10px !important;
  text-shadow: 0 1.5px 0 #14532d !important;
}
.skill-up-btn:hover { filter: brightness(1.1); }

/* WOODEN ROSTER TRAY */
.roster-bar {
  background: linear-gradient(180deg, #4a2816 0%, #2d170c 100%) !important;
  border: 3px solid var(--outline) !important;
  border-radius: 16px !important;
  box-shadow: 0 5px 0 #140904, inset 0 2px 0 rgba(255, 214, 153, 0.25) !important;
}
.roster-empty { color: #e8c794 !important; font-weight: 700 !important; }
.roster-chip {
  background: linear-gradient(180deg, #f8e3be 0%, #e5c38e 100%) !important;
  border: 2.5px solid var(--outline) !important;
  border-radius: 11px !important;
  color: #2a160c !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 0 #1a0c05, inset 0 2px 0 rgba(255, 255, 255, 0.6) !important;
}
.roster-chip.rare {
  background: linear-gradient(180deg, #dbeafe 0%, #93c5fd 100%) !important;
  border-color: #1e3a8a !important;
}
.roster-chip.legendary {
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%) !important;
  border-color: #78350f !important;
}

/* ===== WARM PARCHMENT & CARVED WOOD MODALS (Like Reference #4!) ===== */
.modal-box {
  background: var(--parchment) !important;
  border: 5px solid #c26a1b !important;
  outline: 3px solid var(--outline) !important;
  border-radius: 22px !important;
  color: #3a1f0f !important;
  box-shadow:
    0 12px 0 #6e3509,
    0 26px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 0 3px #fff3d9 !important;
}
.modal-head {
  background: linear-gradient(180deg, #ffb82e 0%, #ea7c0e 100%) !important;
  border-bottom: 3px solid #9a4708 !important;
  color: #ffffff !important;
}
.modal-head h2 {
  color: #ffffff !important;
  text-shadow: 0 2px 0 #7c2d12, -1px -1px 0 #7c2d12, 1px -1px 0 #7c2d12 !important;
}
.modal-sub { color: #fef3c7 !important; font-weight: 600 !important; }
.modal-close {
  background: linear-gradient(180deg, #ff6b6b, #dc2626) !important;
  border: 2.5px solid var(--outline) !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-weight: 900 !important;
  box-shadow: 0 3px 0 #7f1d1d !important;
}

.gateway-strip {
  background: #ebd0a0 !important;
  border-bottom: 2px solid #cfa96d !important;
  color: #4a2816 !important;
  font-weight: 700 !important;
}
.gateway-strip select {
  background: #fff8eb !important;
  color: #2a160c !important;
  border: 2px solid #a86c2d !important;
  font-weight: 700 !important;
}
.tx-counter { color: #15803d !important; }

.modal-tabs {
  background: #f0d7aa !important;
  border-bottom: 2px solid #cfa96d !important;
}
.tab-btn {
  color: #6e3d21 !important;
  font-family: "Rubik", sans-serif !important;
  font-weight: 800 !important;
}
.tab-btn.active {
  color: #b45309 !important;
  border-bottom: 4px solid #ea580c !important;
}

.offer-card {
  background: #fff6e5 !important;
  border: 3px solid #cfa163 !important;
  border-radius: 16px !important;
  color: #3a1f0f !important;
  box-shadow: 0 4px 0 #b88442, inset 0 2px 0 #ffffff !important;
}
.offer-card.popular {
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 100%) !important;
  border-color: #d97706 !important;
  box-shadow: 0 4px 0 #92400e, inset 0 2px 0 #ffffff !important;
}
.offer-badge {
  background: linear-gradient(180deg, #ff5e5e, #dc2626) !important;
  color: #ffffff !important;
  border: 2px solid var(--outline) !important;
  box-shadow: 0 2px 0 #7f1d1d !important;
}
.offer-title { color: #2a160c !important; font-weight: 900 !important; }
.offer-desc { color: #5c3720 !important; font-weight: 600 !important; }
.offer-price { color: #b45309 !important; font-weight: 900 !important; }
.shop-footer {
  background: #ebd0a0 !important;
  border-top: 2px solid #cfa96d !important;
}

/* TOAST */
.toast {
  background: linear-gradient(180deg, #5a321b, #2b150a) !important;
  border: 3px solid #f59e0b !important;
  border-radius: 14px !important;
  color: #fef3c7 !important;
  box-shadow: 0 6px 0 #140904, 0 12px 28px rgba(0, 0, 0, 0.6) !important;
}


/* ============================================================
   FULL RESPONSIVE ADAPTATION (4K / 1920x1080 / 1366x768 / Tablet / Mobile)
   ============================================================ */

/* Fluid canvases everywhere */
canvas {
  max-width: 100%;
  height: auto;
  display: block;
}
#arenaCanvas {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 840 / 460;
}
#plinkoCanvas, #wheelCanvas {
  max-width: 100% !important;
  height: auto !important;
  margin-left: auto;
  margin-right: auto;
}

/* 1920x1080 & Ultrawide (Full HD / 2K / 4K) */
@media (min-width: 1600px) {
  .game-shell {
    max-width: 1480px !important;
    padding: 16px 24px 24px !important;
    gap: 14px !important;
  }
  .main-grid {
    grid-template-columns: 380px 1fr !important;
    gap: 18px !important;
  }
  .hud-bar { padding: 12px 18px !important; }
  .stat-pill { font-size: 14px !important; padding: 6px 14px !important; }
  .hud-btn { font-size: 13.5px !important; padding: 8px 15px !important; }
}

/* Standard Laptops (1024px - 1400px, e.g. 1366x768) */
@media (max-width: 1400px) and (min-width: 981px) {
  .game-shell {
    max-width: 100% !important;
    padding: 8px 12px 14px !important;
    gap: 10px !important;
  }
  .main-grid {
    grid-template-columns: 325px 1fr !important;
    gap: 12px !important;
  }
  .hud-bar { padding: 8px 10px !important; gap: 6px !important; }
  .stat-pill { font-size: 12.5px !important; padding: 4px 10px !important; }
  .hud-btn { font-size: 12px !important; padding: 6px 10px !important; }
}

/* Tablets & Small Laptops (<= 980px) */
@media (max-width: 980px) {
  .game-shell {
    padding: 8px 10px 24px !important;
    gap: 10px !important;
  }
  .main-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  /* Show Battle Arena FIRST on mobile/tablet so combat is immediately visible */
  .arena-column { order: -1; }
  .slot-column { width: 100% !important; max-width: 100% !important; }
  .hud-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 8px 10px !important;
  }
  .hud-left, .hud-right {
    justify-content: center !important;
    gap: 6px !important;
  }
  .arena-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .skills-bar {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .btn-next-wave {
    width: 100% !important;
    padding: 13px 16px !important;
    font-size: 15px !important;
  }
}

/* Smartphones (<= 560px: iPhone SE / iPhone 15 / Android) */
@media (max-width: 560px) {
  .game-shell { padding: 6px 6px 24px !important; gap: 8px !important; }
  .logo-pill { font-size: 13px !important; padding: 4px 10px !important; }
  .stat-pill {
    font-size: 11.5px !important;
    padding: 4px 8px !important;
    gap: 4px !important;
  }
  .stat-pill.stat-gg .gg-label { display: none !important; }
  .gg-coin-ico { width: 17px !important; height: 17px !important; vertical-align: -3px !important; }
  .hud-btn {
    font-size: 11.5px !important;
    padding: 6px 9px !important;
    border-radius: 10px !important;
  }
  .world-banner {
    padding: 7px 10px !important;
    font-size: 12px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .skill-group { flex: 1 1 auto !important; justify-content: space-between !important; }
  .skill-btn { font-size: 11.5px !important; padding: 7px 8px !important; }
  .skill-up-btn { font-size: 11px !important; padding: 7px 8px !important; }
  .roster-bar {
    padding: 8px !important;
    gap: 6px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .roster-chip { flex: 0 0 auto !important; font-size: 11.5px !important; }

  /* Modals fit cleanly inside mobile viewport */
  .modal-backdrop, .gg4-modal-backdrop { padding: 8px !important; }
  .modal-card, .gg4-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    border-radius: 16px !important;
  }
  .modal-content {
    grid-template-columns: 1fr !important;
    padding: 12px !important;
  }
  .modal-tabs {
    padding: 8px 10px 0 !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn { white-space: nowrap !important; font-size: 12px !important; padding: 7px 10px !important; }
  .toast {
    left: 10px !important;
    right: 10px !important;
    bottom: 12px !important;
    text-align: center !important;
    font-size: 12.5px !important;
  }
}
