/* mice — 박물관 안내물처럼: 종이색 바탕, 먹색 글자, 행사 강조색 하나, 얇은 선 */
:root {
  --paper: #f6f4ef;
  --card: #ffffff;
  --ink: #141414;
  --ink-2: #5c5a55;
  --ink-3: #6f6c65;
  --line: #e3dfd6;
  --accent: #1f4bff;
  --danger: #c2391b;
  --ok: #1d7a46;
  --radius: 18px;
  --gutter: 20px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  word-break: keep-all;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); }
body { min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.wrap { max-width: 520px; margin: 0 auto; padding: 28px var(--gutter) 48px; }

/* 머리 — 전시 라벨처럼 */
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 10px; }
.title { text-wrap: pretty; font-size: 28px; line-height: 1.25; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.sub { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin: 10px 0 0; text-wrap: pretty; }
.rule { height: 1px; background: var(--line); border: 0; margin: 24px 0; }

.progress { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 14px; }
.progress strong { font-size: 40px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.progress strong span { color: var(--ink-3); font-weight: 500; font-size: 22px; }
.progress small { color: var(--ink-2); font-size: 14px; }

/* 스탬프판 — 가로 3칸, 부스가 늘면 아래로 붙는다 */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cell {
  appearance: none; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius);
  padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 124px; text-align: center; position: relative;
}
.cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cell .no { font-size: 12px; letter-spacing: .1em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cell .name { font-size: 13px; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell .time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-height: 14px; }

.stamp { width: 60px; height: 60px; border-radius: 50%; border: 1.5px dashed #cfcac0; display: grid; place-items: center; color: #c4bfb4; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
/* 찍힌 칸 = 잉크 도장: 이중 링 + 부스 번호, 살짝 기울고 면은 비운다 */
.cell.on .stamp { border: 2px solid var(--accent); color: var(--accent); font-size: 22px; font-weight: 800; transform: rotate(-8deg); opacity: .92; box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4.5px var(--accent); }
.cell.on .name { color: var(--ink); }
.cell:not(.on) .name { color: var(--ink-2); }
.cell.just .stamp { animation: press .55s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes press {
  0% { transform: scale(1.9) rotate(-22deg); opacity: 0; }
  60% { transform: scale(.92) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); }
}

/* 선물 상자 — 다 모으기 전 회색, 다 모으면 컬러로 떠 있다 */
.cell.gift { border-style: solid; }
.gift .box { width: 64px; height: 64px; position: relative; }
.gift .box svg { width: 100%; height: 100%; display: block; transition: filter .8s ease, opacity .8s ease; }
.gift.locked .box svg { filter: grayscale(1); opacity: .42; }
.gift.ready { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, #fff); }
.gift.ready .time { color: var(--accent); font-weight: 700; }
.gift.ready .box svg { animation: float 3.2s ease-in-out infinite; }
.gift.ready .box::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 40px; height: 6px; margin-left: -20px; border-radius: 50%;
  background: rgba(0,0,0,.2); animation: shadow 3.2s ease-in-out infinite;
}
.gift.ready.unlocking .box svg { animation: reveal 1.2s ease both, float 3.2s ease-in-out 1.2s infinite; }
.gift.redeemed .box svg { opacity: .9; }
@keyframes float { 0%, 100% { transform: translateY(2px) rotate(-1.5deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.7); opacity: .55; } }
@keyframes reveal { 0% { filter: grayscale(1); opacity: .42; transform: scale(.9); } 70% { filter: none; opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .gift.ready .box svg, .gift.ready .box::after, .cell.just .stamp, .gift.ready.unlocking .box svg { animation: none; }
}

/* 안내 띠 */
.note { margin-top: 20px; padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.note b { color: var(--ink); }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(480px, calc(100% - 32px)); background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 18px;
  font-size: 15px; line-height: 1.45; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: up .35s ease both;
}
@keyframes up { from { transform: translate(-50%, 12px); opacity: 0; } }

/* 버튼·입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 650; font-size: 16px; width: 100%; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: default; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input { width: 100%; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 14px; font-size: 17px; }
.field input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 4px 0 18px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.err { color: var(--danger); font-size: 14px; margin: -4px 0 14px; min-height: 20px; }
/* 개인정보 동의 칸: 체크 + 한 줄 요약 + 펼쳐 보는 표 */
.consent { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 16px; margin: 6px 0 18px; }
.consent .check { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; align-items: center; min-height: 44px; }
.consent .gist { margin: 0 0 2px 30px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
details.terms { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin: 2px 0 0 30px; }
.consent > details.terms:not([open]) { display: inline-block; vertical-align: top; }
details.terms summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
details.terms summary::-webkit-details-marker { display: none; }
details.terms summary::after { content: "▾"; text-decoration: none; display: inline-block; }
details.terms[open] summary::after { content: "▴"; }
details.terms summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
details.terms dl { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 12px; margin: 0; padding: 10px 0 4px; border-top: 1px solid var(--line); }
details.terms dd .nw { display: inline-block; max-width: 100%; white-space: normal; }
details.terms dt { color: var(--ink-3); }
details.terms dd { margin: 0; color: var(--ink); text-wrap: pretty; }
.field > label { display: block; }
.field small { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-3); }

/* 참여 화면: 행사 포스터 1장(세로 포스터도 잘리지 않게 높이만 제한) · 관심 분야 칩 */
.poster { display: block; width: auto; height: auto; max-width: 100%; max-height: 46dvh; margin: 0 auto 24px; border-radius: var(--radius); background: #ece8df; border: 1px solid var(--line); }
.nw { white-space: nowrap; }
/* 보관 기간은 눈에 띄게(개인정보 처리 방법에 관한 고시 제4조) */
.consent .gist.keep { color: var(--ink); font-weight: 650; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.pick[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pick:disabled { opacity: .4; cursor: default; }
.pick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 아래에서 올라오는 시트 */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,20,20,.38); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--paper); border-radius: 22px 22px 0 0; padding: 22px var(--gutter) calc(24px + env(safe-area-inset-bottom)); animation: sheet .28s ease both; max-height: 92dvh; overflow: auto; }
@keyframes sheet { from { transform: translateY(24px); opacity: .5; } }
.sheet h2 { font-size: 20px; margin: 0 0 6px; letter-spacing: -.01em; }
.sheet .sub { margin: 0 0 20px; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -8px auto 16px; }

/* PIN */
.dots { display: flex; gap: 14px; justify-content: center; margin: 8px 0 10px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ink); }
.dots i.f { background: var(--ink); }
.dots.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinmsg { text-align: center; min-height: 22px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.pinmsg.bad { color: var(--danger); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keys button { height: 58px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.keys button:active { background: var(--line); }
.keys button.blank { visibility: hidden; }

/* 상태 카드(스탬프 받기 화면) */
.state { text-align: center; padding: 40px 8px 8px; }
.state .mark { width: 96px; height: 96px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; transform: rotate(-8deg); }
.state .mark.muted { background: #e9e5dc; color: var(--ink-2); transform: none; }
.state .mark svg { width: 44px; height: 44px; }
.state h1 { text-wrap: balance; font-size: 24px; line-height: 1.35; margin: 0 0 8px; letter-spacing: -.02em; }
.state p { color: var(--ink-2); margin: 0 0 28px; line-height: 1.6; text-wrap: balance; }
.stack { display: grid; gap: 10px; }
.skeleton { height: 132px; border-radius: var(--radius); background: linear-gradient(90deg, #ece8df, #f3f0e9, #ece8df); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.foot { margin-top: 36px; font-size: 12px; color: var(--ink-3); text-align: center; letter-spacing: .04em; }

/* 행사 문의 줄 */
.contact { margin-top: 28px; padding-top: 6px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 16px; font-size: 14px; color: var(--ink-2); }
.contact span { font-weight: 600; color: var(--ink-3); }
.contact a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* 선택 동의 칸 안의 관심 분야 고르기 */
.consent + .consent { margin-top: -6px; }
.pickbox { margin: 10px 0 4px 30px; }
.pickbox[hidden] { display: none; }
.pickbox .count { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-3); }

/* 개인정보 처리방침 */
.pol { margin: 0 0 26px; }
.pol h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -.01em; }
.pol p { font-size: 15px; line-height: 1.65; color: var(--ink-2); margin: 0 0 8px; text-wrap: pretty; }
.pol .contact { margin-top: 4px; justify-content: flex-start; border-top: 0; padding-top: 0; }
.scrollx { overflow-x: auto; margin: 0 0 10px; }
.poltable { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.poltable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.poltable td { padding: 10px 12px; border-bottom: 1px solid #f0ede6; vertical-align: top; }
.poltable td .nw { display: inline-block; }
.poltable caption.vh, .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.poltable tr:last-child td { border-bottom: 0; }
.consent .more { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 0 16px; font-size: 13px; color: var(--ink-3); text-underline-offset: 3px; }
.consent .check.age { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.consent .check.need span { color: var(--danger); }
.consent .check.need input { outline: 2px solid var(--danger); outline-offset: 2px; }
.pol p b { color: var(--ink); font-weight: 650; }
.pol p a { text-underline-offset: 3px; }
