/* 봉봉 스티커 가게. 규칙은 DESIGN.md */
/* 주아에는 가운뎃점(·)과 곱셈표(×) 글자가 비어 있어서 그 둘은 다음 글꼴에서 가져온다 */
@font-face { font-family: 'Jua'; src: local('BM JUA_TTF'), url('../assets/fonts/BMJUA.ttf') format('truetype'); font-display: swap; unicode-range: U+0020-00B6, U+00B8-00D6, U+00D8-FFFF; }
:root {
  --pink: #FFC6D3; --pink-soft: #FFF0F3; --yellow: #FFF7B8; --coral: #F0707A; --blue: #3B9BE8; --blue-d: #2A82CC;
  --ink: #2B2B2B; --muted: #77706F; --card: #fff;
  --r-s: 10px; --r-m: 16px; --r-l: 22px;
  --line: 2px solid var(--ink);
  --shadow: 0 8px 16px -8px rgba(55, 55, 55, .16);
  --title: 'Jua', 'Pretendard Variable', Pretendard, 'Malgun Gothic', sans-serif;
  --body: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --wrap: 1240px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 16px/1.55 var(--body); background: var(--pink-soft); min-height: 100vh; display: flex; flex-direction: column; word-break: keep-all; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--title); font-weight: 400; margin: 0; letter-spacing: .01em; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

