*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #121215;
  --bg2:       #1E1E20;
  --bg3:       #2A2A2E;
  --pink:      #E082A5;
  --pink-dim:  rgba(224, 130, 165, 0.15);
  --text:      #C7CAD0;
  --text-muted:#838391;
  --text-dim:  #555560;
  --border:    rgba(255,255,255,0.07);
  --radius:    14px;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18,18,21,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.logo img { width: 28px; height: 28px; border-radius: 7px; }
.logo span { font-size: 16px; font-weight: 700; color: #fff; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-nav a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.header-nav a:hover { color: #fff; }
.nav-cta {
  background: var(--pink);
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 700 !important;
  font-size: 13px !important;
}
.nav-cta:hover { opacity: 0.9; }

/* ── Main layout ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 64px;
}

/* ── Hero banner ── */
.hero {
  padding: 36px 20px 32px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--pink);
  background: var(--pink-dim);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.hero p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #E082A5, #c45f8a);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(224,130,165,0.3);
}

/* ── Section ── */
.section {
  padding: 28px 0 0;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

/* ── Horizontal scroll strip ── */
.h-scroll-outer {
  position: relative;
}
.h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 20px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.h-scroll::-webkit-scrollbar { display: none; }
.scroll-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(20,20,22,0.88);
  border: 1px solid rgba(255,255,255,0.13);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.scroll-btn:hover { background: rgba(50,50,55,0.98); }
.scroll-prev { left: 4px; display: none; }
.scroll-next { right: 4px; }

/* ── Game card (vertical, for h-scroll) ── */
.game-card {
  flex-shrink: 0;
  width: calc(50vw - 20px);
  max-width: 220px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rank-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.4;
}
.rank-badge-1 { background: rgba(255,200,0,0.85); color: #222; }
.rank-badge-2 { background: rgba(192,192,192,0.85); color: #222; }
.rank-badge-3 { background: rgba(205,127,50,0.85); color: #fff; }

.card-info { display: flex; flex-direction: column; gap: 4px; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.card-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  margin-top: 2px;
}
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.card-stats {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-dim);
}
.tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--pink);
  background: var(--pink-dim);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Game grid (2 columns) ── */
.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 10px;
}
.grid-item {
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: background 0.15s;
}
.grid-item:hover { background: var(--bg3); }
.grid-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}
.grid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.grid-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  padding: 10px 10px 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.grid-desc-w {
  overflow: hidden;
  max-height: 33px;
  padding: 0 10px 8px;
}
.grid-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.grid-tags {
  display: flex;
  gap: 4px;
  padding: 6px 10px 10px;
  flex-wrap: wrap;
}

/* ── Skeleton ── */
.sk {
  background: var(--bg3);
  border-radius: 6px;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-line { height: 11px; margin-bottom: 4px; }
.sk-line.w80 { width: 80%; }
.sk-line.w60 { width: 60%; }
.sk-line.w50 { width: 50%; }

.game-card.skeleton .card-thumb { background: var(--bg3); animation: shimmer 1.4s ease-in-out infinite; }
.grid-item.skeleton .grid-thumb { animation: shimmer 1.4s ease-in-out infinite; }

@keyframes shimmer {
  0%   { opacity: 0.45; }
  50%  { opacity: 0.9; }
  100% { opacity: 0.45; }
}

/* ── Empty / Error ── */
.empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 20px;
  text-align: center;
}

/* ── Load more sentinel ── */
#sentinel { height: 1px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 28px 20px;
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-nav a:hover { color: #fff; }
.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Responsive ── */
@media (min-width: 600px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 32px; }
}
@media (min-width: 900px) {
  .game-grid { grid-template-columns: repeat(4, 1fr); }
}
