/* 디자인 기준: consalad-dot-studio (web/src/styles/theme.css 의 토큰을 그대로 따른다) */
:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.129 0.042 264.695);
  --card: oklch(1 0 0);
  --primary: oklch(0.208 0.042 265.755);
  --primary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.554 0.046 257.417);
  --border: oklch(0.929 0.013 255.508);
  --ring: oklch(0.704 0.04 256.788);
  --mint: oklch(0.7 0.13 170);
  --side-w: 16rem;
}

.dark {
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.984 0.003 247.858);
  --card: oklch(0.14 0.04 259.21);
  --primary: oklch(0.929 0.013 255.508);
  --primary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --border: oklch(1 0 0 / 10%);
  --ring: oklch(0.551 0.027 264.364);
  --mint: oklch(0.78 0.12 170);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, "Pretendard Variable", Pretendard, ui-sans-serif, system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
svg { width: 16px; height: 16px; flex: none; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.muted { color: var(--muted-foreground); }
.link { text-decoration: underline; text-underline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; color: var(--muted-foreground); font-weight: 400; }

/* 뼈대 */
.shell { display: flex; min-height: 100svh; }
.content { flex: 1; min-width: 0; }
.main { display: flex; flex-direction: column; gap: 2.5rem; width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }

/* 사이드바 */
.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex: none;
  width: var(--side-w);
  height: 100svh;
  padding: 0.5rem;
  border-right: 1px solid var(--border);
  background: var(--background);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 0.5rem; height: 3rem; padding: 0 0.5rem; border-radius: calc(var(--radius) - 2px); }
.brand:hover { background: var(--muted); }
.brand img { width: 2rem; height: 2rem; }
.brand span { display: grid; line-height: 1.25; }
.brand b { font-size: 14px; font-weight: 600; }
.brand small { font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; }
.nav-group { padding: 0.5rem 0; }
.nav-label { display: flex; align-items: center; height: 2rem; padding: 0 0.5rem; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 14px;
}
.nav-item:hover, .nav-item[aria-current="page"] { background: var(--muted); }
.nav-item[aria-current="page"] { font-weight: 500; }
.nav-item span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.side-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 0.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: var(--muted-foreground); }

.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--muted-foreground); cursor: pointer; }
.theme-btn:hover { background: var(--muted); color: var(--foreground); }
.theme-btn .moon, .dark .theme-btn .sun { display: none; }
.dark .theme-btn .moon { display: block; }

/* 모바일 상단 */
.top { display: none; align-items: center; gap: 0.75rem; height: 3.5rem; padding: 0 1rem; border-bottom: 1px solid var(--border); }
.top-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 14px; }
.top-brand b { font-weight: 600; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: inherit;
  cursor: pointer;
}
.icon-btn:hover { background: var(--muted); }

/* 제목 */
.page-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; }
.page-head p { margin-top: 0.25rem; color: var(--muted-foreground); }
.section { margin-bottom: 0.75rem; font-size: 14px; font-weight: 600; }
.note { margin-top: 1rem; font-size: 12px; }

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover, .feature:hover .btn-primary { opacity: 0.9; }
.btn-outline { background: var(--background); border-color: var(--border); color: var(--foreground); flex: none; }
.btn-outline:hover { background: var(--muted); }
.btn-light { background: #fff; color: oklch(0.208 0.042 265.755); }
.btn-light:hover { background: oklch(0.95 0.007 247.896); }
.btn-lg { height: 2.75rem; padding: 0 1.75rem; font-size: 15px; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* 대표 카드 */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  transition: border-color 0.15s;
}
.feature:hover, .card:hover { border-color: color-mix(in oklch, var(--primary) 60%, transparent); }
.feature-thumb, .card-thumb { display: block; overflow: hidden; border-radius: var(--radius); background: var(--muted); aspect-ratio: 16 / 9; }
.feature-thumb img, .card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feature-body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.5rem; padding: 0.5rem 0.75rem 0.5rem 0; min-width: 0; }
.feature-title { font-size: 20px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; }
.feature-desc { color: var(--muted-foreground); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feature-meta { font-size: 12px; color: var(--muted-foreground); }
.feature .btn { margin-top: 0.5rem; }

/* 게임 카드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  transition: border-color 0.15s;
}
.card-thumb { margin: 0.75rem 0.75rem 0; }
.card-body { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.75rem; min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc { font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted-foreground);
}
.card-go { display: inline-flex; align-items: center; gap: 0.125rem; font-weight: 500; color: var(--foreground); }
.card-go svg { width: 12px; height: 12px; }

/* 게임 페이지 (상점 페이지 구조) */
.play { gap: 1.5rem; }
.crumb { display: flex; align-items: center; gap: 0.25rem; font-size: 12px; color: var(--muted-foreground); }
.crumb a:hover { color: var(--foreground); }
.crumb span { color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb svg { width: 12px; height: 12px; }

.g-head { margin-top: -0.5rem; }
.g-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; overflow-wrap: anywhere; }
.g-head p { margin-top: 0.25rem; }

.g-hero { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }

.gallery { min-width: 0; }
.gallery-view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: oklch(0.129 0.042 264.695);
}
.gallery-view img { width: 100%; height: 100%; object-fit: cover; }
.gallery-nav {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-top: -1.125rem;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / 55%);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s;
}
.gallery-nav.prev { left: 0.75rem; }
.gallery-nav.next { right: 0.75rem; }
.gallery-view:hover .gallery-nav, .gallery-nav:focus-visible { opacity: 1; }
.gallery-nav:hover { background: rgb(0 0 0 / 80%); }
@media (hover: none) { .gallery-nav { opacity: 1; } }
.gallery-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 1rem 0.75rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 75%));
  color: #fff;
  font-size: 12px;
}
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.5rem; padding-bottom: 2px; overflow-x: auto; scrollbar-width: thin; }
.gallery-thumbs button {
  flex: none;
  width: 7.25rem;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
}
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs button[aria-selected="true"] { opacity: 1; border-color: var(--primary); }
.gallery-thumbs img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.g-side { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.capsule { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius); }
.g-desc { font-size: 13px; }
.meta { margin: 0; padding-top: 0.75rem; border-top: 1px solid var(--border); display: grid; gap: 0.375rem; font-size: 12px; }
.meta div, .rows div { display: flex; justify-content: space-between; gap: 1rem; }
.meta dt, .rows dt { color: var(--muted-foreground); }
.meta dd, .rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chip { display: inline-flex; align-items: center; height: 1.5rem; padding: 0 0.625rem; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }
.chip:hover { background: var(--muted); }

