/* Home/Landing page styles - based on demo.html */

:root {
  /* fallback kalau template belum define */
  --shadow-neo-lg: 8px 8px 0px var(--border-ink);
}

@keyframes popupFadeIn {
  0% { opacity: 0; transform: scale(0.96) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.card-popup {
  opacity: 0;
  animation: popupFadeIn 0.4s ease-out forwards;
}

/* stagger */
.card-popup:nth-child(1) { animation-delay: 0.05s; }
.card-popup:nth-child(2) { animation-delay: 0.12s; }
.card-popup:nth-child(3) { animation-delay: 0.18s; }
.card-popup:nth-child(4) { animation-delay: 0.24s; }

/* HERO */
.home-hero {
  /* Kurangi ruang kosong di atas hero (lebih dekat ke navbar),
     tapi tetap ada ruang nafas yang cukup sebelum marquee */
  padding-top: 22px;
  padding-bottom: 56px;
  border-bottom: var(--border-neo);
  background: var(--bg-white);
  background-image: radial-gradient(var(--border-ink) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: #fcfcfc;
}

.home-hero__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.home-hero__content {
  background: var(--bg-white);
  padding: 40px;
  border: var(--border-neo);
  box-shadow: var(--shadow-neo-lg);
}

/* Banner/swiper refinement */
.home-hero__banner .swiper-slide {
  border: var(--border-neo);
  box-shadow: var(--shadow-neo);
  background: var(--bg-white);
}

.home-hero__banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* GRID: game cards */
.games-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 60px;
}
@media (min-width: 640px) {
  .games-grid-wrapper { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 768px) {
  .games-grid-wrapper { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1024px) {
  .games-grid-wrapper { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
}

.game-card {
  background: var(--bg-white);
  border: var(--border-neo);
  box-shadow: var(--shadow-neo);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.game-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-neo-lg);
  background: var(--color-butter);
}

.card-img-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-bottom: var(--border-neo);
  overflow: hidden;
  background: #eee;
}

.card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 92px;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  border: 1px solid var(--border-ink);
  padding: 3px 7px;
  background: var(--bg-white);
  display: inline-flex;
  align-self: flex-start;
}

.card-title {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-sub {
  font-size: 0.78rem;
  opacity: 0.78;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabs: active + hover colors lebih aman */
/* Category tabs */
.cat-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  border: var(--border-neo);
  box-shadow: var(--shadow-neo);
  background: var(--bg-white);
  padding: 10px 16px;
  font-weight: 800;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  text-transform: uppercase;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1;
}

.cat-tab:hover {
  background: var(--color-mint);
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--border-ink);
}

.cat-tab.active {
  background: var(--border-ink);
  color: #fff;
}

/* Ensure search button text visible */
.home-search__btn {
  color: #fff;
}

.home-search__btn:hover {
  color: var(--border-ink) !important;
}

.home-badge {
  display: inline-block;
  background: var(--color-mint);
  padding: 6px 12px;
  border: var(--border-neo);
  font-weight: 800;
  font-size: 0.8rem;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.home-hero__title {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 20px;
}

.home-search {
  display: flex;
  margin-top: 30px;
  gap: 10px;
}

.home-search__input {
  flex: 1;
  padding: 15px;
  border: var(--border-neo);
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 1.05rem;
  outline: none;
  background: var(--color-sky);
  box-shadow: none; /* override form shadows */
  height: auto;
}

.home-search__input::placeholder {
  color: rgba(0,0,0,0.6);
}

.home-search__btn {
  background: var(--border-ink);
  color: #fff;
  border: var(--border-neo);
  width: 60px;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.home-search__btn:hover {
  background: var(--color-butter) !important;
  color: var(--border-ink) !important;
  transform: none;
}

.home-hero__banner {
  aspect-ratio: 4 / 3;
  background: var(--color-salmon);
  border: var(--border-neo);
  box-shadow: var(--shadow-neo-lg);
  position: relative;
  overflow: hidden;
}

.home-hero__banner .swiper-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Match existing JS-generated cards */
.hover-animate {
  background-color: var(--bg-white);
  border: var(--border-neo);
  box-shadow: var(--shadow-neo);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.hover-animate:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--shadow-neo-lg);
}

.hover-animate:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border-ink);
}

/* MARQUEE */
.home-marquee {
  background: var(--color-butter);
  border-bottom: var(--border-neo);
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 800;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  text-transform: uppercase;
}

.home-marquee__content {
  display: flex;
  width: max-content;
  animation: home-scroll 40s linear infinite;
}

@keyframes home-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Category Section */
.home-category {
  padding: 60px 20px;
}

.home-section-title {
  margin-bottom: 20px;
  font-size: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  /* Mobile: lebih rapet ke header */
  .home-hero { padding: 18px 0 44px; }
  .home-hero__layout { grid-template-columns: 1fr; gap: 30px; }
  .home-hero__content { padding: 24px; box-shadow: var(--shadow-neo); }
  .home-hero__title { font-size: 2rem; line-height: 1.1; margin-bottom: 16px; }
  .home-badge { font-size: 0.7rem; padding: 5px 10px; margin-bottom: 16px; }
  .home-search { margin-top: 20px; flex-direction: column; gap: 8px; }
  .home-search__btn { width: 100%; height: 48px; }
  .home-hero__banner { box-shadow: var(--shadow-neo); }
  .home-marquee { font-size: 0.85rem; padding: 10px 0; }
  .home-category { padding: 40px 20px; }
  .home-section-title { font-size: 1.5rem; margin-bottom: 16px; }

  .cat-tab { padding: 9px 12px; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .home-section-title { font-size: 1.25rem; }
  .home-hero__title { font-size: 1.75rem; }
}
