/* ============================================
   CSS Variables - Vibrant Gaming Theme
   ============================================ */
:root {
  --primary: #9d4edd;
  /* Brighter Purple */
  --primary-glow: #c77dff;
  --secondary: #ff9e00;
  /* Vivid Gold/Orange */
  --accent: #00ff9f;
  /* Neon Green */

  --bg-deep: #0a0a12;
  --bg-card: rgba(30, 30, 50, 0.7);
  --bg-card-hover: rgba(40, 40, 70, 0.9);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.85);
  --text-muted: rgba(255, 255, 255, 0.5);

  --border: rgba(255, 255, 255, 0.15);
  --glass: cubic-bezier(0.25, 0.8, 0.25, 1);

  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --glow-primary: 0 0 25px rgba(157, 78, 221, 0.5);
  --glow-text: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ============================================
   Reset & Base
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ============================================
   Background System (Vibrant & Colorful)
   ============================================ */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.bg-image {
  position: absolute;
  width: 100%;
  height: 100%;
  background: url('images/bg-gaming.jpg') no-repeat center center;
  background-size: cover;
  opacity: 0.4;
  filter: contrast(1.2) saturate(1.2);
}

/* Add colorful ambient glows */
.bg-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(255, 215, 0, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(157, 78, 221, 0.15) 0%, transparent 60%),
    linear-gradient(to bottom, rgba(10, 10, 18, 0.6), rgba(10, 10, 18, 0.95));
  mix-blend-mode: hard-light;
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ============================================
   Header / Hero
   ============================================ */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  /* margin-bottom: 1.5rem; */
}

.logo-img {
  height: 65px;
  /* Mobile default */
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

@media (min-width: 768px) {
  .logo-img {
    height: 85px;
    /* Larger on PC */
  }
}

/* ============================================
   Customer Service Button
   ============================================ */
.nav-service-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border: none;
  border-radius: 50px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 158, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  height: 44px;
  /* Fixed height for alignment */
}

.nav-service-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  transition: 0.5s;
}

.nav-service-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
}

.nav-service-btn:hover::before {
  transform: translateX(100%);
}

.nav-service-btn svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

@media (max-width: 768px) {
  .nav-service-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    height: 36px;
    /* Smaller on mobile */
    gap: 0.4rem;
  }

  .nav-service-btn span {
    display: inline-block;
    /* Keep text visible on mobile for clarity, but small */
  }

  .nav-service-btn svg {
    width: 16px;
    height: 16px;
  }
}

.hero-section {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1a2e;
}

.hero-banner {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  background: linear-gradient(to top, rgba(10, 10, 18, 0.95), transparent);
  text-align: center;
}

.page-title {
  font-size: 3rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #e0aaff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(157, 78, 221, 0.5));
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* ============================================
   Grid Layout
   ============================================ */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding-bottom: 4rem;
}

/* ============================================
   Game Card Design (Image Background Style)
   ============================================ */
.domain-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  /* Card ratio - make it taller */
  /* aspect-ratio: 3/4; */
  aspect-ratio: 6/4;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.domain-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
  z-index: 10;
}

/* Background Image Container */
.card-bg-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: rgb(50, 55, 56);
  background-image: linear-gradient(to left, rgb(44, 80, 64), transparent 75%);
}

.card-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.domain-card:hover .card-bg-img {
  transform: scale(1.1);
}

/* Gradient Overlay for Text Readability */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
      rgba(10, 10, 18, 0.1) 0%,
      rgba(10, 10, 18, 0.6) 50%,
      rgba(10, 10, 18, 0.95) 100%);
  z-index: 1;
}

/* Content Container */
.card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  gap: 1rem;
}

.card-main-info {
  margin-top: auto;
}

.domain-name {
  font-size: 1.6rem;
  font-family: monospace;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  line-height: 1.1;
}

.domain-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer / Stats Area */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.75rem;
  gap: 0.5rem;
}

.card-stats {
  display: flex;
  /* flex-direction: column; */
  /* gap: 0.25rem; */
  gap: 1rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  /* Mobile default */
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .status-indicator {
    font-size: 1.1rem;
    /* PC font size */
  }
}



.speed-tag {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.9rem;
  /* Mobile default */
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 5px rgba(0, 255, 159, 0.4);
}

@media (min-width: 768px) {
  .speed-tag {
    font-size: 1.1rem;
    /* PC size */
  }
}

.enter-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-glow));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(138, 43, 226, 0.3);
  transition: all 0.2s;
}

.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(138, 43, 226, 0.5);
}

/* ============================================
   Common UI Elements
   ============================================ */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  /* Mobile default */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

@media (min-width: 768px) {
  .refresh-btn {
    font-size: 1.1rem;
    /* PC size */
  }
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--primary);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: auto;
  background: rgba(10, 10, 18, 0.8);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

/* ============================================
   Loading
   ============================================ */
/* ============================================
   Loading
   ============================================ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f0f1a;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s;
  flex-direction: column;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Logo Sizing */
.loading-logo img {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.5));
  animation: logo-pulse 2s infinite ease-in-out;
}

@keyframes logo-pulse {

  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.5));
  }

  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(138, 43, 226, 0.8));
  }
}

/* Spinner */
.loading-spinner {
  /* Use existing spinner logic or remove if replacing */
  display: none;
  /* Hiding default spinner if we use logo pulse, or keep if needed */
}

.loading-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  background: linear-gradient(90deg, #fff, var(--primary), #fff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Responsive Logo Sizing */
@media (max-width: 768px) {
  .loading-logo img {
    height: 70px;
    /* Smaller on mobile */
  }

  .loading-text {
    font-size: 1rem;
  }
}

/* ============================================
   Responsive (Fixed)
   ============================================ */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .top-nav {
    /* margin-bottom: 1rem; */
  }

  .hero-section {
    margin-bottom: 1.5rem;
    border-radius: 16px;
  }

  .hero-banner {
    height: 180px;
  }

  .page-title {
    font-size: 2.2rem;
  }

  /* 2-Column Mobile Grid */
  .domains-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    padding-bottom: 2rem;
  }

  .domain-card {
    border-radius: 12px;
    /* aspect-ratio: 2/3; */
    aspect-ratio: 3/3;
    /* Slightly shorter on mobile if needed, or keep 3/4 */
  }

  .card-content {
    padding: 0.8rem;
    gap: 0.5rem;
  }

  .domain-name {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .domain-desc {
    display: none;
    /* Hide desc to save space */
  }

  /* Fix for alignment: keep status and speed together */
  .card-footer {
    padding-top: 0.5rem;
    flex-wrap: nowrap;
    /* Prevent wrapping */
  }

  .card-stats {
    flex-direction: row;
    /* Put them on same line if space permits, or column if tight */
    align-items: center;
    gap: 0.5rem;
  }

  /* On very small screens, let them stack effectively but look good */
  @media (max-width: 360px) {
    .card-stats {
      flex-direction: column;
      align-items: flex-start;
      gap: 0;
    }

    .domain-card {
      aspect-ratio: 3/5;
      /* Taller to fit content */
    }
  }

  .enter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-nav {
    justify-content: center;
  }
}