/* 글꼴은 모두 사이트 안 파일 (OFL) */
@font-face { font-family: 'Hippie'; src: url(/fonts/hippie.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Jua'; src: url(/fonts/jua.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Gowun Dodum'; src: url(/fonts/gowun-dodum.woff2) format('woff2'); font-display: swap; }

:root {
  --sky: #F0D38E;
  --ink: #3B2F25;
  --sub: #5A4232;
  --paper: #FFFBF2;
  --line: #EADFCC;
  --field: #DCCDB6;
  --brand: #B5532F;
  --muted: #6B5B4B;
  --text: #3B2F25;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--sky);
  color: var(--ink);
  font-family: 'Gowun Dodum', sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
}
[hidden] { display: none !important; }
b { font-weight: 700; }
a { color: inherit; }
:focus-visible { outline: 3px solid #2F6FDE; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 440px; margin: 0 auto; padding: 28px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; flex-direction: column; gap: 6px; }
.brand { margin: 0; font-size: 13px; color: var(--sub); letter-spacing: .04em; text-align: center; font-family: 'Hippie', sans-serif; }
.title { margin: 0; font-weight: 400; font-size: 30px; line-height: 1.25; text-align: center; font-family: 'Hippie', sans-serif; }
.title.pot-name { font-family: 'Jua', sans-serif; }
.lead { margin: 0; font-size: 15px; line-height: 1.6; text-align: center; }
.stage-line { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sub); text-align: center; }
.jua { font-family: 'Jua', sans-serif; }
.center { text-align: center; }
.sub { color: var(--sub); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.card.tall { padding: 20px 16px 16px; text-align: center; }
.card-q { margin: 0; font-family: 'Jua', sans-serif; font-size: 18px; line-height: 1.4; }
.card h2 { margin: 0; font-family: 'Jua', sans-serif; font-weight: 400; font-size: 24px; line-height: 1.35; }
.small { margin: 0; font-size: 12px; color: var(--muted); }
.help { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.err { margin: -4px 0 0; font-size: 13px; color: #A0381A; }

.btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 50px; border: 0; border-radius: 16px; background: var(--brand); color: #FFFFFF; font-family: 'Jua', sans-serif; font-size: 18px; text-decoration: none; cursor: pointer; padding: 0 12px; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-line { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 46px; border: 1px solid var(--brand); border-radius: 14px; background: #FFFFFF; color: var(--brand); font-family: 'Jua', sans-serif; font-size: 15px; cursor: pointer; padding: 0 8px; text-decoration: none; }
.btn-line.big { min-height: 50px; border-radius: 16px; font-size: 16px; }
.btn-text { display: flex; align-items: center; justify-content: center; min-height: 44px; color: var(--muted); font-size: 14px; background: none; border: 0; font-family: inherit; cursor: pointer; }
.btn-dash { min-height: 44px; border: 1px dashed var(--brand); border-radius: 14px; background: transparent; color: var(--sub); font-family: 'Jua', sans-serif; font-size: 15px; cursor: pointer; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn svg, .btn-line svg { flex: none; }

.input, .textarea { width: 100%; border: 1px solid var(--field); border-radius: 14px; background: #FFFFFF; font-family: inherit; font-size: 16px; color: var(--text); }
.input { height: 48px; padding: 0 14px; }
.textarea { padding: 12px; line-height: 1.6; resize: none; }
.counter { margin: -6px 0 0; align-self: flex-end; font-size: 12px; color: var(--muted); }
.divider { height: 1px; background: var(--line); }

/* 재료 고르기 */
.ing-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ing { min-height: 62px; border: 1px solid var(--line); background: #F7EFE0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: inherit; font-size: 11px; color: var(--text); padding: 0; cursor: pointer; }
.ing[aria-pressed="true"] { border: 2px solid var(--brand); background: #FDEBD3; }

/* 솥 그림 · 말풍선 */
.pot-stage { position: relative; }
.pot-stage.with-bubbles { padding-top: 30px; }
.bubble { position: absolute; max-width: 46%; background: var(--paper); border: 1.5px solid #E2A84A; border-radius: 12px; padding: 5px 10px; font-size: 10px; line-height: 1.35; color: var(--text); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bubble:nth-child(1) { left: 33%; top: 5px; transform: rotate(1deg); }
.bubble:nth-child(2) { left: .5%; top: 45px; transform: rotate(-7deg); max-width: 34%; }
.bubble:nth-child(3) { left: 65%; top: 48px; transform: rotate(8deg); max-width: 34%; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 12px; line-height: 1.4; color: var(--text); }
.steps span { font-family: 'Jua', sans-serif; font-size: 18px; color: var(--brand); }

/* 행복 글 카드 */
.notes { column-count: 2; column-gap: 8px; }
.note { break-inside: avoid; margin: 0 0 8px; background: var(--paper); border: 1.5px solid #E2A84A; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.note-owner { border: 2px solid #F2C27A; }
.note-plain { border: 0; }
.note-ing { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 4px; flex: none; }
.dot-ball { border: 1px solid #9C8B78; }
.note-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.clamp4 .note-body { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note-by { font-size: 12px; color: var(--muted); }
.note-tools { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.link-btn { border: 0; background: none; padding: 0 2px; min-height: 44px; color: var(--brand); font-family: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.note.is-hidden { background: #F2EADB; }
.note.is-hidden .note-body, .note.is-hidden .note-ing { opacity: .45; }
.owner-label { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.badge-owner { background: #F2C27A; color: #2E2420; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-family: 'Gowun Dodum', sans-serif; }

/* 거르기 이유 */
.reason { background: #FFF3E3; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.reason-title { margin: 0; font-family: 'Jua', sans-serif; font-size: 16px; color: #A0381A; }
.reason-text { margin: 0; font-size: 14px; line-height: 1.6; }

/* 맨 아래 */
.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; text-align: center; }
.foot-note { margin: 0; font-size: 10px; line-height: 1.6; }
.foot a { font-size: 12px; color: var(--sub); }
.copy { margin: 0; font-size: 11px; color: var(--sub); text-align: center; }
.foot a, .copy a { display: inline-flex; align-items: center; min-height: 32px; }

/* 안내 · 복사 알림 */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); margin: 0; background: #3B2F25; color: #FFF8EE; border-radius: 999px; padding: 10px 18px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet-back { position: fixed; inset: 0; background: rgba(30, 22, 16, .55); z-index: 20; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(440px, 100%); max-height: 90vh; overflow: auto; background: var(--paper); color: var(--text); border-radius: 22px 22px 0 0; padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 14px; z-index: 21; text-align: center; }
.sheet-title { margin: 0; font-family: 'Jua', sans-serif; font-size: 18px; }
.sheet-link { margin: 0; font-size: 14px; word-break: break-all; user-select: all; -webkit-user-select: all; background: #FFFFFF; border: 1px dashed var(--brand); border-radius: 12px; padding: 10px; }
.sheet-img { width: 70%; margin: 0 auto; border-radius: 12px; -webkit-touch-callout: default; }

/* 솥 주인 */
.owner-badge { margin: 0; align-self: center; display: flex; align-items: center; gap: 6px; background: #3B2F25; color: #FFF8EE; border-radius: 999px; padding: 6px 12px; font-size: 12px; }
.open .owner-badge { background: #FFF8EE; color: #3D316A; }
.link-box { display: flex; align-items: center; gap: 8px; background: #FFFFFF; border: 1px solid var(--field); border-radius: 12px; padding: 10px 12px; }
.link-box span { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret-card { background: #FFF3E8; border: 2px solid var(--brand); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.secret-card .link-box { border: 1px dashed var(--brand); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.locked { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 16px; background: #E6D6B8; color: var(--muted); font-family: 'Jua', sans-serif; font-size: 16px; margin: 0; }
.soup-card { background: var(--paper); border-radius: 22px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text); text-align: center; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 4px; }
.chip { display: flex; align-items: center; gap: 5px; background: #F7EFE0; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.btn-gold { background: #F2C27A; color: #2E2420; min-height: 52px; font-size: 16px; }
.btn-ghost { background: transparent; border: 1px solid #F2C27A; color: #FFF8EE; min-height: 52px; font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* PDF (브라우저 인쇄) */
@media print {
  @page { margin: 14mm; }
  body { background: #FFFFFF !important; color: #3B2F25 !important; }
  :root { --sky: #FFFFFF !important; --ink: #3B2F25 !important; --sub: #5A4232 !important; }
  .no-print, #toast, #sheet { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .clamp4 .note-body { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .note { border: 1px solid #E2A84A; }
  .note.is-hidden { display: none; }
  .print-only { display: block !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-only { display: none; }

/* 안내 · 처리방침 요약 */
.policy-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px dashed #E5D6BC; font-size: 13px; line-height: 1.6; }

/* 좁은 폰에서 두 단추가 한 줄씩 맞도록 */
.row2 .btn-line, .row2 .btn { white-space: nowrap; }
@media (max-width: 400px) {
  .row2 .btn-line.big svg, .row2 .btn svg { display: none; }
  .row2 .btn-line.big, .row2 .btn { font-size: 15px; }
}

/* 이미지에 내 글 넣기 / 빼기 */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #F2E8D6; border-radius: 14px; }
.seg button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-family: 'Gowun Dodum', sans-serif; font-size: 14px; cursor: pointer; }
.seg button[aria-checked="true"] { background: #FFFFFF; color: var(--brand); font-family: 'Jua', sans-serif; font-size: 15px; box-shadow: 0 1px 2px rgba(59, 47, 37, .15); }
