/* ===== 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:
    linear-gradient(
      180deg,
      rgba(231, 247, 255, 0.68) 0%,
      rgba(255, 255, 255, 0.78) 42%,
      rgba(174, 225, 255, 0.7) 100%
    ),
    url("white-bg.jpg") center top / cover no-repeat fixed;
  min-height: 100vh;
  color: #0d4f8d;
  overflow-x: hidden;
}

/* ===== Header / Logo ===== */
.site-header {
  text-align: center;
  padding: 8px 20px 0;
}

.logo {
  display: inline-block;
}

.logo-img {
  max-width: 240px;
  height: auto;
}

/* ===== Main Layout ===== */
.main-content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 20px;
}

/* ===== Hero Section ===== */
.hero-section {
  flex: 1 1 0;
  max-width: 600px;
}

.hero-image-placeholder {
  width: 100%;
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 1200px) {
  .hero-section {
    flex: none;
    width: min(100%, 600px);
  }
}

/* ===== Mobile Nav ===== */
.mobile-nav {
  display: none;
  justify-content: center;
  gap: 12px;
}

.nav-btn {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(180deg, #58c7ff, #1688d8);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 30px;
  text-transform: lowercase;
  box-shadow: 0 4px 12px rgba(22, 136, 216, 0.35);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22, 136, 216, 0.48);
}

/* ===== 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: #0d4f8d;
}

/* ===== Speed Test Section ===== */
.speed-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(7, 38, 78, 0.78);
  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(113, 202, 255, 0.18);
}

.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(113, 202, 255, 0.45);
  z-index: 1;
}

/* Speed label pill */
.speed-label {
  background: linear-gradient(180deg, #4dbbff, #116db8);
  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(17, 109, 184, 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(41, 164, 255, 0.5));
  }
  to {
    filter: drop-shadow(0 0 18px rgba(41, 164, 255, 0.9));
  }
}

.speed-card.done .ring-image {
  animation: rotateRing 3s linear infinite;
  filter: drop-shadow(0 0 12px rgba(41, 164, 255, 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, #58c7ff, #1688d8);
  color: #fff;
  border: 2px solid rgba(160, 220, 255, 0.55);
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(22, 136, 216, 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(22, 136, 216, 0.55);
  background: linear-gradient(180deg, #76d5ff, #2099ed);
}

.speed-test-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===== Lotto Results Section ===== */
.lotto-section {
  display: flex;
  justify-content: center;
  padding: 8px 40px 28px;
}

.lotto-shell {
  width: 100%;
  max-width: 1200px;
  background: rgba(7, 64, 122, 0.55);
  border: 1px solid rgba(88, 199, 255, 0.32);
  border-radius: 26px;
  padding: 22px;
  display: flex;
  gap: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.lotto-card {
  flex: 1;
  background: linear-gradient(
    180deg,
    rgba(234, 248, 255, 0.96),
    rgba(78, 181, 242, 0.8)
  );
  border: 1px solid rgba(54, 160, 228, 0.7);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.lotto-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lotto-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lotto-icon {
  width: 52px;
  height: 52px;
  padding: 4px;
  object-fit: contain;
  box-sizing: border-box;
  border-radius: 12px;
  background: linear-gradient(145deg, #effaff, #8ed3fb);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.2),
    inset 0 2px 6px rgba(255, 255, 255, 0.6);
}

.lotto-title {
  font-size: 1rem;
  font-weight: 800;
  color: #073d78;
}

.lotto-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0d4f8d;
  opacity: 0.75;
}

.lotto-balls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.lotto-ball {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #c99a2c;
  background: radial-gradient(circle at 30% 30%, #fff5c7, #d09a19 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 10px rgba(208, 154, 25, 0.4);
}

.lotto-info {
  display: flex;
  justify-content: center;
}

.lotto-row {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.9rem;
  color: #073d78;
  font-weight: 600;
}

.lotto-label {
  opacity: 0.8;
}

.lotto-value {
  font-weight: 800;
}

.lotto-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 112, 188, 0.34);
  border-radius: 14px;
  padding: 10px 12px;
  color: #ffffff;
  font-weight: 700;
  gap: 12px;
}

.lotto-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.lotto-timer-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  position: relative;
  display: inline-block;
}

.lotto-timer-icon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 5px;
  background: #ffffff;
  left: 50%;
  top: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
}

.lotto-next {
  font-size: 0.85rem;
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(
    180deg,
    rgba(7, 64, 122, 0.86),
    rgba(5, 45, 92, 0.96)
  );
  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: 0 24px 30px;
    gap: 30px;
  }

  .hero-section {
    flex: none;
    max-width: 400px;
    width: min(100%, 400px);
  }

  .hero-img {
    width: 100%;
  }

  .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;
  }
}

@media (max-width: 760px) {
  .lotto-section {
    padding: 8px 16px 20px;
  }

  .lotto-shell {
    max-width: 430px;
    flex-direction: column;
    padding: 12px;
    gap: 12px;
    border-radius: 22px;
  }

  .lotto-card {
    padding: 14px;
    border-radius: 18px;
    gap: 10px;
  }

  .lotto-card-top {
    align-items: center;
    gap: 10px;
  }

  .lotto-title-wrap {
    min-width: 0;
    gap: 8px;
  }

  .lotto-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .lotto-title {
    font-size: 1rem;
  }

  .lotto-subtitle {
    font-size: 0.74rem;
  }

  .lotto-balls {
    flex-shrink: 0;
    gap: 7px;
    justify-content: flex-end;
  }

  .lotto-ball {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .lotto-info {
    justify-content: flex-start;
  }

  .lotto-row {
    flex-wrap: wrap;
    font-size: 0.85rem;
  }

  .lotto-footer {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .lotto-countdown,
  .lotto-next {
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.25;
  }
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 640px) {
  .site-header {
    padding: 8px 16px 0;
  }

  .logo-img {
    max-width: 135px;
  }

  .main-content {
    flex-direction: column;
    align-items: center;
    padding: 0 16px 20px;
    gap: 0;
  }

  .hero-section {
    flex: none;
    max-width: 300px;
    width: min(100%, 300px);
  }

  /* 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;
  }

  .lotto-section {
    padding: 8px 14px 18px;
  }

  .lotto-shell {
    padding: 12px;
    border-radius: 20px;
  }

  .site-footer {
    margin-top: 20px;
    padding: 12px 12px;
  }

  .footer-badge {
    padding: 3px 8px;
    font-size: 0.6rem;
  }

  .footer-logos {
    gap: 6px;
  }

  .lotto-section {
    padding: 8px 12px 18px;
  }

  .lotto-shell {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  .lotto-card {
    padding: 12px;
    border-radius: 16px;
    gap: 10px;
  }

  .lotto-card-top {
    align-items: center;
    gap: 8px;
  }

  .lotto-balls {
    flex-shrink: 0;
    gap: 6px;
    justify-content: flex-end;
  }

  .lotto-title-wrap {
    min-width: 0;
    gap: 8px;
  }

  .lotto-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }

  .lotto-title {
    font-size: 0.95rem;
  }

  .lotto-subtitle {
    font-size: 0.72rem;
  }

  .lotto-ball {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .lotto-info {
    justify-content: flex-start;
  }

  .lotto-row {
    flex-wrap: wrap;
    font-size: 0.82rem;
  }

  .lotto-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 9px 10px;
    border-radius: 12px;
  }

  .lotto-countdown,
  .lotto-next {
    font-size: 0.8rem;
    line-height: 1.25;
  }
}

/* ============================================
   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;
  }

  .lotto-ball {
    width: 31px;
    height: 31px;
    font-size: 0.8rem;
  }

  .lotto-footer {
    padding: 8px 9px;
  }

  .lotto-card {
    padding: 10px;
  }

  .lotto-icon {
    width: 42px;
    height: 42px;
  }

  .lotto-title {
    font-size: 0.9rem;
  }
}
