/* ===========================================================
   GAMELAND — Modern Dark Redesign
   Pure HTML, CSS, JS layout for InfinityFree & static hosting
   =========================================================== */

:root {
  --bg: #090a0f;
  --bg-elevated: #101119;
  --card: #12131c;
  --card-hover: #181a26;
  --border: #202232;
  --border-accent: rgba(124, 58, 237, 0.4);
  --accent: #7c3aed;
  --accent-2: #a855f7;
  --accent-grad: linear-gradient(135deg, #7c3aed, #a855f7);
  --accent-glow: rgba(124, 58, 237, 0.25);
  --text: #f4f4f6;
  --text-muted: #9a9aac;
  --text-dim: #646476;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --star: #facc15;
  --green: #22c55e;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: rgba(9, 10, 15, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.site-header .wrap {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.hamburger:hover {
  background: var(--card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 19px;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.icon-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e1b2e;
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Inline Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  width: 100%;
  max-width: 420px;
  transition: border-color 0.2s;
}

/* Search Overlay Backdrop */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 14, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 40;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.search-overlay.active {
  display: block;
  opacity: 1;
}

#searchResultsSection {
  position: relative;
  z-index: 45;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  border: 1px solid var(--border-accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
  margin-top: 20px;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.search-bar.open {
  display: flex;
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  width: 100%;
}

.search-bar input::placeholder {
  color: var(--text-dim);
}

/* ---------- Hero (Game of the Week) ---------- */

.hero {
  position: relative;
  margin: 20px 20px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 440px;
  background: #0f1018;
  border: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(90deg, rgba(9, 10, 15, 0.98) 0%, rgba(9, 10, 15, 0.82) 42%, rgba(9, 10, 15, 0.35) 75%),
    linear-gradient(0deg, rgba(9, 10, 15, 0.95) 0%, rgba(9, 10, 15, 0) 50%);
}

.hero-content {
  position: relative;
  padding: 42px 48px;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 440px;
  justify-content: center;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #5b21b6;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 6px;
  width: fit-content;
}

.hero-title {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.tag {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-btns {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, filter 0.15s, background 0.15s;
  letter-spacing: 0.02em;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-grad);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.platform-btn[data-platform="switch"] svg {
  color: #ffffff;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.hero-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

.hero-dots {
  position: absolute;
  bottom: 24px;
  left: 48px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.hero-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  padding: 0;
  transition: all 0.2s;
}

.hero-dots button.active {
  background: var(--accent-2);
  width: 20px;
  border-radius: 4px;
}

/* ---------- Sections ---------- */

.section {
  padding: 36px 20px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--text);
}

.section-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-2);
  font-weight: 700;
  font-size: 13px;
  transition: opacity 0.15s;
}

.section-link:hover {
  opacity: 0.85;
}

/* ---------- Platform Selector ---------- */

.platform-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.platform-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.platform-btn:hover {
  border-color: var(--border-accent);
  color: var(--text);
  background: var(--card-hover);
}

.platform-btn.active {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(124, 58, 237, 0.12);
  box-shadow: 0 0 16px var(--accent-glow) inset, 0 0 1px var(--accent);
}

.platform-btn svg {
  color: var(--accent-2);
}

/* ---------- Game Grid (Terbaru) ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.game-card {
  position: relative;
  background: #11131f;
  border-radius: 16px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65), 0 0 16px rgba(168, 85, 247, 0.2);
}

.game-card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #151622;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.game-card-poster img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.game-card:hover .game-card-poster img {
  transform: scale(1.05);
}

.game-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 11, 18, 0) 0%,
    rgba(10, 11, 18, 0.15) 35%,
    rgba(10, 11, 18, 0.82) 72%,
    rgba(10, 11, 18, 0.98) 100%
  );
  pointer-events: none;
}

.game-card-content {
  position: relative;
  z-index: 2;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-card-genre {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}

.game-card-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  min-height: 38px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.game-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 4px;
}

.game-card-meta .meta-divider {
  opacity: 0.4;
  font-weight: 300;
}

.download-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

.game-card:hover .download-btn {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ---------- Game Populer List ---------- */

.popular-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}
.popular-card {
  position: relative;
  display: block;
  min-height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  background: #0f111a;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.popular-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
}

.popular-card-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.popular-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

.popular-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 9, 14, 0.96) 0%,
    rgba(8, 9, 14, 0.82) 45%,
    rgba(8, 9, 14, 0.4) 80%,
    rgba(8, 9, 14, 0.2) 100%
  );
}

.popular-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 210px;
  padding: 22px 26px;
}

.popular-card-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 70%;
  margin-bottom: 4px;
}

.popular-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.popular-card-genres {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.popular-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  gap: 12px;
  flex-wrap: wrap;
}

.popular-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.popular-rating-star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #eab308;
  font-weight: 800;
  margin-left: 2px;
}

.popular-rating-star svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.popular-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.popular-platform-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.popular-platform-info img,
.popular-platform-info svg {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.popular-vertical-sep {
  width: 2px;
  height: 18px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.btn-detail-purple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #a855f7;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 6px 16px;
  border-radius: 8px;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-detail-purple:hover {
  background: #9333ea;
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.6);
}

.platform-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
}