.playbox {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1rem 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--muted);
}
.playbox-text { display: grid; gap: 0.125rem; flex: 1; min-width: 0; }
.playbox-text b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.playbox-text span { font-size: 12px; }
.playbox-note { max-width: 15rem; font-size: 12px; color: var(--muted-foreground); }

.g-cols { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.5rem 1rem; align-items: start; }
.g-main { display: flex; flex-direction: column; gap: 2.5rem; min-width: 0; padding-right: 1.5rem; }
.g-aside { display: flex; flex-direction: column; gap: 1rem; }

.prose { display: grid; gap: 0.75rem; max-width: 42rem; line-height: 1.7; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.features li { display: grid; gap: 0.25rem; padding: 0.875rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.features b { font-weight: 600; }
.features span { font-size: 12px; color: var(--muted-foreground); line-height: 1.6; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; border: 1px solid var(--border); border-radius: var(--radius); }
.steps li { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; counter-increment: step; }
.steps li + li { border-top: 1px solid var(--border); }
.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.controls { margin-top: 0.75rem; font-size: 12px; color: var(--muted-foreground); }
.controls b { margin-right: 0.5rem; font-weight: 600; color: var(--foreground); }

.updates { margin: 0; padding: 0; list-style: none; }
.updates li { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.updates li:last-child { border-bottom: 1px solid var(--border); }
.updates time { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; line-height: 21px; }
.updates div { display: grid; gap: 0.125rem; }
.updates b { font-weight: 600; }
.updates span { font-size: 12px; color: var(--muted-foreground); }

.panel { padding: 1rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); }
.panel-title { margin-bottom: 0.75rem; font-size: 14px; font-weight: 600; }
.rows { margin: 0; display: grid; gap: 0.5rem; font-size: 13px; }
.support { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.75rem; }
.support li { display: flex; gap: 0.625rem; }
.support svg { margin-top: 2px; }
.support .ok svg { color: var(--mint); }
.support .no svg { color: var(--muted-foreground); }
.support div { display: grid; }
.support b { font-size: 13px; font-weight: 500; }
.support .no b { color: var(--muted-foreground); }
.support span { font-size: 12px; color: var(--muted-foreground); }

/* 플레이어 */
.playing { overflow: hidden; }
.player { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #05070c; color: #fff; }
.player[hidden] { display: none; }
.player-bar { display: flex; align-items: center; gap: 0.5rem; height: 3rem; padding: 0 0.75rem 0 1rem; border-bottom: 1px solid rgb(255 255 255 / 10%); }
.player-bar b { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-dark { height: 2rem; padding: 0 0.75rem; background: transparent; border-color: rgb(255 255 255 / 15%); color: #fff; font-size: 13px; }
.btn-dark:hover { background: rgb(255 255 255 / 10%); }
.player-stage { position: relative; flex: 1; min-height: 0; }
.player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 1023px) {
  .g-hero, .g-cols { grid-template-columns: minmax(0, 1fr); }
  .g-main { padding-right: 0; }
  .capsule { display: none; }
}

@media (max-width: 767px) {
  .top { display: flex; }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(18rem, 85vw);
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .side-open .side { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 45%); }
  .main { padding: 1rem 1rem 3rem; gap: 2rem; }
  .feature { grid-template-columns: 1fr; gap: 0.5rem; }
  .feature-body { padding: 0.25rem 0.25rem 0.5rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .g-head h1 { font-size: 22px; }
  .playbox { flex-direction: column; align-items: stretch; padding: 1rem; }
  .playbox-note { max-width: none; }
  .features { grid-template-columns: 1fr; }
  .updates li { grid-template-columns: 1fr; gap: 0.125rem; }
  .player-bar b { font-size: 13px; }
}
