/* ==========================================================================
   겜파인더 스타일
   디자인 결정(한 줄 이유):
   - 색: 약국 초록(핵심) + 인주 빨강(강조 1개, 도장과 1위 표시에만). '약국 처방전' 콘셉트를 색으로 바로 읽히게 하려고
   - 배경: 차가운 회녹색 종이. 처방전 종이 느낌을 내되 흔한 베이지 톤은 피했다
   - 글꼴: Pretendard. 한글 본문 가독성이 가장 안정적이고, 굵기 축이 넓어 제목도 같은 글꼴로 처리할 수 있다
   - 모서리: 카드 14px / 버튼·입력 10px / 칩만 완전 둥글게. 이 규칙을 화면 전체에 그대로 쓴다
   - 모션: 상태가 바뀌는 순간(문항 전환, 진행 캡슐, 도장, 막대 증가)에만 쓴다. 움직임 최소화 설정이면 모두 끈다
   ========================================================================== */

:root {
  --bg: #f3f5f2;          /* 페이지 배경 */
  --paper: #fdfefc;       /* 처방전·카드 종이 */
  --ink: #16201b;         /* 본문 글자 */
  --ink-2: #4a5650;       /* 보조 글자(배경 대비 7:1 이상) */
  --line: #d3dbd5;        /* 구분선 */
  --green: #17633f;       /* 핵심 색: 버튼·막대 */
  --on-green: #f6fbf8;    /* 초록 위 글자 */
  --green-soft: #e1ede5;  /* 선택된 보기 배경 */
  --red: #c4372a;         /* 강조 색: 도장·1위 */
  --shadow: 0 1px 0 rgb(22 32 27 / .04), 0 12px 32px -18px rgb(22 50 35 / .35);
  --r-card: 14px;
  --r-btn: 10px;
  --wrap: 1120px;
  color-scheme: light;
}

/* 시스템이 다크 모드이고 사용자가 라이트를 고르지 않았을 때 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121614; --paper: #1a201d; --ink: #e9eeea; --ink-2: #a9b4ae; --line: #2e3833;
    --green: #56c28c; --on-green: #0c1a12; --green-soft: #1e3127; --red: #ff6f5e;
    --shadow: 0 1px 0 rgb(0 0 0 / .3), 0 16px 36px -20px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
/* 사용자가 토글로 다크를 고른 경우(시스템 설정과 무관) */
:root[data-theme="dark"] {
  --bg: #121614; --paper: #1a201d; --ink: #e9eeea; --ink-2: #a9b4ae; --line: #2e3833;
  --green: #56c28c; --on-green: #0c1a12; --green-soft: #1e3127; --red: #ff6f5e;
  --shadow: 0 1px 0 rgb(0 0 0 / .3), 0 16px 36px -20px rgb(0 0 0 / .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;          /* 한글 단어 중간에서 줄이 끊기지 않게 */
  overflow-wrap: anywhere;       /* 긴 영문 게임 제목은 어디서든 끊어 넘치지 않게 */
}
img { max-width: 100%; display: block; }
.ic { width: 1.1em; height: 1.1em; flex: none; }
/* 큰 대표 이미지: 다 받아진 뒤에만 서서히 보인다(app.js setImage). 받는 중·실패 시 깨진 아이콘·대체 텍스트 대신 틀의 배경색만 보인다 */
.fade-img { opacity: 0; transition: opacity .25s ease; }
.fade-img.is-loaded { opacity: 1; }   /* 인라인 SVG 아이콘: 글자 크기를 따라간다 */
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

/* 키보드 사용자를 위한 포커스 표시. outline 을 지우지 않고 더 잘 보이게 바꾼다 */
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }

/* ── 상단 ────────────────────────────────────────────────────── */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; }
/* 약국 간판의 초록 '약' 자. 로고가 아니라 워드마크 옆의 글자 표지다 */
.brand-cross {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  background: var(--green); color: var(--on-green); border-radius: 7px; font-size: 15px; font-weight: 800;
}
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav a { text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: var(--r-btn); color: var(--ink-2); }
.top-nav a:hover { color: var(--ink); background: var(--green-soft); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none;
  color: var(--ink-2); border-radius: var(--r-btn); font-size: 20px; cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: var(--green-soft); }

