/* 재사용 컴포넌트. 새 기능을 추가할 때 여기에 컴포넌트 단위로 이어 붙이세요. */

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: .7rem 1.2rem; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s; }
.btn:hover { background: var(--primary-soft); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); background: var(--primary); }
.btn.ghost { background: transparent; }
.btn.small { padding: .45rem .9rem; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }

/* 히어로 */
.hero { text-align: center; padding: 3rem 0 1.5rem; }
.hero h1 { margin-bottom: .4em; }
.hero p { max-width: 640px; margin-inline: auto; color: var(--muted); }
.hero-art { display: flex; justify-content: center; gap: .5rem; margin-bottom: 1rem; }
.hero-art svg { width: clamp(52px, 12vw, 84px); height: auto; animation: bob 3s ease-in-out infinite; }
.hero-art svg:nth-child(2n) { animation-delay: -1s; }
.hero-art svg:nth-child(3n) { animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* 검색 · 칩 */
.toolbar { display: grid; gap: .9rem; margin: 1.5rem 0 1.2rem; }
.search { position: relative; max-width: 560px; margin-inline: auto; width: 100%; }
.search input { width: 100%; padding: .9rem 1.2rem; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.search input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--primary-soft); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: .45rem 1rem; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--primary-soft); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.result-info { text-align: center; color: var(--muted); font-size: .92rem; min-height: 1.5em; }

/* 카드 그리드 */
.grid { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.card[hidden] { display: none; }
.card a { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: 1rem .6rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; height: 100%; }
.card a:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-art svg, .card-art img { width: 96px; height: 96px; object-fit: contain; }
.card-name { font-weight: 700; margin-top: .3rem; }
.card-cat { font-size: .8rem; color: var(--muted); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }

/* 카테고리 카드 */
.cat-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.cat-card a { display: flex; flex-direction: column; gap: .2rem; align-items: center; padding: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); height: 100%; }
.cat-card a:hover { box-shadow: var(--shadow); }
.cat-art { display: flex; gap: .2rem; margin-bottom: .4rem; }
.cat-art svg, .cat-art img { width: 52px; height: 52px; object-fit: contain; }
.cat-card span:last-child { color: var(--muted); font-size: .9rem; }

/* 본문 텍스트 섹션 */
.prose { max-width: 780px; margin-inline: auto; }
.prose.wide { max-width: 980px; }
.prose h2:first-child { margin-top: 0; }
.prose li { margin-bottom: .35em; }
.page-head { padding: 2rem 0 1rem; }
.page-head.center { text-align: center; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .9rem; color: var(--muted); padding: 1rem 0 0; }
.breadcrumb a { color: var(--muted); }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li { background: var(--primary-soft); color: var(--primary-text); padding: .2rem .7rem; border-radius: 999px; font-size: .9rem; }
.linklist { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; list-style: none; padding: 0; }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 12px; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.notice p:last-child { margin: 0; }

/* 기능·가이드 카드 */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; list-style: none; padding: 0; }
.feature-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin: 0; }
.feature-grid h3 { margin-top: 0; font-size: 1.1rem; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; margin-bottom: .5rem; }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1.2rem; margin-bottom: .7rem; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: .7rem 0 0; color: var(--muted); }

/* 표 */
.table-wrap { overflow-x: auto; margin-bottom: 1.2rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; vertical-align: top; }
th { background: var(--surface-2); }

/* 광고 영역 (adsenseClient/Slot 설정 시에만 출력됨) */
.ad { margin: 2rem 0; min-height: 90px; text-align: center; }

/* 캐릭터 상세 */
.icon-detail { display: grid; grid-template-columns: minmax(280px, 5fr) 6fr; gap: 2rem; padding: 1.5rem 0 1rem; align-items: start; }
.icon-stage { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 2rem; display: grid; place-items: center; position: sticky; top: 80px;
  background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%), linear-gradient(45deg, var(--surface-2) 25%, transparent 25%, transparent 75%, var(--surface-2) 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px; }
.stage-art svg, .stage-art img { width: min(320px, 70vw); height: auto; }
.control { border: 0; padding: 0; margin: 1.2rem 0; }
.control legend, .control > label:first-child { font-weight: 700; margin-bottom: .4rem; display: block; padding: 0; }
.color-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.color-row label { display: inline-flex; align-items: center; gap: .5rem; font-size: .95rem; }
input[type="color"] { width: 44px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch:hover { transform: scale(1.12); }
select { padding: .6rem .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.check { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; font-size: .92rem; font-weight: 400 !important; }
.share { border-top: 1px dashed var(--line); margin-top: 1.5rem; padding-top: 1rem; }
.share h2 { font-size: 1.1rem; margin: 0 0 .3rem; }
.status { min-height: 1.5em; color: var(--primary-text); font-weight: 600; margin: 0; }
@media (max-width: 820px) { .icon-detail { grid-template-columns: 1fr; } .icon-stage { position: static; } }

/* 스튜디오 */
.studio { display: grid; grid-template-columns: 360px 1fr; gap: 1.5rem; align-items: start; margin: 1.5rem 0 2rem; }
.studio-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: grid; gap: 1.1rem; }
.studio-panel fieldset { border: 0; padding: 0; margin: 0; }
.studio-panel legend { font-weight: 700; margin-bottom: .4rem; padding: 0; }
.opt-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.opt-row label { cursor: pointer; }
.opt-row input { position: absolute; opacity: 0; pointer-events: none; }
.opt-row span { display: inline-block; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); font-size: .92rem; font-weight: 600; background: var(--surface); }
.opt-row input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.opt-row input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; }
.pick-grid label { cursor: pointer; }
.pick-grid input { position: absolute; opacity: 0; pointer-events: none; }
.pick-grid span { display: block; border: 2px solid var(--line); border-radius: 12px; padding: 2px; background: var(--surface-2); }
.pick-grid svg { width: 100%; height: auto; }
.pick-grid input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pick-grid input:focus-visible + span { outline: 3px solid var(--focus); }
.stage-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; place-items: center; position: sticky; top: 80px; }
.stage-wrap canvas { max-width: 100%; max-height: 72vh; width: auto; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.row2 { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } .stage-wrap { position: static; order: -1; } }
