/* 반려동물 도감: 따뜻한 종이 앨범. 미색 종이 + 기울어진 폴라로이드 + 마스킹테이프 + 손글씨 */
:root {
  --paper: #f3ecdf; --paper2: #eae0cd; --card: #fffcf6;
  --ink: #3b2f27; --ink2: #5e4c3f; --mute: #9a8a79; --line: #e3d6c2; --dash: #d2c0a4;
  --red: #c4533f; --gold: #dfa23a;
  --hand: "Nanum Pen Script", "Gowun Batang", cursive;
  --book: "Gowun Batang", "Noto Serif KR", serif;
  --ui: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .36  0 0 0 0 .27  0 0 0 0 .17  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.32'/></svg>");
  --safeT: env(safe-area-inset-top, 0px); --safeB: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font-family: var(--ui); font-size: 15px; line-height: 1.5;
  background-color: var(--paper);
  background-image:
    var(--grain),
    radial-gradient(120% 70% at 50% 0%, #f8f2e7 0%, rgba(243,236,223,0) 70%);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }
[hidden] { display: none !important; }
.ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; vertical-align: -0.18em; }

.screen { max-width: 560px; margin: 0 auto; padding: calc(16px + var(--safeT)) 18px calc(28px + var(--safeB)); }

/* ── 단추 */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 50px; padding: 0 18px; border-radius: 15px; font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; transition: transform .1s, opacity .2s, background .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: #fff8ee; box-shadow: 0 6px 16px -8px rgba(59,47,39,.7); }
.btn.ghost { background: rgba(255,252,246,.7); border: 1.5px solid var(--line); color: var(--ink); }
.btn.soft { background: #efe5d4; color: var(--ink); }
.btn.danger { background: var(--red); color: #fff; }
.btn.wide { width: 100%; }
.btn.big { height: 56px; font-size: 16.5px; border-radius: 17px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.link { color: var(--mute); font-size: 14px; padding: 10px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(154,138,121,.45); }
.iconBtn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink2); }
.iconBtn:active { background: rgba(59,47,39,.07); }
.iconBtn .ico { width: 22px; height: 22px; }

/* ── 폴라로이드 */
.pol { position: relative; background: var(--card); padding: 6px 6px 0; border-radius: 3px; transform: rotate(var(--r, 0deg));
  box-shadow: 0 1px 1px rgba(70,48,24,.07), 0 7px 16px -7px rgba(70,48,24,.32); transition: transform .18s ease; }
.pol:active { transform: rotate(var(--r, 0deg)) scale(.97); }
.pol .ph { position: relative; aspect-ratio: 4 / 5; border-radius: 2px; overflow: hidden; background: #f1e8da; }
.pol .ph .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pol.empty .ph { background: linear-gradient(160deg, #f6efe3, #efe5d5); }
.pol.empty .ph::after { content: ""; position: absolute; inset: 5px; border: 1.5px dashed var(--dash); border-radius: 3px; pointer-events: none; }
.pol .sil { position: absolute; left: 50%; top: 47%; width: 58%; transform: translate(-50%, -50%); filter: grayscale(1) sepia(.5) contrast(.8) brightness(1.06); opacity: .34; }
.pol .cap { font-family: var(--hand); font-size: 18.5px; line-height: 1; color: #4a3b30; text-align: center; padding: 7px 3px 9px; min-height: 45px; display: flex; align-items: center; justify-content: center; word-break: keep-all; overflow-wrap: anywhere; }
.pol .cap span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pol.empty .cap { color: #8f7d6b; }
.pol .no { position: absolute; top: 7px; left: 7px; z-index: 2; font: 700 9.5px/1 var(--ui); letter-spacing: .05em; color: rgba(110,92,74,.55); font-variant-numeric: tabular-nums; }
.pol.filled .no { color: rgba(255,255,255,.92); text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.pol .rare { position: absolute; top: 5px; right: 5px; z-index: 2; width: 19px; height: 19px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.pol.empty .rare { opacity: .75; }
.pol .years { position: absolute; right: 6px; bottom: 6px; z-index: 2; padding: 2px 7px; border-radius: 99px; background: rgba(255,252,246,.92); font: 700 10.5px/1.5 var(--ui); color: var(--ink2); }
.tape { position: absolute; z-index: 3; top: -9px; left: 50%; width: 48px; height: 17px; transform: translateX(-50%) rotate(var(--tr, -4deg)); opacity: .9;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.38) 0 3px, rgba(255,255,255,0) 3px 7px), var(--tc, #bfe0cf);
  clip-path: polygon(0 8%, 6% 0, 12% 10%, 20% 2%, 30% 8%, 42% 0, 55% 9%, 68% 1%, 80% 8%, 90% 0, 100% 7%, 100% 92%, 93% 100%, 84% 91%, 72% 99%, 60% 92%, 48% 100%, 36% 91%, 24% 99%, 12% 92%, 4% 100%, 0 93%);
  box-shadow: 0 1px 2px rgba(0,0,0,.05); pointer-events: none; }
.pol.empty .tape { display: none; }

/* ── 첫 화면 */
#intro { display: flex; flex-direction: column; min-height: 100dvh; text-align: center; }
.cover { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 0 10px; }
.stack { position: relative; width: 300px; height: 250px; margin-bottom: 26px; }
.stack .pol { position: absolute; width: 132px; }
.stack .pol .ph { background: linear-gradient(170deg, #fbf3e6, #f0e2cc); }
.stack .pol .ph img { position: absolute; left: 50%; top: 50%; width: 70%; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 8px rgba(80,50,20,.18)); }
.stack .pol:nth-child(1) { left: 6px; top: 34px; --r: -9deg; }
.stack .pol:nth-child(2) { left: 84px; top: 0; --r: 2deg; z-index: 2; }
.stack .pol:nth-child(3) { right: 4px; top: 40px; --r: 10deg; }
.stack .pol .cap { font-size: 17px; min-height: 36px; }
h1.title { margin: 0; font-family: var(--book); font-weight: 700; font-size: 34px; letter-spacing: -0.02em; line-height: 1.2; }
.lead { margin: 10px 0 0; font-family: var(--hand); font-size: 25px; line-height: 1.15; color: var(--ink2); }
.introBtns { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 12px; }

/* ── 친구 고르기 */
.pTop { display: flex; align-items: center; height: 44px; margin: -6px -10px 4px; }
h2.ask { margin: 2px 0 16px; font-family: var(--book); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.kinds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kind { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px 13px; border-radius: 18px; background: var(--card);
  box-shadow: 0 1px 1px rgba(70,48,24,.06), 0 8px 18px -10px rgba(70,48,24,.28); border: 2px solid transparent; transition: transform .12s, border-color .15s; }
.kind:active { transform: scale(.97); }
.kind img { width: 64px; height: 64px; margin-bottom: 4px; filter: drop-shadow(0 5px 6px rgba(80,50,20,.16)); }
.kind b { font-size: 16px; font-weight: 700; }
.kind span { font-size: 12.5px; color: var(--mute); }
.kind.on { border-color: var(--ink); }
.kind.wide { grid-column: span 2; flex-direction: row; justify-content: center; gap: 12px; padding: 12px; }
.kind.wide img { width: 48px; height: 48px; margin: 0; }
.kind.wide .kt { display: flex; flex-direction: column; align-items: flex-start; color: var(--ink); }
.kind.wide .kt span { color: var(--mute); }
.nameBox { margin-top: 22px; padding: 18px; border-radius: 18px; background: var(--card); box-shadow: 0 8px 18px -12px rgba(70,48,24,.3); }
.nameBox label { display: block; font-family: var(--book); font-weight: 700; font-size: 19px; margin-bottom: 10px; }
.nameBox input { width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fffefb; font-size: 17px; outline: none; margin-bottom: 12px; }
.nameBox input:focus { border-color: var(--ink2); }

/* ── 도감 머리 */
.bookHead { display: flex; align-items: center; gap: 4px; margin: -4px -6px 0; }
.who { flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0; padding: 4px 6px; border-radius: 16px; text-align: left; }
.who:active { background: rgba(59,47,39,.05); }
.avatar { position: relative; width: 52px; height: 52px; border-radius: 50%; flex: none; overflow: hidden; background: #fbf4e8; box-shadow: 0 0 0 3px var(--card), 0 4px 10px -3px rgba(70,48,24,.35); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar img.emo { width: 74%; height: 74%; margin: 13%; object-fit: contain; }
.who .t { display: flex; align-items: center; gap: 4px; min-width: 0; }
.who b { font-family: var(--book); font-weight: 700; font-size: 27px; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .ico { width: 16px; height: 16px; color: var(--mute); flex: none; }
.meta { display: flex; align-items: center; gap: 8px; margin: 12px 2px 0; font-size: 13.5px; color: var(--ink2); }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--dash); }
.meta .rareN { display: inline-flex; align-items: center; gap: 3px; }
.meta .rareN img { width: 15px; height: 15px; }
.prog { position: relative; height: 8px; margin: 9px 2px 0; border-radius: 99px; background: #e6dac6; box-shadow: inset 0 1px 1px rgba(70,48,24,.12); }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #e7b56a, #d98a52); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.prog img { position: absolute; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%) rotate(-12deg); transition: left .6s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.gone { display: inline-flex; align-items: center; gap: 4px; margin: 10px 2px 0; font-family: var(--hand); font-size: 21px; color: var(--ink2); }
.gone img { width: 20px; height: 20px; }

/* ── 오늘의 한 칸 */
.today { position: relative; margin: 26px 0 8px; padding: 20px 16px 10px; border-radius: 20px; background: var(--card);
  box-shadow: 0 1px 1px rgba(70,48,24,.06), 0 14px 30px -18px rgba(70,48,24,.45); }
.today > .tape { top: -10px; width: 70px; height: 20px; --tc: #f4c6c1; --tr: -3deg; }
.tLabel { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: #b8673f; letter-spacing: .02em; }
.tLabel img { width: 17px; height: 17px; }
.tBody { display: flex; gap: 15px; margin-top: 10px; align-items: center; }
.tBody .pol { width: 104px; flex: none; --r: -3deg; }
.tBody .pol .cap { min-height: 16px; padding: 0 0 6px; }
.tBody .pol .sil { opacity: .42; }
.tBody .pol .no { display: none; }
.tText { min-width: 0; }
.tQ { font-size: 13.5px; color: var(--mute); }
.tName { margin-top: 3px; font-family: var(--book); font-weight: 700; font-size: 21px; line-height: 1.28; letter-spacing: -0.02em; word-break: keep-all; }
.tHint { margin-top: 6px; font-size: 13.5px; color: var(--ink2); line-height: 1.45; word-break: keep-all; }
.tBtns { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; margin-top: 16px; }
.tBtns.one { grid-template-columns: 1fr; }
.tSkip { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 40px; margin-top: 4px; font-size: 13.5px; color: var(--mute); }
.tSkip .ico { width: 15px; height: 15px; }

/* ── 알림 줄(홈 화면 추가·내려받기) */
.note { display: flex; align-items: center; gap: 11px; margin: 14px 0 0; padding: 12px 10px 12px 13px; border-radius: 16px; background: rgba(255,252,246,.65); border: 1.5px dashed var(--dash); }
.note img { width: 34px; height: 34px; flex: none; }
.note .nt { flex: 1; min-width: 0; font-size: 13px; color: var(--ink2); line-height: 1.4; }
.note .nt b { display: block; font-size: 14px; color: var(--ink); }
.note .btn { height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; }
.note .iconBtn { width: 32px; height: 32px; }
.note .iconBtn .ico { width: 16px; height: 16px; }

/* ── 쪽 고르기 띠 */
.chaps { position: sticky; top: 0; z-index: 20; margin: 18px -18px 0; padding: calc(8px + var(--safeT)) 18px 10px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(var(--paper) 78%, rgba(243,236,223,0)); }
.chaps::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px 0 8px; border-radius: 99px; background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--ink2);
  box-shadow: 0 1px 1px rgba(70,48,24,.06), 0 4px 10px -6px rgba(70,48,24,.3); white-space: nowrap; }
.chip img { width: 20px; height: 20px; }
.chip small { font-size: 11.5px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.chip.full { background: #fff4dc; }
.chip.on { background: var(--ink); color: #fff8ee; }
.chip.on small { color: rgba(255,248,238,.7); }

/* ── 쪽 */
.chap { padding-top: 14px; scroll-margin-top: calc(56px + var(--safeT)); }
.chHead { display: flex; align-items: center; gap: 8px; margin: 8px 2px 16px; }
.chHead img { width: 30px; height: 30px; }
.chHead h2 { margin: 0; font-family: var(--book); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.chHead .cnt { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.chHead .cnt.full { color: #b8673f; font-weight: 700; }
.chHead .shareCh { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--ink2); background: rgba(255,252,246,.8); border: 1px solid var(--line); }
.chHead .shareCh .ico { width: 14px; height: 14px; }
.grid .pol { width: 100%; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px; padding: 0 1px 10px; }
.chap + .chap { border-top: 1px dashed rgba(210,192,164,.7); margin-top: 8px; }

/* ── 바닥 */
.credit { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 40px; font-size: 12px; color: #a99987; }
.credit a { color: inherit; }
.credit a.home { padding: 4px 12px; border: 1px solid rgba(59,47,39,.25); border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none; }

/* ── 아래에서 올라오는 판 */
.veil { position: fixed; inset: 0; z-index: 50; background: rgba(43,32,24,.35); opacity: 0; transition: opacity .25s; }
.veil.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 560px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 18px calc(18px + var(--safeB)); border-radius: 22px 22px 0 0; background: var(--paper);
  background-image: var(--grain); box-shadow: 0 -10px 30px -10px rgba(43,32,24,.35); transform: translateY(105%); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.sheet.on { transform: none; }
.sheet.full { top: 0; max-height: none; border-radius: 0; padding-top: calc(6px + var(--safeT)); }
.grab { width: 40px; height: 5px; margin: 2px auto 10px; border-radius: 99px; background: #d9cbb5; }
.sheetTop { display: flex; align-items: center; justify-content: space-between; height: 46px; margin: 0 -8px 4px; }
.sheetTop .sNo { font: 700 12.5px/1 var(--ui); letter-spacing: .08em; color: var(--mute); }

/* 칸 보기 */
.slotView { text-align: center; padding-bottom: 6px; }
.slotView .pol { width: min(76vw, 330px); margin: 18px auto 0; padding: 9px 9px 0; --r: -1.2deg; }
.slotView .pol .tape { width: 78px; height: 22px; top: -12px; }
.slotView .pol .cap { font-size: 23px; min-height: 52px; }
.slotView .pol .ph .sil { opacity: .3; top: 40%; width: 46%; }
.slotView .pol .hint2 { position: absolute; left: 0; right: 0; bottom: 16%; padding: 0 14%; font-family: var(--hand); font-size: 21px; line-height: 1.1; color: #9c8a77; }
.sName { margin: 22px 0 0; font-family: var(--book); font-weight: 700; font-size: 25px; letter-spacing: -0.02em; line-height: 1.3; word-break: keep-all; }
.sHint { margin: 6px 0 0; font-size: 14.5px; color: var(--ink2); word-break: keep-all; }
.sTags { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.sTag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 99px; background: #efe5d4; font-size: 12px; font-weight: 600; color: var(--ink2); }
.sTag img { width: 15px; height: 15px; }
.yearRow { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 16px 0 0; }
.yearRow button { height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--card); border: 1.5px solid var(--line); color: var(--ink2); }
.yearRow button.on { background: var(--ink); color: #fff8ee; border-color: var(--ink); }
.yearRow button.emptyY { border-style: dashed; }
.sBtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.sBtns .full2 { grid-column: span 2; }
.sMore { display: flex; justify-content: center; gap: 2px; margin-top: 8px; }
.sMore button { display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 12px; font-size: 13.5px; color: var(--mute); }
.sMore .ico { width: 16px; height: 16px; }
.dateBtn { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.dateBtn .ico { width: 15px; height: 15px; opacity: .6; }

/* 목록 판(메뉴·아이 고르기) */
.list { display: flex; flex-direction: column; margin: 0 -6px; }
.row { display: flex; align-items: center; gap: 13px; min-height: 56px; padding: 8px 10px; border-radius: 14px; text-align: left; }
.row:active { background: rgba(59,47,39,.05); }
.row .ri { width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--ink2); }
.row .ri .ico { width: 22px; height: 22px; }
.row .ri img { width: 30px; height: 30px; }
.row .rt { flex: 1; min-width: 0; }
.row .rt b { display: block; font-size: 15.5px; font-weight: 600; }
.row .rt span { display: block; font-size: 12.5px; color: var(--mute); line-height: 1.35; }
a.row { color: inherit; text-decoration: none; }
.row.red { color: var(--red); }
.row.red .ri { color: var(--red); }
.row .avatar { width: 42px; height: 42px; box-shadow: 0 0 0 2px var(--card), 0 3px 8px -3px rgba(70,48,24,.35); }
.row .check { color: var(--ink); }
.sheetTitle { margin: 2px 0 12px; font-family: var(--book); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }
.sheetText { margin: 0 0 14px; font-size: 14.5px; color: var(--ink2); line-height: 1.6; word-break: keep-all; }
.sheetText.small { font-size: 13px; color: var(--mute); }
.steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 9px 0 9px 36px; font-size: 15px; line-height: 1.45; border-bottom: 1px dashed var(--line); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 9px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff8ee; font-size: 13px; font-weight: 700; text-align: center; line-height: 24px; }
.field { width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fffefb; font-size: 16px; outline: none; margin-bottom: 12px; }
.field:focus { border-color: var(--ink2); }
.btnRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menuFoot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); text-align: center; font-size: 12px; color: var(--mute); }

/* ── 확인 창 */
.dlg { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(43,32,24,.4); }
.dlg .box { width: 100%; max-width: 340px; padding: 22px 18px 16px; border-radius: 20px; background: var(--paper); text-align: center; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.dlg .box p { margin: 0 0 18px; font-size: 15.5px; line-height: 1.55; word-break: keep-all; }
.dlg .box p small { display: block; margin-top: 4px; font-size: 13px; color: var(--mute); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── 카메라 */
.cam { position: fixed; inset: 0; z-index: 90; background: #120e0b; color: #fff; overflow: hidden; touch-action: none; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.camFrame { position: absolute; z-index: 2; border-radius: 6px; box-shadow: 0 0 0 200vmax rgba(18,14,11,.62); pointer-events: none; }
.camFrame::before { content: ""; position: absolute; inset: 0; border: 2px solid rgba(255,255,255,.85); border-radius: 6px; }
.camFrame i { position: absolute; width: 22px; height: 22px; border: 3px solid #fff; }
.camFrame i:nth-child(1) { left: -3px; top: -3px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.camFrame i:nth-child(2) { right: -3px; top: -3px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.camFrame i:nth-child(3) { left: -3px; bottom: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.camFrame i:nth-child(4) { right: -3px; bottom: -3px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.camTop { position: absolute; z-index: 3; left: 0; right: 0; top: 0; padding: calc(8px + var(--safeT)) 14px 0; text-align: center; }
.camTop .iconBtn { position: absolute; left: 8px; top: calc(6px + var(--safeT)); color: #fff; }
.camTop .iconBtn:active { background: rgba(255,255,255,.12); }
.camNo { font: 700 11.5px/1 var(--ui); letter-spacing: .1em; color: rgba(255,255,255,.65); margin-top: 8px; }
.camName { margin-top: 7px; padding: 0 44px; font-family: var(--book); font-weight: 700; font-size: 21px; line-height: 1.3; letter-spacing: -0.02em; word-break: keep-all; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.camHint { margin-top: 4px; font-family: var(--hand); font-size: 21px; line-height: 1.1; color: rgba(255,248,236,.85); }
.camBottom { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 0 28px calc(22px + var(--safeB)); display: flex; align-items: center; justify-content: space-between; }
.camSide { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.14); color: #fff; }
.camSide .ico { width: 24px; height: 24px; }
.camSide:active { background: rgba(255,255,255,.25); }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; padding: 5px; background: transparent; }
.shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active i { transform: scale(.88); }
.camFlash { position: absolute; inset: 0; z-index: 5; background: #fff; opacity: 0; pointer-events: none; }
.camFlash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.camMsg { position: absolute; z-index: 4; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); text-align: center; font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.85); }
.camShot { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: calc(20px + var(--safeT)) 24px calc(24px + var(--safeB));
  background: var(--paper) var(--grain); color: var(--ink); }
.camShot .pol { width: min(72vw, 320px); --r: -1.5deg; animation: drop .45s cubic-bezier(.2,.9,.3,1.15); }
.camShot .pol .cap { font-size: 22px; min-height: 50px; }
.camShot .btnRow { width: 100%; max-width: 380px; grid-template-columns: 1fr 1.45fr; }
@keyframes drop { from { transform: translateY(-30px) rotate(6deg) scale(.95); opacity: 0; } to { transform: rotate(var(--r)); opacity: 1; } }

/* ── 채워지는 순간: 도장 */
.stamp { position: absolute; z-index: 4; right: -12px; bottom: -10px; width: 74px; height: 74px; border-radius: 50%; border: 2.5px solid var(--red); color: var(--red);
  display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,250,244,.78); transform: rotate(-14deg);
  font-family: var(--ui); line-height: 1.1; pointer-events: none; box-shadow: 0 2px 6px -2px rgba(120,40,20,.25); animation: stampIn .5s cubic-bezier(.2,.9,.3,1.3) both, stampOut .6s 2.2s ease-in forwards; }
.stamp::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid currentColor; opacity: .7; }
.stamp b { font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.stamp span { font-size: 10.5px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stamp.keep { animation: stampIn .5s cubic-bezier(.2,.9,.3,1.3) both; }
.tBody .stamp { width: 54px; height: 54px; right: -16px; bottom: -14px; }
.tBody .stamp b { font-size: 9.5px; letter-spacing: 0; }
.tBody .stamp span { font-size: 8.5px; }
.slotView .stamp { width: 96px; height: 96px; right: -16px; bottom: -8px; }
.slotView .stamp b { font-size: 15px; }
.slotView .stamp span { font-size: 13px; }
@keyframes stampIn { 0% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 60% { transform: scale(.92) rotate(-12deg); opacity: 1; } 100% { transform: scale(1) rotate(-14deg); opacity: 1; } }
@keyframes stampOut { to { opacity: 0; transform: scale(1.05) rotate(-14deg); } }
.justFilled { animation: filledPop .55s cubic-bezier(.2,.9,.3,1.3); }
@keyframes filledPop { 0% { transform: rotate(var(--r, 0deg)) scale(.86); } 100% { transform: rotate(var(--r, 0deg)) scale(1); } }

/* ── 알림 */
.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safeB)); z-index: 99; transform: translate(-50%, 12px); max-width: 88%; padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: #fff8ee; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.camOn .toast { bottom: calc(132px + var(--safeB)); }
.toast.withBtn { pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.toast .tb { color: #ffd59a; font-weight: 700; white-space: nowrap; }

@media (min-width: 520px) { .grid { gap: 22px 16px; } .stack { transform: scale(1.08); } }
@media (max-width: 360px) { .screen { padding-left: 14px; padding-right: 14px; } .chaps { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; } .grid { gap: 16px 9px; } .pol .cap { font-size: 16.5px; } .tName { font-size: 19px; } .tBody .pol { width: 92px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
