/* ============================================================
   DevDepot Games — 공통 스타일 (모든 페이지에서 로드)
   ------------------------------------------------------------
   토큰(색·글꼴·간격) → 리셋 → 레이아웃 → 내비게이션 → 이벤트 리본
   → 버튼 → 공통 섹션 헤더 → 푸터 → 모바일 하단 고정바 → 라이트박스
   ============================================================ */

/* ---------- 1. 디자인 토큰 ----------
   좀비쨩 키아트에서 뽑은 팔레트: 차가운 남색 밤하늘, 흰 코트, 붉은 눈.
   붉은색은 "행동(위시리스트)"에만 씁니다. 나머지는 전부 조용하게. */
:root {
  --bg: #090b14;
  --bg-2: #0f1224;
  --bg-3: #161a33;
  --surface: rgba(22, 26, 51, 0.55);
  --surface-strong: rgba(22, 26, 51, 0.92);
  --ink: #eef0f8;
  --ink-2: #a9afcc;
  --ink-3: #6f7599;
  --line: rgba(169, 175, 204, 0.16);
  --line-strong: rgba(169, 175, 204, 0.32);
  --red: #e63b4e;
  --red-deep: #b4233a;
  --red-glow: rgba(230, 59, 78, 0.35);
  --star: #c3cbff;
  --star-soft: rgba(195, 203, 255, 0.12);
  --ok: #7fe0a8;
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Hiragino Sans", "Noto Sans JP", "Noto Sans KR",
    "PingFang SC", "PingFang TC", "Microsoft YaHei", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --font-hud: "Chakra Petch", "Pretendard Variable", monospace, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --nav-h: 68px;
  --ribbon-h: 40px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* ---------- 2. 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
/* 일본어·중국어는 단어 사이 공백이 없어 keep-all 이면 줄이 안 끊깁니다 */
html[lang="ja"] body, html[lang^="zh"] body { word-break: normal; line-break: strict; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; font-weight: 800; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--star); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* 배경: 아주 옅은 별빛 두 점. 이미지 없이 그라디언트만 사용 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(195, 203, 255, 0.10), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(230, 59, 78, 0.06), transparent 60%);
}

/* ---------- 3. 레이아웃 ---------- */
.container { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.section { padding-block: clamp(72px, 10vw, 128px); }
.section + .section { padding-top: 0; }

/* 섹션 헤더 (아이브로우 + 제목 + 설명) */
.sec-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.eyebrow {
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--star);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--star); opacity: 0.7; }
.sec-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.sec-head .desc { color: var(--ink-2); font-size: 1.05rem; max-width: 62ch; }

/* ---------- 4. 내비게이션 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(9, 11, 20, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); background: rgba(9, 11, 20, 0.88); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo img { height: 30px; width: auto; }
.nav-logo span { font-family: var(--font-hud); font-weight: 700; letter-spacing: 0.08em; font-size: 0.95rem; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* 언어 선택 */
.lang {
  position: relative;
}
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-hud); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em;
  color: var(--ink-2);
  transition: color 0.2s, border-color 0.2s;
}
.lang-btn:hover, .lang[open] .lang-btn { color: var(--ink); border-color: var(--star); }
.lang-btn svg { width: 14px; height: 14px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 150px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow);
  display: grid;
}
.lang-menu button {
  text-align: left; padding: 8px 12px; border-radius: 6px; font-size: 0.92rem; color: var(--ink-2);
}
.lang-menu button:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.lang-menu button[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.lang-menu button[aria-checked="true"]::after { content: "✓"; float: right; color: var(--star); }

/* 모바일 메뉴 토글 */
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 999px; place-items: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; content: ""; position: relative; transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav.is-open .nav-toggle span { background: transparent; }
.nav.is-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 20px 18px; margin: 0;
    background: rgba(9, 11, 20, 0.96);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.is-open .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1.05rem; }
  .nav-toggle { display: grid; }
  .nav-right .nav-cta-desktop { display: none; } /* .btn 의 display 보다 우선하도록 선택자 강화 */
}

