@font-face { font-family: "Pretendard"; font-weight: 400; font-display: block; src: url("fonts/Pretendard-Regular.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: block; src: url("fonts/Pretendard-Bold.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 800; font-display: block; src: url("fonts/Pretendard-ExtraBold.woff2") format("woff2"); }

/* 부스 폰을 쥐는 사람은 도서관 자원봉사자와 어르신이다. 글씨와 버튼을 크게 둔다. */
:root {
  --bg: #ffffff;
  --soft: #f3f7f7;
  --line: #d9e3e4;
  --ink: #1d2b4a;
  --muted: #5b6780;
  --teal: #127a82;
  --teal-dark: #0d5e64;
  --orange: #e0702e;
  --danger: #b3261e;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 19px/1.55 Pretendard, "Apple SD Gothic Neo", sans-serif;
  word-break: keep-all;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.top a.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 17px; min-height: 44px; }
.top h1 { margin: 0; font-size: 22px; font-weight: 800; }
.count { font-size: 15px; color: var(--teal-dark); background: var(--soft); border-radius: 99px; padding: 6px 12px; white-space: nowrap; }

h2 { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: 15px; color: var(--muted); margin-top: 4px; }
.input, select.input {
  width: 100%; min-height: 58px; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 21px;
}
.input:focus { outline: none; border-color: var(--teal); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 99px;
  padding: 8px 14px; font-size: 16px; min-height: 42px; cursor: pointer;
}
.chip:active { background: var(--soft); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 64px; padding: 14px 18px; border: 0; border-radius: var(--radius);
  font-size: 21px; font-weight: 800; cursor: pointer; text-decoration: none;
  background: var(--teal); color: #fff;
}
.btn:active { background: var(--teal-dark); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.secondary { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.secondary:active { background: var(--soft); }
.btn.accent { background: var(--orange); }
.btn svg { width: 26px; height: 26px; flex: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* 6행시 줄 편집 */
.lines { display: grid; gap: 10px; margin-bottom: 18px; }
.line { display: grid; grid-template-columns: 58px 1fr 52px; gap: 8px; align-items: center; }
.line .syl {
  width: 58px; height: 58px; border-radius: 12px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
}
.line .input { min-height: 58px; font-size: 19px; padding: 10px 12px; }
.line .again {
  width: 52px; height: 58px; border-radius: 12px; border: 2px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.line .again svg { width: 24px; height: 24px; }

/* 라벨 미리보기: 종이처럼 보이게 */
.preview {
  background: var(--soft); border-radius: var(--radius); padding: 18px;
  display: grid; place-items: center; margin-bottom: 16px;
}
.preview canvas, .preview img {
  width: 100%; max-width: 300px; height: auto; background: #fff;
  box-shadow: 0 1px 2px rgba(29,43,74,.12), 0 6px 18px rgba(29,43,74,.10);
  image-rendering: pixelated;
}

.notice { border-radius: 12px; padding: 12px 14px; font-size: 16px; margin-bottom: 14px; background: var(--soft); }
.notice.error { background: #fdecea; color: var(--danger); }

.busy { display: grid; place-items: center; gap: 14px; padding: 28px 0; text-align: center; color: var(--muted); }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.photo-box {
  aspect-ratio: 3 / 4; width: 100%; max-width: 250px; margin: 0 auto 16px; border-radius: var(--radius);
  background: var(--soft); border: 2px dashed var(--line); display: grid; place-items: center; overflow: hidden;
  color: var(--muted); text-align: center; cursor: pointer;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box svg { width: 64px; height: 64px; margin: 0 auto 8px; color: var(--teal); }

/* 첫 화면 부스 고르기 */
.cards { display: grid; gap: 16px; }
.card {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center;
  border: 2px solid var(--line); border-radius: 20px; padding: 14px; text-decoration: none; color: inherit; background: #fff;
}
.card:active { border-color: var(--teal); }
.card .thumb { background: var(--soft); border-radius: 12px; padding: 8px; }
.card .thumb img { box-shadow: 0 1px 4px rgba(29,43,74,.15); background: #fff; }
.card h3 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.card p { margin: 0; font-size: 16px; color: var(--muted); }
.card .where { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--teal-dark); }

.foot-links { margin-top: 28px; text-align: center; font-size: 16px; }
.foot-links a { color: var(--muted); }

.howto { font-size: 16px; color: var(--muted); margin: 14px 0 0; padding-left: 20px; }
.howto li + li { margin-top: 4px; }

[hidden] { display: none !important; }

#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area img { image-rendering: pixelated; }
}

/* 4컷 장면 입력 */
.panels { display: grid; gap: 12px; margin-bottom: 18px; }
.panel-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; }
.panel-head { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.panel-no { width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 18px; }
.panel-card .input { min-height: 54px; font-size: 18px; }
.photo-inline { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.photo-inline .btn { min-height: 54px; font-size: 18px; }
.photo-inline img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: none; }
textarea.input { resize: none; line-height: 1.45; display: block; }
