/* draw.html 전용: 나무 그림 테스트 */
:root{
  --bg:#F3F8EC; --paper:#FFFFFF; --ink:#2F3A2A; --sub:#66745E; --soft:#8E9A86; --line:#DCE6CF;
  --point:#5E8F4A; --point-ink:#fff; --butter:#FFE9A8; --butter-ink:#5A4318;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:Pretendard,-apple-system,sans-serif;background:var(--bg);color:var(--ink);line-height:1.65;-webkit-font-smoothing:antialiased}
.wrap{max-width:460px;margin:0 auto;min-height:100vh;padding:18px 16px 40px}
.top{margin-bottom:14px}
.logo{font-size:14px;font-weight:700;color:var(--sub);text-decoration:none}
.logo span{font-weight:500;color:var(--soft)}
.screen{display:none;animation:fade .35s ease}
.screen.on{display:block}
@keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

.hero{background:var(--paper);border:1px solid var(--line);border-radius:24px;padding:22px 20px 22px;text-align:center}
.hero-art svg{width:220px;height:auto;display:block;margin:0 auto}
.hero h1{font-family:'Gowun Dodum',sans-serif;font-weight:400;font-size:25px;margin:10px 0 6px}
.hero p{font-size:14px;color:var(--sub);word-break:keep-all}
.btn{display:block;width:100%;border:0;border-radius:16px;padding:14px;font-family:inherit;font-size:16px;font-weight:700;cursor:pointer;transition:transform .1s}
.btn:active{transform:scale(.98)}
.btn-main{background:var(--point);color:var(--point-ink);margin-top:16px;box-shadow:0 3px 0 #4A7639}
.btn-sub{background:var(--paper);color:var(--ink);border:1px solid var(--line);margin-top:8px}
.meta{font-size:12px;color:var(--soft);margin-top:10px}

/* 그리기 */
.pad-head{display:flex;flex-direction:column;align-items:center;margin-bottom:8px}
.pad-head b{font-family:'Gowun Dodum',sans-serif;font-weight:400;font-size:20px}
.pad-head span{font-size:12.5px;color:var(--soft)}
.pad{position:relative;background:#FFFEFA;border:1.5px solid var(--line);border-radius:22px;overflow:hidden;aspect-ratio:1/1;touch-action:none}
.pad canvas{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}
.empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#B9C4AE;font-size:15px;pointer-events:none;transition:opacity .2s}
.tools{display:flex;align-items:center;gap:8px;margin-top:10px;flex-wrap:wrap}
.colors,.sizes{display:flex;gap:6px}
.colors button{width:30px;height:30px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1.5px var(--line);cursor:pointer}
.colors button.on{box-shadow:0 0 0 2.5px var(--ink)}
.sizes button{width:30px;height:30px;border-radius:50%;border:1.5px solid var(--line);background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.sizes button i{display:block;border-radius:50%;background:var(--ink)}
.sizes button.on{border-color:var(--ink)}
.tbtn{margin-left:auto;width:38px;height:34px;border-radius:12px;border:1px solid var(--line);background:#fff;font-size:16px;cursor:pointer}
.tbtn+.tbtn{margin-left:0}

/* 기다림 */
.wait{padding:60px 20px}
.leaf-spin{font-size:40px;animation:spin 1.4s ease-in-out infinite;display:inline-block}
@keyframes spin{50%{transform:rotate(25deg) translateY(-6px)}}
.wait h2{font-family:'Gowun Dodum',sans-serif;font-weight:400;font-size:20px;margin-top:12px}
.wait p{font-size:13.5px;color:var(--sub)}

/* 결과 */
.result{background:var(--paper);border:1px solid var(--line);border-radius:24px;padding:22px 20px;text-align:center}
.result small{font-size:12.5px;color:var(--soft);font-weight:700}
.result h1{font-family:'Gowun Dodum',sans-serif;font-weight:400;font-size:27px;line-height:1.3;margin:2px 0 4px}
.r-sum{font-size:14.5px;color:var(--sub);word-break:keep-all}
.r-pic{margin:14px auto 6px;width:180px;height:180px;border-radius:20px;background:#FFFEFA;border:1px solid var(--line);overflow:hidden}
.r-pic img{width:100%;height:100%;display:block}
.reads{text-align:left;margin-top:12px}
.reads div{display:grid;grid-template-columns:54px 1fr;gap:10px;padding:10px 0;border-top:1px dashed var(--line);font-size:14px}
.reads b{font-size:12.5px;color:var(--point);font-weight:800;padding-top:1px}
.reads span{color:#45503F;word-break:keep-all}
.says{display:flex;gap:10px;align-items:flex-start;text-align:left;background:#FFF5E8;border-radius:16px;padding:12px;margin-top:12px}
.says img{width:36px;height:36px;border-radius:50%;background:#fff;object-fit:cover;flex:none}
.says p{font-family:'Gowun Dodum',sans-serif;font-size:15px;color:#4A3B26;word-break:keep-all}
.rest{margin-top:10px;background:#EEF6E6;border-radius:14px;padding:10px 12px;font-size:14px;text-align:left}
.rest b{display:block;font-size:12px;color:var(--point)}
.share-box{margin-top:14px}
.share-box canvas{display:block;width:100%;max-width:320px;height:auto;margin:0 auto 4px;border-radius:18px;box-shadow:0 6px 18px rgba(60,80,40,.14)}
.more{display:grid;gap:8px;margin-top:16px}
.more a{display:flex;align-items:center;gap:12px;background:var(--paper);border:1px solid var(--line);border-radius:16px;padding:12px 14px;text-decoration:none;color:var(--ink)}
.more i{font-style:normal;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;font-size:20px;flex:none}
.more b{display:block;font-size:14.5px}
.more span span{font-size:12.5px;color:var(--sub)}
.more em{margin-left:auto;font-style:normal;color:var(--soft);font-size:20px}

.ad-slot{margin:20px 0;background:#FFF7EA;border:1.5px dashed #E8D3A8;border-radius:14px;min-height:100px;display:flex;align-items:center;justify-content:center;color:#A08355;font-size:13px}
.article{background:var(--paper);border:1px solid var(--line);border-radius:20px;padding:22px 20px;font-size:14.5px}
.article h2{font-family:'Gowun Dodum',sans-serif;font-weight:400;font-size:20px;margin-bottom:8px}
.article h3{font-size:15px;margin:16px 0 6px}
.article p{color:#45503F;margin-bottom:10px;word-break:keep-all}
footer{text-align:center;font-size:12.5px;color:var(--soft);margin-top:24px;line-height:1.9}
footer a{color:var(--sub);text-decoration:none}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#2F3A2A;color:#fff;font-size:14px;padding:9px 16px;border-radius:999px;opacity:0;transition:opacity .2s;pointer-events:none}
.toast.on{opacity:1}
.tools{flex-wrap:nowrap;gap:5px}
.colors,.sizes{gap:5px}
.colors button,.sizes button{width:27px;height:27px}
.colors button{border-width:2px}
.tbtn{width:34px;height:32px;font-size:15px;flex:none}
body.drawing .ad-slot{display:none}
body.drawing .article{margin-top:22px}

/* 펜/채우기 */
.mode{display:flex;background:#fff;border:1px solid var(--line);border-radius:12px;padding:2px;flex:none}
.mode button{width:30px;height:28px;border:0;background:transparent;border-radius:9px;font-size:14px;cursor:pointer}
.mode button.on{background:#E6F2DA}
.colors button,.sizes button{width:24px;height:24px}
.tools{gap:4px}.colors,.sizes{gap:4px}
.tbtn{width:30px}
/* 풍성한 결과 */
.r-keys{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:10px 0 2px}
.r-keys span{background:#5E8F4A;color:#fff;font-size:12.5px;font-weight:700;border-radius:999px;padding:3px 11px}
.block{display:block;background:var(--paper);border:1px solid var(--line);border-radius:20px;padding:16px 16px;margin-top:10px;text-decoration:none;color:var(--ink)}
.block h3{display:flex;align-items:center;gap:8px;font-family:'Gowun Dodum',sans-serif;font-weight:400;font-size:18px;margin-bottom:4px}
.block h3 img{width:30px;height:30px;border-radius:50%;background:#FFF5E8;object-fit:cover}
.block .reads{margin-top:4px}
.block.quote{background:#FFF5E8;border-color:#F0DDBF;text-align:center}
.block.quote small{font-size:12px;font-weight:700;color:#A0783E}
.block.quote p{font-family:'Gowun Dodum',sans-serif;font-size:19px;color:#4A3B26;margin-top:4px;word-break:keep-all}
.rx label{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-top:1px dashed var(--line);font-size:14px;cursor:pointer}
.rx label:first-child{border-top:0}
.rx input{width:18px;height:18px;margin-top:2px;accent-color:#5E8F4A;flex:none}
.rx input:checked+span{text-decoration:line-through;color:var(--soft)}
.corner{position:relative;background:#EEF6E6;border-color:#D5E6C4;padding-right:40px}
.corner small{display:block;font-size:12px;font-weight:700;color:var(--point)}
.corner b{display:block;font-size:16px;margin:2px 0}
.corner span{font-size:13px;color:var(--sub)}
.corner em{position:absolute;right:16px;top:50%;transform:translateY(-50%);font-style:normal;font-size:22px;color:var(--soft)}
.friend{display:flex;gap:12px;align-items:center}
.friend .fav{width:48px;height:48px;border-radius:50%;background:#FFF5E8;display:grid;place-items:center;font-size:26px;overflow:hidden;flex:none}
.friend .fav img{width:100%;height:100%;object-fit:cover}
.friend small{display:block;font-size:12px;color:var(--soft);font-weight:700}
.friend b{display:block;font-size:16px}
.friend span span{font-size:13px;color:var(--sub);word-break:keep-all}
.note-s{font-size:11.5px;color:var(--soft);text-align:center;margin-top:10px;word-break:keep-all}
.tools{display:grid;grid-template-columns:auto 1fr auto auto;grid-template-areas:'m c c c' 's . u t';gap:8px 6px;align-items:center}
.mode{grid-area:m}.colors{grid-area:c;justify-content:flex-end}.sizes{grid-area:s}
.tools>button:nth-last-child(2){grid-area:u;margin:0}.tools>button:last-child{grid-area:t;margin:0}
.colors button,.sizes button{width:28px;height:28px}
.colors,.sizes{gap:6px}
.mode{justify-self:start}
/* 테마 고르기 */
.themes{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.themes button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;font-family:inherit;background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:14px;cursor:pointer;color:var(--ink);transition:transform .12s,box-shadow .12s}
.themes button:hover{transform:translateY(-2px);box-shadow:0 6px 14px rgba(60,80,40,.10)}
.themes i{font-style:normal;font-size:28px;line-height:1}
.themes b{font-size:15px;margin-top:6px}
.themes span{font-size:12px;color:var(--sub);line-height:1.4;word-break:keep-all}
.themes button:first-child{grid-column:1/-1;flex-direction:row;align-items:center;gap:12px}
.themes button:first-child span{display:block}
#start-one{margin-top:4px}
/* 물어보기 */
.ask{padding:28px 18px}
.ask h2{font-family:'Gowun Dodum',sans-serif;font-weight:400;font-size:21px;margin-bottom:14px}
.ask-body{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.ask-body>button:not(.btn){font-family:inherit;font-size:14.5px;font-weight:600;background:#fff;border:1.5px solid var(--line);border-radius:999px;padding:8px 14px;cursor:pointer;color:var(--ink)}
.ask-body>button:not(.btn):hover{background:#EEF6E6}
.ask-body .etc{color:var(--soft)!important}
.ask-body input{width:100%;font-family:inherit;font-size:16px;border:1.5px solid var(--line);border-radius:14px;padding:12px 14px;outline:none}
.ask-body .btn{margin-top:6px}
/* 괴물 길들이기, 다른 그림 */
.tame{margin-top:6px}
.tamed{font-family:'Gowun Dodum',sans-serif;font-size:15px;color:#4A3B26;background:#FFF5E8;border-radius:14px;padding:10px 12px;margin-top:6px;word-break:keep-all}
.others{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.others button{font-family:inherit;font-size:13px;font-weight:600;background:#fff;border:1px solid var(--line);border-radius:999px;padding:6px 12px;cursor:pointer;color:var(--ink)}
.others i{font-style:normal;margin-right:3px}
.colors button,.sizes button{width:25px;height:25px}
.colors,.sizes{gap:5px}
.themes button:first-child b{white-space:nowrap;margin-top:0;flex:none}.themes button:first-child span{flex:1}

/* 해석 리포트 */
.rp-sum p{font-size:14.5px;line-height:1.8;color:#3E4938;margin-top:8px;word-break:keep-all}
.bars{margin-top:8px}
.bar{display:grid;grid-template-columns:54px 1fr 30px;gap:8px;align-items:center;padding:5px 0;font-size:13px}
.bar b{font-weight:700;color:#45503F}
.bar span{height:10px;background:#EEF3E8;border-radius:6px;overflow:hidden}
.bar i{display:block;height:100%;background:linear-gradient(90deg,#9CCB7E,#5E8F4A);border-radius:6px;transition:width .8s}
.bar em{font-style:normal;font-size:12px;color:var(--soft);text-align:right}
.muted{font-size:11.5px;color:var(--soft);margin-top:6px}
.colorsx div{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-top:1px dashed var(--line);font-size:13.5px;line-height:1.6}
.colorsx div:first-child{border-top:0}
.sw{width:20px;height:20px;border-radius:50%;flex:none;margin-top:2px;box-shadow:0 0 0 2px #fff,0 0 0 3px var(--line)}
.colorsx b{margin-right:4px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.two h4{font-size:14px;margin-bottom:4px}
.two ul{padding-left:16px;font-size:13px;line-height:1.6;color:#45503F}
.two li{margin-bottom:4px;word-break:keep-all}
@media(max-width:380px){.two{grid-template-columns:1fr}}

/* 붓 + 팔레트 (2줄) */
.tools{display:grid;grid-template-columns:auto 1fr auto auto;grid-template-areas:'m s u t' 'c c c c';gap:10px 6px;align-items:center}
.mode{grid-area:m}.sizes{grid-area:s;justify-content:flex-start}.colors{grid-area:c}
.tools>button:nth-last-child(2){grid-area:u}.tools>button:last-child{grid-area:t}
.sizes{gap:5px}.sizes button{width:28px;height:28px}
.colors{display:grid;grid-template-columns:repeat(7,1fr);gap:7px;justify-items:center;background:#fff;border:1px solid var(--line);border-radius:16px;padding:9px 8px}
.colors button,.cpick{width:30px;height:30px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px var(--line);cursor:pointer;padding:0}
.colors button.on,.cpick.on{box-shadow:0 0 0 2.5px var(--ink)}
.cpick{position:relative;display:block;background:conic-gradient(#E2554F,#F4C542,#5E9E4A,#6FA8DC,#9B7BC8,#E2554F)}
.cpick input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
@media(max-width:380px){.colors button,.cpick{width:26px;height:26px}}

/* 8가지 주제: 모두 같은 크기 */
.themes button:first-child{grid-column:auto;flex-direction:column;align-items:flex-start;gap:2px}
.themes button:first-child b{white-space:normal;margin-top:6px}
.themes b{word-break:keep-all;line-height:1.35}
