/* 리셋 + 전역 베이스 + 버튼 — 전 모듈 공통.
   버튼 클래스명은 이전 버전의 두 표기(main=.btn-primary, game=.btn--primary)를 BEM(.btn--*)으로 통일.
   폰트 로딩(Pretendard CDN 등)은 CSS가 아니라 각 페이지 <head>의 링크 태그에서 처리 — shared/README.md 참고. */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.6;
  word-break: keep-all;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--primary); color: #fff; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* JS가 화면 상태를 바꿀 때 쓰는 공용 숨김 클래스 — 페이지마다 각자 정의하던 걸 여기로 통합 */
.is-hidden { display: none !important; }

/* 키보드 포커스 — 마우스 클릭 시에는 뜨지 않고 키보드 이동에서만 보인다 */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  /* <a class="btn">와 <button class="btn">를 나란히 쓰면 브라우저 기본 line-height가 서로 달라
     (button은 normal로 리셋, a는 본문 1.6을 상속) 같은 padding에도 높이가 어긋난다 — 태그와
     무관하게 항상 같은 높이가 되도록 고정값으로 통일. */
  line-height: 1.2;
  padding: 13px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn .icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn:active { transform: scale(0.98); }
.btn--full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }

.btn--primary {
  background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 85, 157, .28);
}
.btn--primary:hover { box-shadow: 0 10px 20px rgba(0, 85, 157, .34); transform: translateY(-1px); }

.btn--outline { border-color: var(--line); color: var(--text); background: #fff; }
.btn--outline:hover { border-color: var(--primary); color: var(--primary); }

.btn--gold {
  background: linear-gradient(155deg, var(--game) 0%, var(--game-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 106, 61, .3);
}
.btn--gold:hover { box-shadow: 0 10px 20px rgba(255, 106, 61, .36); transform: translateY(-1px); }

.btn--danger { background: var(--bg); color: var(--wrong); }
.btn--danger:hover { background: var(--wrong-bg); }

.btn--ghost { background: var(--primary-pale); color: var(--primary-dark); }
.btn--ghost:hover { background: #E2E9FB; }

.btn-link {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}
.btn-link:hover { color: var(--primary); }
