/* 오징어 운세 — 공통 스타일
 * 색은 모두 변수. 스킨을 고르면 skins.js 가 --bg, --accent 등을 바꿔 끼운다.
 * 브레이크포인트: 모바일 기본, 768px 이상 PC 배치.
 */
:root {
  --bg: #EAF7FB;
  --bg2: #D3EEF6;
  --surface: #FFFFFF;
  --ink: #3A2E2C;
  --ink-soft: #6F625E;
  --line: #6A4A3A;
  --accent: #3FA9D6;
  --accent-ink: #FFFFFF;
  --machine: #A8DDF0;
  --machine-dark: #6BBBD9;
  --reel-bg: #FFFFFF;
  --coin: #FFCF4A;
  --coin-dark: #E0A422;

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --gap: 16px;
  --pad: 16px;
  --shadow: 0 4px 0 rgba(58, 46, 44, .08), 0 12px 28px rgba(58, 46, 44, .10);
  /* 글꼴 역할: 타이틀(큰 제목·운 이름·총운·결론) = 고운바탕 굵게 / 캐릭터 이름 = 주아(여기서만)
     / 결과 단계(대박 등) = 고운돋움 / 설명 = 연성 / 버튼·상단·진지한 곳 = 프리텐다드 굵게 */
  --font-head: 'Gowun Batang', 'Gowun Dodum', serif;
  --head-weight: 700;
  --font-name: 'Jua', 'Gowun Dodum', sans-serif;
  --font-title: 'Gowun Dodum', 'Malgun Gothic', serif;
  --font-body: 'Yeon Sung', 'Gowun Dodum', 'Malgun Gothic', sans-serif;
  --font-serious: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all; /* 한글 단어 중간에서 줄바꿈하지 않게 */
  overflow-wrap: anywhere;
  color: var(--ink);
  background: radial-gradient(120% 80% at 50% 0%, var(--bg) 0%, var(--bg2) 100%) fixed;
  transition: background .4s var(--ease-out);
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); line-height: 1.25; margin: 0; }