/* ── 버튼 ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-btn);
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--on-green); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--green-soft); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px;
  border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--r-btn);
}
.link-btn:hover { color: var(--ink); }
.link-btn[disabled] { visibility: hidden; }

/* ── 첫 화면 ─────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1.35fr .9fr; gap: 56px; align-items: center;
  padding-top: 72px; padding-bottom: 80px;
}
.eyebrow { color: var(--green); font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); font-weight: 800; letter-spacing: -0.035em; }
.hero-sub { margin-top: 20px; font-size: 18px; color: var(--ink-2); max-width: 30em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

/* 오늘의 1위 처방 카드. 살짝 기울여 책상 위 처방전처럼 보이게 했다(정체성 모티프) */
.today {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: 20px; transform: rotate(1.2deg);
}
.today-title { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 14px; }
.today-img { display: block; aspect-ratio: 3 / 2; width: 100%; overflow: hidden; border-radius: 10px; background: var(--green-soft); }
.today-img img { width: 100%; height: 100%; object-fit: cover; }
.today-name { display: block; margin-top: 14px; font-size: 20px; font-weight: 800; }
.today-meta { display: block; margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.today-empty { padding: 28px 4px; color: var(--ink-2); }
.today-empty strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* 로딩 자리표시(최종 모양과 같은 틀) */
.skel { background: var(--green-soft); border-radius: 10px; }
.skel-img { aspect-ratio: 3 / 2; }
.skel-line { height: 22px; width: 60%; margin-top: 14px; }

/* ── 랭킹 ────────────────────────────────────────────────────── */
.ranking { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 72px 0; scroll-margin-top: 64px; }
.ranking-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; }
.ranking-head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
.tabs button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--green); color: var(--on-green); }
.ranking-total { margin-top: 10px; color: var(--ink-2); font-size: 15px; min-height: 1.6em; }
.ranking-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; margin-top: 28px; }
.ranking-grid h3 { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.rank-side { display: grid; gap: 36px; align-content: start; }

/* 게임 순위: 1위만 크게(초점 하나), 나머지는 촘촘한 목록 */
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
/* 순위 한 줄 = 버튼 하나. 줄 아무 데나 눌러도 게임 정보 레이어가 열린다 */
.g-row, .rd-row, .today-open {
  width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  cursor: pointer; border-radius: 10px; transition: background-color .15s ease;
}
.g-row:hover, .rd-row:hover { background: var(--green-soft); }
.today-open:hover .today-name { text-decoration: underline; text-underline-offset: 4px; }
.game-list .g-row { display: grid; grid-template-columns: 28px 64px 1fr auto; align-items: center; gap: 14px; padding: 8px 6px; }
.game-list .rank-no { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: center; }
.game-list img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--green-soft); }
.game-list .g-name { font-weight: 700; line-height: 1.35; }
.game-list .g-sub { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.game-list .g-count { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.game-list li.first { padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.game-list li.first .g-row { grid-template-columns: 28px 120px 1fr auto; }
.game-list li.first img { width: 120px; height: 80px; }
.game-list li.first .rank-no { color: var(--red); font-size: 20px; }
.game-list li.first .g-name { font-size: 19px; }

/* 장르·기기 막대: 바탕 트랙 없이 막대와 숫자만 */
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-list li { display: grid; grid-template-columns: 7.5em 1fr 3.2em; align-items: center; gap: 12px; font-size: 15px; }
.bar-list .b-label { font-weight: 600; }
.bar-list .b-track { min-width: 0; }   /* 막대만 담는 칸. 숫자는 오른쪽 칸에 따로 둬서 1위 막대가 숫자를 밀어내지 않게 한다 */
.bar-list .b-bar {
  display: block; height: 12px; border-radius: 3px; background: var(--green); min-width: 4px;
  transform-origin: left center; animation: grow .6s cubic-bezier(.16, 1, .3, 1) both;
}
.bar-list li:first-child .b-bar { background: var(--red); }
.bar-list .b-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; }
@keyframes grow { from { transform: scaleX(0); } }
.empty-row { color: var(--ink-2); padding: 12px 0; list-style: none; }
/* 빈 상태 줄은 순위 칸 나누기(grid)를 쓰지 않는다. '.game-list li' 의 4칸 grid 가 그대로 걸리면
   문장이 28px 첫 칸에 갇혀 한 단어씩 줄이 바뀐다(2026-10-14 운영에서 발견) */
.game-list li.empty-row, .bar-list li.empty-row { display: block; }
.game-list li.empty-row {
  padding: 28px 24px; border: 1px dashed var(--line); border-radius: var(--r-card); text-align: center;
}
.game-list li.empty-row .btn { margin-top: 14px; }
.retry { margin-top: 8px; }

/* 전체 순위 버튼 */
.rank-more { margin-top: 16px; }

/* ── 전체 순위 레이어(dialog) ────────────────────────────────── */
/* 패딩을 dialog 자신이 아니라 안쪽 요소에 둔다. 바깥(배경) 클릭 판정이 'target === dialog' 라서,
   dialog 에 패딩이 있으면 안쪽 여백을 눌러도 닫혀 버린다 */
.rank-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: min(80dvh, 820px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow); overflow: hidden;
}
.rank-dialog[open] { display: flex; flex-direction: column; animation: rd-in .25s cubic-bezier(.16, 1, .3, 1); }
@keyframes rd-in { from { opacity: 0; transform: translateY(12px); } }
.rank-dialog::backdrop { background: rgb(10 16 13 / .55); }
html:has(.rank-dialog[open]) { overflow: hidden; }   /* 레이어가 열린 동안 뒤쪽 페이지가 같이 스크롤되지 않게 */
.rd-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 22px 20px 16px 24px; border-bottom: 2px dashed var(--line);
}
.rd-head h2 { font-size: 22px; font-weight: 800; }
.rd-sub { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.rd-list { list-style: none; margin: 0; padding: 8px 24px 20px; overflow-y: auto; overscroll-behavior: contain; }
.rd-list .rd-row { display: grid; grid-template-columns: 32px 72px 1fr auto; align-items: center; gap: 14px; padding: 10px 6px; }
.rd-list li + li { border-top: 1px solid var(--line); }
.rd-rank { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: center; }
.rd-list li.rd-top .rd-rank { color: var(--red); }   /* 1~3위만 인주 빨강 */
.rd-list img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--green-soft); }
.rd-info { min-width: 0; }
.rd-title { display: block; font-weight: 700; line-height: 1.35; }
.rd-meta { display: block; font-size: 13px; color: var(--ink-2); }
.rd-num { display: grid; justify-items: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-num strong { font-size: 15px; }
.rd-num span { font-size: 13px; color: var(--ink-2); }

/* ── 게임 정보 레이어 ───────────────────────────────────────── */
.game-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: min(88dvh, 900px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow); overflow: hidden;
}
.game-dialog[open] { display: flex; flex-direction: column; animation: rd-in .25s cubic-bezier(.16, 1, .3, 1); }
.game-dialog::backdrop { background: rgb(10 16 13 / .55); }
html:has(.game-dialog[open]) { overflow: hidden; }
.gd-scroll { overflow-y: auto; overscroll-behavior: contain; }
.gd-close { position: absolute; top: 10px; right: 10px; z-index: 1; background: var(--paper); box-shadow: var(--shadow); }
.gd-img-wrap { aspect-ratio: 3 / 2; background: var(--green-soft); }
.gd-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.gd-body { padding: 22px 24px 26px; }
.gd-body h2 { font-size: 26px; font-weight: 800; margin-top: 4px; }
.gd-orig { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.gd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 20px 0 0; }
.gd-facts div { border-top: 2px dashed var(--line); padding-top: 10px; }
.gd-facts dt { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.gd-facts dd { margin: 2px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.gd-traits { margin-top: 20px; }
.gd-state { margin-top: 16px; color: var(--ink-2); min-height: 0; }
.gd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.gd-note { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.skel-text { display: inline-block; width: 60%; height: 1em; border-radius: 6px; background: var(--green-soft); }

/* ── 복약 안내 ───────────────────────────────────────────────── */
.guide { padding: 72px 0 88px; scroll-margin-top: 64px; }
.guide-in { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.guide h2 { font-size: 26px; font-weight: 800; }
.guide-list { margin: 0; display: grid; gap: 28px; max-width: 46em; }
.guide-list dt { font-weight: 800; margin-bottom: 4px; }
.guide-list dd { margin: 0; color: var(--ink-2); }

/* 커피 후원 블록. QR 은 흰 바탕이 있어야 인식되므로 다크 모드에서도 흰 틀을 유지한다 */
.coffee {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; margin-top: 56px;
  padding: 24px; border: 1px dashed var(--line); border-radius: var(--r-card); max-width: 760px; scroll-margin-top: 80px;
}
.coffee-qr { width: 160px; height: 160px; padding: 8px; background: #fff; border-radius: 10px; }
.coffee h3 { font-size: 20px; font-weight: 800; }
.coffee p { margin-top: 6px; color: var(--ink-2); }
.coffee-link { margin-top: 14px; }

/* ── 문진 ────────────────────────────────────────────────────── */
.survey { min-height: calc(100dvh - 64px); padding: 24px 0 64px; }
.survey-in { max-width: 720px; }
.survey-bar { display: flex; align-items: center; justify-content: space-between; }
.survey-count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* 캡슐 20개: 반은 초록, 반은 종이색인 알약 모양. 답하면 채워진다 */
.capsules { display: grid; grid-template-columns: repeat(20, 1fr); gap: 5px; margin: 14px 0 36px; }
.capsules span {
  height: 12px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent;
  transition: background-color .25s ease, border-color .25s ease;
}
.capsules span.on { border-color: var(--green); background: linear-gradient(90deg, var(--green) 50%, var(--paper) 50%); }
.capsules span.now { border-color: var(--green); }

.q-card { animation: q-in .35s cubic-bezier(.16, 1, .3, 1); }
@keyframes q-in { from { opacity: 0; transform: translateY(10px); } }
.q-hint { color: var(--green); font-weight: 700; font-size: 15px; min-height: 1.6em; }
.q-text { font-size: clamp(24px, 3.6vw, 32px); font-weight: 800; margin-top: 8px; outline: none; }
.q-options { display: grid; gap: 10px; margin-top: 28px; }
.q-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 12px 18px;
  text-align: left; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-btn); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.q-opt:hover { border-color: var(--green); }
.q-opt .key {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.q-opt[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.q-opt[aria-pressed="true"] .key { background: var(--green); color: var(--on-green); border-color: var(--green); }
.q-next { margin-top: 20px; }
.q-error { margin-top: 14px; color: var(--red); font-weight: 600; min-height: 1.6em; }

/* ── 조제 중 ─────────────────────────────────────────────────── */
.brewing { min-height: calc(100dvh - 64px); display: grid; place-items: center; }
.brewing-in { text-align: center; padding: 64px 20px; }
.brewing h2 { font-size: 26px; font-weight: 800; margin-top: 28px; }
.brewing-step { margin-top: 8px; color: var(--ink-2); min-height: 1.6em; }
/* 알약 하나가 천천히 도는 표시. 조제(대기) 중이라는 상태를 알려 주는 용도 */
.pill-spin { display: inline-flex; width: 84px; height: 34px; border-radius: 999px; overflow: hidden; border: 2px solid var(--green); animation: spin 1.6s ease-in-out infinite; }
.pill-spin span { flex: 1; }
.pill-spin span:first-child { background: var(--green); }
@keyframes spin { 50% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }

/* ── 처방전 ──────────────────────────────────────────────────── */
.result { padding: 40px 0 80px; }
.result-in { max-width: 760px; }
.rx {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: 28px 28px 32px;
}
/* 처방전 윗단: 점선으로 뜯는 선을 표현 */
.rx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 16px; border-bottom: 2px dashed var(--line); }
.rx-head h2 { font-size: 28px; font-weight: 800; letter-spacing: .3em; }
.rx-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.rx-diag { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 0; padding-right: 96px; }   /* 오른쪽은 도장 자리 */
.rx-diag dt { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.rx-diag dd { margin: 2px 0 0; font-weight: 700; }
.rx-game { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; margin-top: 24px; align-items: start; }
.rx-img-wrap { border-radius: 10px; overflow: hidden; background: var(--green-soft); aspect-ratio: 3 / 2; }
.rx-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.rx-label { font-size: 13px; font-weight: 700; color: var(--green); }
.rx-title { font-size: 26px; font-weight: 800; margin-top: 4px; }
.rx-orig { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; }
.rx-guide { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.rx-reason { margin-top: 6px; font-size: 17px; line-height: 1.75; max-width: 40em; }
.rx-by { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
/* 인주 도장. 결과가 나오는 순간 한 번 '쾅' 찍힌다(완료 피드백) */
.stamp {
  position: absolute; right: 24px; top: 74px; width: 84px; height: 84px; display: grid; place-items: center;
  border: 3px solid var(--red); border-radius: 50%; color: var(--red); font-weight: 800; font-size: 17px; line-height: 1.15;
  text-align: center; transform: rotate(-14deg); opacity: .85; pointer-events: none;
  animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1) .25s both;
}
@keyframes stamp { from { opacity: 0; transform: rotate(-14deg) scale(1.8); } }
.rx-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* 처방전 나눠 주기: 처방전 바로 아래 한 줄. 결과를 퍼 나르는 사람이 곧 유입 경로라 다른 버튼보다 앞에 둔다 */
.share { margin-top: 24px; padding: 18px 20px 16px; border: 1px dashed var(--line); border-radius: var(--r-card); }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.share-note { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.btn[aria-busy="true"] { cursor: progress; opacity: .7; }
.toast { margin-top: 12px; color: var(--green); font-weight: 700; min-height: 1.6em; }

/* ── 안내 화면 ───────────────────────────────────────────────── */
.notice { min-height: calc(100dvh - 64px - 140px); display: grid; align-items: center; }
.notice-in { max-width: 640px; padding-top: 64px; padding-bottom: 64px; }
.notice h1, .notice h2 { font-size: clamp(26px, 3.6vw, 34px); font-weight: 800; }
.notice .eyebrow { margin: 0 0 8px; color: var(--green); font-size: 15px; }   /* 404 화면의 '404' 표시 */
.notice p { margin-top: 12px; color: var(--ink-2); font-size: 17px; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ── 바닥글 ──────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--ink-2); }
.foot-in { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; }
.foot-brand { color: var(--ink); font-weight: 800; margin-right: auto; }
.foot-brand span { font-weight: 500; color: var(--ink-2); margin-left: 8px; }

/* ── 태블릿 이하: 한 줄로 쌓는다 ─────────────────────────────── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; padding-bottom: 56px; }
  .today { transform: none; }
  .ranking { padding: 52px 0; }
  .ranking-grid { grid-template-columns: 1fr; gap: 40px; }
  .guide-in { grid-template-columns: 1fr; gap: 20px; }
  .coffee { grid-template-columns: 1fr; justify-items: start; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .top-nav a[data-go="guide"] { display: none; }   /* 좁은 화면에서는 메뉴를 하나로 줄여 한 줄을 지킨다 */
  .hero-cta .btn { flex: 1 1 100%; }
  .capsules { gap: 3px; }
  .rx { padding: 20px 18px 28px; }
  .rx-head h2 { font-size: 22px; letter-spacing: .2em; }
  .rx-diag, .rx-game { grid-template-columns: 1fr; }
  .stamp { width: 64px; height: 64px; font-size: 13px; right: 14px; top: 64px; }
  .rx-diag { padding-right: 72px; }
  .rx-actions .btn { flex: 1 1 100%; }
  .share { padding: 16px 14px 14px; }
  .share-row .btn { flex: 1 1 calc(50% - 5px); padding: 0 12px; }   /* 공유 버튼은 두 개씩 한 줄 */
  .game-list .g-row, .game-list li.first .g-row { grid-template-columns: 24px 56px 1fr auto; gap: 10px; }
  .game-list img, .game-list li.first img { width: 56px; height: 40px; }
  .bar-list li { grid-template-columns: 6em 1fr 3em; }
  .rank-dialog { max-height: 86dvh; }
  .rd-head { padding: 18px 12px 14px 18px; }
  .rd-list { padding: 4px 18px 16px; }
  .rd-list .rd-row { grid-template-columns: 26px 56px 1fr auto; gap: 10px; }
  .gd-body { padding: 18px 18px 22px; }
  .rd-list img { width: 56px; height: 38px; }
}

/* 움직임 최소화 설정: 모든 애니메이션·전환을 끈다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
