@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --bg: #F6F6F8;
  --surface: #FFFFFF;
  --ink: #17171C;
  --sub: #6E6E78;
  --faint: #A6A6B0;
  --line: #EBEBF0;
  --rose: #FF4F6D;
  --peach: #FF8A5B;
  --grad: linear-gradient(135deg, #FF4F6D 0%, #FF7E5F 100%);
  --sky: #4C8DFF;
  --violet: #8B6CFF;
  --mint: #16B47C;
  --f-grad: linear-gradient(160deg, #FF5C7C 0%, #FF9877 100%);
  --m-grad: linear-gradient(160deg, #3F7BFF 0%, #6FB4FF 100%);
  --x-grad: linear-gradient(160deg, #7C5CFF 0%, #C27BFF 100%);
  --shadow: 0 10px 30px rgba(23, 23, 28, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.5; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.hidden { display: none !important; }

/* ───────── 로고 ───────── */
.brand { display: flex; align-items: center; gap: 10px; }
.logo-sym { height: 24px; width: auto; flex: none; }
.gate-logo { height: 84px; width: auto; max-width: 70vw; object-fit: contain; margin-bottom: 22px; }
.setup-sym { height: 30px; width: auto; display: block; margin-bottom: 6px; }
.tcard .card-sym { position: absolute; top: 26px; left: 24px; height: 26px; width: auto; filter: brightness(0) invert(1); }
.match .match-sym { height: 44px; width: auto; filter: brightness(0) invert(1); margin-bottom: 18px; }
.empty .empty-sym { height: 30px; width: auto; filter: grayscale(1); opacity: .3; margin-bottom: 6px; }
.floor .floor-sym { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 42%; max-width: 200px; filter: grayscale(1); opacity: .06; pointer-events: none; }
.foot-sym { display: block; height: 22px; width: auto; margin: 10px auto 0; filter: grayscale(1); opacity: .3; }

/* ───────── 공통 버튼 ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 52px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; font-size: 16px; transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(255, 79, 109, .28); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); }
.btn-soft { background: #FFF0F2; color: var(--rose); }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }
.link { color: var(--sub); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ───────── 입장 화면 ───────── */
.gate {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 28px; text-align: center; gap: 14px;
}
.gate-orb {
  width: 132px; height: 132px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; line-height: 1.2;
  box-shadow: 0 18px 50px rgba(255, 79, 109, .35); margin-bottom: 14px;
}
.gate-orb.waiting { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 18px 70px rgba(255, 79, 109, .5); } }
.gate h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.gate p { color: var(--sub); max-width: 300px; }
.gate .actions { width: 100%; max-width: 340px; display: grid; gap: 10px; margin-top: 18px; }
.pin-input {
  width: 100%; max-width: 240px; height: 64px; text-align: center; font-size: 32px; font-weight: 800;
  letter-spacing: .5em; padding-left: .5em; border: 2px solid var(--line); border-radius: 18px; background: var(--surface);
}
.pin-input:focus { border-color: var(--rose); outline: none; }

/* ───────── 프로필 폼 ───────── */
.setup { min-height: 100dvh; padding: 28px 22px 40px; max-width: 480px; margin: 0 auto; }
.setup h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 4px; }
.setup > p { color: var(--sub); margin-bottom: 24px; }
.field { margin-bottom: 22px; }
.field-label { font-weight: 700; margin-bottom: 10px; display: block; }
.field-help { color: var(--faint); font-size: 13px; margin-top: 6px; }
.counter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.counter {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.counter .sex { font-weight: 700; }
.counter .sex.f { color: var(--rose); }
.counter .sex.m { color: var(--sky); }
.counter .ctl { display: flex; align-items: center; gap: 10px; }
.counter .ctl button { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); font-size: 18px; font-weight: 700; }
.counter .ctl b { min-width: 18px; text-align: center; font-size: 18px; }
.text-input {
  width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.text-input:focus { border-color: var(--rose); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--sub);
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px;
}
.switch-row small { display: block; color: var(--faint); font-size: 13px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #DCDCE3; border-radius: 999px; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.switch input:checked + span { background: var(--rose); }
.switch input:checked + span::before { transform: translateX(20px); }

/* ───────── 메인 레이아웃 ───────── */
.main { height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; }
.topbar .brand { font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.topbar .brand small { display: block; font-size: 12px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.topbar .right { display: flex; gap: 8px; align-items: center; }
.pill { height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.pill.heart { color: var(--rose); border-color: #FFD3DA; background: #FFF3F5; }
.notice {
  margin: 0 16px 10px; height: 48px; padding: 0 6px 0 8px; border-radius: 14px;
  background: linear-gradient(100deg, #E8112D 0%, #FF3B30 55%, #FF6A00 100%); color: #fff;
  display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 22px rgba(232, 17, 45, .4);
  animation: noticeIn .45s cubic-bezier(.2, .9, .3, 1.2), noticeGlow 2.4s ease-in-out .5s infinite;
}
@keyframes noticeGlow { 50% { box-shadow: 0 8px 30px rgba(255, 59, 48, .7); } }
@keyframes noticeIn { from { transform: translateY(-10px) scale(.97); opacity: 0; } }
.notice-tag { flex: none; background: #FFE14D; color: #8A0010; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 8px; }
.marquee { flex: 1; overflow: hidden; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent); }
.marquee .track { display: inline-flex; white-space: nowrap; animation: marquee 12s linear infinite; }
.marquee .track span { padding-right: 64px; font-weight: 800; font-size: 15px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.notice button { flex: none; width: 32px; height: 32px; font-size: 20px; color: #fff; opacity: .8; }

.views { position: relative; overflow: hidden; min-height: 0; flex: 1; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }
.scroll { flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }

.tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--faint); position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--ink); }
.tab .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--rose); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ───────── 둘러보기 카드 ───────── */
.deck-wrap { flex: 1; display: flex; flex-direction: column; padding: 4px 16px 14px; min-height: 0; }
.ratio { margin: 2px 2px 10px; }
.ratio-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ratio-row b { font-size: 17px; font-weight: 800; }
.ratio-row .rm { color: #3F7BFF; } .ratio-row .rf { color: #FF4F6D; }
.ratio-row .rt { color: #8A8A96; font-size: 12px; font-weight: 500; }
.ratio-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #E6E6EC; gap: 2px; }
.ratio-bar i { display: block; height: 100%; transition: width .5s ease; }
.ratio-bar i.m { background: var(--m-grad); border-radius: 99px 0 0 99px; }
.ratio-bar i.f { background: var(--f-grad); border-radius: 0 99px 99px 0; }
.ratio-bar i[style*="width:0%"] { display: none; }
.ratio-empty { text-align: center; color: #8A8A96; font-size: 13px; padding: 4px 0; }
.deck { position: relative; flex: 1; min-height: 0; }
.tcard {
  position: absolute; inset: 0; border-radius: 28px; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 26px 24px;
  box-shadow: 0 16px 40px rgba(23, 23, 28, .16); touch-action: none; user-select: none;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.tcard.back { transform: scale(.94) translateY(14px); opacity: .7; }
.tcard.f { background: var(--f-grad); }
.tcard.m { background: var(--m-grad); }
.tcard.mix { background: var(--x-grad); }
.tcard .bignum { position: absolute; top: 18px; right: 22px; font-size: 120px; font-weight: 900; line-height: 1; letter-spacing: -0.06em; opacity: .18; }
.tcard .where { font-size: 15px; font-weight: 600; opacity: .9; }
.tcard .comp { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; margin: 2px 0 12px; }
.tcard .intro { font-size: 18px; font-weight: 600; line-height: 1.4; margin-bottom: 14px; word-break: keep-all; }
.tcard .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tcard .tags span { padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); }
.tcard .stamp { position: absolute; top: 34px; padding: 6px 14px; border: 3px solid #fff; border-radius: 12px; font-size: 22px; font-weight: 900; opacity: 0; }
.tcard .stamp.like { left: 24px; transform: rotate(-12deg); }
.tcard .stamp.nope { right: 24px; transform: rotate(12deg); }
.deck-actions { display: flex; justify-content: center; align-items: center; gap: 18px; padding-top: 16px; }
.round { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; transition: transform .12s; }
.round:active { transform: scale(.92); }
.round svg { width: 26px; height: 26px; }
.round.big { width: 72px; height: 72px; }
.round.big svg { width: 32px; height: 32px; }
.round.nope { color: var(--faint); }
.round.chat { color: var(--sky); }
.round.like { color: var(--rose); }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 10px; color: var(--sub); }
.empty h2 { font-size: 20px; color: var(--ink); font-weight: 800; letter-spacing: -0.03em; }

/* ───────── 지도 ───────── */
.seg { display: inline-grid; grid-auto-flow: column; background: #EBEBF0; border-radius: 999px; padding: 4px; margin: 2px 16px 12px; }
.seg button { height: 34px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--sub); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.floor { position: relative; margin: 0 16px; aspect-ratio: 4 / 3.4; background: var(--surface); border-radius: 24px; border: 1px solid var(--line); }
.edge {
  position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background-color: #E6F0FF; color: #3F68B5; font-size: 11px; font-weight: 800; letter-spacing: .12em;
}
.edge span { background: #E6F0FF; padding: 2px 6px; border-radius: 6px; }
.edge-top { top: 7px; left: 10%; right: 10%; height: 22px; background-image: repeating-linear-gradient(90deg, transparent 0 46px, rgba(63, 104, 181, .22) 46px 48px); }
.edge-right { right: 7px; top: 8%; bottom: 8%; width: 22px; writing-mode: vertical-rl; background-image: repeating-linear-gradient(180deg, transparent 0 46px, rgba(63, 104, 181, .22) 46px 48px); }
.legend .win-swatch { width: 18px; height: 8px; border-radius: 3px; background: #CFE0FF; }
.dot {
  position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
  font-weight: 800; font-size: 18px; transition: transform .15s;
}
.floor.f2 .dot { width: 46px; height: 46px; font-size: 16px; }
.floor.f2 .dot small { font-size: 9px; }
.dot:active { transform: translate(-50%, -50%) scale(.93); }
.dot small { font-size: 10px; font-weight: 700; opacity: .9; margin-top: 2px; }
.dot.empty-t { background: var(--bg); color: #C9C9D1; border: 1.5px dashed #DADAE0; }
.dot.wait { background: #EFEFF3; color: var(--faint); }
.dot.f { background: var(--f-grad); color: #fff; box-shadow: 0 8px 22px rgba(255, 92, 124, .45); }
.dot.m { background: var(--m-grad); color: #fff; box-shadow: 0 8px 22px rgba(63, 123, 255, .4); }
.dot.mix { background: var(--x-grad); color: #fff; box-shadow: 0 8px 22px rgba(124, 92, 255, .4); }
.dot.off { opacity: .45; box-shadow: none; }
.dot.mine { outline: 3px solid var(--ink); outline-offset: 3px; }
.dot.mine::after { content: '우리'; position: absolute; bottom: -24px; font-size: 11px; font-weight: 800; color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px 20px 20px; font-size: 13px; color: var(--sub); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ───────── 채팅 ───────── */
.msgs { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.msg .who { flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 11px; display: grid; place-items: center; line-height: 1; text-align: center; }
.msg .body small { display: block; font-size: 12px; color: var(--faint); margin: 0 0 3px 4px; font-weight: 600; }
.bubble { background: var(--surface); border: 1px solid var(--line); padding: 9px 13px; border-radius: 18px 18px 18px 6px; word-break: break-word; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--grad); color: #fff; border: 0; border-radius: 18px 18px 6px 18px; }
.msg time { font-size: 11px; color: var(--faint); flex: none; }
.sys { align-self: center; font-size: 12px; color: var(--faint); background: #EDEDF1; padding: 4px 12px; border-radius: 999px; }
.composer { display: flex; gap: 8px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.composer input { flex: 1; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 16px; }
.composer input:focus { outline: none; border-color: var(--rose); }
.composer button { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.composer button svg { width: 20px; height: 20px; }

.threads { padding: 4px 12px 16px; }
.thread { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 16px; width: 100%; text-align: left; }
.thread:active { background: #EDEDF1; }
.thread .av { width: 52px; height: 52px; border-radius: 50%; color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; font-size: 15px; line-height: 1.1; text-align: center; }
.thread .info { flex: 1; min-width: 0; }
.thread .info b { display: flex; align-items: center; gap: 6px; }
.thread .info p { color: var(--sub); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--faint); }
.thread .unread { width: 9px; height: 9px; border-radius: 50%; background: var(--rose); }
.tag-match { font-size: 11px; font-weight: 800; color: var(--rose); background: #FFF0F2; padding: 2px 7px; border-radius: 999px; }
.av.f, .who.f { background: var(--f-grad); }
.av.m, .who.m { background: var(--m-grad); }
.av.mix, .who.mix { background: var(--x-grad); }
.av.none, .who.none { background: #C9C9D1; }
#dmThread { background: var(--bg); z-index: 2; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; border-bottom: 1px solid var(--line); }
.thread-head .title { flex: 1; font-weight: 800; }
.thread-head .title small { display: block; font-weight: 500; color: var(--faint); font-size: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }

/* ───────── 내 테이블 ───────── */
.me-wrap { padding: 4px 16px 28px; display: grid; gap: 14px; }
.panel { background: var(--surface); border-radius: 22px; padding: 18px; border: 1px solid var(--line); }
.panel h3 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.pin-big { font-size: 40px; font-weight: 900; letter-spacing: .2em; }
.muted { color: var(--sub); font-size: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #EFEFF3; color: var(--sub); flex: none; }
.status.ok { background: #E6F7F0; color: var(--mint); }
.status.no { background: #FFF0F2; color: var(--rose); }

/* ───────── 시트 / 모달 ───────── */
.scrim { position: fixed; inset: 0; background: rgba(23, 23, 28, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.scrim.center { align-items: center; padding: 24px; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto; background: var(--surface); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.sheet .grip { width: 40px; height: 5px; border-radius: 9px; background: #E1E1E7; margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.dialog { width: 100%; max-width: 380px; background: var(--surface); border-radius: 28px; padding: 26px 22px 20px; text-align: center; animation: pop .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.dialog h2, .sheet h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.dialog p { color: var(--sub); margin-bottom: 18px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.prof-head { border-radius: 22px; padding: 22px 20px; color: #fff; margin-bottom: 16px; position: relative; overflow: hidden; }
.prof-head.f { background: var(--f-grad); } .prof-head.m { background: var(--m-grad); } .prof-head.mix { background: var(--x-grad); } .prof-head.none { background: #B8B8C2; }
.prof-head .where { font-weight: 600; opacity: .9; font-size: 14px; }
.prof-head .comp { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.prof-head .intro { margin-top: 8px; font-weight: 600; }
.prof-head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.prof-head .tags span { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: 12px; font-weight: 600; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action { height: 76px; border-radius: 20px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 14px; }
.action svg { width: 24px; height: 24px; }
.action.heart { color: var(--rose); background: #FFF0F2; }
.action[disabled] { opacity: .45; pointer-events: none; }
.sheet-foot { display: flex; justify-content: center; gap: 22px; margin-top: 18px; }

.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-item b { display: block; }
.menu-item small { color: var(--sub); }
.reason { width: 100%; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); margin-bottom: 8px; font-weight: 600; }
.reason.on { border-color: var(--rose); color: var(--rose); background: #FFF6F7; }
.gift-list { background: var(--bg); border-radius: 18px; padding: 12px 16px; margin-bottom: 14px; text-align: left; }
.gift-list div { display: flex; justify-content: space-between; padding: 4px 0; font-weight: 600; }
.gift-note { font-size: 17px; font-weight: 600; margin-bottom: 14px; }

/* 매칭 */
.match { position: fixed; inset: 0; z-index: 60; background: var(--grad); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; }
.match h1 { font-size: 40px; font-weight: 900; letter-spacing: -0.05em; }
.match p { opacity: .9; margin-top: 6px; }
.match .pair { display: flex; align-items: center; margin: 34px 0 40px; }
.match .pair div { width: 112px; height: 112px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; line-height: 1.2; }
.match .pair .a { animation: inL .6s cubic-bezier(.2, .9, .3, 1.3) both; background: rgba(255,255,255,.18); }
.match .pair .b { animation: inR .6s cubic-bezier(.2, .9, .3, 1.3) both; margin-left: -18px; background: rgba(255,255,255,.28); }
@keyframes inL { from { transform: translateX(-120px); opacity: 0; } }
@keyframes inR { from { transform: translateX(120px); opacity: 0; } }
.match .btn { width: 100%; max-width: 320px; }
.match .btn-white { background: #fff; color: var(--rose); margin-bottom: 10px; }
.match .btn-line { border: 2px solid rgba(255,255,255,.7); color: #fff; }

/* 토스트 */
.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: 420px; animation: drop .25s cubic-bezier(.2, .8, .2, 1); }
.toast.err { background: #C8323F; }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } }

/* 선물 상자 뒤로 퍼지는 빛 */
.gift-stage .rays { position: absolute; left: 50%; top: 50%; width: 340px; height: 340px; margin: -170px 0 0 -170px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 201, 74, .55) 0deg 10deg, transparent 10deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 68%); mask-image: radial-gradient(circle, #000 18%, transparent 68%); }
.gift-stage.open .rays { animation: rays 6s linear infinite, raysIn .6s ease-out forwards; }
@keyframes rays { to { transform: rotate(360deg); } }
@keyframes raysIn { to { opacity: 1; } }
.pop-gift .gift-title, .pop-gift .gift-list, .pop-gift .gift-note, .pop-gift .btn-row { position: relative; }

/* 화면 전체 축하 효과 */
.scrim.incoming { z-index: 65; }
.celebrate { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.celebrate .flash { position: absolute; inset: 0; opacity: 0; animation: flash 1s ease-out; }
.celebrate.gift .flash { background: radial-gradient(circle at 50% 45%, rgba(255, 214, 102, .65), transparent 60%); }
.celebrate.heart .flash { background: radial-gradient(circle at 50% 50%, rgba(255, 79, 109, .4), transparent 65%); }
@keyframes flash { 15% { opacity: 1; } 100% { opacity: 0; } }
.celebrate i { position: absolute; top: -24px; border-radius: 3px; opacity: 0; animation: fall var(--d) cubic-bezier(.25, .6, .5, 1) var(--delay) forwards; }
@keyframes fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--sway), 108vh) rotate(var(--rot)); }
}
.celebrate b { position: absolute; bottom: -60px; opacity: 0; line-height: 1; animation: rise var(--d) cubic-bezier(.3, .5, .4, 1) var(--delay) forwards; text-shadow: 0 6px 16px rgba(255, 79, 109, .35); }
@keyframes rise {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  15% { opacity: 1; transform: translate(calc(var(--sway) * .3), -15vh) scale(1); }
  100% { opacity: 0; transform: translate(var(--sway), -105vh) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee .track { white-space: normal; animation: none !important; }
  .marquee .track span + span { display: none; }
  .notice { height: auto; padding-top: 8px; padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───────── 채팅 속 선물 ───────── */
.composer .gift-btn { background: #FFF0F2; color: var(--rose); }
.composer .gift-btn svg { width: 22px; height: 22px; }
.head-gift { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; background: #FFF0F2; color: var(--rose); font-weight: 700; font-size: 13px; }
.head-gift svg { width: 17px; height: 17px; }
.gift-news { align-self: center; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 18px; background: linear-gradient(135deg, #FFF1F3, #FFF6EC); border: 1px solid #FFD9DF; max-width: 92%; }
.gift-news img, .gift-news .gn-ico { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }
.gift-news .gn-ico { display: grid; place-items: center; color: var(--rose); background: #fff; }
.gift-news .gn-ico svg { width: 26px; height: 26px; }
.gift-news b { font-size: 13px; color: var(--rose); }
.gift-news p { font-size: 14px; font-weight: 600; }
.gift-bubble { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1.5px solid #FFD0D8; border-radius: 18px; padding: 8px 14px 8px 8px; max-width: 280px; }
.msg.mine .gift-bubble { background: #FFF4F6; }
.gift-bubble img, .gift-bubble .gb-ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.gift-bubble .gb-ph { display: grid; place-items: center; background: #FFF0F2; color: var(--rose); }
.gift-bubble .gb-ph svg { width: 28px; height: 28px; }
.gb-body b { display: block; color: var(--rose); font-size: 13px; }
.gb-body p { font-size: 14px; font-weight: 600; line-height: 1.35; }
.gb-body .gb-note { font-weight: 500; color: var(--sub); font-size: 13px; }
.gb-body .status { display: inline-block; margin-top: 4px; }

/* ───────── 선물 메뉴판 ───────── */
.gift-sheet { padding-bottom: 0; }
.gift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-bottom: 12px; }
.gcard { position: relative; text-align: left; border-radius: 18px; background: var(--bg); padding: 6px 6px 10px; border: 2px solid transparent; transition: transform .12s; }
.gcard:active { transform: scale(.97); }
.gcard.on { border-color: var(--rose); background: #FFF6F7; }
.gimg { display: block; aspect-ratio: 4 / 3; border-radius: 13px; overflow: hidden; background: #EDEDF1; margin-bottom: 7px; }
.gimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gimg.ph, .gitems .ph-sym { display: grid; place-items: center; background: var(--grad); }
.gimg.ph .ph-sym { width: 55%; height: auto; filter: brightness(0) invert(1); }
.gname { display: block; font-weight: 700; font-size: 14px; padding: 0 4px; line-height: 1.3; }
.gprice { display: block; font-size: 13px; color: var(--sub); padding: 0 4px; }
.gq { position: absolute; top: 12px; right: 12px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--rose); color: #fff; font-weight: 800; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(255, 79, 109, .4); }
.gminus { position: absolute; top: 12px; left: 12px; width: 30px; height: 30px; border-radius: 50%; background: rgba(23, 23, 28, .7); color: #fff; font-weight: 800; font-size: 18px; display: grid; place-items: center; }
.gift-foot { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 10px; border-top: 1px solid var(--line); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }

/* ───────── 하트 팝업 ───────── */
.pop-heart { padding-top: 30px; }
.pop-heart h2 { font-size: 23px; margin-bottom: 14px; }
.pop-heart .prof-head { text-align: left; margin-bottom: 12px; }
.heart-stage { position: relative; width: 96px; height: 96px; margin: 0 auto 14px; display: grid; place-items: center; }
.big-heart { color: var(--rose); animation: beat 1.1s ease-in-out infinite; display: grid; }
.big-heart svg { width: 76px; height: 76px; filter: drop-shadow(0 10px 20px rgba(255, 79, 109, .45)); }
.heart-stage .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--rose); opacity: 0; animation: ring 1.6s ease-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.96); } 45% { transform: scale(1.1); } }
@keyframes ring { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }

/* ───────── 선물 도착 팝업 ───────── */
.pop-gift { padding-top: 18px; overflow: hidden; }
.gift-title { font-size: 20px; line-height: 1.35; margin: 4px 0 14px; word-break: keep-all; }
.gift-stage { position: relative; height: 170px; display: grid; place-items: center; }
.gbox { position: relative; width: 120px; height: 112px; animation: dropIn .55s cubic-bezier(.3, 1.5, .5, 1) both, shake .6s ease-in-out .55s; }
@keyframes dropIn { from { transform: translateY(-160px) scale(.6); opacity: 0; } }
.gbody { position: absolute; bottom: 0; left: 6px; right: 6px; height: 80px; border-radius: 10px;
  background: linear-gradient(90deg, transparent 43%, #FFE14D 43% 57%, transparent 57%), linear-gradient(160deg, #FF5C7C, #FF7E5F);
  box-shadow: 0 14px 30px rgba(255, 79, 109, .35); transition: transform .45s cubic-bezier(.5, -0.4, .6, 1), opacity .45s; }
.glid { position: absolute; top: 14px; left: 0; right: 0; height: 26px; border-radius: 8px; z-index: 2;
  background: linear-gradient(90deg, transparent 42%, #FFE14D 42% 58%, transparent 58%), linear-gradient(160deg, #FF4F6D, #F2475F);
  transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .5s .15s; }
.glid::before, .glid::after { content: ''; position: absolute; top: -20px; width: 30px; height: 22px; border: 6px solid #FFE14D; border-radius: 50% 50% 4px 50%; }
.glid::before { left: calc(50% - 32px); transform: rotate(-20deg); }
.glid::after { right: calc(50% - 32px); transform: rotate(20deg) scaleX(-1); }
@keyframes shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } }
.gitems { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 10px; pointer-events: none; }
.gitems span { width: 104px; height: 104px; border-radius: 24px; overflow: hidden; background: #fff; box-shadow: 0 14px 34px rgba(23, 23, 28, .25); opacity: 0; transform: scale(.2) translateY(40px); border: 4px solid #fff; display: grid; place-items: center; }
.gitems span img { width: 100%; height: 100%; object-fit: cover; }
.gitems .ph-sym { width: 70%; height: auto; filter: none; background: none; }
.gift-stage .burst { position: absolute; left: 50%; top: 50%; }
.gift-stage .burst i { position: absolute; width: 9px; height: 14px; border-radius: 3px; opacity: 0; }
.gift-stage.open .glid { transform: translate(-40px, -110px) rotate(-35deg); opacity: 0; }
.gift-stage.open .gbody { transform: scale(.5) translateY(40px); opacity: 0; }
.gift-stage.open .gitems span { animation: popIn .7s cubic-bezier(.2, 1.6, .4, 1) forwards; animation-delay: calc(.25s + var(--n) * .12s); }
.gift-stage.open .burst i { animation: fly 1.1s cubic-bezier(.1, .7, .3, 1) .2s forwards; }
@keyframes popIn { to { opacity: 1; transform: scale(1) translateY(0) rotate(calc((var(--n) - 1) * 6deg)); } }
@keyframes fly { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }
