/* =========================================================
   공통 스타일 — index.html(시작) / play.html(게임) / privacy.html / 404.html
   보통은 고칠 필요 없음. 게임 화면 비율만 아래 --game-w / --game-h 숫자로 맞추기.
   ========================================================= */
:root {
  --bg: #0c0a09;
  --panel: #1a1512;
  --panel-2: #241c17;
  --text: #f6efdd;
  --muted: #b9ad98;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #ffd400;
  --accent-ink: #0a0a0c;
  --red: #e0231b;
  --radius: 14px;
  --gap: 22px;

  /* ▼ 게임 화면 비율 (가로 : 세로) — 뷲초선 타이쿤은 세로 화면 게임이라 PC도 9:16 */
  --game-w: 9;
  --game-h: 16;
  --stage-vh: 80vh;   /* PC: 게임 높이 = 화면 높이의 80% */
}
@media (max-width: 600px) {
  /* ▼ 게임 화면 비율 — 휴대폰
     가로 고정 게임이면 위와 같게(예: 16 / 9), 세로 게임이면 9 / 16 */
  :root { --game-w: 9; --game-h: 16; --stage-vh: 92vh; }
}
@supports (height: 1svh) {
  @media (max-width: 600px) { :root { --stage-vh: 92svh; } }  /* 휴대폰: 주소창을 뺀 화면 높이 기준 */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- 상단 바 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
}
.brand { font-weight: 800; text-decoration: none; letter-spacing: -0.01em; }
.topbar nav { display: flex; gap: 14px; font-size: 14px; color: var(--muted); }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { color: var(--text); }
.topbar.play { display: grid; grid-template-columns: 1fr auto 1fr; }
.topbar .title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-link { text-decoration: none; color: var(--muted); font-size: 14px; white-space: nowrap; }
.back-link:hover { color: var(--text); }

/* ---------- 본문 폭 ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 40px; }
.wrap.wide { max-width: 960px; }

/* =========================================================
   광고 자리
   - 각 .ad-slot 안의 <!-- 여기에 … --> 주석 자리에 Adsterra 코드를 그대로 붙여넣기
   - 실제 사이트: 코드가 없는 자리는 통째로 숨김 (빈 상자 안 보임)
   - 미리보기(내 PC에서 열거나 주소 끝에 ?slots): 빈 자리를 점선 상자로 표시
   ========================================================= */
.ad-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--gap) auto;
}
.ad-label { font-size: 11px; line-height: 1; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.04em; }
.ad-slot { display: flex; justify-content: center; max-width: 100%; overflow: hidden; }
.ad-slot[data-size="320x50"]  { width: 320px; min-height: 50px; }
.ad-slot[data-size="300x250"] { width: 300px; min-height: 250px; }
.ad-slot[data-size="native"]  { display: block; width: 100%; min-height: 100px; }

.ad-wrap:has(> .ad-slot:empty) { display: none; }

.show-slots .ad-wrap:has(> .ad-slot:empty) { display: flex; }
.show-slots .ad-slot:empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.show-slots .ad-slot:empty::before { content: attr(data-label) " 코드 자리"; }

/* 아주 작은 휴대폰(가로 360px 미만): 광고가 잘리지 않게 좌우 여백까지 사용 */
@media (max-width: 359px) {
  .ad-wrap { margin-left: -16px; margin-right: -16px; }
}

/* ---------- 시작 페이지 ---------- */
.hero { text-align: center; }
.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(5, 8, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}
.hero h1 { margin: 16px 0 4px; font-size: clamp(26px, 6vw, 38px); letter-spacing: -0.02em; line-height: 1.25; }
.lead { margin: 0 auto; max-width: 34em; color: var(--muted); }

.play-btn {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 8px auto;
  padding: 17px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-align: center;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.play-btn:hover { filter: brightness(1.05); }
.play-btn:focus-visible, .tool-btn:focus-visible, .kofi-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.play-btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 700;
  padding: 13px 20px;
}
.note { text-align: center; font-size: 13px; color: var(--muted); margin: 0; }

.card {
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.card h2 { margin: 0 0 8px; font-size: 18px; }
.card p, .card ol { margin: 0; color: var(--muted); }
.card ol { padding-left: 20px; }
.card ol li + li { margin-top: 4px; }

.support { text-align: center; }
.card ol b { color: var(--text); margin-right: 4px; }
.sns-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}
.sns-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.satire { margin: 28px auto 0; max-width: 36em; text-align: center; font-size: 13px; color: var(--muted); }
.kofi-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #72a4f2;
  color: #08203f;
  font-weight: 800;
  text-decoration: none;
}

/* ---------- 게임 페이지 ---------- */
.stage {
  position: relative;
  width: min(100%, calc(var(--stage-vh) * var(--game-w) / var(--game-h)));
  aspect-ratio: var(--game-w) / var(--game-h);
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.stage-close { display: none; position: absolute; left: 0; right: 0; top: 0; height: 40px; z-index: 2; border: 0; background: var(--accent-ink); color: var(--text); font: 800 15px system-ui, sans-serif; cursor: pointer; border-bottom: 2px solid var(--red); }
.stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; }
.stage:-webkit-full-screen { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.stage.expanded { position: fixed; inset: 0; z-index: 1000; width: auto; height: auto; aspect-ratio: auto; border: 0; border-radius: 0; margin: 0; }
/* :fullscreen 을 모르는 옛 브라우저가 규칙을 통째로 버리지 않게, 크게 하기(.expanded) 규칙은 따로 씀 */
.stage.expanded .stage-close { display: block; }
.stage.expanded iframe { top: 40px; height: calc(100% - 40px); }
.stage:fullscreen .stage-close { display: block; }
.stage:fullscreen iframe { top: 40px; height: calc(100% - 40px); }
.stage:-webkit-full-screen .stage-close { display: block; }
.stage:-webkit-full-screen iframe { top: 40px; height: calc(100% - 40px); }
html.lock, html.lock body { overflow: hidden; }
.play-tools { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.tool-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 18px;
  font: 700 14px system-ui, sans-serif;
  cursor: pointer;
}

/* ---------- 하단 ---------- */
.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.footer p { margin: 0; }
.footer a { color: var(--muted); }

/* ---------- 문서(개인정보처리방침·404) ---------- */
.doc h1 { font-size: 24px; margin: 20px 0 6px; }
.doc h2 { font-size: 17px; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--muted); }
.doc .meta { font-size: 13px; }
.center { text-align: center; }
