@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

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

:root {
  --dark:   #0b0b0f;
  --dark2:  #13131a;
  --dark3:  #1c1c28;
  --border: rgba(255,255,255,0.08);
  --text:   #d8d4e8;
  --dim:    #7a748c;
  --accent: #a78bfa;
}

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NAVBAR ─────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: rgba(11,11,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  display: block;
  padding: 6px 14px;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  user-select: none;
}

/* ── HOME HERO ───────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 20px 50px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(120,80,200,0.15) 0%, transparent 70%);
}

.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  text-shadow: 0 0 40px rgba(167,139,250,0.4);
}

.hero p {
  font-size: 1rem;
  color: var(--dim);
}

/* ── GAME GRID ───────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px 100px;
}

/* ── GAME CARD ───────────────────────────────── */
.game-card {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 14px;
  overflow: hidden;
  min-height: 320px;
  border: 1px solid var(--border);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.game-card:hover { transform: translateY(-8px) scale(1.01); }

/* 이미지 레이어 — 호버 시 확대 */
.card-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.game-card:hover .card-img { transform: scale(1.08); }

/* 그라디언트 오버레이 */
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 28px 32px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.5) 50%,
    rgba(0,0,0,0.1) 100%
  );
  transition: background 0.3s ease;
}
.game-card:hover .card-overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.92) 0%,
    rgba(0,0,0,0.55) 50%,
    rgba(0,0,0,0.15) 100%
  );
}

/* 게임별 accent 색상 */
.game-card.dbd       { --card-accent: #e05c4a; }
.game-card.peak      { --card-accent: #4fc3f7; }
.game-card.mahjong   { --card-accent: #f0c060; }
.game-card.wuthering { --card-accent: #00e5ff; }
.game-card.seven     { --card-accent: #ce93d8; }
.game-card.persona   { --card-accent: #4a9eff; }

.game-card.dbd:hover       { box-shadow: 0 16px 50px rgba(224,92,74,0.35);  border-color: rgba(224,92,74,0.4); }
.game-card.peak:hover      { box-shadow: 0 16px 50px rgba(79,195,247,0.3);  border-color: rgba(79,195,247,0.4); }
.game-card.mahjong:hover   { box-shadow: 0 16px 50px rgba(240,192,96,0.3);  border-color: rgba(240,192,96,0.4); }
.game-card.wuthering:hover { box-shadow: 0 16px 50px rgba(0,229,255,0.3);   border-color: rgba(0,229,255,0.4); }
.game-card.seven:hover     { box-shadow: 0 16px 50px rgba(206,147,216,0.3); border-color: rgba(206,147,216,0.4); }
.game-card.persona:hover   { box-shadow: 0 16px 50px rgba(74,158,255,0.35); border-color: rgba(74,158,255,0.4); }

/* 이미지 없는 게임 폴백 배경 */
.game-card.dbd .card-img       { background-color: #2a0505; }
.game-card.peak .card-img      { background-color: #051828; }
.game-card.mahjong .card-img   { background-color: #1e1205; }
.game-card.wuthering .card-img { background-color: #021a1e; }
.game-card.seven .card-img {
  background: linear-gradient(135deg, #1a0530 0%, #0d0220 40%, #200535 100%);
}
.game-card.persona .card-img { background-color: #020810; }

.card-genre {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--card-accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.game-card h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  color: #fff;
  margin-bottom: 10px;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.game-card p {
  font-size: 0.88rem;
  color: rgba(230,225,245,0.82);
  line-height: 1.65;
  margin-bottom: 14px;
}

.card-btn {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--card-accent);
  letter-spacing: 0.05em;
  font-weight: 600;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s, transform 0.25s;
}
.game-card:hover .card-btn { opacity: 1; transform: translateX(0); }

/* ── GAME PAGE HERO ──────────────────────────── */
.page-hero {
  position: relative;
  text-align: center;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 80px;
  overflow: hidden;
}

/* 배경 이미지 레이어 */
.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.35) saturate(1.3);
  transform: scale(1.03);
  transition: transform 8s ease;
  z-index: 0;
}
.page-hero:hover .page-hero-bg { transform: scale(1.06); }

/* 그라디언트 오버레이 */
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.7) 100%),
    radial-gradient(ellipse 70% 80% at 50% 0%, var(--hero-glow, rgba(120,80,200,0.25)) 0%, transparent 70%);
  z-index: 1;
}

.page-hero > *:not(.page-hero-bg) { position: relative; z-index: 2; }

.page-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
  opacity: 0.9;
  backdrop-filter: blur(4px);
  background: rgba(0,0,0,0.25);
}

.page-hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.2rem, 7vw, 5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
  text-shadow:
    0 0 40px var(--hero-glow, rgba(120,80,200,0.6)),
    0 4px 20px rgba(0,0,0,0.8);
  line-height: 1.1;
}

.page-hero p {
  font-size: 1.1rem;
  color: rgba(220,215,235,0.85);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
  font-style: italic;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* ── CONTENT SECTIONS ────────────────────────── */
.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 70px 40px;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
}

.content-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 24px;
  font-weight: 700;
}

.content-section p {
  font-size: 1.05rem;
  line-height: 1.95;
  color: var(--text);
  margin-bottom: 18px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── INFO CARDS ──────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.info-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 22px;
  transition: border-color 0.2s, transform 0.2s;
}

.info-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.info-card-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.info-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 0.88rem;
  color: var(--dim);
  line-height: 1.7;
  margin: 0;
}

/* ── HIGHLIGHT BOX ───────────────────────────── */
.highlight-box {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 28px 32px;
  margin: 24px 0;
}

.highlight-box h3 {
  font-family: 'Cinzel', serif;
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.highlight-box p {
  font-size: 0.95rem;
  color: var(--dim);
  line-height: 1.8;
  margin: 0;
}

/* ── STATS ROW ───────────────────────────────── */
.stats-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 32px;
}

.stat-item {
  flex: 1;
  padding: 28px 20px;
  text-align: center;
  background: var(--dark2);
  border-right: 1px solid var(--border);
}

.stat-item:last-child { border-right: none; }

.stat-value {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--dim);
  letter-spacing: 0.06em;
}

/* ── FOOTER ──────────────────────────────────── */
footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.85rem;
  background: rgba(0,0,0,0.3);
}

/* ── GAME BANNER ─────────────────────────────── */
#game-banner {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 9000;
}

