/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: url("bg-jl.webp") center center / cover no-repeat fixed;
  min-height: 100vh;
  color: #1a5c3a;
  overflow-x: hidden;
}

/* ===== Header / Logo ===== */
.site-header {
  text-align: center;
  padding: 20px 20px 10px;
}

.logo {
  display: inline-block;
}

.logo-img {
  max-width: 300px;
  height: auto;
}

/* ===== Main Layout ===== */
.main-content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 40px 20px;
}

/* ===== Hero Section ===== */
.hero-section {
  flex: 1;
  max-width: 600px;
}

.hero-image-placeholder {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
}

/* ===== Mobile Nav ===== */
.mobile-nav {
  display: none;
  justify-content: center;
  gap: 12px;
}

.nav-btn {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(180deg, #4de8a6, #2abf7b);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 30px;
  text-transform: lowercase;
  box-shadow: 0 4px 12px rgba(42, 191, 123, 0.4);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(42, 191, 123, 0.5);
}

/* ===== Game Thumbnails ===== */
.game-thumbnails {
  display: none;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.game-thumb {
  width: 64px;
  text-align: center;
}

.game-thumb-img {
  width: 58px;
  height: 58px;
  background: linear-gradient(145deg, #3b1d80, #5c35a8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 200, 50, 0.6);
  overflow: hidden;
}

.game-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-thumb span {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 4px;
  color: #1a5c3a;
}

/* ===== Speed Test Section ===== */
.speed-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(15, 25, 45, 0.75);
  padding: 20px 30px;
  border-radius: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(100, 255, 200, 0.15);
}

.speed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.speed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.2s,
    filter 0.2s;
}

.speed-card:hover {
  transform: translateY(-4px);
  filter: brightness(1.15);
}

/* Ring gauge */
.speed-ring {
  position: relative;
  width: 140px;
  height: 140px;
}

.ring-image {
  width: 100%;
  height: 100%;
  display: block;
  animation: rotateRing 3s linear infinite;
}

@keyframes rotateRing {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.speed-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.6rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(100, 255, 200, 0.4);
  z-index: 1;
}

/* Speed label pill */
.speed-label {
  background: linear-gradient(180deg, #3ad48f, #1ea05f);
  color: #fff;
  padding: 6px 24px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(30, 160, 95, 0.35);
}

/* Glow animation when testing */
.speed-card.testing .ring-image {
  animation:
    rotateRing 1.5s linear infinite,
    ringPulse 0.8s ease-in-out infinite alternate;
}

@keyframes ringPulse {
  from {
    filter: drop-shadow(0 0 6px rgba(0, 255, 100, 0.5));
  }
  to {
    filter: drop-shadow(0 0 18px rgba(0, 255, 100, 0.9));
  }
}

.speed-card.done .ring-image {
  animation: rotateRing 3s linear infinite;
  filter: drop-shadow(0 0 12px rgba(0, 255, 100, 0.8));
}

.speed-card.done .speed-value {
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% {
    transform: translate(-50%, -50%) scale(0.7);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Speed test button */
.speed-test-btn {
  margin-top: 16px;
  padding: 12px 48px;
  background: linear-gradient(180deg, #4de8a6, #25b070);
  color: #fff;
  border: 2px solid rgba(100, 255, 200, 0.5);
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 176, 112, 0.4);
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

.speed-test-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37, 176, 112, 0.55);
  background: linear-gradient(180deg, #5cf0b5, #2dc07e);
}

.speed-test-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(
    180deg,
    rgba(10, 60, 30, 0.85),
    rgba(10, 60, 30, 0.95)
  );
  padding: 16px 20px;
  margin-top: 20px;
}

.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-payments-img {
  max-width: 100%;
  height: auto;
  display: block;
}

.footer-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   RESPONSIVE - Tablet
   ============================================ */
@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
    align-items: center;
    padding: 20px 24px 30px;
    gap: 30px;
  }

  .hero-section {
    max-width: 100%;
    width: 100%;
  }

  .hero-img {
    width: 50%;
    border-radius: 16px;
  }

  .speed-section {
    width: 100%;
    padding: 18px 24px;
  }

  .speed-grid {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
  }

  .speed-ring {
    width: 120px;
    height: 120px;
  }

  .speed-value {
    font-size: 2.2rem;
  }

  .speed-label {
    font-size: 0.75rem;
    padding: 5px 18px;
  }
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 640px) {
  .site-header {
    padding: 20px 16px 8px;
  }

  .logo-img {
    max-width: 160px;
  }

  .main-content {
    flex-direction: column;
    align-items: center;
    padding: 10px 16px 20px;
    gap: 0;
  }

  /* Hero shrinks */
  .hero-image-placeholder {
    border-radius: 16px;
  }

  .hero-img {
    width: 70%;
    border-radius: 16px;
  }

  /* Show mobile nav and game thumbnails */
  .mobile-nav {
    display: flex;
  }

  .game-thumbnails {
    display: flex;
  }

  .nav-btn {
    padding: 8px 20px;
    font-size: 0.85rem;
  }

  .game-thumb-img {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  /* Speed section */
  .speed-section {
    padding: 14px 16px;
    border-radius: 18px;
  }

  .speed-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .speed-card {
    gap: 6px;
  }

  .speed-ring {
    width: 110px;
    height: 110px;
  }

  .speed-value {
    font-size: 2rem;
  }

  .speed-label {
    padding: 4px 14px;
    font-size: 0.7rem;
  }

  .speed-test-btn {
    padding: 9px 32px;
    font-size: 0.85rem;
  }

  .site-footer {
    margin-top: 20px;
    padding: 12px 12px;
  }

  .footer-badge {
    padding: 3px 8px;
    font-size: 0.6rem;
  }

  .footer-logos {
    gap: 6px;
  }
}

/* ============================================
   RESPONSIVE - Very small screens
   ============================================ */
@media (max-width: 380px) {
  .speed-section {
    padding: 12px 14px;
  }

  .speed-ring {
    width: 95px;
    height: 95px;
  }

  .speed-value {
    font-size: 1.8rem;
  }

  .speed-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .nav-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
  }
}