/* ---------- 5. 이벤트 리본 (config.js 로 자동 전환) ---------- */
.ribbon {
  position: relative; z-index: 51;
  background: linear-gradient(90deg, var(--bg-3), #1c2148 50%, var(--bg-3));
  border-bottom: 1px solid var(--line);
  min-height: var(--ribbon-h);
  font-size: 0.9rem;
}
.ribbon-inner { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: var(--ribbon-h); padding: 6px 0; flex-wrap: wrap; text-align: center; }
.ribbon-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 var(--red-glow); animation: pulse 2s infinite; flex-shrink: 0; }
.ribbon-text { color: var(--ink); font-weight: 500; }
.ribbon-cta {
  font-family: var(--font-hud); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--star); color: var(--star);
  transition: background-color 0.2s, color 0.2s;
}
.ribbon-cta:hover { background: var(--star); color: var(--bg); }
@media (max-width: 720px) {
  .ribbon { font-size: 0.8rem; }
  .ribbon-inner { gap: 8px 12px; padding: 8px 0; }
  .ribbon-cta { display: none; }          /* 모바일: 리본 전체가 링크 역할 (site.js) */
  .ribbon { cursor: pointer; }
  .ribbon-text::after { content: " \203A"; color: var(--star); }
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--red-glow); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- 6. 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border-radius: 999px;
  font-weight: 700; font-size: 1rem; line-height: 1;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 30px var(--red-glow); }
.btn-primary:hover { background: #ff4a5e; box-shadow: 0 14px 36px var(--red-glow); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.btn-white { background: var(--ink); color: var(--bg); }
.btn-white:hover { background: #fff; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }
@media (max-width: 720px) {
  /* 일본어·중국어 라벨은 길어서 한 줄 고정을 풀고 가운데 정렬로 줄바꿈 허용 */
  .btn { white-space: normal; text-align: center; padding-block: 12px; line-height: 1.25; }
}
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 1.08rem; }

/* 태그 (플랫폼·장르) */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-hud); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--ink-2);
}

/* ---------- 7. 푸터 ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--ink-3); font-size: 0.9rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: start; }
.footer-brand { display: grid; gap: 8px; }
.footer-brand img { height: 26px; width: auto; opacity: 0.8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; }
.footer-links a:hover { color: var(--ink); }
.footer-social { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.footer-social a { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.footer-social a:hover { border-color: var(--ink); color: var(--ink); }
.footer-social svg { width: 16px; height: 16px; }
.footer-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links, .footer-social { justify-content: flex-start; }
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } /* 하단 고정바 높이만큼 */
}

/* ---------- 8. 모바일 하단 고정 CTA ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 49;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(9, 11, 20, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.35s var(--ease);
  display: none;
}
.sticky-cta .btn { width: 100%; }
.sticky-cta.is-visible { transform: translateY(0); }
@media (max-width: 720px) { .sticky-cta { display: block; } }

/* ---------- 9. 라이트박스 / 트레일러 대화상자 ---------- */
dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 96vh; color: var(--ink);
}
dialog.lightbox::backdrop { background: rgba(4, 5, 12, 0.92); backdrop-filter: blur(6px); }
.lightbox-body { position: relative; display: grid; gap: 12px; }
.lightbox-body img, .lightbox-body iframe { width: min(96vw, 1400px); max-height: 84vh; object-fit: contain; border-radius: var(--radius-sm); background: #000; }
.lightbox-body iframe { aspect-ratio: 16 / 9; height: auto; border: 0; }
.lightbox-cap { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.92rem; color: var(--ink-2); }
.lightbox-cap .idx { font-family: var(--font-hud); letter-spacing: 0.1em; }
.lb-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink); }
.lb-btn:hover { background: rgba(255, 255, 255, 0.16); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-close { position: absolute; top: -52px; right: 0; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
@media (max-width: 720px) { .lb-prev, .lb-next { display: none; } .lb-close { top: auto; bottom: -56px; right: 50%; transform: translateX(50%); } }

/* ---------- 10. 스크롤 등장 (초기 상태에서도 읽힘: 살짝만 움직임) ---------- */
/* JS 가 켜진 경우에만 적용 (.js 클래스는 site.js 가 <html> 에 붙임).
   첫 화면에 이미 보이는 요소는 site.js 가 로드 직후 바로 is-in 을 붙이므로 빈 화면이 생기지 않습니다. */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .ribbon-dot { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
