/* 쿠소월드 — 보플 팔레트 기반. 색은 brand/character-bible.md §3에서만 가져온다. */

:root {
  --body:      #C7BFD4;
  --shadow:    #9E93B0;
  --highlight: #E4DEEC;
  --outline:   #4A3F5C;
  --eye:       #221C2B;
  --blush:     #FF7BA8;
  --danger:    #FF4D3D;

  --bg:        #16121E;
  --bg-2:      #1E1929;
  --bg-3:      #272134;
  --fg:        #EDE9F2;
  --fg-muted:  #A79FB5;

  --radius: 14px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Pretendard",
               "Malgun Gothic", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--fg-muted); }
.small { font-size: 0.875rem; }

/* ── 헤더 ───────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(22, 18, 30, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bg-3);
}
.head-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--fg); }
.brand-name { font-weight: 800; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; object-fit: contain; display: block; }

.pts-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3); border: 1px solid var(--outline);
  padding: 5px 13px 5px 9px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 800; color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.pts-chip .coin {
  width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE07A, #F5B softly 60%, #E59B2B);
  background: radial-gradient(circle at 35% 30%, #FFE79A, #EBA23A);
  box-shadow: inset 0 0 0 1.5px #C6811F;
}
.pts-chip #pts-val { color: var(--body); }

/* ── 히어로 ─────────────────────────── */
.hero {
  padding: 40px 0 28px;
  background:
    radial-gradient(760px 420px at 78% 34%, rgba(199, 191, 212, 0.18), transparent 68%);
}
.hero-inner {
  display: flex; align-items: center; gap: 28px;
  flex-direction: column-reverse; text-align: center;
}
/* align-items:center가 카피를 내용폭으로 줄이면 제목이 한 줄로 넘친다.
   폭을 채워야 제목이 정상적으로 줄바꿈된다. */
.hero-copy { width: 100%; min-width: 0; }
.eyebrow {
  margin: 0 0 10px; font-size: .8125rem; font-weight: 700;
  color: var(--blush); letter-spacing: .02em;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 5.2vw, 2.6rem);
  line-height: 1.28; letter-spacing: -0.03em; font-weight: 800;
  text-wrap: balance; word-break: keep-all;
}
.lede { margin: 0 auto; max-width: 44ch; color: var(--fg-muted); }
.hero-art img {
  width: clamp(180px, 46vw, 300px); height: auto; display: block;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, .55));
  animation: bob 3.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-12px) rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) { .hero-art img { animation: none; } }

@media (min-width: 760px) {
  .hero { padding: 60px 0 48px; }
  .hero-inner { flex-direction: row; text-align: left; justify-content: space-between; gap: 40px; }
  .hero-copy { flex: 1 1 auto; }
  .hero-art { flex: 0 0 auto; }
  .lede { margin: 0; }
}

/* ── 게임 아트 타일 (캐릭터 + 그라디언트, CSS 구성) ─── */
.game-art {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 120%, hsl(var(--h,270) 45% 22%), transparent 60%),
    linear-gradient(160deg, #221B30, #14101C);
}
.game-art::before { /* 캐릭터 뒤 발광 */
  content: ''; position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  width: 62%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--h,270) 60% 70% / .35), transparent 68%);
}
.game-art img {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: 56%; max-width: 220px; filter: drop-shadow(0 10px 22px rgba(0,0,0,.5));
}

/* ── 피처드 게임 ─────────────────────── */
.feature {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  background: var(--bg-2); border: 1px solid var(--bg-3);
  border-radius: 18px; overflow: hidden;
  transition: border-color .16s ease, transform .16s ease;
}
.feature:hover { border-color: var(--body); transform: translateY(-2px); }
.feature .game-art { aspect-ratio: 16 / 10; }
.feature-body { padding: 20px 22px 24px; }
.feature-body .tag { align-self: flex-start; }
.feature-body h3 { margin: 12px 0 8px; font-size: 1.375rem; letter-spacing: -0.02em; }
.feature-body p { margin: 0 0 16px; max-width: 52ch; }
.cta { font-weight: 700; color: var(--body); font-size: .9375rem; }

@media (min-width: 760px) {
  .feature { flex-direction: row; align-items: stretch; }
  .feature .game-art { flex: 0 0 44%; aspect-ratio: auto; min-height: 260px; }
  .feature-body { flex: 1 1 auto; display: flex; flex-direction: column;
                  align-items: flex-start; justify-content: center; padding: 32px 36px; }
}

/* ── 게임 그리드 ─────────────────────── */
.sec-title {
  font-size: 1.0625rem; letter-spacing: -0.01em;
  margin: 44px 0 16px; color: var(--fg-muted); font-weight: 700;
}
.game-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding-bottom: 56px;
}
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-2); border: 1px solid var(--bg-3);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--body); }
.card:hover .game-art img { transform: translate(-50%, -56%); }
.card .game-art { aspect-ratio: 4 / 3; }
.card .game-art img { transition: transform .18s ease; }
.next-up { padding: 22px 0 4px; }
.diff .off { opacity: .28; }
.tag { align-self: flex-start; }
.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 1rem; letter-spacing: -0.01em; }
.card-body p { margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2;
               -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag {
  font-size: 0.75rem; padding: 2px 9px; border-radius: 999px;
  background: var(--bg-3); color: var(--fg-muted);
}
.diff { font-size: 0.6875rem; color: var(--blush); letter-spacing: 1px; }

/* ── 푸터 ───────────────────────────── */
.site-foot { border-top: 1px solid var(--bg-3); padding: 24px 0 40px; }

/* ── 플레이 페이지 ───────────────────── */
.play-page { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.play-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px; height: 52px; flex: 0 0 auto;
  background: var(--bg-2); border-bottom: 1px solid var(--bg-3);
}
.play-bar .back { color: var(--fg-muted); text-decoration: none; font-size: 0.875rem; }
.play-bar .back:hover { color: var(--fg); }
.play-title { font-weight: 700; letter-spacing: -0.01em; }
.play-bar .pts-chip { margin-left: auto; }

.stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.stage iframe {
  width: 100%; height: 100%; border: 0; display: block;
}
/* 세로 게임은 데스크톱에서 폭을 제한해야 조작감이 유지된다 */
@media (min-width: 720px) {
  .stage[data-orientation="portrait"] iframe {
    width: min(480px, 56.25vh); height: 100%;
  }
}
