/* 대서소 — 기본 모양 (대서소 화면 시안 '1. 첫 화면' 기준) */
:root {
  --paper: #F7F3EA;      /* 누런 종이 */
  --ink-navy: #1F2A44;   /* 남색 글씨 */
  --seal-red: #B23A2E;   /* 붉은 인주 */
  --ink-black: #1F1D1B;  /* 검은 먹 */
  --sub: #5B5A55;        /* 보조 글씨 */
  --ad: #E6E0D2;
  --footer: #2A221C;
  --accent: #E8A04A;
  --line: #E6E0D2;
  --sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
  --brush: "East Sea Dokdo", "Noto Serif KR", cursive;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-navy);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: inherit; }
button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--seal-red); outline-offset: 2px; }

/* 폰 390px 기준, PC에선 가운데 */
.page {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

main { flex: 1; padding: 0 20px; }

/* ① 머리 */
.masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 20px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-seal { flex: none; width: 58px; height: 58px; display: block; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-name {
  font-family: var(--brush);
  font-weight: 400;
  color: var(--seal-red);
  font-size: 56px;
  line-height: 0.85;
}

.brand-sub { font-size: 14px; color: var(--sub); }

.kakao {
  margin-left: auto;
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #FEE500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.kakao svg { width: 26px; height: 26px; }

/* ② 찾기 칸 */
.finder { padding-top: 12px; }

.search-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  background: #FFFFFF;
  border: 2px solid var(--ink-navy);
  border-radius: 14px;
  padding: 0 8px 0 14px;
}
.search:focus-within { box-shadow: 0 0 0 3px rgba(178, 58, 46, .25); }

.search-icon { flex: none; width: 22px; height: 22px; }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 18px;
  color: var(--ink-navy);
  padding: 0;
}
.search input::placeholder { color: #8E8A80; opacity: 1; transition: opacity .25s; }
.search input.fade::placeholder { opacity: 0; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.mic {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--ink-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.mic svg { width: 20px; height: 20px; }
.mic.listening { background: var(--seal-red); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(178, 58, 46, .2); } }

.search-hint { margin: 6px 2px 0; font-size: 13px; color: var(--sub); }

/* ③ 큰 버튼 2개 */
.choices {
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--ink-navy);
  -webkit-tap-highlight-color: transparent;
}
.choice:active .choice-seal { transform: scale(.97); }

.choice-seal {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  transition: transform .12s;
}

.choice-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  min-height: 44px;
}
.choice-label strong {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.3;
}
.choice-label span { font-size: 13px; color: var(--sub); }

/* ④ TOP 5 */
.top5 { padding-top: 20px; display: flex; flex-direction: column; gap: 6px; }

.top5 h2 { margin: 0; font-size: 17px; font-weight: 700; }

.top5 ol { list-style: none; margin: 0; padding: 0; }

.top5 a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.top5 a:active { background: rgba(178, 58, 46, .06); }

.rank {
  width: 22px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 18px;
  color: var(--seal-red);
}
.name { flex: 1; font-size: 16px; }
.kind { font-size: 13px; color: var(--sub); }

/* ⑤ 광고 자리 */
.ad-slot {
  margin-top: 24px;
  height: 56px;
  background: var(--ad);
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ⑥ 푸터: 글자 작게, 띠 가늘게 (누르는 범위는 위아래로 넓혀 44px 유지) */
.footer {
  background: var(--footer);
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  /* PC에서도 갈색 띠가 화면 양끝까지 이어지게 */
  box-shadow: 0 0 0 100vmax var(--footer);
  clip-path: inset(0 -100vmax);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}
.footer-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 44px;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}
.footer-links a::before { content: ""; position: absolute; inset: -7px 0; }
.footer-links .bar { width: 1px; height: 12px; background: #6B5F55; flex: none; }

.copyright { margin: 0; font-size: 11px; line-height: 1.4; color: #B9AEA3; }
.ddlab { color: var(--accent); }

@media (max-width: 380px) {
  .footer-links { gap: 7px; font-size: 12.5px; }
}

/* 알림 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  background: var(--ink-black);
  color: #FFFFFF;
  font-size: 17px;
  padding: 14px 20px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 준비 중 페이지 */
.sub-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-navy);
  border-radius: 10px;
}
.back:active { background: rgba(31, 42, 68, .06); }

.sub-main { flex: 1; padding: 32px 20px; text-align: center; font-size: 17px; }
.sub-main h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 28px;
  margin: 0 0 16px;
  color: var(--ink-black);
}
.sub-main p { margin: 0 0 12px; color: var(--sub); }
.soon-stamp {
  display: inline-block;
  margin: 8px 0 24px;
  padding: 6px 14px;
  border: 3px solid var(--seal-red);
  color: var(--seal-red);
  font-family: var(--serif);
  font-weight: 900;
  font-size: 22px;
  transform: rotate(-4deg);
  border-radius: 4px;
}
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  margin-top: 16px;
  background: var(--ink-navy);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
