/* HoYoverse Aesthetic Dark Theme for TopSpeedBoost */

:root {
  --hy-bg-dark: #070913;
  --hy-card-bg: rgba(15, 23, 42, 0.75);
  --hy-card-border: rgba(99, 102, 241, 0.2);
  --hy-glow-genshin: rgba(99, 102, 241, 0.4);
  --hy-glow-hsr: rgba(168, 85, 247, 0.4);
  --hy-glow-zzz: rgba(234, 179, 8, 0.4);
  --hy-glow-wuwa: rgba(34, 197, 94, 0.4);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--hy-bg-dark);
  color: #f1f5f9;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.08) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Fallback for hidden elements — works even if Tailwind CDN doesn't load */
.hidden {
  display: none;
}

/* Responsive overrides so Tailwind breakpoint utilities (lg:block, md:block etc.) beat .hidden */
@media (min-width: 768px)  { .md\:block  { display: block  !important; } .md\:flex   { display: flex   !important; } .md\:grid   { display: grid   !important; } }
@media (min-width: 1024px) { .lg\:block  { display: block  !important; } .lg\:flex   { display: flex   !important; } .lg\:grid   { display: grid   !important; } }
@media (min-width: 1280px) { .xl\:block  { display: block  !important; } .xl\:flex   { display: flex   !important; } .xl\:grid   { display: grid   !important; } }
/* Opposite direction: hide on larger screens */
@media (min-width: 768px)  { .md\:hidden  { display: none !important; } }
@media (min-width: 1024px) { .lg\:hidden  { display: none !important; } }

.font-display {
  font-family: 'Poppins', 'Inter', sans-serif;
}

.font-game {
  font-family: 'Orbitron', 'Poppins', sans-serif;
  letter-spacing: 0.05em;
}

/* Glassmorphism containers */
.hy-glass {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.hy-glass-nav {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.hy-card {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hy-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.2);
}

/* Game Gradients & Glows */
.gacha-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
}

.hy-gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hy-gradient-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Custom Range Sliders */
input[type=range].hy-slider {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range].hy-slider:focus {
  outline: none;
}

input[type=range].hy-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 9999px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

input[type=range].hy-slider::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #a855f7);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.8);
  transition: transform 0.15s ease;
}

input[type=range].hy-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Number inputs without spinners */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type="number"] { 
    -moz-appearance: textfield; 
}

/* Sidebar navigation */
.sidebar-link {
  transition: all 0.2s ease;
  border-radius: 0.875rem;
}
.sidebar-link:hover {
  background-color: rgba(30, 41, 59, 0.7);
  color: #ffffff;
  transform: translateX(3px);
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.1) 100%);
  color: #ffffff;
  border-left: 3px solid #818cf8;
}

/* Badges */
.hy-badge-genshin { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.hy-badge-hsr { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.hy-badge-zzz { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.hy-badge-wuwa { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }

/* Modal animation */
.modal-pop {
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.6);
}

/* ===== ANIME GACHA VISUAL EFFECTS ===== */
@keyframes logoShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hy-gradient-shimmer {
  background: linear-gradient(270deg, #818cf8, #c084fc, #f472b6, #fbbf24, #818cf8);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logoShimmer 6s ease infinite;
}

.hy-logo-glow {
  filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.5));
}

@keyframes starryTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.3); }
}

@keyframes floatSparkles {
  0% { transform: translateY(0px) rotate(0deg); opacity: 0.4; }
  50% { transform: translateY(-12px) rotate(180deg); opacity: 0.9; }
  100% { transform: translateY(0px) rotate(360deg); opacity: 0.4; }
}

.gacha-star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px #818cf8, 0 0 14px #c084fc;
  animation: starryTwinkle 3s ease-in-out infinite;
  pointer-events: none;
}

.gacha-star-gold {
  box-shadow: 0 0 10px #fbbf24, 0 0 18px #f59e0b;
}

.gacha-sparkle {
  animation: floatSparkles 4s ease-in-out infinite;
}

.gacha-btn-glow {
  position: relative;
  overflow: hidden;
}

.gacha-btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 70%
  );
  transform: rotate(30deg) translateX(-100%);
  transition: transform 0.8s ease;
}

.gacha-btn-glow:hover::after {
  transform: rotate(30deg) translateX(100%);
}

/* ===== MOBILE OPTIMIZATION ===== */

/* Mobile hamburger button */
.mobile-menu-btn {
  display: none;
}
@media (max-width: 1023px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #818cf8;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  .mobile-menu-btn:hover {
    background: rgba(99, 102, 241, 0.2);
  }
  .mobile-menu-btn:active {
    transform: scale(0.92);
  }
}

