/* 시작 화면 · 작품 보기 · 작품 실행 · VIP 방 · 비밀번호 */
.view[hidden] { display: none !important; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.make .app { flex: 1; }

/* 시작 화면 */
.home { align-items: center; justify-content: center; gap: 6px; padding: 24px 16px; overflow: auto;
        background: radial-gradient(circle at 50% 45%, #FFF3DF 0, #FBF8F4 60%); }
.home-title { font-size: clamp(40px, 7vw, 68px); font-weight: 900; margin: 0; letter-spacing: -.03em; color: var(--ink); }
.home-title span { color: #FF8A1F; }
.home-sub { margin: 0 0 18px; color: var(--muted); font-size: 17px; }
.home-row { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 4vw, 48px); flex-wrap: wrap; }
.big-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none;
           width: 250px; min-height: 120px; text-align: center; border: 3px solid var(--ink); border-radius: 30px; box-shadow: 0 6px 0 var(--ink);
           color: #fff; padding: 16px; transition: transform .1s; }
.big-btn b { font-size: 23px; font-weight: 900; letter-spacing: -.03em; text-align: center; white-space: nowrap; }
.big-btn span { font-size: 15px; opacity: .92; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.big-btn.make { background: linear-gradient(#FFB45C, #FF8A1F); }
.big-btn.works { background: linear-gradient(#5FE0C8, #12B8A0); }
.choco-box { position: relative; width: clamp(200px, 26vw, 280px); }
.choco { width: 100%; display: block; cursor: pointer; user-select: none; -webkit-user-drag: none; touch-action: manipulation; }
.choco.bounce { animation: hop .3s ease-out; }
.choco.wag { animation: wag .7s ease-in-out; transform-origin: 50% 90%; }
.choco.shake { animation: shake .45s ease-in-out; }
@keyframes hop { 40% { transform: translateY(-14px); } }
@keyframes wag { 20% { transform: rotate(-7deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(5deg); } }
@keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-8px); } 80% { transform: translateX(6px); } }
.choco-say { position: absolute; left: 50%; top: -14px; transform: translate(-50%, -100%); background: #fff; border: 2.5px solid var(--ink);
             border-radius: 16px; padding: 8px 14px; font-weight: 800; font-size: 17px; white-space: nowrap; z-index: 2; }
.choco-say::after { content: ''; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%) rotate(45deg); width: 14px; height: 14px;
                    background: #fff; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); }
.home-foot { margin-top: 26px; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .home-row { flex-direction: column; }
  .choco-box { order: -1; }
  .big-btn { width: min(320px, 100%); min-height: 90px; }
}

/* 작품 보기 */
.bar-title { font-weight: 800; font-size: 17px; }
a.ghostbtn { text-decoration: none; }
.works-view, .play-view { overflow: auto; }
.works-wrap { max-width: 1100px; width: 100%; margin: 0 auto; padding: 18px 16px 40px; }
.works-wrap h2 { font-size: 22px; margin: 18px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { background: #fff; border: 2px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; text-align: left; padding: 0;
        transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-3px); border-color: var(--ink); }
.card canvas { width: 100%; aspect-ratio: 4 / 3; display: block; border-bottom: 2px solid var(--line); }
.card .info { padding: 10px 12px 12px; }
.card b { display: block; font-size: 17px; }
.card span { font-size: 13px; color: var(--muted); }
.soon { color: var(--muted); background: #fff; border: 2px dashed var(--line); border-radius: 16px; padding: 18px; }

/* 작품 실행 */
.play-wrap { display: grid; grid-template-columns: minmax(0, 720px) 280px; gap: 18px; padding: 18px 16px; max-width: 1060px; width: 100%; margin: 0 auto; align-items: start; }
.stage-wrap.big { max-width: 720px; }
#pstage { display: block; width: 100%; aspect-ratio: 4 / 3; touch-action: none; }
.play-side { display: flex; flex-direction: column; gap: 12px; }
.play-note { margin: 0; font-size: 16px; line-height: 1.55; }
.play-btns { display: flex; gap: 8px; }
.play-btns .go, .play-btns .stopbtn { font-size: 18px; padding: 10px 26px; }
@media (max-width: 820px) { .play-wrap { grid-template-columns: 1fr; } }

/* 묻고 대답: 화면 아래 가운데 */
.ask { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); z-index: 40;
       box-shadow: 0 10px 30px rgba(0,0,0,.2); right: auto; }

/* 로그인 표시 */
.home { position: relative; }
.home-who { position: absolute; top: 12px; right: 16px; display: flex; gap: 8px; align-items: center; }
.who { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; padding: 4px 0; text-align: left; }

/* 만들기 머리 */
.title-in { border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 10px; font-size: 15px; width: 170px; font-weight: 700; }
.pubbtn { border: 2px solid #12B8A0; background: #E8FBF7; color: #0E7F6E; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; }
.pubbtn.on { background: #12B8A0; color: #fff; }

/* 만들기 문 (로그인·신청) */
.gate { flex: 1; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 30px 16px; flex-wrap: wrap; }
.gate img { width: 200px; }
.gate > div { max-width: 420px; }
.gate h2 { font-size: 24px; margin: 0 0 8px; }
.gate p { margin: 0 0 14px; line-height: 1.6; }
.gate form { display: flex; flex-direction: column; gap: 10px; }
.gate input, .gate textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 16px; font-family: inherit; }
.gate .go { align-self: flex-start; }
.make.gated .app { display: none; }
.make.gated #go, .make.gated #stop, .make.gated #title, .make.gated #pub, .make.gated #mine, .make.gated #saveState { display: none; }

/* 내 작품 */
.mine-box { width: min(460px, calc(100vw - 32px)); text-align: left; }
.mine-list { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.mine-row { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.mine-row b { flex: 1; cursor: pointer; }
.mine-row .tag2 { font-size: 12px; background: #12B8A0; color: #fff; border-radius: 999px; padding: 1px 8px; }
.mine-row .cur { font-size: 12px; color: var(--muted); }

/* 원장님 관리 */
.admin-view { overflow: auto; }
.adm-list { display: flex; flex-direction: column; gap: 8px; }
.adm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.adm-row .who2 { flex: 1; min-width: 220px; }
.adm-row .who2 small { color: var(--muted); display: block; }
.st { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 10px; }
.st.pending { background: #FFF3CC; color: #8A6100; } .st.approved { background: #DDF5EC; color: #1B9773; } .st.rejected { background: #FDECEA; color: #C2412D; }
.adm-row button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.adm-row button.ok { border-color: #1B9773; color: #1B9773; } .adm-row button.no { border-color: #C2412D; color: #C2412D; }
.adm-row button.vip.on { background: #2B211C; color: #FFD27A; border-color: #2B211C; }

/* 비밀번호 */
.pw { position: fixed; inset: 0; background: rgba(43,33,28,.45); display: flex; align-items: center; justify-content: center; z-index: 70; }
.pw-box { background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 20px 22px; width: min(340px, calc(100vw - 32px)); text-align: center; }
.pw-box p { margin: 0 0 10px; font-weight: 800; font-size: 18px; }
.pw-box input { width: 100%; font-size: 24px; letter-spacing: .3em; text-align: center; border: 2px solid var(--line); border-radius: 12px; padding: 8px; }
.pw-btns { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.pw-msg { color: #C2412D; font-size: 15px !important; min-height: 1em; margin-top: 10px !important; font-weight: 600 !important; }

/* VIP 방: 도트 느낌의 어두운 방 (아직 공사 중) */
.vip { background: #0E0B14; align-items: center; justify-content: center; padding: 20px; }
.vip-room { position: relative; width: min(720px, 100%); aspect-ratio: 4 / 3; border: 6px solid #fff; background:
            linear-gradient(#1C1630 0 62%, #2A2140 62% 100%); image-rendering: pixelated; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.vip-room::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 2px, transparent 2px),
                    linear-gradient(90deg, rgba(255,255,255,.04) 2px, transparent 2px); background-size: 24px 24px; }
.vip-choco { position: absolute; top: 18%; width: 22%; image-rendering: pixelated; filter: contrast(1.1); }
.vip-box { position: relative; width: calc(100% - 40px); margin: 0 20px 20px; min-height: 120px; background: #000; border: 5px solid #fff;
           color: #fff; padding: 16px 20px; font-family: 'DungGeunMo', 'Galmuri11', 'NeoDunggeunmo', monospace; font-size: 20px; line-height: 1.55; cursor: pointer; }
.vip-box p { margin: 0; white-space: pre-wrap; }
.vip-next { position: absolute; right: 14px; bottom: 8px; font-size: 14px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.vip-exit { position: absolute; right: 12px; top: 10px; color: #fff; font-family: monospace; font-size: 16px; text-decoration: none; border: 2px solid #fff; padding: 2px 10px; z-index: 1; }