/* 물방울 배경 (장식) */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 12% 78%, rgba(255,255,255,.55) 0 10px, transparent 11px),
    radial-gradient(circle at 18% 70%, rgba(255,255,255,.45) 0 5px, transparent 6px),
    radial-gradient(circle at 88% 30%, rgba(255,255,255,.5) 0 14px, transparent 15px),
    radial-gradient(circle at 92% 20%, rgba(255,255,255,.4) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 88%, rgba(255,255,255,.45) 0 8px, transparent 9px);
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 상단 바 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 64px;
}
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { height: 36px; width: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 6px; /* 2026-11-27: 상단 요소 높이 32px로 통일 */
  background: var(--surface); border-radius: 999px;
  box-shadow: var(--shadow);
  font-family: var(--font-serious); font-weight: 700; font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.pill .coin-ico { width: 20px; height: 20px; }
/* 오늘 코인: 있으면 불 켜짐(.on), 쓰면 회색 */
.coin-pill { font-size: 13px; color: var(--ink-soft); }
.coin-pill .coin-ico { filter: grayscale(1) opacity(.45); transition: filter .4s; }
.coin-pill.on { color: var(--ink); box-shadow: var(--shadow), 0 0 0 2px var(--coin), 0 0 14px rgba(255, 207, 74, .75); }
.coin-pill.on .coin-ico { filter: drop-shadow(0 0 4px rgba(255, 196, 40, .9)); }
.pill-join {
  height: 32px; padding: 0 12px; font-size: 14px; /* 2026-11-27: 상단 요소 높이 32px로 통일 */ border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  touch-action: manipulation;
}
.pill-signup { background: var(--surface); color: var(--accent); box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.pill-join:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* 소리 켜고 끄기(로그인·코인 옆 동그란 버튼, 높이는 옆 버튼과 같은 36px) */
.sound-btn {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); touch-action: manipulation;
}
.sound-btn.off { color: var(--ink-soft); opacity: .7; }
.sound-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sound-ico { width: 20px; height: 20px; }
/* 로고 옆 KO / EN */
.topbar-left { display: flex; align-items: center; gap: 10px; flex: none; }
.lang-toggle {
  display: inline-flex; padding: 2px; border-radius: 999px;
  background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1.5px rgba(106, 74, 58, .18);
}
.lang-toggle button {
  height: 24px; min-width: 30px; padding: 0 7px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-soft);
  font-family: var(--font-serious); font-weight: 700; font-size: 11px; letter-spacing: .02em; line-height: 1;
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; cursor: default; }
.lang-toggle button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.logo, .pill { flex: none; white-space: nowrap; }
.streak { min-width: 0; overflow: hidden; }
/* 상단 'OO님 · N일째 출석' 한 줄, 고딕 */
.streak { display: flex; align-items: baseline; white-space: nowrap; font-family: var(--font-serious); font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.streak b { display: inline-block; max-width: 5em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; font-weight: 700; color: var(--ink); }
.streak-day::before { content: '·'; margin: 0 4px; }
/* 'OO님 · N일째 출석'을 누르면 출석 달력 */
button.streak {
  border: 0; background: none; padding: 6px 8px; margin: 0 -2px 0 0; border-radius: 10px; cursor: pointer;
  align-items: center; line-height: 1.2; transition: background .2s;
}
button.streak:hover { background: rgba(255, 255, 255, .7); }
button.streak:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.cal-ico { width: 14px; height: 14px; margin-left: 5px; flex: none; color: var(--ink-soft); }
.streak b { flex: none; } /* 좁을 땐 닉네임 대신 'N일째 출석'이 줄어듦 */
.streak-day { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 모바일: 첫 줄 = 로고 + KO/EN, 둘째 줄 = 닉네임·출석(왼쪽) + 코인(오른쪽) */
@media (max-width: 767px) {
  .topbar { flex-wrap: wrap; height: auto; row-gap: 6px; padding-top: 12px; padding-bottom: 4px; }
  .topbar-left { width: 100%; justify-content: space-between; } /* KO/EN은 첫 줄 오른쪽 끝 */
  .topbar-right { width: 100%; justify-content: flex-end; }
  .topbar-right .streak { margin-right: auto; } /* 닉네임은 왼쪽, 코인·소리 버튼은 오른쪽 */
  .topbar-right.guest { justify-content: flex-end; } /* 로그인 전: 로그인 버튼은 오른쪽 */
  .logo img { height: 48px; } /* 모바일 로고(한·영) 크게 */
  button.streak { margin-left: -8px; } /* 글자 왼쪽 끝을 로고 왼쪽 끝에 맞춤(안쪽 여백만큼) */
  .streak b { max-width: 8em; }
}

/* 출석 달력 창 */
.att-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.att-sum div { background: var(--bg); border-radius: var(--r-sm); padding: 10px 4px 9px; text-align: center; font-family: var(--font-serious); }
.att-sum b { display: block; font-weight: 800; font-size: 22px; line-height: 1.2; }
.att-sum span { display: block; font-weight: 600; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-family: var(--font-serious); }
.cal-head strong { font-weight: 800; font-size: 17px; }
.cal-nav {
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0 0 3px;
  border: 0; border-radius: 50%; background: var(--bg); color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.cal-nav[disabled] { opacity: .3; cursor: default; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-week { margin-bottom: 5px; }
.cal-week span { text-align: center; font-family: var(--font-serious); font-weight: 700; font-size: 12px; color: var(--ink-soft); }
.cal-week span:first-child { color: #D9534F; }
.cal-cell {
  aspect-ratio: 1; border-radius: 10px; background: #F7F2F0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-family: var(--font-serious);
}
.cal-empty { background: none; }
.cal-d { font-style: normal; font-weight: 600; font-size: 12px; line-height: 1; color: var(--ink-soft); }
.cal-cell.on { background: var(--bg2, #FFE9A8); box-shadow: inset 0 0 0 2px var(--line); }
.cal-cell.on .cal-d { font-size: 10px; color: var(--ink); }
/* 운세 본 날은 그날 총운 단계 색(결과 화면 캡슐과 같은 색) */
.cal-cell.on.lv-5 { background: #FFD45C; }
.cal-cell.on.lv-4 { background: #FFE9A8; }
.cal-cell.on.lv-3 { background: #FFFFFF; }
.cal-cell.on.lv-2 { background: #E3E8F0; }
.cal-cell.on.lv-1 { background: #C9D0DC; }
.cal-sc { font-weight: 800; font-size: 15px; line-height: 1; color: var(--ink); }
.cal-cell.today { outline: 2px dashed var(--accent); outline-offset: 1px; }
.cal-foot { margin: 12px 0 0; text-align: center; font-family: var(--font-serious); font-weight: 600; font-size: 12px; color: var(--ink-soft); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-serious); font-weight: 800; font-size: 18px; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), filter .2s;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn:focus-visible, .theme-card:focus-visible, .lever-hit:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* =========================================================
 * ① 테마 선택
 * ========================================================= */
.hero { text-align: center; padding: 24px 0 28px; }
.hero h1 { font-size: 30px; text-wrap: balance; }
.hero p { margin: 8px 0 0; color: var(--ink-soft); }

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; margin-bottom: 20px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.notice p { margin: 0; text-wrap: balance; }
.notice .btn { flex: none; white-space: nowrap; }   /* 버튼 글자가 두 줄로 꺾이지 않게(설명 글이 대신 줄바꿈) */

.theme-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: 1fr;
}
.theme-card {
  --c-bg: #fff; --c-bg2: #eee; --c-accent: #999;
  display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 16px;
  padding: 16px; border: 0; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow);
  text-align: left; cursor: pointer;
  /* 등장은 CSS 애니메이션(translate·scale, 끝나면 사라짐), 마우스 반응은 transform 으로 나눠 서로 부딪치지 않게 */
  transition: transform .2s var(--ease-out);
  animation: card-in .45s cubic-bezier(.3, 1.4, .5, 1) backwards;
}
.theme-card:nth-child(2) { animation-delay: .08s; }
.theme-card:nth-child(3) { animation-delay: .16s; }
.theme-card:nth-child(4) { animation-delay: .24s; }
@keyframes card-in { from { opacity: 0; translate: 0 16px; scale: .96; } }
.theme-card:hover { transform: translateY(-4px); }
.theme-card:active { transform: scale(.98); }
.theme-art {
  width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--c-bg) 0%, var(--c-bg2) 100%);
  display: grid; place-items: center; overflow: hidden;
}
.theme-art img, .theme-art svg { width: 86%; height: 86%; object-fit: contain; }
.theme-info h2 { font-family: var(--font-name); font-weight: 400; font-size: 22px; }
.theme-info p { margin: 4px 0 10px; color: var(--ink-soft); font-size: 15px; }
.theme-go {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border-radius: 999px; background: var(--c-accent); color: #fff;
  font-family: var(--font-serious); font-weight: 700; font-size: 15px;
}

/* 가입 창 */
.modal {
  border: 0; padding: 0; border-radius: var(--r-lg); width: min(420px, calc(100% - 32px));
  box-shadow: 0 24px 60px rgba(0,0,0,.25); color: var(--ink);
}
.modal::backdrop { background: rgba(40, 30, 30, .45); }
.modal-in { position: relative; padding: 24px; }
.modal-x {
  position: absolute; right: 10px; top: 19px; width: 40px; height: 40px; /* 가운데를 제목 줄 가운데에 맞춤 */
  display: grid; place-items: center; padding: 0 0 4px; border: 0; border-radius: 50%; /* 고딕 × 글자 가운데를 제목 글자 가운데에 맞춤(실측) */
  background: transparent; color: var(--ink-soft); font-family: var(--font-serious); font-weight: 400; font-size: 26px; line-height: 1; cursor: pointer;
}
.modal-x:hover { background: var(--bg); }
/* 가입창은 주아체를 쓰지 않음: 제목·버튼 = 프리텐다드 굵게 */
.modal h2 { font-family: var(--font-serious); font-weight: 800; font-size: 24px; text-align: center; }
/* 가입창 아래 '이미 회원이면 로그인 / 처음이면 신규가입' 바꾸기 글자 */
.join-switch { margin: 14px 0 0; text-align: center; font-family: var(--font-serious); font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.join-switch button { border: 0; background: none; padding: 4px 2px; cursor: pointer; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.modal .lead { text-wrap: balance; text-align: center; color: var(--ink-soft); margin: 6px 0 18px; font-size: 15px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-family: var(--font-serious); font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 14px;
  border: 2px solid #E6DCD8; border-radius: var(--r-sm);
  font: inherit; font-family: var(--font-serious); font-weight: 700; background: #FFFCFB;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field small { display: block; font-family: var(--font-serious); font-weight: 700; margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
.check { font-family: var(--font-serious); font-weight: 700; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 6px 0 18px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.err { font-family: var(--font-serious); font-weight: 700; color: #C0392B; font-size: 14px; min-height: 20px; margin: -6px 0 8px; }
.modal .btn { width: 100%; font-family: var(--font-serious); font-weight: 700; }

[hidden] { display: none !important; }   /* .btn·grid 등 display 를 정한 요소도 hidden 이면 숨김 */

/* 카카오·구글 로그인 버튼(각 회사 버튼 색 규칙: 카카오 #FEE500 + 검정 85%, 구글 흰 바탕 + 회색 테두리) */
.auth-btns { display: grid; gap: 10px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px;
  border-radius: 12px; border: 0; cursor: pointer; font-family: var(--font-serious); font-weight: 700; font-size: 15px;
}
.auth-btn svg { width: 20px; height: 20px; flex: none; }
.auth-btn:disabled { opacity: .6; cursor: wait; }
.auth-kakao { background: #FEE500; color: rgba(0, 0, 0, .85); }
.auth-google { background: #fff; color: #1F1F1F; box-shadow: inset 0 0 0 1px #DADCE0; }
.auth-note { margin: 4px 0 0; text-align: center; font-size: 12px; color: var(--ink-soft); }
.link-notice { flex-wrap: wrap; }
.link-notice p { margin: 0; flex: 1 1 240px; }
.link-btns { display: flex; gap: 8px; }
.link-btns .auth-btn { width: auto; height: 40px; padding: 0 14px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: #fff; font-family: var(--font-serious); font-weight: 700; font-size: 16px;
  transition: opacity .3s, transform .3s var(--ease-out); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.dev {
  position: fixed; right: 12px; bottom: 12px; z-index: 95;
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: rgba(30, 24, 28, .88); border-radius: 12px;
}
.dev-badge { color: #FFD45C; font-size: 12px; font-weight: 700; padding: 0 6px; }
.dev button { font-size: 12px; min-height: 32px; padding: 0 10px; border-radius: 8px; border: 0; background: #fff; color: #222; cursor: pointer; }

/* =========================================================
 * ② 슬롯
 * ========================================================= */
.slot-page { display: flex; flex-direction: column; align-items: center; padding-bottom: 40px; }
.slot-title { text-align: center; margin: 4px 0 18px; }
.slot-title h1 { font-size: 26px; }
.slot-title p { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }
.slot-title .boost-chip { margin: 8px auto 0; } /* .slot-title p 의 margin 이 auto 를 덮어 왼쪽으로 쏠리던 것 */
/* 코인 슬롯·운세 슬롯·랭킹: 왼쪽 위(로고 아래) '돌아가기'(로고 말고도 나갈 길) */
main:has(> .page-back) { position: relative; }
.rank-page { --back-top: 15px; }
.page-back {
  position: absolute; top: var(--back-top, 8px); left: var(--pad); /* 세로 가운데를 제목(h1) 가운데에 맞춤 */ z-index: 2; padding: 6px 2px; /* 자리를 차지하지 않게 띄움 → 기계 크기·위치 그대로 */
  font-family: var(--font-serious); font-weight: 700; font-size: 14px; line-height: 1; color: var(--ink-soft); text-decoration: none;
}
.page-back:hover { color: var(--ink); }
@media (max-width: 767px) {   /* 모바일: 제목이 길면 '돌아가기'와 겹침 → 제목 위 한 줄로 */
  .page-back { position: static; display: block; width: fit-content; margin: 2px auto -4px 0; align-self: flex-start; }
}
.lucky-page .page-back { position: absolute; margin-top: 2px; }   /* 코인 슬롯은 제목을 빼서 겹칠 것이 없음 → 자리 차지 안 하게(PC·모바일) */
.page-back:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* 크기 기준: --tile(그림 한 칸). 나머지는 여기서 계산
 * 모바일: 2×2 배치 / PC(768px 이상): 1×4 배치
 * 가로 = 4(테두리)×2 + m-pad×2 + 칸 수×(tile + col-pad×2) + 간격 + 레버 */
.stage {
  --cols: 2;
  --rows: 2;
  --reel-gap: 10px;
  --col-pad: 6px;
  --label-h: 34px;
  --m-pad: 12px;
  --top-h: 64px;
  --lever-w: 40px;
  --tile: clamp(90px, calc((100vw - 32px - 40px - 8px - 24px - 24px - 10px) / 2), 150px);
  --col-h: calc(var(--tile) + var(--col-pad) + var(--label-h)); /* 위 여백 + 그림 + 이름표 */
  --reels-h: calc(var(--col-h) * var(--rows) + var(--reel-gap) * (var(--rows) - 1));
  /* 레버 높이 = 릴 묶음 세로 가운데 (테두리 4 + 간판 + 간격 12 + 릴 묶음 절반) */
  --reel-center: calc(4px + var(--top-h) + 12px + var(--reels-h) / 2);
  position: relative;
  padding-right: var(--lever-w);
}
.machine {
  position: relative;
  width: calc((var(--tile) + var(--col-pad) * 2) * var(--cols) + var(--reel-gap) * (var(--cols) - 1) + var(--m-pad) * 2 + 8px);
  background: var(--machine);
  border: 4px solid var(--line);
  border-radius: 32px 32px 24px 24px;
  box-shadow: inset 0 -10px 0 var(--machine-dark), 0 18px 34px rgba(58, 46, 44, .18);
  padding: 0 var(--m-pad) 18px;
}
.machine-top {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--top-h); margin: 0 calc(var(--m-pad) * -1) 12px;
  border-bottom: 4px solid var(--line);
  border-radius: 28px 28px 0 0;
  background: var(--accent);
  color: var(--accent-ink);
}
.machine-top .sign-art { width: 48px; height: 48px; margin-top: -18px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.12)); }
.machine-top .sign-art img, .machine-top .sign-art svg { width: 100%; height: 100%; object-fit: contain; }
.machine-top h2 { font-family: var(--font-name); font-weight: 400; font-size: 22px; letter-spacing: .02em; }

.reels {
  display: grid; gap: var(--reel-gap);
  grid-template-columns: repeat(var(--cols), auto);
}
.reel-col {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--col-pad) var(--col-pad) 0;
  background: var(--line); border-radius: var(--r-md);
}
.reel-window {
  width: var(--tile); height: var(--tile);
  background: var(--reel-bg);
  border-radius: var(--r-sm);
  box-shadow: inset 0 6px 8px -6px rgba(0,0,0,.35), inset 0 -6px 8px -6px rgba(0,0,0,.35);
}
.reel-window .slot-machine__tile {
  width: var(--tile); height: var(--tile);
  display: grid; place-items: center;
}
.reel-window .slot-machine__tile img,
.reel-window .slot-machine__tile svg { width: 88%; height: 88%; object-fit: contain; }

.reel-label {
  width: var(--tile); height: var(--label-h);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-serious); font-weight: 700; font-size: 15px; line-height: 1;
  color: rgba(255,255,255,.75);
}
.reel-label b { font-weight: 400; color: rgba(255,255,255,.45); }
.reel-label b.on { color: #FFD45C; }

.machine-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 10px 12px;
  background: rgba(255,255,255,.6); border-radius: var(--r-md);
}
.status { margin: 0; font-family: var(--font-serious); font-weight: 700; font-size: 16px; line-height: 1.35; }
.coin-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.slot-hole {
  width: 40px; height: 12px; border-radius: 999px;
  background: var(--line); box-shadow: inset 0 3px 0 rgba(0,0,0,.4);
  transition: box-shadow .3s;
}
.coin-slot.glow .slot-hole { box-shadow: inset 0 3px 0 rgba(0,0,0,.4), 0 0 0 4px var(--coin), 0 0 16px 4px var(--coin); }
.coin-slot span:last-child { font-size: 12px; color: var(--ink-soft); }

/* 레버 */
.lever {
  position: absolute; right: 0; top: 0; bottom: 0; width: var(--lever-w);
  pointer-events: none;
}
.lever {
  --base-h: 36px; --base-w: 22px; --arm-h: 92px; --arm-w: 10px;
}
.lever-base {
  position: absolute; left: -6px; top: calc(var(--reel-center) - var(--base-h) / 2);
  width: var(--base-w); height: var(--base-h); border-radius: 0 10px 10px 0;
  background: var(--machine-dark); border: 4px solid var(--line); border-left: 0;
}
.lever-arm {
  position: absolute; width: var(--arm-w);
  left: calc(-6px + var(--base-w) / 2 - var(--arm-w) / 2);
  top: calc(var(--reel-center) - var(--arm-h)); height: var(--arm-h);
}
.lever-rod {
  position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(90deg, #D9D9DE, #FFFFFF 40%, #B9B9C2);
  border: 3px solid var(--line);
}
.lever-knob {
  position: absolute; left: 50%; top: -14px; width: 34px; height: 34px; margin-left: -17px;
  border-radius: 50%; border: 4px solid var(--line);
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0 4px, var(--accent) 5px);
}
.lever-hit {
  position: absolute; right: -8px; width: 60px;
  top: calc(var(--reel-center) - var(--arm-h) - 28px); height: calc(var(--arm-h) * 2 + 56px);
  background: transparent; border: 0; border-radius: 20px;
  pointer-events: auto; cursor: grab; touch-action: none;
}
.lever-hit[disabled] { cursor: default; }
.lever.ready .lever-knob { animation: knob-pulse 1.2s ease-in-out infinite; }
@keyframes knob-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.0); transform: scale(1); }
  50% { box-shadow: 0 0 0 8px rgba(255,255,255,.55); transform: scale(1.08); }
}

/* 칸 멈춤 효과 */
.reel-col { position: relative; }
.reel-window { position: relative; z-index: 1; transition: box-shadow .4s; }
.reel-window.glow-5 { box-shadow: 0 0 0 3px #FFD45C, 0 0 18px 6px rgba(255, 212, 92, .85); }
.reel-window.glow-4 { box-shadow: 0 0 0 3px #FFE9A8, 0 0 12px 3px rgba(255, 233, 168, .7); }
.fx-layer { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - var(--label-h)); pointer-events: none; z-index: 2; }
.reel-window { overflow: hidden; }
.reel-window .slot-machine__container { position: relative; z-index: 1; }
/* 대길: 칸 안 캐릭터 뒤에서 빛살이 천천히 돔 (칸 밖으로는 안 나감) */
.fx-rays {
  position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: 50%;
  width: calc(var(--tile) * 1.5); height: calc(var(--tile) * 1.5);
  max-width: none; /* 기본 img 최대폭 때문에 타원으로 찌그러지지 않게 */
  margin: calc(var(--tile) * -.75) 0 0 calc(var(--tile) * -.75);
}
.reel-strip { will-change: transform; }
.fx-spark { position: absolute; left: 50%; top: 50%; width: 22%; margin: -11% 0 0 -11%; }
.fx-stamp {
  position: absolute; right: -6%; top: -8%; width: 42%; aspect-ratio: 1;
  display: grid; place-items: center; z-index: 3;
}
.fx-stamp-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-stamp span { position: relative; font-family: var(--font-title); font-size: clamp(13px, calc(var(--tile) * .14), 24px); line-height: 1; }
.fx-stamp.lv-s5 span { color: #E8574A; }
.fx-stamp.lv-s4 span { color: #E0861F; }
.fx-sweat { position: absolute; right: 8%; top: 4%; width: 18%; z-index: 3; }
.fx-cloud { position: absolute; left: 20%; top: -10%; width: 60%; z-index: 3; }
.fx-cloud-img { width: 100%; display: block; }
.fx-cloud i {
  position: absolute; top: 70%; width: 3px; height: 12%; border-radius: 3px; background: #7CC4FF; opacity: 0;
}
.fx-cloud i:nth-of-type(1) { left: 22%; } .fx-cloud i:nth-of-type(2) { left: 42%; }
.fx-cloud i:nth-of-type(3) { left: 62%; } .fx-cloud i:nth-of-type(4) { left: 80%; }

/* 날아가는 동전 */
.fly-coin {
  position: fixed; left: 0; top: 0; z-index: 40; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  pointer-events: none;
}

/* 마지막 연출: 캐릭터만 남고 어두워짐 */
.finale {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
}
.finale-dim { position: absolute; inset: 0; background: #120E14; opacity: 0; }
.finale-item { position: absolute; display: grid; place-items: center; }
.finale-item img, .finale-item svg { width: 100%; height: 100%; object-fit: contain; }

/* =========================================================
 * ③ 결과
 * ========================================================= */
.fade-in-cover { position: fixed; inset: 0; z-index: 90; background: #120E14; pointer-events: none; }

.result-head { text-align: center; padding: 8px 0 20px; }
.result-head .date { font-family: var(--font-serious); font-weight: 700; color: var(--ink-soft); font-size: 15px; }
.result-head h1 { font-size: 28px; margin-top: 2px; }

.lv {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; height: 26px; padding: 0 10px; margin-top: 4px;
  border-radius: 999px; font-family: var(--font-title); font-size: 14px;
  border: 2px solid var(--line);
}
.lv-5 { background: #FFD45C; }
.lv-4 { background: #FFE9A8; }
.lv-3 { background: #FFFFFF; }
.lv-2 { background: #E3E8F0; }
.lv-1 { background: #C9D0DC; }
/* 좋음·대박 캡슐: 글자 더 굵게 + 테두리 꾸밈(안쪽 흰 줄, 대박은 금빛·은은한 빛·반짝이 별) */
.lv.lv-4, .lv.lv-5 {
  position: relative; -webkit-text-stroke: .03em currentColor; letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
}
.lv.lv-5 {
  background: linear-gradient(180deg, #FFE58A 0%, #FFD45C 55%, #F5B935 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9), 0 0 10px 3px rgba(255, 212, 92, .55);
}
.lv.lv-5::before, .lv.lv-5::after {
  content: '✦'; position: absolute; color: #FFB800; line-height: 1;
  -webkit-text-stroke: 0; text-shadow: 0 0 0 var(--line), 1px 1px 0 var(--line), -1px -1px 0 var(--line), 1px -1px 0 var(--line), -1px 1px 0 var(--line);
}
.lv.lv-5::before { top: -9px; right: -7px; font-size: 14px; }
.lv.lv-5::after { bottom: -7px; left: -6px; font-size: 10px; }

.r-list { display: grid; gap: 12px; margin-bottom: 20px; }
/* 운별 카드: 그림 + 풀이 한 묶음 */
.r-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start;
  padding: 14px 16px 16px 12px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.r-card .art { width: 96px; height: 96px; display: grid; place-items: center; background: var(--bg); border-radius: var(--r-sm); }
.r-card .art img, .r-card .art svg { width: 92%; height: 92%; object-fit: contain; }
.r-card .body { min-width: 0; }
.r-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.r-item-head h2 { font-size: 20px; -webkit-text-stroke: .045em currentColor; } /* 고운바탕은 700이 가장 굵어서 외곽선으로 더 두껍게 */
.r-item-head .lv { margin-top: 0; }
.r-item-head .who { color: var(--ink-soft); font-size: 14px; }
.r-card p { margin: 6px 0 0; }
.r-card .todo { grid-column: 1 / -1; margin-top: 0; }
.todo {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 10px; padding: 10px 12px;
  background: var(--bg); border-radius: var(--r-sm); font-size: 15px;
}
.todo b { font-family: var(--font-title); font-weight: 400; flex: none; color: var(--line); }

.total {
  position: relative; overflow: hidden; /* 대길 빛살이 칸 밖으로 안 나가게 */
  padding: 16px 18px 24px; margin-bottom: 20px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  border: 4px solid var(--line);
}
.total-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.total .label { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 22px; }
.stamp {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 84px; height: 84px;
  background: url('../img/fx/fx-stamp-3.webp') center / contain no-repeat;
  font-family: var(--font-title); font-size: 24px; color: #8A7F76;
  transform: rotate(-8deg);
}
.stamp.lv-5 { background-image: url('../img/fx/fx-stamp-5.webp'); color: #E8574A; }
.stamp.lv-4 { background-image: url('../img/fx/fx-stamp-4.webp'); color: #E0861F; }
.stamp-rays {
  position: absolute; left: 50%; top: 50%; width: 220%; height: 220%; margin: -110% 0 0 -110%;
  background: url('../img/fx/fx-rays-5.webp') center / contain no-repeat; z-index: -1;
  animation: spin 14s linear infinite;
}
.total-head { position: relative; z-index: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 총운 점수 줄: 0~100, 캐릭터가 점수 자리까지 걸어감.
   점수(큰 말풍선)는 캐릭터 위, 캐릭터는 줄 가운데에 걸쳐 줄을 덮음 */
/* 총운 그림(정사각) 실측: 캐릭터 몸 가운데 = 그림 높이의 64%. 머리(소품 포함) 위 끝 --t 는 그림마다 달라 page-result.js 가 재서 넣음(기본 .31) */
.meter { --walker: 84px; --track-h: 18px; --bubble-h: 52px; --t: .31; margin: 0 0 6px; padding: 0 calc(var(--walker) / 2 - 4px); }
.meter-track {
  position: relative; height: var(--track-h);
  margin-top: calc(var(--bubble-h) + 12px + var(--walker) * (.64 - var(--t)) - var(--track-h) / 2);
  background: var(--bg); border: 3px solid var(--line); border-radius: 999px;
}
.meter-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--score) * 1%);
  background: var(--accent); border-radius: 999px;
}
.meter-walker {
  position: absolute; left: calc(var(--score) * 1%); bottom: calc((var(--track-h) - 6px) / 2 - var(--walker) * .36); z-index: 1; /* 몸 가운데(64%)를 줄 가운데에. 6px = 줄 위아래 테두리 */
  width: var(--walker); margin-left: calc(var(--walker) / -2);
  display: flex; flex-direction: column; align-items: center;
}
.walker-art { width: var(--walker); height: var(--walker); transform-origin: 50% 100%; }
.walker-art img, .walker-art svg { width: 100%; height: 100%; object-fit: contain; }
.bubble {
  position: relative; display: flex; align-items: baseline; gap: 2px;
  height: var(--bubble-h); margin-bottom: calc(10px - var(--walker) * var(--t)); padding: 0 16px; white-space: nowrap; z-index: 1;
  background: var(--line); color: #fff; border-radius: 999px;
  font-family: var(--font-serious); font-weight: 700; font-size: 18px; line-height: var(--bubble-h);
}
.bubble::after { /* 말풍선 꼬리 */
  content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -8px;
  border: 8px solid transparent; border-bottom: 0; border-top-color: var(--line);
}
.bubble b { font-weight: 800; font-size: 36px; letter-spacing: -.02em; }
.meter-ticks { position: relative; height: 18px; margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--ink-soft); }
.meter-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.meter-ticks span:nth-child(1) { left: 0; }
.meter-ticks span:nth-child(2) { left: 20%; }
.meter-ticks span:nth-child(3) { left: 40%; }
.meter-ticks span:nth-child(4) { left: 60%; }
.meter-ticks span:nth-child(5) { left: 80%; }
.meter-ticks span:nth-child(6) { left: 100%; }
/* 오늘 믿을 것·조심할 것: 총운 점수 바로 아래, 한눈에 */
.focus { display: grid; gap: 8px; margin-top: 18px; }
.focus-row { display: grid; gap: 4px; margin: 0; padding: 12px 16px; border-radius: var(--r-sm); border-left: 6px solid; }
.focus-row b { font-family: var(--font-serious); font-weight: 700; font-size: 14px; }
.focus-row span { font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.5; color: var(--ink); }
.focus-good { background: #E3F4FB; border-color: #3FA9D6; }
.focus-good b { color: #1F7FAA; }
.focus-warn { background: #FDECEA; border-color: #E0645A; }
.focus-warn b { color: #C2433A; }
.total-text { margin-top: 18px; }
.total-text p { margin: 0 0 10px; font-size: 17px; }
/* 결론: 진하고 크게, 형광펜 밑줄 */
.total-text .closing { margin: 18px 0 0; font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1.5; color: var(--ink); text-align: center; text-wrap: balance; }
.total-text .closing span { background: linear-gradient(transparent 58%, rgba(255, 207, 74, .6) 58%); padding: 0 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding-bottom: 12px; }
/* 결과 그림카드 창 */
.card-modal .modal-in { max-width: 440px; }
.card-preview { margin: 12px 0 10px; aspect-ratio: 4 / 5; border-radius: var(--r-sm); overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.card-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-preview.loading::after { content: attr(data-msg); font-family: var(--font-serious); font-weight: 700; color: var(--ink-soft); }
.card-hint { text-align: center; font-family: var(--font-serious); font-weight: 700; font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }
.card-btns { display: grid; gap: 10px; }
.tomorrow { text-align: center; color: var(--ink-soft); font-size: 14px; padding-bottom: 40px; }

/* ---------- 슬롯: 기계 몸통·레버 그림 (PC·모바일 모두 2×2) ----------
 * 좌표 단위 --u = 기계 그림 1px. 몸통 그림(1024×1536)의 불투명 영역 왼쪽 위(38, 82)를 원점으로 씀.
 * 실측(2차 기계): 화면(마젠타) 81,277 787×787 · 간판 150,75 650×144 · 상태 띠 151,1109 647×60
 *       동전 구멍 381,1218 168×17 · 레버 꽂는 곳 가운데 957,998 (레버 그림은 0.5배)
 */
.lever-img { display: none; }
/* 기계 위 전구 5개(몸통 그림 전구 자리, 가운데 x 314.5 + 80씩, y 29.5, 지름 47): 돌 때 차례로, 멈추면 한꺼번에 반짝 */
.bulbs { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.bulbs i {
  position: absolute; top: calc(var(--u) * 29.5); left: calc(var(--u) * 314.5);
  width: calc(var(--u) * 47); height: calc(var(--u) * 47);
  margin: calc(var(--u) * -23.5) 0 0 calc(var(--u) * -23.5); border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #fff 0 22%, rgba(255, 246, 190, .95) 45%, rgba(255, 226, 110, 0) 72%);
  box-shadow: 0 0 calc(var(--u) * 28) calc(var(--u) * 8) rgba(255, 226, 110, .75);
  opacity: 0;
}
.bulbs i:nth-child(2) { left: calc(var(--u) * 394.5); }
.bulbs i:nth-child(3) { left: calc(var(--u) * 474.5); }
.bulbs i:nth-child(4) { left: calc(var(--u) * 554.5); }
.bulbs i:nth-child(5) { left: calc(var(--u) * 634.5); }
.machine.spinning .bulbs i { animation: bulb-chase .7s linear infinite; }
.machine.spinning .bulbs i:nth-child(2) { animation-delay: .14s; }
.machine.spinning .bulbs i:nth-child(3) { animation-delay: .28s; }
.machine.spinning .bulbs i:nth-child(4) { animation-delay: .42s; }
.machine.spinning .bulbs i:nth-child(5) { animation-delay: .56s; }
.machine.win .bulbs i { animation: bulb-flash .4s steps(1) 5; }
@keyframes bulb-chase { 0%, 24% { opacity: 1; } 34%, 100% { opacity: .12; } }
@keyframes bulb-flash { 0% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .machine.spinning .bulbs i, .machine.win .bulbs i { animation: none; opacity: .8; } }
@media all {
  .stage {
    /* 가로: 화면 폭과 높이(머리글·제목 약 230px 제외) 중 작은 쪽에 맞춤, 최대 600px */
    /* 기계 몸통(폭 966)이 가운데 오도록 왼쪽에도 레버 폭(119)만큼 빈칸 → 전체 폭 1204 */
    --sw: min(calc(100vw - 32px), 666px, calc((100dvh - 230px) * 1204 / 1364));
    --u: calc(var(--sw) / 1204);
    --gap: calc(var(--u) * 14);
    --col-pad: calc(var(--u) * 10);
    --label-h: calc(var(--u) * 64);
    /* 칸 크기: 화면 788 안에 2×2 + 이름표가 들어가는 크기 중 작은 쪽 */
    --tile: min(calc((var(--u) * 788 - var(--gap) * 3) / 2 - var(--col-pad) * 2),
                calc((var(--u) * 788 - var(--gap) * 3) / 2 - var(--col-pad) - var(--label-h)));
    width: var(--sw); height: calc(var(--u) * 1364);
    padding: 0;
  }
  .machine {
    position: absolute; left: calc(var(--u) * 119); top: 0;
    width: calc(var(--u) * 966); height: calc(var(--u) * 1364);
    padding: 0; border: 0; border-radius: 0; box-shadow: none;
    background: url('../img/machine/machine-body.webp?v=2') no-repeat;
    background-size: calc(var(--u) * 1024) calc(var(--u) * 1536);
    background-position: calc(var(--u) * -38) calc(var(--u) * -82);
  }
  .machine-top {
    position: absolute; left: calc(var(--u) * 150); top: calc(var(--u) * 75);
    width: calc(var(--u) * 650); height: calc(var(--u) * 144);
    margin: 0; border: 0; border-radius: 0; background: none; color: var(--ink);
  }
  .machine-top .sign-art { width: calc(var(--u) * 120); height: calc(var(--u) * 120); margin-top: 0; }
  .machine-top h2 { font-size: calc(var(--u) * 64); position: relative; top: calc(var(--u) * 5); } /* 주아 글자가 위로 떠 보여서 간판 안쪽 테두리 가운데에 맞춤(실측) */
  .reels {
    /* 마젠타 영역보다 사방 3px 크게 덮어 가장자리 분홍 테두리가 안 보이게 */
    position: absolute; left: calc(var(--u) * 77); top: calc(var(--u) * 273);
    width: calc(var(--u) * 794); height: calc(var(--u) * 794);
    box-sizing: border-box; padding: var(--gap);
    gap: var(--gap); align-content: center; justify-content: center;
    background: var(--line); border-radius: calc(var(--u) * 44);
    overflow: hidden; /* 대길 빛살이 화면 밖으로 안 나가게 */
  }
  .reel-col { background: rgba(255,255,255,.08); }
  .reel-label { font-size: calc(var(--u) * 36); }
  .machine-panel { display: contents; }
  .status {
    position: absolute; left: calc(var(--u) * 151); top: calc(var(--u) * 1109);
    width: calc(var(--u) * 647); height: calc(var(--u) * 60);
    display: flex; align-items: center; justify-content: center;
    font-size: calc(var(--u) * 38); line-height: 1; white-space: nowrap; overflow: hidden;
  }
  .coin-slot {
    position: absolute; left: calc(var(--u) * 381); top: calc(var(--u) * 1218);
    width: calc(var(--u) * 168); height: calc(var(--u) * 17); display: block;
  }
  .coin-slot span:last-child { display: none; }
  .slot-hole { display: block; width: 100%; height: 100%; background: transparent; box-shadow: none; }
  .coin-slot.glow .slot-hole { box-shadow: 0 0 0 3px var(--coin), 0 0 14px 4px var(--coin); }

  .lever { position: absolute; inset: 0; width: auto; overflow-x: clip; } /* 레버 그림 투명 여백 때문에 가로 스크롤 생기지 않게 */
  .lever-rod, .lever-knob { display: none; }
  /* 연결대: 몸통 오른쪽 외곽선(몸통 x 987)에서 레버 막대 아래까지 가로로 이어 줌
     (몸통 그림의 원래 경첩 동그라미·받침은 지움) */
  .lever-base {
    left: calc(var(--u) * 1061); top: calc(var(--u) * 976);
    width: calc(var(--u) * 70); height: calc(var(--u) * 36);
    background: var(--frame, #6BC4A6); border: calc(var(--u) * 8) solid #111; border-left: 0;
    border-radius: 0 calc(var(--u) * 18) calc(var(--u) * 18) 0;
  }
  .lever-arm {
    /* 레버 막대 가운데 = 몸통 그림 x 1030 (꽂는 곳 987~1004 바로 오른쪽), 화면 좌표는 +81 */
    left: calc(var(--u) * 983); top: calc(var(--u) * 482); /* 막대 아래 끝 = 연결대 가운데(몸통 y 1076) */
    width: calc(var(--u) * 256); height: calc(var(--u) * 512);
  }
  .lever-img { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; }
  .lever-hit {
    left: calc(var(--u) * 1000); right: auto; width: calc(var(--u) * 204);
    top: calc(var(--u) * 470); height: calc(var(--u) * 820);
  }

  /* 기계 뒤에서 엿보는 캐릭터: 디자이너 예시(assets/peek/mock-<id>.png)에서 잘라 낸 위치 그대로 — 표지 원본(cover.png)을 예시에 맞춰 돌린 고해상도 그림 (tools/fit-peek.js 출력값) */
  .peek { position: absolute; max-width: none; pointer-events: none; user-select: none; }
  .peek-squid .peek { left: calc(var(--u) * -213.2); top: calc(var(--u) * 396.7); width: calc(var(--u) * 660.2); height: calc(var(--u) * 773); }
  .peek-toad .peek { left: calc(var(--u) * 183.5); top: calc(var(--u) * -182.2); width: calc(var(--u) * 813.3); height: calc(var(--u) * 836.4); } /* 예시보다 85% 크기, 머리 꼭대기는 -182(디자이너 요청: 덜 깨져 보이게, 기계는 약 100px만 내려가게) */
  /* 꺼비는 기계 위로 머리를 내밀어 제목을 덮지 않게 그만큼(182) 아래로 내리고, 높이 맞춤도 그만큼 더 셈 */
  .stage.peek-toad {
    --sw: min(calc(100vw - 32px), 666px, calc((100dvh - 230px) * 1204 / 1546));
    margin-top: calc(var(--u) * 182);
  }
  .peek-pick .peek { left: calc(var(--u) * 770.6); top: calc(var(--u) * 105.4); width: calc(var(--u) * 727.3); height: calc(var(--u) * 686.0); } /* 코인 슬롯 .pk-pick 과 같게 */
  .peek-capybara .peek { left: calc(var(--u) * -246); top: calc(var(--u) * -36); width: calc(var(--u) * 749.9); height: calc(var(--u) * 669.3); transform: scaleX(-1); } /* 코인 슬롯 .pk-capybara 와 같게(왼쪽, 좌우 뒤집음, 2026-11-22) */
}
/* 엿보는 캐릭터가 화면 옆으로 삐져나가도 가로 스크롤이 생기지 않게 */
.slot-page { overflow-x: clip; } /* 안쪽 여백 바깥(=모바일에선 화면 끝)에서 잘림 */

/* ---------- PC (768px 이상) ---------- */
@media (min-width: 768px) {
  :root { --pad: 32px; --gap: 24px; }
  main:has(> .page-back) { --back-top: 12px; } /* PC 제목이 커진 만큼 '돌아가기'도 내림 */
  main.rank-page { --back-top: 21px; }
  .topbar { height: 80px; }
  .logo img { height: 64px; }
  .streak { font-size: 14px; }
  .streak b { max-width: 9em; }
  .hero { padding: 40px 0 44px; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 18px; }
  /* minmax(0,…): 카드가 그림 크기 때문에 칸보다 넓어져 오른쪽으로 삐져나가지 않게(그림이 칸에 맞춰 줄어듦) */
  .theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .theme-card { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 28px 24px 26px; }
  .theme-art { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1; }
  .theme-info h2 { font-size: 28px; }

  .slot-title h1 { font-size: 34px; }

  .result-head h1 { font-size: 38px; }
  .lv { font-size: 16px; height: 30px; }
  .r-list { grid-template-columns: 1fr 1fr; gap: 16px; }
  .r-card { grid-template-columns: 140px 1fr; gap: 18px; padding: 18px 20px 20px 16px; }
  .r-card .art { width: 140px; height: 140px; }
  .total { padding: 22px 40px 36px; }
  .total .label { font-size: 28px; }
  .stamp { width: 104px; height: 104px; font-size: 30px; }
  .meter { --walker: 120px; --track-h: 22px; --bubble-h: 64px; }
  .bubble { font-size: 22px; padding: 0 20px; }
  .bubble b { font-size: 46px; }
  .meter-ticks { font-size: 14px; height: 20px; line-height: 20px; }
  .total-text p { font-size: 18px; }
  .total-text .closing { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 첫 화면 아래 읽을거리 버튼 · 저작권 ---------- */
.info-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 36px 0 0; }
.info-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  font-family: var(--font-serious); font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none;
  transition: transform .12s var(--ease-out);
}
.info-link:hover { transform: translateY(-2px); }
.info-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
/* 모바일: 읽을거리 버튼 2개 한 줄 (개인정보처리방침은 맨 아래 작은 링크로) */
@media (max-width: 767px) {
  .info-links { flex-wrap: nowrap; gap: 6px; }
  .info-link { flex: 1 1 0; min-width: 0; justify-content: center; padding: 4px 6px; font-size: 13px; line-height: 1.2; text-align: center; letter-spacing: -.02em; } /* 영어처럼 긴 글자는 버튼 안에서 두 줄 */
}
/* 하단 광고(애드센스 'ohun-bottom', 가로형 작은 배너) — 첫 화면·결과·랭킹·설명·캐릭터 맨 아래에만.
   슬롯 화면·약관류엔 없음. 자동 광고(팝업·화면 아래 고정)는 애드센스에서 꺼 둠.
   광고가 채워지기 전·못 채우면 자리를 차지하지 않음(빈 칸 없음) */
.ad-bottom { width: 100%; max-width: 728px; margin: 0 auto; text-align: center; }
.ad-bottom .ad-label { display: none; margin-bottom: 6px; font-family: var(--font-serious); font-weight: 600; font-size: 11px; line-height: 1; color: var(--ink-soft); }
.ad-bottom:has(ins[data-ad-status="filled"]) { margin-top: 32px; }
.ad-bottom:last-child:has(ins[data-ad-status="filled"]) { margin-bottom: 32px; } /* 아래 링크가 없는 결과·랭킹: 화면 끝과도 띄움 */
.ad-bottom:has(ins[data-ad-status="filled"]) .ad-label { display: block; }
.ad-bottom:has(ins[data-ad-status="unfilled"]) { display: none; }
/* 화면 하단 고정 광고(자동 광고 '앵커')가 떠 있으면 맨 아래 링크가 가려지지 않게 그만큼 띄움(코인 슬롯은 자체 여백) */
body:not(.lucky):has(> ins.adsbygoogle[data-anchor-status="displayed"]) { padding-bottom: 100px; }
/* 맨 아래 작은 안내 링크(이용약관·개인정보처리방침·문의) — 모든 페이지 저작권 위 */
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 0; margin: 32px 0 0; font-family: var(--font-serious); font-weight: 400; font-size: 12px; }
.foot-links a { padding: 0 10px; line-height: 1; color: var(--ink-soft); text-decoration: none; }
.foot-links a + a { border-left: 1px solid currentColor; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-links + .copyright { margin-top: 6px; }
.contact-mail { margin: 18px 0 8px; font-size: 20px; font-weight: 700; }
.copyright { margin: 18px 0 40px; text-align: center; font-family: var(--font-serious); font-weight: 400; font-size: 12px; color: var(--ink-soft); }

/* ---------- 읽을거리 페이지(운세 설명·개인정보처리방침·캐릭터 소개) ---------- */
html[lang="en"] [data-lang="ko"], html[lang="ko"] [data-lang="en"] { display: none !important; }
.doc { max-width: 760px; padding-top: 8px; }
.doc-back { display: inline-block; margin: 4px 0 14px; font-family: var(--font-serious); font-weight: 700; font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.doc-back:hover { color: var(--ink); }
.doc article { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px 24px 30px; }
.doc h1 { font-size: 28px; margin: 0 0 6px; }
.doc .doc-lead { margin: 0 0 22px; color: var(--ink-soft); }
.doc h2 { font-family: var(--font-title); font-weight: 700; font-size: 19px; margin: 26px 0 8px; }
.doc p, .doc li { margin: 0 0 8px; }
.doc ul, .doc ol { margin: 0 0 8px; padding-left: 1.3em; }
.doc a { color: var(--ink); }
.doc .note { margin-top: 22px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); font-size: 14px; }
.doc table { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-family: var(--font-serious); font-size: 14px; }
.doc th, .doc td { padding: 8px 10px; border-bottom: 1px solid #EEE4E0; text-align: left; vertical-align: top; }
.doc th { font-weight: 700; white-space: nowrap; }
/* 개인정보처리방침·영어 글은 읽기 쉬운 고딕 */
.doc-formal, html[lang="en"] .doc article { font-family: var(--font-serious); font-weight: 500; font-size: 15px; line-height: 1.7; }
.doc-formal h2, html[lang="en"] .doc h2 { font-family: var(--font-serious); font-weight: 800; font-size: 17px; }
/* 단계 표시 칩 */
.lv-chip { display: inline-block; min-width: 3.6em; padding: 1px 10px; border: 2px solid var(--line); border-radius: 999px; text-align: center; font-family: var(--font-title); font-size: 14px; }
/* 캐릭터 소개 */
.char-list { display: grid; gap: 14px; }
.char { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; padding: 16px; border-radius: var(--r-md); background: var(--c-bg, var(--bg)); }
.char img { width: 120px; height: 120px; object-fit: contain; }
.char h2 { margin: 0 0 4px; font-family: var(--font-name); font-weight: 400; font-size: 26px; }
.char .tag { margin: 0 0 6px; font-family: var(--font-title); color: var(--ink-soft); }
.char p { margin: 0; }
@media (max-width: 480px) {
  .doc article { padding: 22px 18px 24px; }
  .char { grid-template-columns: 88px 1fr; gap: 12px; }
  .char img { width: 88px; height: 88px; }
}

/* =========================================================
 * 코인(서버) · 보물상자 · 코인 슬롯 · 랭킹 (2026-11-20 추가)
 * ========================================================= */
/* 상단 코인: 보유 숫자. 누르면 코인 슬롯 */
.coin-pill { font-size: 15px; color: var(--ink); text-decoration: none; }
.coin-pill:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.fly-coin.burst-coin { z-index: 1000; }

/* 보물상자 창 */
.chest-modal .modal-in { padding-bottom: 22px; }
.chest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 6px; }
.chest {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 1 / .9; padding: 6px; border: 0; border-radius: var(--r-md);
  background: var(--bg); cursor: pointer; touch-action: manipulation;
  transition: transform .15s var(--ease-out), background .2s, opacity .3s;
}
.chest:hover:not([disabled]) { transform: translateY(-3px); background: var(--bg2); }
.chest:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.chest[disabled] { cursor: default; }
.chest-svg { width: 100%; height: 100%; overflow: visible; }
.chest-svg .lid { transform-origin: 50px 47px; transition: transform .45s var(--ease-out); }
.chest-svg .treasure { opacity: 0; transition: opacity .25s var(--ease-out); }
.chest-svg .lock { transition: opacity .15s; }
.chest-svg .glow { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; transform: scale(.3); transition: opacity .3s, transform .5s var(--ease-out); }
.chest.open .lid { transform: translateY(-15px) scaleY(.65); }
.chest.open .treasure { opacity: 1; }
.chest-svg .coin-pair,
.chest[data-amount="100"] .coin-side,
.chest[data-amount="200"] .coin-side,
.chest[data-amount="200"] .coin-center { display: none; }
.chest[data-amount="200"] .coin-pair { display: inline; }
.chest.open .lock { opacity: 0; }
.chest.picked.open .glow { opacity: 1; transform: scale(1); }
.chest.shake { animation: chest-shake .16s linear infinite; }
@keyframes chest-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.chest-amt {
  position: absolute; left: 0; right: 0; top: -4%; text-align: center;
  font-family: var(--font-serious); font-weight: 900; font-size: 22px; color: var(--ink);
  text-shadow: 0 0 4px #fff, 0 0 8px #fff; opacity: 0; transform: translateY(8px);
  transition: opacity .3s, transform .4s var(--ease-out);
}
.chest.open .chest-amt { opacity: 1; transform: translateY(0); }
.chest.picked.open .chest-amt { top: -9%; font-size: 26px; line-height: 1; color: #D2541E; }
.chest-modal.done .chest:not(.picked) { opacity: .45; }
.chest-modal.done .chest.picked { background: #FFF3C4; box-shadow: 0 0 0 3px var(--coin); }
.chest-msg { min-height: 1.5em; margin: 8px 0 12px; text-align: center; font-family: var(--font-serious); font-weight: 700; font-size: 17px; }

/* 첫 화면: 코인 슬롯 · 랭킹 버튼 */
.play-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin: var(--gap) 0 40px; }  /* 캐릭터 카드 아래, 카드 사이 간격과 같게 */
.play-link {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .15s var(--ease-out);
}
.play-link:hover { transform: translateY(-2px); }
.play-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.play-ico { font-size: 30px; line-height: 1; flex: none; }
.slot-icon { width: 1.375em; height: 1.125em; object-fit: contain; }
/* 두 버튼 같은 배치: 제목 | 설명(제목 오른쪽 남은 자리의 가운데) */
.play-link > span:last-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.play-link b { display: block; font-family: var(--font-name); font-weight: 400; font-size: 22px; line-height: 1.2; white-space: nowrap; }   /* 캐릭터 이름(징양)과 같은 글꼴·크기 */
.play-link small { display: block; flex: 1; text-align: center; font-size: 13px; color: var(--ink-soft); }
@media (min-width: 768px) { .play-link b { font-size: 28px; } .play-link small { font-size: 15px; } }   /* 이름은 .theme-info h2, 설명은 .theme-info p(오늘도~)와 같은 크기 */
@media (max-width: 767px) {   /* 폭이 좁아 한 줄에 안 들어감 → 두 버튼 모두 설명은 제목 아래 줄. 아이콘·여백을 줄여 설명이 한 줄에 들어가게 */
  .play-link { gap: 8px; padding: 14px 12px; }
  .play-ico { font-size: 24px; }
  .play-link > span:last-child { display: block; }
  .play-link small { margin-top: 2px; text-align: left; white-space: nowrap; }
  html[lang="en"] .play-link {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr;
    align-items: start; gap: 2px 6px; padding-inline: 9px;
  }
  html[lang="en"] .play-link > span:last-child { display: contents; }
  html[lang="en"] .play-ico { font-size: 20px; align-self: center; }
  html[lang="en"] .play-link b { font-size: 20px; }
  html[lang="en"] .play-link small { grid-column: 1 / -1; margin-top: 0; white-space: normal; overflow-wrap: anywhere; }
  html[lang="en"] .play-rank small { text-align: center; }
}
.play-lucky { background: linear-gradient(135deg, #E3F5FC, #C9EBF8); }
.play-rank { background: linear-gradient(135deg, #FFF6D6, #FFE9A3); }

/* 결과 화면: 코인 슬롯 버튼 · 행운 대박 알림 */
.btn-lucky { background: #5FB5DA; color: #fff; }
.boost-banner, .boost-chip {
  display: table; margin: 0 auto 16px; padding: 8px 16px; border-radius: 999px;
  background: linear-gradient(90deg, #FFE27A, #FFCF4A); color: #5A3A00;
  font-family: var(--font-serious); font-weight: 800; font-size: 15px;
  box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(255, 207, 74, .8);
}
.boost-banner[hidden], .boost-chip[hidden] { display: none; }
.boost-chip { margin: 8px auto 0; font-size: 13px; padding: 5px 12px; }
.lucky-hint { margin: 0 auto 16px; text-align: center; font-size: 15px; opacity: .75; } /* 오늘의 행운 캐릭터 힌트(은근히) */
.lucky-hint[hidden] { display: none; }
.lucky-share { margin-top: 16px; padding-bottom: 0; } /* 큰 당첨 때만 보이는 공유 버튼 줄(슬롯 조작판 아래) */
.lucky-share[hidden] { display: none; }
/* 올인 구제 상자 제목 위 '딱 한 번!' 배지 */
.rescue-once { display: table; margin: 0 auto 8px; padding: 3px 12px; border-radius: 999px; background: #FF6B5B; color: #fff; font-size: 14px; font-weight: 800; line-height: 1.4; }

/* ---------- 코인 슬롯 ---------- */
body.lucky { --frame: #5fb5da; }
.lucky-page { padding-bottom: 110px; } /* 아래 자리는 화면 하단 고정 광고(모바일 앵커)용. 기계 크기 --lsw 는 아래 화면 크기별로 */
/* 제목·설명·행운 캡슐은 PC·모바일 모두 뺌(행운 안내는 기계 가운데 안내 줄로) → 그 자리만큼 기계를 키움
   (모바일 2026-11-21, PC 2026-11-22 — 운세 슬롯과 비슷한 크기) */
.lucky-page .slot-title { display: none; }
@media (max-width: 767px) {
  .lucky-page { --lsw: min(calc(100vw - 32px), 600px, calc((100dvh - 210px) * 1204 / 1546)); }
}
@media (min-width: 768px) {
  /* 세로 = 머리글 + 꺼비 머리(182) + 몸통(1364) − 조작판이 덮는 184 + 조작판 → 조작판까지 한 화면에 */
  .lucky-page { --lsw: min(calc(100vw - 32px), 666px, calc((100dvh - 225px) * 1204 / 1362)); }
}
/* 기계: 꺼비 엿보기처럼 위로 머리가 나오니 그만큼 내리고, 조작판·하단 광고 자리만큼 더 작게 */
.stage.lucky-stage {
  --sw: var(--lsw);
  --cols: 3;
  margin-top: calc(var(--u) * 182);
}
.lucky .machine { background-image: url('../img/machine/machine-body-sky.webp?v=1'); }
.lucky .peek { position: absolute; max-width: none; pointer-events: none; user-select: none; }
.pk-squid { left: calc(var(--u) * -213.2); top: calc(var(--u) * 396.7); width: calc(var(--u) * 660.2); height: calc(var(--u) * 773); }
.pk-toad { left: calc(var(--u) * 183.5); top: calc(var(--u) * -182.2); width: calc(var(--u) * 813.3); height: calc(var(--u) * 836.4); }
.pk-capybara { left: calc(var(--u) * -246); top: calc(var(--u) * -36); width: calc(var(--u) * 749.9); height: calc(var(--u) * 669.3); transform: scaleX(-1); } /* 원래 오른쪽 자리(left 699.3, top 114.2)를 기계 가운데(601.4u) 기준 좌우 대칭 → 징양 위 모서리 쪽으로(2026-11-22) */
.pk-pick { left: calc(var(--u) * 770.6); top: calc(var(--u) * 105.4); width: calc(var(--u) * 727.3); height: calc(var(--u) * 686.0); } /* 바라군 옛 자리에서 60u 바깥(눈 보이게)·각도(tools/make-peek-pick.js) */
.lucky .peek:not([src]) { visibility: hidden; }

/* 3×3: 세로 릴 3개, 릴마다 세 칸이 보임 */
.reels-3 { --t3: calc((var(--u) * 794 - var(--gap) * 4 - var(--col-pad) * 6) / 3); position: absolute; }
.reels-3 .reel-col { padding: var(--col-pad); }
.l-window { width: var(--t3); height: calc(var(--t3) * 3); }
.l-tile { width: var(--t3); height: var(--t3); display: grid; place-items: center; position: relative; }
.l-tile img, .l-tile svg { width: 84%; height: 84%; object-fit: contain; }
.l-tile.hit { background: radial-gradient(circle, rgba(255, 226, 122, .95) 0 45%, rgba(255, 226, 122, 0) 70%); }
.reels-3.won .l-tile.hit { animation: hit-pulse .8s ease-in-out 3; }
@keyframes hit-pulse { 50% { background-color: rgba(255, 207, 74, .35); } }
.win-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.win-lines line { stroke: #FF5A3C; stroke-width: calc(var(--u) * 14); stroke-linecap: round; opacity: .85; filter: drop-shadow(0 0 4px #fff); }
.reels-3.tease .reel-col:last-child { box-shadow: 0 0 0 calc(var(--u) * 6) #FFCF4A, 0 0 calc(var(--u) * 40) #FFCF4A; animation: tease 0.5s ease-in-out infinite alternate; }
@keyframes tease { to { box-shadow: 0 0 0 calc(var(--u) * 6) #FF8A5B, 0 0 calc(var(--u) * 60) #FF8A5B; } }
.reels-3.jackpot { animation: jp-flash .25s steps(1) 10; }
@keyframes jp-flash { 50% { background: #FFCF4A; } }
.lucky .status { font-size: calc(var(--u) * 34); }
/* '행' 동전(행운 버프 날 WILD) */
.l-tile svg.wild-coin { width: 62%; height: 62%; will-change: transform; } /* 캐릭터보다 작게. 당첨 '톡' 효과 때 한 장 그림처럼 커졌다 줄어 글자가 떨리지 않게 */
.wild-coin text { font-family: 'Noto Serif KR', serif; font-weight: 700; font-size: 30px; fill: #7A4A00; text-rendering: geometricPrecision; }
.bust-coin text { fill: #3E4248; } /* 꽝 동전 글자 */ /* 幸: lucky.html 에서 이 한 글자만 받는 웹 글꼴. 위치는 page-lucky.js 실측값 */

/* 조작판: 캐릭터 고르기 + 거는 코인. 기계 아래쪽(안내 글 아래 동전 구멍~다리)을 덮어 올림
   → 화면 맨 아래는 하단 고정 광고 자리로 비움(2026-11-21 디자이너 결정).
   덮는 높이 = 몸통 바닥(1364) − 안내 글 아래(1169) − 여유 11 = 184 (기계 그림 단위) */
.lucky-ctrl {
  position: relative; z-index: 6; width: 100%; max-width: 632px;
  margin: calc(var(--lsw) / 1204 * -184) auto 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, .96); box-shadow: 0 6px 24px rgba(58, 46, 44, .16);
  border-radius: 22px;
}
.lucky-ctrl > .btn { align-self: center; }
.ctrl-row { display: flex; align-items: center; gap: 10px; max-width: 600px; width: 100%; margin: 0 auto; }
.ctrl-row h2 { flex: none; width: 5.6em; font-family: var(--font-serious); font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.pick-row, .bet-row { flex: 1; display: grid; gap: 6px; }
.pick-row { grid-template-columns: repeat(4, 1fr); }
.bet-row { grid-template-columns: repeat(5, 1fr); }
.pick-btn, .bet-btn {
  height: 44px; border: 2px solid transparent; border-radius: 14px; cursor: pointer; touch-action: manipulation;
  background: var(--bg); color: var(--ink); font-family: var(--font-serious); font-weight: 700;
  transition: background .15s, border-color .15s, transform .1s;
}
.pick-btn { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 4px; }
.pick-face { width: 34px; height: 34px; flex: none; }
.pick-face img, .pick-face svg { width: 100%; height: 100%; object-fit: contain; }
.pick-name { font-family: var(--font-name); font-weight: 400; font-size: 16px; white-space: nowrap; }
.bet-btn { padding: 0 2px; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; } /* 1,000 이 두 줄로 안 깨지게 */
.pick-btn.on, .bet-btn.on { background: #fff; border-color: var(--pick-c, #3FA9D6); box-shadow: 0 0 0 2px var(--pick-c, #3FA9D6) inset; }
.bet-btn.on { border-color: #E0A422; box-shadow: 0 0 0 2px #E0A422 inset; background: #FFF6D6; }
.pick-btn:focus-visible, .bet-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.bet-btn[disabled] { opacity: .35; cursor: not-allowed; }
.is-spinning .pick-btn, .is-spinning .bet-btn { pointer-events: none; }
/* 오늘의 운세 전: 첫 화면 코인 슬롯 버튼은 회색(누르면 안내 팝업) */
.play-link.locked { background: #ECECEC; opacity: .7; }
.play-link.locked:hover { transform: none; }
.notice-modal .modal-in { text-align: center; }
.notice-modal .btn { margin-top: 16px; min-width: 120px; }
@media (max-width: 420px) { .ctrl-row h2 { display: none; } .pick-name { font-size: 14px; } }

/* 배당표 */
.pay-table { margin: 18px auto 0; width: min(100%, 360px); font-family: var(--font-serious); }
.pay-table summary { cursor: pointer; text-align: center; font-weight: 700; color: var(--ink-soft); font-size: 14px; }
.pay-table table { width: 100%; margin-top: 8px; border-collapse: collapse; background: var(--surface); border-radius: var(--r-sm); overflow: hidden; font-size: 14px; }
.pay-table th, .pay-table td { padding: 7px 12px; border-bottom: 1px solid var(--bg2); }
.pay-table th { text-align: left; font-weight: 600; }
.pay-table td { text-align: right; font-weight: 800; }
@media all {   /* 코인 슬롯(PC·모바일): 배당표는 '돌아가기' 맞은편(오른쪽 위)에, 펼치면 기계 위로 덮어 보임 */
  .lucky-page .pay-table { position: absolute; top: var(--back-top, 8px); right: var(--pad); z-index: 7; margin: 2px 0 0; width: auto; }   /* 위 2px = '돌아가기'의 margin-top 과 같게 */
  .lucky-page .pay-table summary { padding: 6px 2px; font-size: 14px; line-height: 1; }
  .lucky-page .pay-table table { position: absolute; right: 0; top: 100%; width: min(320px, calc(100vw - 32px)); box-shadow: 0 6px 24px rgba(58, 46, 44, .18); }
}

/* ---------- 랭킹 ---------- */
.rank-page { max-width: 560px; }
.rank-sub { margin: 4px 0 0; color: var(--ink-soft); }
.rank-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.rank-tabs button {
  height: 40px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-family: var(--font-serious); font-weight: 700; font-size: 16px; color: var(--ink-soft);
}
.rank-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.rank-tabs button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.rank-note { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 10px 0 12px; }
.rank-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 6px; min-height: 120px; }
.rank-list.loading { opacity: .4; }
.rank-row, .rank-me {
  display: grid; grid-template-columns: 3em 1fr auto; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface);
  font-family: var(--font-serious); font-weight: 700;
}
.rank-row .rk, .rank-me .rk { text-align: center; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.rank-row .nk, .rank-me .nk { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .cv, .rank-me .cv { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.rank-row .coin-ico, .rank-me .coin-ico { width: 18px; height: 18px; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-style: normal; color: #fff; font-weight: 900; }
.gold .medal { background: linear-gradient(135deg, #FFD95C, #E0A422); }
.silver .medal { background: linear-gradient(135deg, #DDE3E8, #9AA5AE); }
.bronze .medal { background: linear-gradient(135deg, #F0B98A, #B87333); }
/* 주간 1~3위 트로피(2026-11-21) — 메달 원과 같은 28px 자리 */
.trophy { display: block; width: 28px; height: 28px; margin: 0 auto; }
.trophy .t-line { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.trophy text { font-size: 9px; font-weight: 900; fill: #fff; }
.gold .trophy .t-body { fill: #F2B824; } .gold .trophy .t-line { stroke: #D29A12; }
.silver .trophy .t-body { fill: #AEB8C1; } .silver .trophy .t-line { stroke: #8D98A2; }
.bronze .trophy .t-body { fill: #C98450; } .bronze .trophy .t-line { stroke: #A8693A; }
.rank-row.me { box-shadow: 0 0 0 2px var(--accent) inset; }
.rank-me { margin-bottom: 10px; background: #FFF6D6; box-shadow: 0 0 0 2px var(--coin) inset; }
.rank-empty { text-align: center; padding: 30px 0; color: var(--ink-soft); }

/* 하단 시리즈 링크 → squidpopgi.com/series */
.copyright .series-link { color: inherit; text-decoration: none; }
.copyright .series-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 첫 화면 아래 소개 문단(검색용 설명, 화면에선 작고 흐리게) */
.site-intro { max-width: 640px; margin: 32px auto 0; text-align: center; color: var(--ink-soft); }
.site-intro h2 { margin: 0 0 6px; font-family: var(--font-serious); font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.site-intro p { margin: 0; font-family: var(--font-serious); font-size: 12px; line-height: 1.7; word-break: keep-all; }

/* 코인 슬롯 엿보기 4마리 80% 크기(2026-11-22, 4마리라 복잡해 보여서) — 기계와 닿는 점을 기준으로 줄임 */
.lucky .pk-squid { scale: .8; transform-origin: 56% 30%; top: calc(var(--u) * 446.7); }
.lucky .pk-toad { scale: .8; transform-origin: 50% 22%; }
.lucky .pk-capybara { scale: .8; transform-origin: 62% 45%; left: calc(var(--u) * -441.9); top: calc(var(--u) * 46.4); } /* 픽과 좌우 대칭(화면에 그려진 상자 중심을 실측해 맞춤)(기계 가운데 601.4u 기준) */
.lucky .pk-pick { scale: .8; transform-origin: 38% 45%; top: calc(var(--u) * 45.4); } /* 60u 올림 */

/* 로그아웃: 상단 흰 버튼(눈에 덜 띄게) + 확인 창 */
.pill-logout { height: 32px; padding: 0 12px; border: 0; cursor: pointer; color: var(--ink-soft); font-size: 13px; touch-action: manipulation; }
.pill-logout:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.logout-modal .modal-in { text-align: center; }
.logout-msg { margin: 12px 0 20px; font-family: var(--font-serious); font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.logout-btns { display: flex; gap: 10px; justify-content: center; }
.logout-btns .btn { flex: 1; }
.logout-btns .btn-ghost { box-shadow: inset 0 0 0 2px rgba(58, 46, 44, .15), 0 4px 0 rgba(0, 0, 0, .06); }

/* 운세 풀이 사전 탭(2026-11-30) — 페이지마다 따로 있는 링크를 탭처럼 */
.guide-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.guide-tabs a { padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-family: var(--font-serious); font-weight: 700; font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.guide-tabs a:hover { color: var(--ink); }
.guide-tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.doc h3 { font-family: var(--font-serious); font-weight: 800; font-size: 15px; margin: 14px 0 6px; color: var(--ink-soft); }
.doc .guide-quotes { list-style: none; padding-left: 0; }
.doc .guide-quotes li { padding: 6px 12px; margin: 0 0 6px; border-radius: var(--r-sm); background: var(--bg); }
.doc h2 .lv-chip { margin-right: 6px; vertical-align: 2px; }

/* 시리즈 버튼(2026-11-30): 하단 저작권 옆, 모바일은 위아래 */
.foot-copy{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 14px}
.series-btn{display:inline-block;white-space:nowrap;padding:6px 14px;border:1.5px solid currentColor;border-radius:999px;font-weight:700;color:inherit;text-decoration:none!important;line-height:1.3}
.series-btn:hover{background:rgba(0,0,0,.05)}
@media (max-width:600px){.foot-copy{flex-direction:column}}
@media (max-width:600px){.foot-links a[href="guide.html"],.foot-links a[href="faq.html"]{display:none}} /* 모바일에서 줄바꿈 때 앞에 구분선이 남지 않게 */