/* Mobile slide-out drawer */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: none;
  pointer-events: none;
}
.mobile-drawer-overlay.open {
  display: block;
  pointer-events: auto;
}
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(11, 15, 25, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(99, 102, 241, 0.2);
  z-index: 9999;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  padding-top: 70px;
  padding-bottom: 80px;
  pointer-events: none;
}
.mobile-drawer.open {
  left: 0;
  pointer-events: auto;
}
.mobile-drawer .sidebar-link {
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 4px;
}
.mobile-drawer .drawer-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  font-weight: 700;
  padding: 12px 16px 8px;
  margin-top: 8px;
}

/* Bottom navigation bar for mobile */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-bottom-nav .mb-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: #64748b;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-bottom-nav .mb-nav-item i {
    font-size: 18px;
  }
  .mobile-bottom-nav .mb-nav-item.active {
    color: #818cf8;
  }
  .mobile-bottom-nav .mb-nav-item:active {
    transform: scale(0.9);
  }
  /* Add bottom padding so content isn't hidden behind nav */
  #main-content {
    padding-bottom: 70px !important;
  }
}

/* Responsive header adjustments */
@media (max-width: 767px) {
  .hy-glass-nav .max-w-screen-2xl {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .hy-glass-nav .h-16 {
    height: 56px;
  }
  .font-game {
    font-size: 16px;
  }
  .hy-glass-nav > div > div:first-child > div:last-child > div:last-child {
    display: none;
  }
  /* Hide language switcher text on very small screens */
  .lang-switcher span {
    display: none;
  }
  /* Compact user button */
  .hy-glass-nav button[class*="rounded-2xl"] {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }
  #cartBtn {
    padding: 6px 10px !important;
  }
}

/* Responsive main content */
@media (max-width: 767px) {
  #main-content {
    padding: 12px !important;
  }
  #section-home > div:first-child {
    margin-bottom: 16px !important;
  }
  #section-home h1 {
    font-size: 24px !important;
    line-height: 1.2 !important;
  }
  #section-home .text-4xl {
    font-size: 24px !important;
  }
  #section-home .text-5xl {
    font-size: 26px !important;
  }
  #section-home .p-8 {
    padding: 16px !important;
  }
  #section-home .md\:p-12 {
    padding: 16px !important;
  }
  #section-home .max-w-2xl {
    max-width: 100% !important;
  }
  /* Hero buttons */
  #section-home .flex-wrap.gap-4 {
    flex-direction: column;
    gap: 8px !important;
  }
  #section-home .flex-wrap.gap-4 button {
    width: 100%;
    padding: 12px 16px !important;
    font-size: 13px !important;
  }
  /* How it works grid */
  .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  /* Section titles */
  h2.text-2xl {
    font-size: 18px !important;
  }
  /* Promo section */
  .grid.grid-cols-1.lg\:grid-cols-12 {
    grid-template-columns: 1fr !important;
  }
  .lg\:col-span-7, .lg\:col-span-5 {
    grid-column: span 1 !important;
  }
  /* Games grid */
  #gamesGrid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  /* Game services */
  #gameServicesView .flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  #gameServicesView .text-2xl {
    font-size: 16px !important;
  }
  /* Boosters grid */
  #boostersGridContainer, #boostersGrid {
    grid-template-columns: 1fr !important;
  }
  /* Orders tables - make scrollable */
  .hy-card.overflow-hidden {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .hy-card table {
    min-width: 500px;
  }
  /* Footer */
  footer .max-w-screen-2xl {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  footer .grid.grid-cols-1.md\:grid-cols-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
  footer .md\:col-span-1 {
    grid-column: span 2 !important;
  }
  /* Modal adjustments */
  .modal-pop {
    max-width: 95vw !important;
  }
  /* Hide decorative stars on mobile for performance */
  .gacha-star {
    display: none;
  }
  /* Hero banner image */
  #section-home .absolute.inset-0 {
    background-size: cover !important;
  }
}

/* Touch-friendly tap targets */
@media (max-width: 767px) {
  button, a[class*="onclick"], .sidebar-link {
    min-height: 40px;
  }
  /* Prevent text selection on quick taps */
  button, a {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  #main-content {
    padding: 16px !important;
  }
  #gamesGrid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

/* Smooth scrolling for mobile */
@media (max-width: 767px) {
  * {
    -webkit-overflow-scrolling: touch;
  }
  html {
    scroll-behavior: smooth;
  }
}

/* Header / Sidebar / Mobile notification badges */
.header-badge,
.sidebar-badge,
.mobile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.8), 0 4px 10px rgba(244, 63, 94, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.header-badge.hidden,
.sidebar-badge.hidden,
.mobile-badge.hidden {
  display: none;
}

/* Sidebar orders badge - amber color to match the menu icon */
.sidebar-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.8), 0 4px 10px rgba(245, 158, 11, 0.35);
}

/* Mobile badge is positioned on the icon */
.mobile-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
}
