/* 창작 도구 페이지 */
.cr-wrap { max-width: 1120px; margin: 2rem auto 4rem; padding: 0 1rem; }
.cr-notice { max-width: 760px; margin: 0 auto 1.3rem; padding: .8rem 1.1rem; background: #fff8e1; border: 1px solid #ffd24d; border-radius: 14px; color: #5a4300; font-size: .95rem; line-height: 1.6; text-align: center; }
.cr-hero { text-align: center; margin-bottom: 1.6rem; }
.cr-hero h1 { font-size: 2.2rem; margin: 0 0 .4rem; color: #333; }
.cr-hero p { margin: 0 auto; max-width: 640px; color: #666; line-height: 1.6; }
.cr-badge { display: inline-block; vertical-align: middle; margin-left: .4rem; font-size: .75rem; font-weight: 800; background: linear-gradient(135deg, #ffe38a, #ffc83d); color: #5a4300; padding: .2rem .6rem; border-radius: 999px; }
.cr-lock-note { max-width: 760px; margin: 0 auto 1.3rem; padding: .8rem 1.1rem; background: #fff8e1; border: 1px solid #ffd24d; border-radius: 14px; color: #5a4300; text-align: center; line-height: 1.6; }

.cr-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.cr-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; text-align: left; padding: 1.4rem 1.3rem 1.1rem; border: 2px solid rgba(0,0,0,.05); border-radius: 22px; background: var(--cc, #FFF3C4); cursor: pointer; font-family: inherit; color: #333; box-shadow: 0 4px 14px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s; }
.cr-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.cr-card.locked { filter: saturate(.75); }
.cr-ic { font-size: 2.6rem; line-height: 1; } .cr-card b { font-size: 1.2rem; } .cr-d { font-size: .92rem; color: #555; line-height: 1.5; flex: 1; }
.cr-go, .cr-pro { margin-top: .5rem; align-self: flex-end; font-weight: 800; background: #fff; padding: .4rem .95rem; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.12); font-size: .9rem; }
.cr-pro { color: #8a6000; }

.cr-stage { background: #fff; border: 1px solid #eee; border-radius: 22px; box-shadow: 0 6px 24px rgba(0,0,0,.07); padding: 1.2rem 1.4rem 1.6rem; }
.cr-bar { display: flex; align-items: center; gap: .8rem; border-bottom: 1px solid #f0f0f0; padding-bottom: .9rem; margin-bottom: 1.2rem; }
.cr-bar h2 { margin: 0; flex: 1; text-align: center; font-size: 1.25rem; color: #333; }
.cr-btn { border: 0; border-radius: 999px; padding: .6rem 1.2rem; font: 700 .95rem inherit; font-family: inherit; background: #f1f1f1; color: #555; cursor: pointer; text-decoration: none; display: inline-block; }
.cr-btn:hover { background: #ffeaa0; color: #5a4300; }
.cr-btn.primary { background: linear-gradient(135deg, #ffe38a, #ffd24d); color: #5a4300; box-shadow: 0 4px 12px rgba(255,190,50,.35); }

.cr-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1.6rem; align-items: start; }
.cr-ctl { display: flex; flex-direction: column; gap: 1rem; }
.cr-f label, .cr-ai > label { display: block; font-weight: 800; font-size: .9rem; color: #666; margin-bottom: .4rem; }
.cr-f input[type=number], .cr-f input[type=text], .cr-ai input[type=text] { width: 100%; box-sizing: border-box; border: 2px solid #eee; border-radius: 12px; padding: .55rem .7rem; font: inherit; font-family: inherit; }
.cr-f input:focus, .cr-ai input:focus { outline: none; border-color: #FFD700; }
.cr-f input[type=range] { width: 100%; accent-color: #FFC83D; }
.cr-row { display: flex; gap: .6rem; } .cr-row .cr-f { flex: 1; min-width: 0; }
.cr-check { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: #555; cursor: pointer; }
.cr-hint { margin: .3rem 0 0; font-size: .82rem; color: #999; line-height: 1.5; }
.cr-acts { margin-top: .4rem; } .cr-acts .cr-btn { width: 100%; padding: .85rem; font-size: 1.05rem; }

.cr-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.cr-chips button { display: inline-flex; align-items: center; gap: .35rem; border: 2px solid #eee; background: #fffdf5; border-radius: 999px; padding: .4rem .8rem; font: 700 .85rem inherit; font-family: inherit; color: #555; cursor: pointer; transition: border-color .12s, background .12s; }
.cr-chips button i { font-style: normal; font-size: 1.1rem; }
.cr-chips button:hover { border-color: #ffe27a; } .cr-chips button.on { border-color: #FFD700; background: #FFF8D6; color: #5a4300; }
.cr-chips.sm button { padding: .3rem .7rem; font-size: .82rem; }
.cr-seg { display: inline-flex; padding: 3px; background: #f3f1ea; border-radius: 999px; gap: 2px; }
.cr-seg button { border: 0; background: transparent; padding: .38rem 1rem; border-radius: 999px; font: 700 .88rem inherit; font-family: inherit; color: #777; cursor: pointer; }
.cr-seg button:disabled { opacity: .35; cursor: not-allowed; }
.cr-seg button.on { background: #fff; color: #333; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.cr-tints { display: flex; gap: .5rem; } .cr-tints button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #ddd; cursor: pointer; padding: 0; } .cr-tints button.on { border-color: #FFD700; box-shadow: 0 0 0 3px rgba(255,215,0,.35); }
.cr-six { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; } .cr-six input { text-align: center; font-size: 1.2rem; padding: .5rem .3rem; }
.cr-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; max-height: 330px; overflow-y: auto; padding: 2px; }
.cr-thumbs button { display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 2px solid #eee; background: #fff; border-radius: 12px; padding: .35rem; cursor: pointer; font: 700 .75rem inherit; font-family: inherit; color: #555; }
.cr-thumbs button.on { border-color: #FFD700; background: #FFF8D6; } .cr-thumbs svg, .cr-thumbs img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.cr-ai { border-top: 1px dashed #e5dcb6; padding-top: .9rem; }

.cr-pvwrap { background: #f3f1ea; border-radius: 16px; padding: 1.2rem; display: flex; justify-content: center; }
.cr-pv { width: 100%; max-width: 520px; background: #fff; box-shadow: 0 6px 22px rgba(0,0,0,.12); aspect-ratio: 210 / 297; }
.cr-pv svg { display: block; width: 100%; height: auto; }

.cr-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.cr-mbox { background: #fff; border-radius: 22px; max-width: 420px; width: 100%; padding: 1.8rem 1.5rem 1.4rem; text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,.3); }
.cr-mi { font-size: 2.6rem; } .cr-mbox h3 { margin: .3rem 0; font-size: 1.3rem; } .cr-mbox p { color: #666; line-height: 1.6; margin: .4rem 0 1.1rem; }
.cr-macts { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 900px) { .cr-grid { grid-template-columns: 1fr; } .cr-menu { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cr-menu { grid-template-columns: 1fr; } .cr-bar h2 { font-size: 1.05rem; } }
@media print { .cr-wrap { display: none !important; } }

.cr-warn { margin: 0; padding: .6rem .8rem; background: #fff1f0; border: 1px solid #f3b4ad; border-radius: 12px; color: #a3392d; font-size: .85rem; line-height: 1.5; }
.cr-warn[hidden] { display: none; }

.cr-tints .cr-cust { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #ddd; cursor: pointer; background: conic-gradient(#ff5d5d, #ffd94d, #6fcf6a, #4cc3ff, #8a63d2, #ff5d5d); overflow: hidden; display: inline-block; }
.cr-tints .cr-cust.on { border-color: #FFD700; box-shadow: 0 0 0 3px rgba(255,215,0,.35); }
.cr-tints .cr-cust input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }

/* 도형 도안 설정 화면 (아이콘 카드, 구역 제목) */
.cr-sec { padding: 1.1rem 0; border-top: 1px solid #ece6d3; }
.cr-sec:first-child { border-top: 0; padding-top: 0; }
.cr-sec h3 { margin: 0 0 .7rem; font-size: 1.05rem; font-weight: 800; color: #2d2a24; }
.cr-shapes.cr-scroll { max-height: 330px; overflow-y: auto; padding: 2px; }
.cr-shapes { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.cr-shapes button { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 2px solid #e4dfd0; border-radius: 14px; background: #fff; cursor: pointer; font: 700 .93rem inherit; font-family: inherit; color: #2d2a24; text-align: left; line-height: 1.25; transition: border-color .12s, background .12s, transform .12s; }
.cr-shapes button:hover { border-color: #f3cf6a; transform: translateY(-1px); }
.cr-shapes button.on { border-color: #f0b429; background: #FFF1B8; }
.cr-ico { width: 40px; height: 40px; flex: 0 0 40px; }
.cr-ico2 { width: 1.3em; height: 1.3em; flex: 0 0 auto; }
.cr-acts .cr-btn.primary { display: flex; align-items: center; justify-content: center; gap: .55rem; }
.cr-sec .cr-f label { font-size: .88rem; color: #3b372e; }
.cr-sec .cr-f input[type=number] { border-radius: 12px; }
.cr-sec .cr-tints button, .cr-sec .cr-tints .cr-cust { width: 38px; height: 38px; }
.cr-sec .cr-tints button.on { border-color: #f0b429; box-shadow: 0 0 0 3px rgba(240, 180, 41, .3); }

/* 설정 화면 글씨: 두껍지 않은 보통 글씨 */
.cr-sec h3 { font-weight: 600; font-size: 1rem; letter-spacing: 0; color: #2d2a24; }
.cr-f label, .cr-ai > label, .cr-sec .cr-f label { font-weight: 500; font-size: .9rem; color: #4a463c; }
.cr-shapes button { font-weight: 500; font-size: .92rem; }
.cr-seg button { font-weight: 500; }
.cr-check { font-weight: 500; }
.cr-btn { font-weight: 600; }
.cr-acts .cr-btn.primary { font-weight: 600; }
.cr-thumbs button { font-weight: 500; }
.cr-bar h2 { font-weight: 600; }
.cr-sec .cr-f input[type=number], .cr-sec .cr-f input[type=text], .cr-sec input[type=text] { width: 100%; box-sizing: border-box; border: 2px solid #eee; border-radius: 12px; padding: .55rem .7rem; font: inherit; font-family: inherit; }

/* 왼쪽 설정 메뉴: 가운데 정렬 */
.cr-sec-h { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: .7rem; }
.cr-sec-h h3 { margin: 0; text-align: center; }
.cr-sec-r { justify-self: end; }
.cr-lockchk { font-size: .8rem; white-space: nowrap; gap: .35rem; }
.cr-ctl .cr-sec { text-align: center; }
.cr-ctl .cr-f label, .cr-ctl .cr-ai > label { text-align: center; }
.cr-ctl .cr-f input[type=number], .cr-ctl .cr-f input[type=text], .cr-ctl .cr-sec input[type=text] { text-align: center; }
.cr-ctl .cr-seg { display: flex; width: max-content; max-width: 100%; margin: 0 auto; }
.cr-ctl .cr-chips, .cr-ctl .cr-tints, .cr-ctl .cr-row { justify-content: center; }
.cr-ctl .cr-check { justify-content: center; }
.cr-ctl .cr-sec-r .cr-check { justify-content: flex-end; }
.cr-ctl .cr-shapes button { justify-content: center; text-align: center; }
.cr-ctl .cr-hint, .cr-ctl .cr-warn { text-align: center; }

.cr-ctl .cr-row .cr-btn { white-space: nowrap; flex: 0 0 auto; }

/* 맨 위 탭 (종류 | AI) */
.cr-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .3rem; background: #f3f1ea; border-radius: 14px; margin-bottom: 1.1rem; }
.cr-tabs button { border: 0; background: transparent; padding: .65rem .5rem; border-radius: 11px; font: 600 .98rem inherit; font-family: inherit; color: #777; cursor: pointer; transition: background .12s, color .12s; }
.cr-tabs button.on { background: #fff; color: #333; box-shadow: 0 1px 5px rgba(0,0,0,.14); }
.cr-tabs button.ai i { margin-right: .25rem; }
.cr-tabs button.ai.on { background: linear-gradient(135deg, #4A90E2, #1a5fc8); color: #fff; box-shadow: 0 3px 10px rgba(74,144,226,.4); }

/* AI 패널: 일반 학습지의 AI 생성기와 같은 파란색 */
.cr-aip { display: flex; flex-direction: column; gap: .6rem; background: linear-gradient(160deg, #fafcff 0%, #f3f0ff 100%); border: 1px solid #c8d4f8; border-radius: 14px; padding: 1.2rem 1.1rem; margin-bottom: 1rem; }
.cr-aip-h { display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: 1.05rem; color: #1a5fc8; }
.cr-aip-h b { font-weight: 700; background: linear-gradient(90deg, #1a5fc8, #7c3aed); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cr-aip-msg { margin: 0; min-height: 1.1rem; font-size: .8rem; line-height: 1.5; color: #5b6f94; text-align: center; }
.cr-aip-msg.err { color: #e05c5c; }
.cr-aip input[type=text] { padding: .7rem 1rem; border: 1px solid #d0e4fa; border-radius: 8px; font: inherit; font-size: 1rem; width: 100%; box-sizing: border-box; outline: none; text-align: left; background: #fff; }
.cr-aip input[type=text]:focus { border-color: #4A90E2; }
.cr-aip-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.cr-aip-chip { padding: .28rem .75rem; border-radius: 999px; background: #e8f0fe; color: #1a5fc8; font-size: .85rem; cursor: pointer; border: 1px solid #c3d8f8; }
.cr-aip-chip:hover { background: #d6e6fd; }
.cr-aip-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; background: linear-gradient(135deg, #4A90E2, #1a5fc8); border: 0; border-radius: 8px; padding: .8rem; font: 700 1rem inherit; font-family: inherit; color: #fff; cursor: pointer; width: 100%; }
.cr-aip-btn:hover { opacity: .9; }
.cr-aip-btn:disabled { opacity: .6; cursor: not-allowed; }
.cr-spin { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: cr-spin .7s linear infinite; }
@keyframes cr-spin { to { transform: rotate(360deg); } }
.cr-aip-btn.busy .cr-spin { display: inline-block; }
.cr-aip-btn.busy .fa-magic { display: none; }

/* 색칠놀이 요청 목록 */
.cr-reqs { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; padding: 2px; }
.cr-req { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; background: #fff; border: 1px solid #e4e8f3; border-radius: 10px; }
.cr-req-t { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: #333; text-align: left; }
.cr-req.done { background: #f1f8f1; border-color: #cfe6cf; }
.cr-req-ok { color: #2e8b57; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.cr-req-v { border: 1px solid #c3d8f8; background: #e8f0fe; color: #1a5fc8; border-radius: 999px; padding: .25rem .7rem; font: 700 .85rem inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.cr-req-v:hover { background: #d6e6fd; }
.cr-req-v.on { background: #4A90E2; border-color: #4A90E2; color: #fff; }
.cr-req-a { border: 1px solid #ddd; background: #fafafa; border-radius: 8px; padding: .2rem .5rem; cursor: pointer; font-size: .85rem; }

/* 요청 탭은 AI가 아니라서 파란색 대신 차분한 분홍색 */
.cr-tabs button.req i { margin-right: .25rem; }
.cr-tabs button.req.on { background: linear-gradient(135deg, #F3B1C8, #DC7FA2); color: #fff; box-shadow: 0 3px 10px rgba(220,127,162,.32); }
.cr-aip.req { background: linear-gradient(160deg, #fffbfc 0%, #fdf0f4 100%); border-color: #f2d3de; }
.cr-aip.req .cr-aip-h { color: #bf5c80; }
.cr-aip.req .cr-aip-h b { background: linear-gradient(90deg, #cc6a8e, #a9609f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cr-aip.req .cr-aip-msg { color: #8a6677; }
.cr-aip.req .cr-aip-msg.err { color: #d04b4b; }
.cr-aip.req input[type=text] { border-color: #f3dce5; }
.cr-aip.req input[type=text]:focus { border-color: #e08fae; }
.cr-aip.req .cr-aip-btn { background: linear-gradient(135deg, #F3B1C8, #DC7FA2); }
.cr-req-v { border-color: #f2d3de; background: #fdf0f4; color: #b85a7b; }
.cr-req-v:hover { background: #fbe3ec; }
.cr-req-v.on { background: #e48fb0; border-color: #e48fb0; color: #fff; }
