/* =========================================================
   📱 모바일 우선 스타일
   - 휴대폰: 화면 전체를 사용
   - PC: 가운데에 휴대폰 크기 화면으로 보기 (소개 패널 · 넓게 보기)
   ========================================================= */
:root {
  /* 🌿 봄·여름 숲 (기본) — 🍂 가을 · ❄️ 겨울은 아래 body.season-○○ 에서 덮어써요 (src/season.js) */
  --cream: #F4F7EA;
  --paper: #FFFEF6;
  --peach: #D7EBC4;
  --blush: #A8D08D;
  --rose: #4E9A55;
  --rose-deep: #2F7A43;
  --gold: #E2B865;
  --sage: #93B86A;
  --sky: #8FC3DE;
  --ink: #33402F;
  --ink-soft: #66705C;
  --line: #DFE8D0;
  --wood: #8F6243;
  --shadow: 0 8px 24px rgba(60, 90, 50, .18);
  --bg: #DCEBD0;
  --desk-bg: linear-gradient(135deg, #E6F4FB, #DCEFD0 55%, #BFDDA8);
  --frame: #FBFDF6;
  --frame-line: #CFE0C0;
  --rotate-bg: linear-gradient(180deg, #CDEBFA, #DCEFD0);
  --intro-bg: radial-gradient(circle at 80% 8%, rgba(255,250,210,.55), transparent 45%), linear-gradient(180deg, rgba(205,235,250,.25) 0%, rgba(220,239,208,.4) 60%, rgba(150,200,130,.5) 100%);
  --intro-solid: linear-gradient(180deg, #CDEBFA 0%, #DCEFD0 60%, #B9D9A0 100%);
  --grad: linear-gradient(135deg, #5FAE63, #A6C957);
  --glow: rgba(78, 154, 85, .4);
  --glow2: rgba(78, 154, 85, .8);
  --soft: #EEF5E2;
  --knob: #DDEFCB;
  --fill: #E8F0DC;
  --btn: #EAF2DF;
  --hero: #E3F0D3;
  --paper-line: #DCE8CC;
  --banner-bg: linear-gradient(135deg, #EAF6DA, #FFF6D2);
  --banner-line: #CFE3B4;
  --hl: #E2F0CF;
  --on: #E5F2D8;
  --on2: #D6EBC2;
  --bar: #DCEFC8;
  --qbg: #E9F2DA;
  --lockbg: #EEF1E6;
  --card-line: #D3E3C2;
  --card-inset: rgba(78, 120, 60, .12);
  --eyebrow: '🌿 ';
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg);
  font-family: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--ink); overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
a { touch-action: manipulation; }
.serif { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }

/* 휴대폰 화면 틀: 안쪽의 fixed 요소들은 모두 이 틀 기준으로 배치됩니다 */
#phone { position: fixed; inset: 0; overflow: hidden; transform: translateZ(0); background: var(--bg); }
#app { position: absolute; inset: 0; }
#app canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* ---------- PC에서는 휴대폰 크기로 미리보기 ---------- */
#desk { display: none; }
@media (min-width: 700px) and (hover: hover) and (pointer: fine) {
  body {
    background:
      radial-gradient(circle at 15% 15%, rgba(255,255,255,.7), transparent 40%),
      var(--desk-bg);
  }
  #phone {
    inset: 0; margin: auto; width: 400px; height: min(860px, calc(100vh - 48px)); border-radius: 40px;
    box-shadow: 0 30px 80px var(--glow), 0 0 0 10px var(--frame), 0 0 0 11px var(--frame-line);
  }
}
@media (min-width: 1060px) and (hover: hover) and (pointer: fine) {
  #desk {
    display: block; position: fixed; top: 50%; left: calc(50% + 250px); transform: translateY(-50%); width: 250px;
    background: rgba(255,253,248,.88); border-radius: 22px; padding: 20px; box-shadow: var(--shadow);
    font-size: 13px; line-height: 1.65; color: var(--ink-soft); -webkit-user-select: text; user-select: text;
  }
  #desk h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; }
  #desk kbd { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 11px; }
  #desk hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
}

/* ---------- 가로 화면 안내 ---------- */
#rotate {
  display: none; position: fixed; inset: 0; z-index: 200; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; background: var(--rotate-bg); font-size: 16px;
}
#rotate .ph { font-size: 54px; animation: tilt 2.2s ease-in-out infinite; }
@keyframes tilt { 0%, 100% { transform: rotate(-90deg); } 50% { transform: rotate(0); } }
/* 키보드가 올라와 화면이 낮아진 경우(비율 4:3 미만)는 가로로 치지 않음 */
@media (orientation: landscape) and (max-height: 520px) and (min-aspect-ratio: 4/3) and (pointer: coarse) { #rotate { display: flex; } }

/* ---------- 시작 화면 ---------- */
#intro {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background:
    var(--intro-bg);
  padding: calc(20px + var(--safe-t)) 16px calc(20px + var(--safe-b)); overflow-y: auto; touch-action: pan-y;
  transition: opacity .8s ease, visibility .8s;
}
#intro.hide { opacity: 0; visibility: hidden; }
.intro-card {
  width: 100%; max-width: 380px; background: rgba(255,249,238,.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 28px; box-shadow: var(--shadow), inset 0 0 0 6px var(--card-inset); padding: 30px 22px 22px; text-align: center; border: 2px solid var(--card-line);
}
.intro-eyebrow { letter-spacing: .3em; font-size: 12px; color: var(--rose-deep); margin-bottom: 10px; }
.intro-eyebrow::before { content: var(--eyebrow); letter-spacing: 0; }
.intro-names { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 34px; margin: 4px 0; white-space: nowrap; }
.intro-names .heart { color: var(--rose); font-size: 21px; margin: 0 8px; vertical-align: 3px; }
.intro-date { color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.intro-dday { display: inline-block; margin: 14px 0 18px; padding: 6px 14px; border-radius: 999px; background: var(--rose); color: #fff; font-weight: 700; letter-spacing: .05em; }
.intro-label { font-size: 13px; color: var(--ink-soft); margin: 4px 0 8px; }
.btn-primary {
  width: 100%; min-height: 56px; padding: 14px; border-radius: 16px; font-size: 18px; font-weight: 700; color: #fff;
  background: var(--grad); box-shadow: 0 8px 20px var(--glow); transition: transform .15s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .6; }
.btn-ghost { margin-top: 10px; font-size: 14px; color: var(--ink-soft); text-decoration: underline; padding: 10px; }
.intro-help { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }
.loadbar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 0 0 16px; }
.loadbar i { display: block; height: 100%; width: 0; background: var(--rose); transition: width .3s; }

/* 🎲 내 캐릭터 (무작위) */
.char-line { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 18px; background: var(--soft); border-radius: 16px; padding: 10px 12px; }
.avatar { position: relative; flex: none; width: 46px; height: 66px; --skin: #FFE0C7; --outfit: #8FB8DE; --hair: #5A3A2A; animation: bob 2.4s ease-in-out infinite; }
.avatar i { position: absolute; left: 50%; display: block; }
.avatar .hd { top: 4px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: var(--skin); z-index: 2; }
.avatar .hd::before { content: ''; position: absolute; left: -2px; right: -2px; top: -3px; height: 17px; border-radius: 17px 17px 5px 7px; background: var(--hair); }
.avatar .hd::after { content: ''; position: absolute; left: 8px; top: 15px; width: 4px; height: 5px; border-radius: 50%; background: #2B2220; box-shadow: 10px 0 0 #2B2220; }
.avatar .bd { top: 31px; width: 28px; height: 25px; margin-left: -14px; border-radius: 12px 12px 8px 8px; background: var(--outfit); z-index: 1; }
.avatar .lg { top: 54px; width: 22px; height: 10px; margin-left: -11px; border-radius: 0 0 6px 6px; background: #6B5B53; }
.avatar.long::before { content: ''; position: absolute; left: 50%; top: 8px; width: 38px; height: 40px; margin-left: -19px; border-radius: 18px 18px 12px 12px; background: var(--hair); }
.avatar.pop { animation: pop .45s ease; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pop { 0% { transform: scale(.5) rotate(-12deg); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.char-text { flex: 1; text-align: left; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; word-break: keep-all; }
.char-text b { display: block; color: var(--ink); font-size: 14px; }
.btn-reroll { flex: none; font-size: 13px; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.btn-reroll:active { transform: scale(.95); }

/* ---------- 상단 ---------- */
.hud-top {
  position: fixed; z-index: 10; top: calc(10px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r));
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.pill {
  pointer-events: auto; background: rgba(255,249,238,.94); border-radius: 999px; box-shadow: var(--shadow);
  padding: 9px 14px; font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 0;
}
.pill b { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.pill .dd { color: var(--rose); font-weight: 700; font-size: 12px; }
.hud-top .spacer { flex: 1; }
/* 📖 글로 보기 (☰ 옆) */
.text-pill { min-height: 44px; font-weight: 700; font-size: 14px; }
.text-pill:active { transform: scale(.95); }
/* ☰ 아래 세로 버튼 (소리 · 기념사진) */
.hud-side {
  position: fixed; z-index: 10; right: calc(12px + var(--safe-r)); top: calc(62px + var(--safe-t));
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
body.in-museum .hud-side { top: calc(116px + var(--safe-t)); }
body:not(.playing) .hud-side, body.reading .hud-side { display: none; }
/* 사진관 안에서는 이름표 대신 '밖으로 나가기' 버튼 */
.exit-pill { display: none; min-height: 44px; font-size: 15px; font-weight: 700; color: #fff; background: var(--rose); }
.exit-pill:active { transform: scale(.95); }
body.in-museum .exit-pill { display: flex; }
body.in-museum .names-pill { display: none; }
.icon-btn {
  pointer-events: auto; flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,249,238,.95);
  box-shadow: var(--shadow); font-size: 19px; display: grid; place-items: center;
}
.icon-btn:active, .round:active { transform: scale(.92); }

/* 사진관 테마 바 */
#museum-bar {
  position: fixed; z-index: 10; top: calc(62px + var(--safe-t)); left: 0; right: 0; display: none;
  gap: 8px; overflow-x: auto; padding: 4px 12px 8px; scrollbar-width: none; touch-action: pan-x;
}
#museum-bar::-webkit-scrollbar { display: none; }
body.in-museum #museum-bar { display: flex; }
.chip {
  flex: none; min-height: 44px; padding: 9px 14px; border-radius: 999px; background: rgba(255,253,248,.95); font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1); border: 2px solid transparent;
}
.chip.on { border-color: var(--rose); color: var(--rose-deep); font-weight: 700; }
.chip.accent { background: var(--rose); color: #fff; }

/* ---------- 조이스틱 (화면 어디든 끌면 그 자리에 나타남) ---------- */
#joy {
  position: absolute; z-index: 9; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%;
  left: calc(80px + var(--safe-l)); top: calc(100% - 100px - var(--safe-b));
  background: radial-gradient(circle, rgba(255,255,255,.4), rgba(255,255,255,.14)); border: 2px solid rgba(255,255,255,.75);
  box-shadow: 0 6px 20px rgba(120,80,60,.15); pointer-events: none; opacity: .6; transition: left .3s, top .3s, opacity .3s;
}
#joy.active { opacity: 1; transition: opacity .12s; }
#joy .knob {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  background: linear-gradient(145deg, #fff, var(--knob)); box-shadow: 0 4px 12px rgba(110,70,40,.3);
}
#joy .hint {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap;
  font-size: 12px; color: #fff; background: rgba(74,59,56,.55); padding: 4px 10px; border-radius: 999px;
}
body.moved #joy .hint { display: none; }

/* ---------- 오른쪽 버튼 ---------- */
.actions {
  position: fixed; z-index: 10; right: calc(16px + var(--safe-r)); bottom: calc(24px + var(--safe-b));
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.actions .row { display: flex; gap: 10px; }
.round { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,253,248,.94); box-shadow: var(--shadow); font-size: 21px; display: grid; place-items: center; }
#btn-action {
  min-width: 84px; height: 84px; border-radius: 42px; padding: 0 18px; color: #fff; font-size: 15px; font-weight: 700;
  background: var(--grad); box-shadow: 0 8px 22px var(--glow);
  display: flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; max-width: 200px;
  transform: scale(.85); opacity: .45; transition: transform .2s, opacity .2s;
}
#btn-action.ready { transform: scale(1); opacity: 1; animation: pulse 1.6s ease-in-out infinite; }
#btn-action .em { font-size: 24px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 8px 22px var(--glow); } 50% { box-shadow: 0 8px 34px var(--glow2); } }

/* ---------- 알림 / 화면 전환 ---------- */
#toast {
  position: fixed; z-index: 40; left: 50%; top: calc(118px + var(--safe-t)); transform: translate(-50%, -10px);
  background: rgba(74,59,56,.88); color: #fff; padding: 11px 18px; border-radius: 18px; font-size: 14px; line-height: 1.5;
  opacity: 0; transition: .35s; pointer-events: none; width: max-content; max-width: calc(100% - 40px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#fade { position: fixed; inset: 0; z-index: 45; background: var(--cream); opacity: 0; pointer-events: none; transition: opacity .45s; }
#fade.on { opacity: 1; }

/* ---------- 아래에서 올라오는 팝업 ---------- */
#modal { position: fixed; inset: 0; z-index: 30; display: none; }
#modal.open { display: block; }
#modal .backdrop { position: absolute; inset: 0; background: rgba(74,59,56,.38); animation: fadeIn .25s; transition: opacity .22s; }
#modal .sheet {
  position: absolute; left: 0; right: 0; bottom: var(--kb, 0px); max-height: calc(90% - var(--kb, 0px));
  background: var(--paper); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.15);
  display: flex; flex-direction: column; padding-bottom: var(--safe-b);
  animation: slideUp .38s cubic-bezier(.2,.9,.3,1.03); transition: transform .25s ease;
}
#modal.closing .backdrop { opacity: 0; }
#modal.closing .sheet { transform: translateY(105%) !important; transition: transform .22s ease-in; }
.sheet-top { flex: none; touch-action: none; cursor: grab; }
.grab { width: 42px; height: 5px; border-radius: 3px; background: #E6D5C6; margin: 9px auto 0; }
.sheet-head { display: flex; align-items: center; padding: 8px 16px 8px 20px; }
.sheet-head h2 { margin: 0; font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 20px; flex: 1; }
.sheet-head .close { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); font-size: 17px; }
.sheet-head .fs { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); font-size: 13px; font-weight: 700; margin-right: 6px; }
.sheet-body {
  overflow-y: auto; padding: 4px 20px 26px; touch-action: pan-y; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; -webkit-user-select: text; user-select: text;
}
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } }

/* 팝업 안 공통 */
.card { background: #FFFCF6; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 12px 0; }
.muted { color: var(--ink-soft); font-size: 14px; }
.center { text-align: center; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  flex: 1; min-width: 110px; min-height: 48px; padding: 12px 10px; border-radius: 14px; background: var(--btn); font-size: 15px;
  text-align: center; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.pink { background: var(--rose); color: #fff; }
.btn.small { flex: none; min-width: 0; min-height: 44px; padding: 10px 14px; font-size: 14px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.ornament { text-align: center; color: var(--gold); letter-spacing: .5em; margin: 8px 0; }

/* 청첩장 */
.inv-hero { text-align: center; padding: 20px 8px 12px; background: linear-gradient(180deg, var(--hero), var(--paper)); border-radius: 18px; }
.inv-hero .en { letter-spacing: .35em; font-size: 12px; color: var(--rose); }
.inv-hero .names { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 26px; margin: 12px 0 6px; }
.inv-greet { white-space: pre-line; line-height: 1.9; text-align: center; font-family: 'Gaegu', 'Gowun Dodum', sans-serif; font-size: 19px; }
.parents { text-align: center; line-height: 2; font-size: 15px; }
.parents b { font-size: 17px; font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; }
.cal { width: 100%; border-collapse: collapse; text-align: center; font-size: 14px; table-layout: fixed; }
.cal th { font-weight: 400; color: var(--ink-soft); padding: 6px 0; font-size: 12px; }
.cal td { padding: 7px 0; }
.cal td.sun, .cal th.sun { color: var(--rose); }
.cal td.day span { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--rose); color: #fff; font-weight: 700; }
.countdown { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.countdown div { background: #FFF1E8; border-radius: 12px; padding: 8px 6px; flex: 1; max-width: 70px; text-align: center; }
.countdown b { display: block; font-size: 20px; color: var(--rose-deep); }
.countdown small { font-size: 11px; color: var(--ink-soft); }

/* 계좌 */
details.acc { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin: 10px 0; overflow: hidden; }
details.acc summary { padding: 17px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; cursor: pointer; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: '▾'; color: var(--ink-soft); transition: transform .2s; }
details.acc[open] summary::after { transform: rotate(180deg); }
.acc-row { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px dashed var(--line); }
.acc-row[data-copy] { cursor: pointer; }
.acc-row[data-copy]:active { background: #FFF6EE; }
.acc-row .info { flex: 1; font-size: 14px; line-height: 1.5; min-width: 0; }
.acc-row .info small { color: var(--ink-soft); }

/* ---------- ✉️ 편지함: 쓰기 ---------- */
.field { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 16px; color: var(--ink); margin-top: 8px; -webkit-user-select: text; user-select: text; }
textarea.field { min-height: 110px; resize: none; }
.seg { display: flex; background: var(--fill); border-radius: 12px; padding: 4px; margin-top: 8px; }
.seg button { flex: 1; min-height: 44px; border-radius: 9px; font-size: 14px; }
.seg button.on { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.08); font-weight: 700; color: var(--rose-deep); }

/* ---------- ✉️ 편지함: 봉투 목록 ---------- */
.env-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 4px; }
.l-status { font-size: 12.5px; margin: 0 0 10px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--rose-deep); text-decoration: underline; cursor: pointer; min-height: 0; }
.env.pending { opacity: .75; border-style: dashed; }
.env-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.env {
  position: relative; display: block; width: 100%; text-align: left; min-height: 98px; padding: 40px 12px 12px; overflow: hidden;
  background: #FFF8EE; border: 1px solid #EEDCC6; border-radius: 12px; transition: transform .15s;
}
.env { --c: #F4B8C0; background: color-mix(in srgb, var(--c) 14%, #FFFDF8); border-color: color-mix(in srgb, var(--c) 40%, #FFFDF8); }
.env.locked { background: #F3EEE8; border-color: #E2D6CA; }
.env.locked .flap { background: #CBBFB2 !important; }
.env.unread::after { content: ''; position: absolute; right: 8px; top: 40px; width: 10px; height: 10px; border-radius: 50%; background: #E4605A; box-shadow: 0 0 0 3px #fff; }
.env.mine { box-shadow: inset 0 0 0 2px var(--gold); }
.env:active { transform: scale(.97); }
.env .flap {
  position: absolute; left: 0; right: 0; top: 0; height: 34px; background: #E9D8C4;
  clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .3s ease;
}
.env .flap { background: var(--c); }
.env.open .flap { transform: rotateX(180deg); opacity: .5; }
.env::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 34px; background: linear-gradient(180deg, rgba(0,0,0,.05), transparent); }
.env .seal { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); font-size: 16px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.env-name { display: block; font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 14.5px; line-height: 1.3; word-break: keep-all; }
.env-meta { display: block; color: var(--ink-soft); font-size: 11.5px; margin-top: 3px; }

/* ---------- 📜 편지지 ---------- */
.paper {
  position: relative; background: #FFFDF6; border: 1px solid #EFE2D0; border-radius: 6px; padding: 22px 20px 18px; margin-top: 6px;
  box-shadow: 0 10px 30px rgba(120,80,60,.12);
  background-image: repeating-linear-gradient(transparent 0 31px, var(--paper-line) 31px 32px); background-position: 0 60px;
  touch-action: pan-y;
}
.paper::before { content: ''; position: absolute; left: 16px; right: 16px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--blush), var(--gold)); }
.paper { --c: #F4B8C0; }
.paper::before { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, #8F6243)) !important; }
.paper-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.paper-stamp { font-size: 22px; }
.paper-msg { font-family: 'Gaegu', 'Gowun Dodum', sans-serif; font-size: 20px; line-height: 32px; white-space: pre-wrap; word-break: break-word; margin: 0; min-height: 96px; }
.paper-from { text-align: right; margin-top: 14px; font-size: 14px; }
.paper-from b { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; }
.paper-from small { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 2px; }
.paper-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.paper-nav .btn { flex: none; }

/* 식순 */
.timeline { position: relative; margin: 10px 0 0 8px; padding-left: 22px; border-left: 2px dashed var(--blush); }
.tl-item { position: relative; padding: 4px 0 18px; }
.tl-item::before { content: ''; position: absolute; left: -30px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--blush); }
.tl-item.now::before { background: var(--rose); border-color: var(--rose); box-shadow: 0 0 0 6px rgba(232,138,152,.25); }
.tl-item .t { font-weight: 700; color: var(--rose-deep); }
.tl-item .d { color: var(--ink-soft); font-size: 13px; }

/* 퀴즈 */
.quiz-q { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 19px; text-align: center; margin: 14px 0 18px; line-height: 1.5; }
.quiz-opt { display: block; width: 100%; text-align: left; padding: 16px; margin: 8px 0; border-radius: 14px; background: #fff; border: 2px solid var(--line); font-size: 16px; }
.quiz-opt.right { border-color: var(--sage); background: #EEF7E9; }
.quiz-opt.wrong { border-color: var(--rose); background: #FDEDEF; }
.progress-dots { display: flex; justify-content: center; gap: 6px; }
.progress-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.progress-dots i.on { background: var(--rose); }

/* 바로가기 메뉴 */
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.howto { margin: 8px 0 0; padding-left: 22px; line-height: 1.9; }
.kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; }
.menu-sec { margin: 18px 2px 0; font-size: 15px; font-weight: 400; color: var(--ink-soft); font-family: 'Jua', 'Gowun Dodum', sans-serif; }
.menu-grid.small { grid-template-columns: repeat(2, 1fr); }
.menu-item.small { flex-direction: row; justify-content: flex-start; padding: 12px 14px; gap: 10px; text-align: left; }
.menu-item.small .e { font-size: 22px; }
.menu-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 4px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 6px; line-height: 1.3; }
.menu-item .e { font-size: 28px; }
.menu-item:active { background: var(--hero); }

/* 앨범 */
.album-theme h3 { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; margin: 18px 0 4px; font-size: 17px; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; }
.album-grid button { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); }
.album-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 사진 크게 보기 ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 35; background: rgba(30,22,20,.96); display: none; flex-direction: column;
  align-items: center; justify-content: center; touch-action: none; overflow: hidden;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 100%; max-height: 72%; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.5);
  pointer-events: none; -webkit-user-drag: none; will-change: transform;
}
#lightbox .cap { color: #fff; margin-top: 16px; text-align: center; padding: 0 24px; font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; line-height: 1.6; pointer-events: none; }
#lightbox .cap small { display: block; color: rgba(255,255,255,.6); font-family: 'Gowun Dodum', sans-serif; font-size: 12px; margin-top: 4px; }
#lightbox .lb-help { position: absolute; bottom: calc(18px + var(--safe-b)); left: 0; right: 0; text-align: center; color: rgba(255,255,255,.45); font-size: 12px; pointer-events: none; }
#lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; }
#lightbox .prev { left: 8px; }
#lightbox .next { right: 8px; }
#lightbox .lb-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 19px; }

/* ---------- 📖 글로 보기 ---------- */
#textview {
  position: absolute; inset: 0; z-index: 20; display: none; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y; background: var(--cream);
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
body.reading #textview { display: block; }
body.reading .hud-top, body.reading #joy, body.reading .actions, body.reading #museum-bar { display: none !important; }
.tv-top {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center;
  padding: calc(8px + var(--safe-t)) 10px 8px; background: rgba(255,249,240,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.tv-fs { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.tv-back { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--rose); color: #fff; font-weight: 700; font-size: 14px; }
.tv-back:active { transform: scale(.95); }
.tv-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.tv-chips::-webkit-scrollbar { display: none; }
.tv-chips .chip { min-height: 40px; padding: 7px 12px; font-size: 13px; box-shadow: none; background: #fff; border: 1px solid var(--line); }
.tv-chips .chip.on { border-color: var(--rose); }
.tv-inner { padding: 0 18px calc(40px + var(--safe-b)); }
.tv-hero { text-align: center; padding: 28px 8px 18px; }
.tv-hero .en { letter-spacing: .35em; font-size: 12px; color: var(--rose); }
.tv-names { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 30px; margin: 10px 0 6px; }
.tv-names .heart { color: var(--rose); font-size: 22px; margin: 0 6px; }
.tv-hero .btn-primary { margin-top: 10px; }
.tv-hint { font-size: 12.5px; margin: 10px 0 0; }
.tv-sec { padding: 22px 0 10px; border-top: 1px dashed var(--line); scroll-margin-top: 68px; }
.tv-h { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 20px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.tv-sub { margin: 0 0 8px; }
.tv-foot { text-align: center; padding: 30px 0 10px; color: var(--ink-soft); font-size: 13px; border-top: 1px dashed var(--line); }

/* 3D가 안 되는 휴대폰: 3D 전용 버튼 숨김 */
body.no3d .swipe-hint, body.no3d #btn-look, body.no3d #btn-text, body.no3d .intro-help,
body.no3d #btn-shot, body.no3d #joy, body.no3d .actions { display: none !important; }

/* 시작 전에는 조작 버튼 숨김 */
body:not(.playing) .hud-top, body:not(.playing) #joy, body:not(.playing) .actions { display: none; }

@media (max-width: 360px) {
  #btn-action { height: 76px; min-width: 76px; font-size: 13px; }
  .pill { font-size: 13px; padding: 8px 11px; }
  .text-pill { padding: 8px 10px; }
  .intro-names { font-size: 25px; }
  .menu-item { font-size: 12px; }
  .env-grid { grid-template-columns: 1fr; }
}

.confetti { position: absolute; z-index: 60; top: -30px; font-size: 22px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* 움직임을 줄여 달라고 설정한 휴대폰 */
@media (prefers-reduced-motion: reduce) {
  .avatar, #rotate .ph, #btn-action.ready, .confetti { animation: none !important; }
  #modal .sheet, #modal .backdrop, #intro, .env .flap { animation: none !important; transition: none !important; }
}

/* ---------- 시작 화면: 3D가 안 되면 불투명하게 ---------- */
body.no3d #intro { background: var(--intro-solid); }
.btn-row { display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; }
.btn-row .btn-ghost { margin-top: 6px; padding: 10px 8px; }
body.no3d #btn-tour-start { display: none !important; }
.demo-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #4A3B38; color: #fff; font-size: 11px; vertical-align: middle; }

/* 예식 당일: 시작 화면 바로가기 */
.today { background: var(--hl); border-radius: 16px; padding: 12px 12px 10px; margin: 0 0 14px; }
.today .t-now { font-weight: 700; color: var(--rose-deep); font-size: 14px; }
.today .btns { margin-top: 8px; justify-content: center; }

/* 📸 포토존 카운트다운 */
#count {
  position: fixed; z-index: 44; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.4); opacity: 0; pointer-events: none;
  font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 120px; color: #fff; text-shadow: 0 6px 24px var(--glow2), 0 0 0 4px var(--glow);
}
#count.show { animation: countPop .65s ease-out forwards; }
@keyframes countPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } }

/* 🚶 투어 중 표시 */
.tour-pill { display: none; min-height: 44px; font-size: 14px; font-weight: 700; color: #fff; background: var(--ink); }
body.touring .tour-pill { display: flex; }
body.touring .names-pill { display: none; }

/* 가+ 큰 글씨 */
html.big .sheet-body, html.big .tv-inner { zoom: 1.18; }
html.big .menu-grid { grid-template-columns: repeat(2, 1fr); }

/* ---------- PC 소개 패널 ---------- */
#desk p { margin: 6px 0 0; }
#desk .desk-btns { display: flex; gap: 6px; margin-top: 10px; }
#desk .desk-btns .btn { min-height: 38px; font-size: 12.5px; padding: 6px 8px; min-width: 0; }
#desk .visits { list-style: none; padding: 0; margin: 6px 0 0; columns: 2; column-gap: 8px; font-size: 12.5px; line-height: 1.9; }
#desk .visits li::before { content: '○ '; color: #C9B9B3; }
#desk .visits li.done { color: var(--ink); }
#desk .visits li.done::before { content: '✓ '; color: var(--rose-deep); font-weight: 700; }
#desk a { color: var(--rose-deep); text-decoration: none; font-weight: 700; }
#desk small { display: block; color: #9A8C88; font-size: 11.5px; line-height: 1.5; }

/* 🖥 넓게 보기 (PC): 휴대폰 틀을 벗고 창 전체로 */
body.wide #phone { inset: 0 !important; width: auto !important; height: auto !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
body.wide #desk { top: auto; bottom: 16px; left: 16px; transform: none; width: 230px; max-height: 50vh; overflow: auto; }
body.wide #modal .sheet { left: 0; right: 0; width: min(100%, 560px); margin: 0 auto; border-radius: 26px 26px 0 0; }
body.wide .tv-inner { max-width: 620px; margin: 0 auto; }
body.wide #lightbox img { max-width: min(100%, 900px); }
body.wide #intro .intro-card { max-width: 420px; }


/* =========================================================
   🏡 가족 마을 추가 스타일
   ========================================================= */
/* 작은 캐릭터 얼굴: 안경 · 모자 · 아이 · 크기 */
.avatar .gls { top: 17px; left: 50%; width: 24px; height: 8px; margin-left: -12px; z-index: 3; border: 2px solid #4A3B38; border-radius: 5px; background: rgba(255,255,255,.25); }
.avatar .gls::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #4A3B38; }
.avatar .ht { z-index: 4; left: 50%; }
.avatar .ht-cap { top: -1px; width: 32px; height: 13px; margin-left: -16px; border-radius: 16px 16px 2px 2px; background: var(--outfit); box-shadow: 8px 9px 0 -4px var(--outfit); filter: brightness(.92); }
.avatar .ht-beanie { top: -3px; width: 34px; height: 15px; margin-left: -17px; border-radius: 17px 17px 4px 4px; background: #E88A98; border-bottom: 4px solid #FFFDF8; }
.avatar .ht-beanie::after { content: ''; position: absolute; left: 50%; top: -6px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #FFFDF8; }
.avatar .ht-flower { top: 3px; width: 10px; height: 10px; margin-left: 7px; border-radius: 50%; background: #F4B8C0; box-shadow: 5px 3px 0 -1px #F7D58B, -3px 5px 0 -2px #fff; }
.avatar.kid { transform: scale(.82); transform-origin: 50% 100%; }
.avatar.big { zoom: 1.45; }
.avatar.mini { zoom: .55; animation: none; flex: none; }
span.avatar { display: inline-block; vertical-align: middle; }

/* 🔒 가족 암호 */
.lock { margin: 0 0 14px; }
.lock-row { display: flex; gap: 8px; }
.lock-row .field { margin: 0; flex: 1; text-align: center; letter-spacing: .3em; font-size: 20px; }
.lock-row .btn { flex: none; min-width: 76px; }
.lock-hint { font-size: 12.5px; margin: 8px 0 0; }
.lock.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* 🙋 나는 누구예요? */
.who-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 14px; }
/* 🙋 시작 화면: 캐릭터 카드를 옆으로 넘겨 고르기 */
.swipe-hint { margin-left: 4px; font-size: 11.5px; opacity: .75; }
.who-grid.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; touch-action: pan-x; overscroll-behavior-x: contain;
  margin: 0 -22px 6px; padding: 6px 22px 10px; scroll-padding: 0 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.who-grid.carousel::-webkit-scrollbar { display: none; }
.carousel .who-btn { position: relative; flex: 0 0 34%; max-width: 132px; min-height: 0; padding: 8px 4px 10px; scroll-snap-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 26%, #fff) 0%, #fff 78%); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.carousel .who-btn.on { border-color: var(--c); box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 45%, transparent); transform: translateY(-2px); }
.carousel .who-btn.on::after { content: '✓'; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); color: #fff; font-size: 13px; line-height: 22px; font-weight: 700; }
.char-pic { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 104px; }
.char-img { width: 84px; height: 105px; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.who-grid:not(.carousel) .char-pic { height: 74px; }
.who-grid:not(.carousel) .char-img { width: 60px; height: 75px; }
.char-pic .avatar.big { margin-bottom: 4px; }
.char-pic .guest-ic { font-size: 40px; line-height: 1; margin-bottom: 26px; }
.who-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; min-height: 36px; font-size: 12.5px; color: var(--ink-soft); text-align: left; word-break: keep-all; line-height: 1.45; }
.who-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 16px; background: #fff; border: 2px solid var(--line); min-height: 104px; transition: transform .12s; }
.who-btn:active { transform: scale(.96); }
.who-btn b { font-size: 14px; }
.who-btn small { font-size: 11.5px; color: var(--ink-soft); }
.who-btn.on { border-color: var(--rose); background: var(--on); }
.who-btn .avatar { animation: none; }
.guest-ic { font-size: 34px; line-height: 66px; }


/* 공통 조각 */
.who-chip { --c: #E6D5C6; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 13px; background: color-mix(in srgb, var(--c) 22%, #fff); border: 1px solid color-mix(in srgb, var(--c) 55%, #fff); white-space: nowrap; }
.who-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.up-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: 14.5px; width: 100%; text-align: left; }
.up-row:first-of-type { border-top: 0; }
.up-row .dd { flex: none; color: var(--rose-deep); font-weight: 700; font-size: 13px; }
.linkrow { min-height: 44px; }
.linkrow:active { background: #FFF6EE; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #E4605A; color: #fff; font-size: 12px; }
.bday-banner { background: var(--banner-bg); border: 1px solid var(--banner-line); border-radius: 16px; padding: 12px 14px; margin: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 15px; }

/* 🏡 우리 가족 */
.mem-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.mem-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.mem-card:active { transform: scale(.97); }
.mem-card b { font-size: 15px; margin-top: 2px; }
.mem-card b small { color: var(--rose-deep); font-weight: 400; }
.mem-card > small { font-size: 12px; color: var(--ink-soft); }
.mem-heart { position: absolute; right: 10px; top: 8px; font-size: 12px; color: var(--rose-deep); }

/* 👤 구성원의 집 */
.mem-hero { --c: #F4B8C0; text-align: center; padding: 18px 8px 12px; border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, #fff), #fff); }
.mem-hero .names { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 24px; margin: 6px 0 2px; }
.mem-line { font-family: 'Gaegu', 'Gowun Dodum', sans-serif; font-size: 20px; margin: 10px 0 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat-row div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; text-align: center; }
.stat-row b { display: block; font-size: 18px; }
.stat-row small { font-size: 11.5px; color: var(--ink-soft); }

/* 💬 오늘의 질문 */
.q-hero { text-align: center; padding: 18px 12px 14px; border-radius: 18px; background: var(--qbg); margin-bottom: 12px; }
.q-text { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 21px; line-height: 1.5; margin: 8px 0; word-break: keep-all; }
.ans-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ans-card { --c: #E6D5C6; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 14px; padding: 10px 12px; }
.ans-card.locked { display: flex; align-items: center; gap: 8px; background: var(--lockbg); }
.ans-card.locked b { flex: 1; }
.ans-top { display: flex; align-items: center; gap: 6px; }
.ans-top b { flex: 1; font-size: 14.5px; }
.ans-text { margin: 6px 0 2px; font-family: 'Gaegu', 'Gowun Dodum', sans-serif; font-size: 19.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.past-q { margin-top: 6px; }
.past-q .up-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 💬 답장 · 반응 */
.rx { margin-top: 8px; }
.rx-emojis { display: flex; gap: 6px; flex-wrap: wrap; }
.rx-e { min-height: 36px; min-width: 44px; padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: 16px; display: inline-flex; align-items: center; gap: 4px; }
.rx-e b { font-size: 12px; color: var(--ink-soft); }
.rx-e.on { background: var(--on2); box-shadow: inset 0 0 0 2px var(--rose); }
.rx-e:disabled { opacity: .6; }
.rx-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
.rx-list li { padding: 4px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rx-list small { color: var(--ink-soft); font-size: 11.5px; }
.rx-form { display: flex; gap: 6px; margin-top: 8px; }
.rx-form .field { margin: 0; padding: 10px 12px; font-size: 15px; }
.rx-open { margin-top: 8px; font-size: 13.5px; min-height: 32px; }

/* ✉️ 받는 사람 · 타임캡슐 */
.to-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.to-chip { --c: #F4B8C0; min-height: 40px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-size: 14px; }
.to-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, #fff); font-weight: 700; }
.tc-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; flex-wrap: wrap; min-height: 36px; }
.tc-row input { width: 20px; height: 20px; accent-color: var(--rose); }
.l-filter { margin-top: 6px; }
.l-filter b { color: #E4605A; }

/* ❓ 점수판 */
.board { list-style: none; padding: 0; margin: 8px 0 0; }
.board li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.board li:first-child { border-top: 0; }
.board .rank { width: 26px; text-align: center; font-size: 18px; }
.board b { flex: 1; }
.board .sc { color: var(--rose-deep); font-weight: 700; }

/* 📅 달력 */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.cal-nav b { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 18px; }
.fam-cal td { padding: 2px 0; }
.fam-cal td button { width: 100%; min-height: 42px; border-radius: 10px; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; color: inherit; }
.fam-cal td button i { font-style: normal; font-size: 12px; }
.fam-cal td.today button { background: var(--hl); font-weight: 700; }
.fam-cal td.pick button { box-shadow: inset 0 0 0 2px var(--rose); }
.ups .up-row { flex-wrap: wrap; }
.ups .up-row > span:first-child { flex: 1 1 60%; }

/* 🗳️ 투표 */
.poll-opt { position: relative; display: flex; flex-wrap: wrap; align-items: center; width: 100%; min-height: 48px; margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: #fff; border: 2px solid var(--line); overflow: hidden; text-align: left; font-size: 15px; }
.poll-opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); transition: width .4s; }
.poll-opt .txt, .poll-opt .cnt, .poll-opt .voters { position: relative; }
.poll-opt .txt { flex: 1; }
.poll-opt .cnt { font-weight: 700; color: var(--rose-deep); font-size: 13px; }
.poll-opt .voters { flex-basis: 100%; display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.poll-opt .voters i { --c: #ccc; font-style: normal; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--c) 30%, #fff); }
.poll-opt.on { border-color: var(--rose); }
.poll-opt:disabled { opacity: 1; cursor: default; }
.poll-new .field { margin-top: 8px; }

/* 🌱 나무 */
.tree-hero { text-align: center; padding: 16px 10px 12px; border-radius: 18px; background: linear-gradient(180deg, #EEF7E9, #fff); margin-bottom: 10px; }
.tree-emoji { font-size: 64px; line-height: 1.1; }
.tree-hero .names { font-family: 'Jua', 'Gowun Dodum', sans-serif; font-weight: 400; font-size: 22px; margin: 4px 0; }
.prog { height: 10px; border-radius: 5px; background: #E3EED9; overflow: hidden; margin: 10px 20px 6px; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #A8D08D, #6FB35A); border-radius: 5px; }
.week { display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; margin: 12px 4px 0; height: 110px; }
.week div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.week i { width: 70%; border-radius: 6px 6px 2px 2px; background: #8FD3F0; }
.week small { font-size: 11px; color: var(--ink-soft); }

/* 🎨 꾸미기 */
.look-preview { display: grid; place-items: center; padding: 18px 0 8px; }
.look-preview .avatar.big { zoom: 2; }
.look-img { width: 128px; height: 160px; object-fit: contain; }
.look-box > b { display: block; margin: 14px 0 6px; font-size: 14px; }
.sw { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-c { --c: #ccc; width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.sw-c.on { box-shadow: 0 0 0 3px var(--rose); }
.look-box .seg { margin-top: 0; }

/* 글로 보기의 가족 마을 머리 */
.tv-hero .intro-dday { margin: 10px 0 6px; }


/* =========================================================
   🍂 가을 · ❄️ 겨울 화면 색 (메뉴의 '계절' 또는 config.js의 season)
   ========================================================= */
body.season-autumn {
  --cream: #FBF1E1; --paper: #FFF9EE; --peach: #F6CFA0; --blush: #F2B27A; --rose: #E07B39; --rose-deep: #B5552B;
  --gold: #E2A93B; --sage: #93A86A; --sky: #8BB8C9; --ink: #4A3528; --ink-soft: #7D6553; --line: #EBDCC4;
  --shadow: 0 8px 24px rgba(110, 70, 40, .2);
  --bg: #F3DEC0; --desk-bg: linear-gradient(135deg, #F6E3C3, #F2C99C 55%, #D9A27A); --frame: #FFF9EE; --frame-line: #D9C2A0;
  --rotate-bg: linear-gradient(180deg, #F6D7A8, #F3DEC0);
  --intro-bg: radial-gradient(circle at 80% 8%, rgba(255,226,160,.55), transparent 45%), linear-gradient(180deg, rgba(246,215,168,.25) 0%, rgba(240,200,150,.4) 60%, rgba(200,140,90,.5) 100%);
  --intro-solid: linear-gradient(180deg, #F6D7A8 0%, #F3DEC0 60%, #E3B98C 100%);
  --grad: linear-gradient(135deg, #E9894A, #D9A441); --glow: rgba(224, 123, 57, .45); --glow2: rgba(224, 123, 57, .85);
  --soft: #F8EBD6; --knob: #F6D9B5; --fill: #F2E4CE; --btn: #F5E6CF; --hero: #F8E6CA; --paper-line: #EAD9BF;
  --banner-bg: linear-gradient(135deg, #FDE7CF, #FFF3D2); --banner-line: #EFC99C; --hl: #FBE3C6; --on: #FDEBD6; --on2: #FCDDBF;
  --bar: #FBE0BE; --qbg: #F6E3C4; --lockbg: #F4EADB; --card-line: #E6CFAE; --card-inset: rgba(143, 98, 67, .12);
  --eyebrow: '🍂 ';
}
body.season-winter {
  --cream: #F3F6FA; --paper: #FDFEFF; --peach: #DCE7F3; --blush: #A9C3E0; --rose: #3E6FA8; --rose-deep: #B23A3A;
  --gold: #E2B865; --sage: #7FA88A; --sky: #8FB4D8; --ink: #2E3442; --ink-soft: #5F6878; --line: #DCE4EE;
  --shadow: 0 8px 24px rgba(50, 70, 110, .2);
  --bg: #E2EAF3; --desk-bg: linear-gradient(135deg, #DCE8F4, #EEF3F8 55%, #C9D8EA); --frame: #FDFEFF; --frame-line: #C9D6E6;
  --rotate-bg: linear-gradient(180deg, #D8E6F2, #E2EAF3);
  --intro-bg: radial-gradient(circle at 80% 8%, rgba(255,255,255,.6), transparent 45%), linear-gradient(180deg, rgba(216,230,242,.3) 0%, rgba(233,239,246,.45) 60%, rgba(180,200,226,.55) 100%);
  --intro-solid: linear-gradient(180deg, #D8E6F2 0%, #E9EFF6 60%, #C9D8EA 100%);
  --grad: linear-gradient(135deg, #3E6FA8, #6C9BD0); --glow: rgba(62, 111, 168, .4); --glow2: rgba(62, 111, 168, .8);
  --soft: #EAF0F7; --knob: #DCE7F3; --fill: #E6ECF4; --btn: #E9EFF6; --hero: #E3ECF6; --paper-line: #DFE6EF;
  --banner-bg: linear-gradient(135deg, #FBE6E6, #EAF2FB); --banner-line: #E6C3C3; --hl: #E3ECF6; --on: #E6EEF8; --on2: #D9E6F5;
  --bar: #DCE7F4; --qbg: #E6EDF6; --lockbg: #EDF1F6; --card-line: #D3DEEB; --card-inset: rgba(62, 111, 168, .12);
  --eyebrow: '❄️ ';
}

/* ⚙️ 가족 암호 설정 (시작 화면 오른쪽 위) */
.intro-card { position: relative; }
.intro-gear { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; background: var(--fill); font-size: 19px; display: grid; place-items: center; }
.intro-gear:active { transform: scale(.92); }
.ls-form .field { margin-top: 8px; }
/* 시작 화면에서 연 창(⚙️ 가족 암호)은 시작 카드 위로, 안내 문구는 그 위로 */
body:not(.playing) #modal { z-index: 56; }
body:not(.playing) #toast { z-index: 66; }