/* ---------- Genre Section ---------- */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.genre-card {
  position: relative;
  height: 110px;
  background: #11131f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.genre-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.genre-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.genre-card-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.02em;
}

.genre-card-count {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin: 0;
}

.genre-card-thumb {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-42%) rotate(10deg);
  width: 105px;
  height: 125px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: -6px 8px 20px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.genre-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popular-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.popular-actions .os-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

.btn-download-sm {
  background: var(--accent-grad);
  color: #ffffff;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-download-sm:hover {
  filter: brightness(1.1);
}

/* ---------- States ---------- */

.state-msg {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.state-msg.error {
  color: #f87171;
}

.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 37%, var(--card) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Detail Page ---------- */

.breadcrumb {
  position: relative;
  z-index: 2;
  padding: 18px 20px 0;
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumb .crumb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  transition: color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.breadcrumb .crumb-link:hover {
  color: var(--accent-2);
}

.breadcrumb .crumb-sep,
.breadcrumb .crumb-plat {
  color: var(--text-dim);
  flex-shrink: 0;
  white-space: nowrap;
}

.breadcrumb .crumb-title {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

/* Top screenshot backdrop (fades into background color) */
.detail-top-backdrop {
  position: absolute;
  top: -65px; /* extends behind transparent site-header at top 0 */
  left: 0;
  right: 0;
  height: 580px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.detail-top-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: blur(3px) brightness(0.42);
  transform: scale(1.05);
}

.detail-top-backdrop-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(180deg, rgba(10, 11, 18, 0.15) 0%, rgba(10, 11, 18, 0.75) 60%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, transparent 12%, transparent 88%, var(--bg) 100%);
}

.detail-hero {
  position: relative;
  z-index: 1;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  border: none;
  background: transparent;
  box-shadow: none;
}

.detail-poster,
.detail-info {
  position: relative;
  z-index: 2;
}

.detail-poster {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 3/4;
  background: #171822;
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.15;
  margin: 0;
  color: #ffffff;
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-quickmeta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.detail-quickmeta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-quickmeta .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.detail-quickmeta .value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.download-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download-panel .btn {
  padding: 14px 24px;
}

.note-box {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
}

.detail-section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 0;
}

.detail-section h2 {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  color: var(--text);
}

.description-text {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 14px;
  white-space: pre-line;
}

.specs-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.spec-item {
  background: var(--card);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.spec-item .k {
  color: var(--text-dim);
}

.spec-item .v {
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.requirements-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: pre-line;
  line-height: 1.7;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.screenshot-grid img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  cursor: zoom-in;
  transition: transform 0.2s;
}

.screenshot-grid img:hover {
  transform: scale(1.02);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 10, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  user-select: none;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 210;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.lightbox-content {
  position: relative;
  max-width: 1050px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img-wrapper {
  position: relative;
  width: 100%;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  touch-action: pan-y;
  cursor: grab;
}

.lightbox-img-wrapper:active {
  cursor: grabbing;
}

.lightbox-img-wrapper img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.lightbox-bottom-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 0 4px;
}

.lightbox-counter {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-arrows {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lightbox-arrow {
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(124, 58, 237, 0.5);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-arrow:hover {
  background: var(--accent);
  border-color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.lightbox-arrow:active {
  transform: translateY(0);
}

/* ---------- Site Footer ---------- */

.site-footer {
  margin-top: 50px;
  border-top: 1px solid var(--border);
  padding: 32px 20px 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));  }
  .detail-hero {
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 760px) {
  .hero {
    margin: 12px 12px 0;
    min-height: 380px;
  }
  .hero-content {
    padding: 28px 24px;
    min-height: 380px;
  }
  .hero-title {
    font-size: 28px;
  }
  .platform-row {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 28px 12px 0;
  }
  .popular-card {
    min-height: 185px;
  }
  .popular-card-body {
    padding: 16px 18px;
    min-height: 175px;
  }
  .popular-card-title {
    font-size: 17px;
  }
  .popular-card-genres {
    font-size: 12px;
  }
  .popular-card-top {
    max-width: 100%;
    margin-bottom: 4px;
  }
  .popular-card-bottom {
    margin-top: 4px;
    gap: 8px;
  }
  .popular-meta-left {
    font-size: 12px;
    gap: 6px;
  }
  .popular-rating-star {
    font-size: 12px;
  }
  .popular-rating-star svg {
    width: 13px;
    height: 13px;
  }
  .popular-platform-info {
    font-size: 12px;
    gap: 5px;
  }
  .popular-platform-info img,
  .popular-platform-info svg {
    width: 16px;
    height: 16px;
  }
  .popular-vertical-sep {
    height: 16px;
  }
  .btn-detail-purple {
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 6px;
  }
  .breadcrumb {
    padding: 12px 14px 0;
    font-size: 12px;
    gap: 6px;
  }
  .detail-hero {
    grid-template-columns: 1fr;
    padding: 16px 12px;
  }
  .detail-poster {
    max-width: 260px;
    margin: 0 auto;
  }
  .specs-table {
    grid-template-columns: 1fr;
  }
  .screenshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) and (orientation: portrait), (max-width: 480px) {
  .hero {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .genre-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .hero-title {
    font-size: 22px;
  }
  .hero-btns {
    flex-direction: column;
  }
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
}
