/* MiniPlay 공통 스타일 */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --text: #1b1d29;
  --muted: #646a80;
  --line: #e1e4ee;
  --accent: #5b5bf0;
  --accent-2: #ff7a59;
  --accent-text: #ffffff;
  --shadow: 0 2px 10px rgba(20, 24, 50, 0.06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12131a;
    --surface: #1c1e28;
    --surface-2: #262936;
    --text: #eceef6;
    --muted: #9aa0b8;
    --line: #2f3242;
    --accent: #8486ff;
    --accent-2: #ff8e70;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12131a;
  --surface: #1c1e28;
  --surface-2: #262936;
  --text: #eceef6;
  --muted: #9aa0b8;
  --line: #2f3242;
  --accent: #8486ff;
  --accent-2: #ff8e70;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* 헤더 */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }
.nav { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 0.95rem; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.lang-select { font: inherit; font-size: .85rem; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); max-width: 120px; }
.theme-pick { position: relative; }
.theme-btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.theme-btn:hover { border-color: var(--accent); }
.theme-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 140px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.theme-menu[hidden] { display: none; }
.theme-menu button { font: inherit; font-size: .9rem; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; white-space: nowrap; }
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button[aria-checked="true"] { color: var(--accent); font-weight: 700; }
@media (max-width: 560px) { .hide-sm { display: none; } .btn-coffee { padding: 7px 10px; font-size: .8rem; } }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-coffee { background: #ffdd00; border-color: #ffdd00; color: #1b1d29; font-weight: 600; }

/* 히어로 */
.hero { padding: 28px 0 8px; }
.hero h1 { margin: 0 0 4px; font-size: clamp(1.5rem, 4vw, 2.1rem); letter-spacing: -0.03em; }
.hero p { margin: 0; color: var(--muted); }

/* 검색 + 필터 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 14px; }
.search {
  flex: 1 1 220px; min-width: 0; padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer;
}
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* 게임 카드 그리드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .12s ease;
}
.card:hover { transform: translateY(-2px); text-decoration: none; }
.thumb {
  aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 3rem; position: relative;
  background-size: cover; background-position: center;
}
.badge {
  position: absolute; top: 8px; left: 8px; background: var(--accent-2); color: #fff;
  font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.card-body { padding: 10px 12px 12px; }
.card-title { font-weight: 700; margin: 0; font-size: 1rem; }
.card-desc { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-cat { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* 광고 자리 */
.ad-slot { margin: 18px 0; min-height: 0; text-align: center; }
.ad-slot.placeholder {
  min-height: 90px; display: grid; place-items: center; border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--muted); font-size: 0.8rem;
}

/* 플레이 페이지 */
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 18px 0; }
@media (max-width: 900px) { .play-layout { grid-template-columns: minmax(0, 1fr); } }
.play-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.play-head h1 { margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; }
.play-head .actions { margin-left: auto; display: flex; gap: 8px; }
.frame-wrap {
  position: relative; width: 100%; aspect-ratio: 4 / 3; background: #000;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
}
.frame-wrap.portrait { aspect-ratio: 3 / 4; max-width: 520px; margin: 0 auto; }
@media (max-width: 600px) { .frame-wrap, .frame-wrap.portrait { aspect-ratio: auto; height: 78vh; } }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.panel h2 { font-size: 1.05rem; margin: 0 0 8px; }
.panel p { margin: 0 0 8px; }
.panel .meta { color: var(--muted); font-size: 0.85rem; }
.side .panel:first-child { margin-top: 0; }
.related { display: grid; gap: 10px; }
.related a { display: flex; gap: 10px; align-items: center; color: var(--text); }
.related .mini { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; font-size: 1.6rem; flex: none; background-size: cover; }
.rating-stars { display: flex; gap: 4px; font-size: 1.6rem; }
.rating-stars button { background: none; border: 0; cursor: pointer; color: var(--line); padding: 0; font-size: inherit; }
.rating-stars button.on { color: #ffb400; }

.affiliate { text-align: center; }
.affiliate .disclosure { font-size: 0.75rem; color: var(--muted); margin-top: 6px; }

/* 본문 페이지 (소개, 개인정보처리방침 등) */
.prose { max-width: 760px; padding: 24px 0 40px; }
.prose h1 { letter-spacing: -0.02em; }
.prose h2 { margin-top: 28px; font-size: 1.15rem; }

/* 푸터 */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 36px; color: var(--muted); font-size: 0.85rem; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.site-footer a { color: var(--muted); }