/* 머리 */
.announce { margin: 0; padding: 9px 16px; background: var(--coral); color: #fff; text-align: center; font: 400 15px var(--title); letter-spacing: .02em; }
.top { background: var(--pink); }
.top-in { width: min(var(--wrap), 100% - 40px); margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 0; }
.logo { grid-column: 2; display: flex; align-items: center; gap: 10px; font: 400 34px/1 var(--title); }
.logo img { width: 56px; height: 56px; object-fit: contain; }
.quick { grid-column: 3; justify-self: end; display: flex; gap: 10px; }
.round { width: 58px; height: 58px; border-radius: 50%; background: #fff; border: var(--line); display: grid; place-items: center; align-content: center; gap: 0; font: 400 11px/1 var(--title); transition: transform .15s; }
.round svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.round:hover { transform: translateY(-2px); }
.round:nth-child(1) { background: #FFE3E8; } .round:nth-child(2) { background: var(--yellow); } .round:nth-child(3) { background: #D9EEFF; }
.menu { background: var(--yellow); display: flex; justify-content: center; flex-wrap: wrap; gap: 0 4px; padding: 0 12px; border-bottom: var(--line); border-top: var(--line); }
.menu a { padding: 11px 18px; font: 400 17px var(--title); position: relative; }
.menu a + a::before { content: ''; position: absolute; left: -2px; top: 30%; height: 40%; border-left: 1.5px solid var(--ink); }
.menu a[aria-current='page'] { color: var(--coral); }
main { flex: 1; padding-bottom: 56px; }
main:focus { outline: none; }
.foot { background: var(--pink); border-top: var(--line); padding: 22px 16px 28px; text-align: center; font-size: 14px; }
.foot p { margin: 0; } .foot b { font: 400 17px var(--title); }
.foot-links { margin-top: 8px !important; display: flex; justify-content: center; gap: 18px; color: var(--muted); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

/* 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 14px; border: var(--line); background: #fff; font: 400 17px var(--title); transition: transform .12s, background .12s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.main { background: var(--blue); color: #fff; }
.btn.main:hover { background: var(--blue-d); }
.btn.warn { background: #FFE3E8; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 배너 */
.hero { padding: 28px 0 8px; }
.banners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.banner { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 300px; padding: 22px; border: var(--line); border-radius: var(--r-l); overflow: hidden; background: #fff; transition: transform .18s; }
.banner:hover { transform: translateY(-3px); }
.banner.b1 { background: #FFE3E8; } .banner.b2 { background: #D9EEFF; } .banner.b3 { background: var(--yellow); }
.banner .pile { position: absolute; inset: 14px 14px 96px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; align-items: center; justify-items: center; }
.banner .pile img { width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(43, 43, 43, .14)); }
.banner .pile img:nth-child(2) { transform: translateY(-10px) scale(1.12); }
.banner h2 { font-size: 27px; line-height: 1.2; }
.banner p { margin: 4px 0 0; font-size: 15px; color: #4b4544; }
.tag { position: absolute; left: 16px; top: 16px; z-index: 1; padding: 3px 12px 2px; border-radius: 10px; background: var(--coral); color: #fff; font: 400 14px var(--title); border: var(--line); }

/* 진열 */
.band { background: var(--pink); margin-top: 40px; padding: 30px 0 38px; border-block: var(--line); }
.band.plain { background: none; border: 0; padding-bottom: 8px; }
.sec-head { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-bottom: 20px; text-align: center; }
.sec-head h2 { font-size: 22px; }
.sec-head small { color: var(--muted); font-size: 14px; }
.band:last-child { margin-bottom: -56px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.sheet-card { position: relative; background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 12px 12px 14px; display: flex; flex-direction: column; transition: transform .15s; }
.sheet-card:hover { transform: translateY(-3px); }
.sheet-card .pic { aspect-ratio: 1 / 2; border-radius: var(--r-s); overflow: hidden; background: #fff; border: 1.5px solid #eee3e5; }
.sheet-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.mini { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(8, 1fr); gap: 2px; padding: 6px; height: 100%; }
.mini img { width: 100%; height: 100%; object-fit: contain; }
.sheet-card h3 { font-size: 18px; margin-top: 10px; line-height: 1.25; }
.sheet-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; color: var(--muted); font-size: 14px; }
.sheet-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-m); }
.sheet-card .tag { left: 10px; top: -9px; font-size: 13px; border-width: 1.5px; }
.sheet-card h3 { font-size: 17px; padding-right: 36px; }
.sheet-card .heart { top: auto; right: 6px; bottom: 8px; background: none; }
.sheet-card .meta { padding-right: 36px; }
.tag.quoka { background: var(--blue); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.steps li { counter-increment: step; position: relative; background: #fff; border: var(--line); border-radius: var(--r-m); padding: 20px 20px 20px 74px; font-size: 15px; }
.steps li::before { content: counter(step); position: absolute; left: 18px; top: 18px; width: 42px; height: 42px; border-radius: 50%; background: var(--yellow); border: var(--line); display: grid; place-items: center; font: 400 22px var(--title); }
.steps b { display: block; font: 400 20px var(--title); }
.guide { margin: 0; }
.pick-grid .guide { grid-column: 1 / -1; padding: 20px 8px; text-align: center; color: var(--muted); font-size: 14px; }
.heart { position: absolute; right: 18px; top: 18px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); display: grid; place-items: center; }
.heart svg { width: 22px; height: 22px; fill: none; stroke: var(--coral); stroke-width: 2; stroke-linejoin: round; }
.heart[aria-pressed='true'] svg { fill: var(--coral); }
.more { display: flex; justify-content: center; margin-top: 24px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: #fff; border-radius: var(--r-m); border: 1.5px dashed #d9c9cc; }
.empty b { display: block; font: 400 20px var(--title); color: var(--ink); margin-bottom: 4px; }

/* 판 */
.page { padding-top: 26px; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumb a:hover { text-decoration: underline; }
.sheet-page { display: grid; grid-template-columns: minmax(0, 560px) minmax(260px, 1fr); gap: 32px; align-items: start; justify-content: center; }
.board { background: #fff; border: var(--line); border-radius: var(--r-l); padding: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.board button { border: 0; background: none; border-radius: var(--r-s); transition: transform .12s, background .12s; }
.board button:hover { background: var(--pink-soft); transform: scale(1.08); }
/* 네모 칸 안에 그림을 꼭 맞게 넣는 단추(판, 고르기 칸, 운영자 낱개) */
.board button, .pick-grid button, .admin-stickers button { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; overflow: hidden; }
.board button img, .pick-grid button img, .admin-stickers button img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.info { position: sticky; top: 16px; background: #fff; border-radius: var(--r-m); box-shadow: var(--shadow); padding: 24px; }
.info h1 { font-size: 30px; line-height: 1.2; }
.info .count { color: var(--muted); margin: 4px 0 18px; }
.info .btn { width: 100%; margin-top: 10px; }
.info .hint { margin: 16px 0 0; padding: 12px 14px; background: var(--yellow); border-radius: var(--r-s); font-size: 14px; }

/* 낱개 창 */
dialog { border: var(--line); border-radius: var(--r-l); padding: 0; width: min(420px, calc(100vw - 32px)); background: #fff; color: var(--ink); }
dialog::backdrop { background: rgba(43, 43, 43, .45); }
.one { padding: 22px; text-align: center; }
.one .big { position: relative; aspect-ratio: 1; background: var(--pink-soft); border-radius: var(--r-m); }
.one .big img { position: absolute; inset: 11%; width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 10px 10px rgba(43, 43, 43, .16)); }
.one h2 { font-size: 24px; margin: 14px 0 12px; }
.one .row { display: flex; gap: 10px; }
.one .row .btn { flex: 1; padding: 0 10px; }
.x { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; font-size: 24px; line-height: 1; }

/* 꾸미기 */
.editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: #fff; border-radius: var(--r-m); box-shadow: var(--shadow); padding: 14px; }
.panel h2 { font-size: 19px; margin-bottom: 10px; }
.picker select { width: 100%; height: 44px; border: var(--line); border-radius: 12px; padding: 0 10px; background: #fff; margin-bottom: 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; max-height: min(52vh, 480px); overflow: auto; padding: 2px; }
.pick-grid button { border: 0; background: var(--pink-soft); border-radius: 8px; }
.pick-grid button:hover { background: var(--pink); }
.picker .btn { width: 100%; margin-top: 10px; }
.work { min-width: 0; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.bar .sp { flex: 1; }
.seg { display: inline-flex; border: var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 0 12px; min-height: 38px; font: 400 15px var(--title); }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed='true'] { background: var(--yellow); }
.swatches { display: inline-flex; gap: 6px; align-items: center; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: var(--line); padding: 0; }
.swatches button[aria-pressed='true'] { outline: 3px solid var(--blue); outline-offset: 2px; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #e9e2e3 25%, transparent 25%, transparent 75%, #e9e2e3 75%), linear-gradient(45deg, #e9e2e3 25%, transparent 25%, transparent 75%, #e9e2e3 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.stage-wrap { background: #fff; border: var(--line); border-radius: var(--r-l); padding: 14px; display: grid; place-items: center; }
.stage { position: relative; width: 100%; overflow: hidden; border-radius: 6px; touch-action: none; user-select: none; -webkit-user-select: none; }
.it { position: absolute; transform-origin: center; cursor: grab; }
.it img { width: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.it.sel { outline: 2px dashed var(--blue); outline-offset: 4px; }
.it .grip { display: none; position: absolute; right: -18px; bottom: -18px; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: nwse-resize; touch-action: none; }
.it.sel .grip { display: block; }
.stage .guide { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); pointer-events: none; padding: 20px; }
.ops { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ops .btn { padding: 0 11px; }

/* 만들기 */
.make { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.make .panel { padding: 22px; }
.make h2 { font-size: 23px; }
.make p.sub { margin: 4px 0 14px; color: var(--muted); font-size: 15px; }
.field { display: block; width: 100%; height: 52px; border: var(--line); border-radius: 14px; padding: 0 16px; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.chips button { border: 1.5px solid var(--ink); background: var(--pink-soft); border-radius: 10px; padding: 4px 10px; font-size: 14px; }
.drop { display: grid; place-items: center; text-align: center; min-height: 180px; border: 2px dashed var(--ink); border-radius: var(--r-m); background: var(--pink-soft); padding: 14px; cursor: pointer; margin-bottom: 14px; }
.drop img { max-height: 220px; border-radius: 10px; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.notice { grid-column: 1 / -1; padding: 14px 18px; background: var(--yellow); border: var(--line); border-radius: var(--r-m); }
.notice b { font: 400 18px var(--title); }
.code-row { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code-row .field { width: 240px; height: 44px; }
.mine { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mine .row .btn { flex: 1; padding: 0 6px; }
.mine .pic { position: relative; }
.mine .pic img { position: absolute; inset: 8%; width: 84%; height: 84%; }
.mine figure { margin: 0; background: #fff; border-radius: var(--r-m); box-shadow: var(--shadow); padding: 10px; text-align: center; }
.mine .pic { aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r-s); padding: 8px; }
.mine .pic img { max-height: 100%; object-fit: contain; }
.mine figcaption { font: 400 15px var(--title); margin: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine .row { display: flex; gap: 4px; }
.busy { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 운영자 */
.admin-login { max-width: 420px; margin: 40px auto; text-align: center; }
.admin-login .field { margin: 14px 0 10px; text-align: center; }
.admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.admin-card { background: #fff; border-radius: var(--r-m); box-shadow: var(--shadow); padding: 12px; }
.admin-card.off { background: #f3ecec; }
.admin-card.off .pic img { opacity: .4; filter: grayscale(1); }
.admin-card .row { display: flex; gap: 6px; margin-bottom: 10px; }
.admin-card .row .btn { flex: 1; margin: 0; padding: 0 6px; }
.admin-card .pic { aspect-ratio: 1 / 2; border-radius: var(--r-s); overflow: hidden; border: 1.5px solid #eee3e5; }
.admin-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.admin-card h3 { font-size: 18px; margin: 2px 0; }
.admin-card .state { font-size: 13px; color: var(--muted); margin: 0 0 8px; min-height: 3.1em; }
.admin-card .btn { width: 100%; margin-top: 6px; }
.admin-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.admin-stickers button { border: 2px solid transparent; background: var(--pink-soft); border-radius: 10px; }
.admin-stickers button.off { border-color: var(--coral); background: #FFE3E8; }
.admin-stickers button.off img { opacity: .35; }
.admin-stickers button.off::after { content: '내림'; position: absolute; inset: auto 4px 4px auto; background: var(--coral); color: #fff; font: 400 12px var(--title); padding: 1px 6px; border-radius: 6px; }
.mini { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); }
.mini img { min-height: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font: 400 16px var(--title); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: var(--yellow); text-decoration: underline; margin-left: 8px; }

@media (max-width: 980px) {
  .banners { grid-template-columns: 1fr 1fr; } .banner.b3 { grid-column: 1 / -1; min-height: 220px; }
  .sheet-page { grid-template-columns: 1fr; } .info { position: static; }
  .editor { grid-template-columns: 1fr; } .picker { order: 2; } .pick-grid { grid-template-columns: repeat(8, 1fr); max-height: 240px; }
  .make { grid-template-columns: 1fr; } .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top-in { grid-template-columns: 1fr; justify-items: center; gap: 10px; } .logo, .quick { grid-column: 1; justify-self: center; }
  .logo { font-size: 28px; } .logo img { width: 46px; height: 46px; } .round { width: 52px; height: 52px; }
  .banners { grid-template-columns: 1fr; } .banner { min-height: 240px; } .banner.b3 { grid-column: auto; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 12px; } .menu a { padding: 10px 12px; font-size: 16px; }
  .pick-grid { grid-template-columns: repeat(5, 1fr); } .board { padding: 10px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }
