/* Kilat77 - Starry Night Theme */
:root {
  --blue-light: #00d4ff;
  --blue-mid: #0099ff;
  --blue-dark: #0054a6;
  --silver: #c8d6e5;
  --black: #030508;
  --black-card: rgba(8, 14, 28, 0.92);
  --border: rgba(0, 153, 255, 0.35);
  --glow: 0 0 20px rgba(0, 212, 255, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--black);
  color: var(--silver);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Starry sky background */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(ellipse at 50% 0%, #0a1628 0%, #030508 55%, #000 100%);
}

.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

a {
  color: var(--blue-light);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: #fff;
  text-shadow: var(--glow);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 5, 8, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-link img {
  height: 52px;
  width: auto;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-light), var(--blue-dark));
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 153, 255, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--blue-light);
  border: 2px solid var(--blue-mid);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

/* Nav */
.main-nav {
  background: rgba(0, 40, 80, 0.4);
  border-bottom: 1px solid var(--border);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  gap: 4px;
  padding: 8px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--silver);
  font-size: 0.85rem;
  font-weight: 600;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(0, 153, 255, 0.2);
  color: var(--blue-light);
}

.nav-icon {
  width: 22px;
  height: 22px;
}

/* Hero banner — full width, responsive */
.hero-banner {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.banner-slide {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: none;
  border-bottom: 2px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 153, 255, 0.2);
  background: #001a33;
  aspect-ratio: 16 / 9;
}

.banner-slide-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.banner-slide-item[hidden] {
  display: none !important;
}

.banner-slide-item.is-active {
  position: relative;
  z-index: 1;
  display: block;
}

.banner-slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

@media (min-width: 576px) {
  .banner-slide {
    aspect-ratio: 21 / 9;
  }
}

@media (min-width: 992px) {
  .banner-slide {
    aspect-ratio: 3 / 1;
    max-height: min(42vw, 480px);
  }
}

.banner-slide-item .banner-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(0, 26, 51, 0.85) 0%, rgba(0, 51, 102, 0.7) 50%, rgba(0, 8, 16, 0.9) 100%);
  pointer-events: none;
}

.banner-title {
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
  line-height: 1.2;
}

.banner-sub {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--silver);
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px 16px;
  background: rgba(3, 5, 8, 0.6);
}

.banner-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--blue-mid);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.banner-dots button.active {
  background: var(--blue-light);
  box-shadow: var(--glow);
}

/* Game categories grid */
.section {
  padding: 24px 0;
}

.section-title {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--blue-light);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.game-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-light);
  box-shadow: var(--glow);
}

.game-card img {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  object-fit: contain;
}

.game-card span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-weight: 700;
}

.badge-hot { background: #ff4444; color: #fff; }
.badge-new { background: #00cc66; color: #fff; }
.badge-exclusive { background: #aa44ff; color: #fff; }

/* Provider strip */
.provider-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.provider-chip {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.75rem;
  color: var(--silver);
  white-space: nowrap;
}

.provider-chip:hover {
  border-color: var(--blue-light);
  color: #fff;
}

/* SEO content */
.seo-hero {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  margin: 24px 0;
}

.seo-hero h1 {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.35;
}

.seo-hero p {
  margin-bottom: 12px;
  color: #b0bec5;
}

.read-more {
  color: var(--blue-light);
  font-weight: 600;
  cursor: pointer;
}

.seo-collapsed {
  display: none;
}

.seo-collapsed.open {
  display: block;
}

/* Popup modal */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.popup-overlay:not(.is-open) {
  display: none;
}

.popup-overlay.is-open {
  display: flex;
}

.popup-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid var(--border);
  box-shadow: 0 0 40px rgba(0, 153, 255, 0.35);
  background: linear-gradient(180deg, rgba(0, 40, 80, 0.95), rgba(3, 5, 8, 0.98));
  animation: popup-in 0.35s ease-out;
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.popup-close:hover {
  background: var(--blue-mid);
  color: #fff;
}

.popup-banner {
  flex-shrink: 0;
  width: 100%;
  line-height: 0;
  background: #001a33;
}

.popup-banner img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: top center;
  display: block;
  vertical-align: top;
}

.popup-body.info-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 576px) {
  .popup-modal {
    max-width: 520px;
  }
}

/* Info panel content (popup body) */
.info-panel {
  background: linear-gradient(180deg, rgba(0, 54, 102, 0.6), rgba(3, 5, 8, 0.95));
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.info-panel h2 {
  font-size: 1rem;
  color: var(--blue-light);
  margin-bottom: 16px;
  text-align: center;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: #8899aa;
}

.info-value {
  color: #fff;
  font-weight: 600;
}

.info-cta {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.info-cta .btn {
  flex: 1;
}

/* Footer */
.site-footer {
  background: rgba(0, 20, 40, 0.8);
  border-top: 1px solid var(--border);
  padding: 40px 0 80px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.footer-grid h4 {
  color: var(--blue-light);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 6px;
}

.footer-grid a {
  font-size: 0.85rem;
  color: #8899aa;
}

.bank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bank-item {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.copyright {
  text-align: center;
  font-size: 0.8rem;
  color: #667788;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(3, 5, 8, 0.98);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.mobile-bottom-nav ul {
  display: flex;
  justify-content: space-around;
  list-style: none;
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  color: var(--silver);
}

.mobile-bottom-nav img {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

/* Carousel numbers */
.slide-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 12px 16px;
}

.slide-numbers a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--black-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--silver);
}

.slide-numbers a:hover,
.slide-numbers a.active {
  background: var(--blue-mid);
  color: #fff;
}

/* Casino lobby list */
.lobby-list {
  display: grid;
  gap: 10px;
}

.lobby-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.lobby-item img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.lobby-meta h3 {
  font-size: 0.9rem;
  color: #fff;
}

.lobby-meta span {
  font-size: 0.75rem;
  color: var(--blue-light);
}

@media (max-width: 768px) {
  .header-actions .btn-outline {
    display: none;
  }

  .mobile-bottom-nav {
    display: block;
  }

  body {
    padding-bottom: 70px;
  }

  .nav-list {
    font-size: 0.75rem;
  }

  .nav-list a {
    padding: 6px 10px;
  }
}