#banner-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124,58,237,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}

#banner-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(124,58,237,0.65);
}

.banner-icon { font-size: 1.1rem; }

#banner-popup {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: var(--dark2, #13131a);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 14px;
  padding: 20px;
  width: 260px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(167,139,250,0.1);
}

#banner-popup[hidden] { display: none; }

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.popup-title {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #a78bfa;
  font-weight: 600;
}

.popup-close {
  background: none;
  border: none;
  color: #7a748c;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.popup-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

.popup-result {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  padding: 14px 12px;
  margin-bottom: 14px;
  text-align: center;
  gap: 6px;
}

.popup-hint {
  font-size: 0.82rem;
  color: #7a748c;
  line-height: 1.5;
}

.popup-game {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  word-break: break-word;
}

.popup-count {
  font-size: 0.72rem;
  color: #7a748c;
}

.recommend-btn {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  border: none;
  border-radius: 8px;
  padding: 11px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}

.recommend-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.recommend-btn:active { transform: translateY(0); }

/* ── STEAM LINKS ─────────────────────────────── */
.steam-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.steam-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #1b2838;
  border: 1px solid rgba(102,192,244,0.3);
  border-radius: 8px;
  padding: 10px 20px;
  color: #66c0f4;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}

.steam-btn:hover {
  background: #2a475e;
  border-color: rgba(102,192,244,0.65);
  transform: translateY(-2px);
  color: #c7e8ff;
}

.steam-btn .steam-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(11,11,15,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 24px; border-radius: 0; }
  .hamburger { display: block; }
  .game-grid { padding: 20px 20px 60px; }
  .game-grid { grid-template-columns: 1fr; }
  .content-section { padding: 50px 24px; }
  .stats-row { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
  .page-hero { min-height: 380px; }
}
