:root {
  --ink: #2b2350; --paper: #fff7e6; --red: #ff6b5b; --orange: #ff9f43; --yellow: #ffd23f;
  --green: #5fd068; --blue: #4cc3ff; --purple: #a98bff; --pink: #ff8fc7; --sky: #bfe9ff;
  --u: min(1vh, 0.62vw);
  font-family: system-ui, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  background: var(--paper); color: var(--ink);
}
#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
button { font: inherit; color: inherit; touch-action: manipulation; }
svg { display: block; }

/* 두드리는 곳은 96px 이상 */
.btn {
  min-width: 96px; min-height: 96px; padding: 8px 20px; border-radius: 28px; border: 5px solid var(--ink);
  background: #fff; box-shadow: 0 7px 0 var(--ink); font-weight: 900; font-size: 32px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; transition: transform .06s; flex: none;
}
.btn:active, .btn.down { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.btn svg { width: 56px; height: 56px; }
.btn.round { border-radius: 50%; width: 112px; height: 112px; padding: 0; }
.btn.round svg { width: 64px; height: 64px; }
.btn.yellow { background: var(--yellow); } .btn.green { background: var(--green); } .btn.blue { background: var(--blue); }
.btn.pink { background: var(--pink); } .btn.red { background: var(--red); } .btn.purple { background: var(--purple); }
.btn.small { min-width: 96px; min-height: 96px; font-size: 24px; }
.corner { position: absolute; z-index: 30; }
.corner.tl { top: 16px; left: 16px; } .corner.tr { top: 16px; right: 16px; }
.corner.bl { bottom: 16px; left: 16px; } .corner.br { bottom: 16px; right: 16px; }

/* 시작·홈 */
.s-start { background: radial-gradient(circle at 50% 40%, #fff 0, var(--sky) 70%); }
.title-heroes { display: flex; gap: calc(var(--u) * 2); align-items: flex-end; }
.title-heroes svg, .title-heroes img { width: calc(var(--u) * 22); height: auto; }
.logo { font-size: calc(var(--u) * 11); font-weight: 900; letter-spacing: 4px; margin: 0 0 calc(var(--u) * 3);
  color: var(--yellow); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
.big-play { width: calc(var(--u) * 22); height: calc(var(--u) * 22); min-width: 140px; min-height: 140px; margin-top: calc(var(--u) * 4); }
.big-play svg { width: 60%; height: 60%; }

.s-home { background: linear-gradient(#bfe9ff, #fff7e6 70%); justify-content: flex-end; padding-bottom: 4vh; }
.tongue, .dizzy { display: none; }
.block .tongue, .dizzy-on .dizzy { display: block; }
.monster img, .dragon img { position: absolute; inset: 0; width: 100%; height: 100%; }
.block .mb, .dizzy-on .mb { visibility: hidden; }
.home-grid { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; grid-template-rows: 1fr 1fr; gap: calc(var(--u) * 3);
  width: min(94vw, 1500px); height: min(76vh, calc(100vh - 150px)); }
.tile-big { border: 6px solid var(--ink); border-radius: 36px; box-shadow: 0 9px 0 var(--ink); overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tile-big:active { transform: translateY(6px); box-shadow: 0 3px 0 var(--ink); }
.tile-big.span2 { grid-row: span 2; }
.tile-big svg, .tile-big .art { width: 100%; height: 100%; }
.tile-big .name { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-weight: 900; font-size: calc(var(--u) * 5);
  color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }

/* 진단 */
.s-diag { background: linear-gradient(#e9f7ff, #fff7e6); }
.diag-top { position: absolute; top: 16px; left: 140px; right: 140px; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.diag-top .dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; }
.diag-top .dot.on { background: var(--yellow); }
.prompt { display: flex; align-items: center; gap: calc(var(--u) * 4); min-height: calc(var(--u) * 26); }
.pic { font-size: calc(var(--u) * 18); line-height: 1; filter: drop-shadow(0 4px 0 rgba(43,35,80,.25)); }
.choices { display: flex; gap: calc(var(--u) * 3); flex-wrap: wrap; justify-content: center; margin-top: calc(var(--u) * 3); }
.card {
  min-width: max(140px, calc(var(--u) * 24)); min-height: max(140px, calc(var(--u) * 24)); padding: 0 calc(var(--u) * 3);
  border: 6px solid var(--ink); border-radius: 32px; background: #fff; box-shadow: 0 9px 0 var(--ink);
  font-size: calc(var(--u) * 13); font-weight: 900; display: flex; align-items: center; justify-content: center; cursor: pointer; white-space: nowrap;
}
.card:active { transform: translateY(6px); box-shadow: 0 3px 0 var(--ink); }
.card.long { font-size: calc(var(--u) * 9); }
.card.glow, .tile.glow, .mon.glow .sign { animation: glow 0.8s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 0 4px var(--yellow), 0 0 24px 8px var(--yellow); } to { box-shadow: 0 0 0 10px var(--yellow), 0 0 40px 20px #fff2a8; } }
.card.gone, .tile.gone { animation: gone .35s forwards; pointer-events: none; }
@keyframes gone { to { transform: scale(0.2) rotate(20deg); opacity: 0; } }
.dunno { position: absolute; right: 16px; bottom: 16px; font-size: 22px; }
.dunno svg { width: 48px; height: 48px; }

/* 조립 */
.slots { display: flex; gap: 10px; align-items: flex-end; }
.slot { min-width: max(110px, calc(var(--u) * 17)); height: max(110px, calc(var(--u) * 17)); border: 5px dashed var(--ink); border-radius: 22px;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--u) * 12); font-weight: 900; background: rgba(255,255,255,.75); }
.slot.now { border-style: solid; background: #fff; box-shadow: 0 0 0 6px var(--yellow); }
.slot.done { border-style: solid; background: var(--yellow); }
.slot.fixed { border: none; background: none; min-width: 40px; }
.slot .g { display: inline-block; }
.slot .g.pop { animation: pop .3s; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.tiles { display: flex; gap: calc(var(--u) * 2.5); justify-content: center; margin-top: calc(var(--u) * 3); }
.tile {
  width: max(112px, calc(var(--u) * 17)); height: max(112px, calc(var(--u) * 17)); border: 5px solid var(--ink); border-radius: 24px;
  background: #fff; box-shadow: 0 8px 0 var(--ink); font-size: calc(var(--u) * 10); font-weight: 900;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tile:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--ink); }
.tile.cho { background: #ffe1dc; } .tile.jung { background: #dcf3ff; } .tile.jong { background: #e7ffd9; }
.tile .none { width: 50%; height: 50%; border: 5px dashed #8a83a8; border-radius: 10px; }
.tile.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-12px) rotate(-4deg); } 40%, 80% { transform: translateX(12px) rotate(4deg); } }

/* 덮개 화면 */
.overlay { position: absolute; inset: 0; z-index: 50; background: rgba(43,35,80,.55); display: flex; align-items: center; justify-content: center; }
.panel { background: #fff; border: 6px solid var(--ink); border-radius: 36px; box-shadow: 0 10px 0 var(--ink); padding: 28px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 92vw; max-height: 92vh; }
.panel h2 { margin: 0; font-size: 34px; }
.numpad { display: grid; grid-template-columns: repeat(5, 96px); gap: 12px; }
.lock-q { font-size: 48px; font-weight: 900; }

/* 움직임 */
.bounce { animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8%); } }
.wiggle { animation: wiggle 1.6s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.spark { position: absolute; width: 18px; height: 18px; border-radius: 50%; pointer-events: none; z-index: 60; border: 3px solid var(--ink); }
.floaty { position: absolute; z-index: 60; pointer-events: none; font-size: 64px; font-weight: 900; color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; animation: floaty 1s forwards; }
@keyframes floaty { to { transform: translateY(-120px); opacity: 0; } }
.star-fly { position: absolute; z-index: 60; width: 80px; height: 80px; pointer-events: none; }

/* 결과(보호자용 글) */
.result-table { border-collapse: collapse; font-size: 20px; }
.result-table td, .result-table th { border: 2px solid #d9d3ee; padding: 6px 12px; text-align: center; }
.ok { color: #1d9a3a; font-weight: 800; } .ng { color: #d8402f; font-weight: 800; }

#rotate { display: none; position: fixed; inset: 0; z-index: 100; background: var(--ink); align-items: center; justify-content: center; }
#rotate .rotate-phone { width: 120px; height: 200px; border: 10px solid #fff; border-radius: 24px; animation: rot 2s ease-in-out infinite; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) { #rotate { display: flex; } }

/* 영웅·대원 고르기 */
.pick-row { display: flex; gap: calc(var(--u) * 3); flex-wrap: wrap; justify-content: center; align-items: flex-end; max-width: 96vw; }
.pick-card { width: max(150px, calc(var(--u) * 26)); padding: 12px 8px 8px; border: 6px solid var(--ink); border-radius: 30px; background: #fff;
  box-shadow: 0 8px 0 var(--ink); display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.pick-card svg, .pick-card img { width: 100%; height: auto; aspect-ratio: 140 / 170; object-fit: contain; }
.pick-card.sel { background: #fff6c8; }
.pick-card.chosen { animation: pop .45s; background: var(--yellow); }
.pick-name { font-size: calc(var(--u) * 5); font-weight: 900; }
img.mine { image-rendering: auto; }

/* 던전 */
.s-dungeon, .s-crew { background: #241c4d; }
.dg-bg { position: absolute; left: 0; top: 0; height: 100%; width: 400vh; display: flex; will-change: transform; }
.dg-bg svg { width: 200vh; height: 100%; flex: none; }
.dg-hero { position: absolute; left: 4vw; bottom: 9vh; width: min(24vw, 36vh); z-index: 5; }
.dg-hero svg, .dg-hero img { width: 100%; height: auto; }
.dg-hero.walk { animation: walk .35s ease-in-out infinite; }
@keyframes walk { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6%) rotate(2deg); } }
.dg-hero .pose { position: absolute; left: 50%; bottom: 0; width: 166.7%; max-width: none; transform: translateX(-50%); display: none; }
.dg-hero.posing .pose { display: block; }
.dg-hero.posing .hero { visibility: hidden; }
.dg-hero.atk { animation: lunge .4s ease-out; }
@keyframes lunge { 40% { transform: translateX(12%) translateY(-6%); } }
.dg-mons { position: absolute; left: 32vw; right: 1vw; bottom: 8vh; height: 62vh; z-index: 6; }
.mon { position: absolute; bottom: 0; width: min(16vw, 26vh); min-width: 110px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.mon .monster { position: relative; width: 100%; aspect-ratio: 1; }
.mon .sign { background: #f6d7a7; border: 5px solid var(--ink); border-radius: 16px; padding: 4px 14px; font-weight: 900; font-size: calc(var(--u) * 8.5);
  box-shadow: 0 6px 0 var(--ink); margin-bottom: -6px; position: relative; z-index: 2; white-space: nowrap; line-height: 1.25; min-width: 96px; text-align: center; }
.mon .sign.l3 { font-size: calc(var(--u) * 6.5); } .mon .sign.l4 { font-size: calc(var(--u) * 5.2); }
.mon .sign::after { content: ''; position: absolute; left: 50%; bottom: -26px; width: 8px; height: 22px; background: #a86b3c; border: 3px solid var(--ink); transform: translateX(-50%); }
.mon .mb, .mon .tongue { transform-origin: 50% 92%; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04, .96); } }
.mon .shield { position: absolute; width: 34%; left: -14%; bottom: 0; display: none; z-index: 3; }
.mon.block .shield { display: block; animation: pop .25s; }
.mon.block { animation: wobble .6s; }
@keyframes wobble { 20% { transform: rotate(-10deg); } 40% { transform: rotate(9deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
.mon.flee { animation: flee .6s forwards; pointer-events: none; }
@keyframes flee { to { transform: translateX(60vw) translateY(-10vh) rotate(25deg); opacity: 0; } }
.mon.popped { animation: popped .35s forwards; pointer-events: none; }
@keyframes popped { 50% { transform: scale(1.35); filter: brightness(1.8); } 100% { transform: scale(0); opacity: 0; } }
.hud { position: absolute; top: 16px; left: 140px; right: 16px; display: flex; justify-content: space-between; align-items: center; z-index: 20; pointer-events: none; }
.rooms { display: flex; gap: 10px; align-items: center; }
.rooms .r { width: 30px; height: 30px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.2); }
.rooms .r.on { background: var(--yellow); } .rooms .r.now { box-shadow: 0 0 0 5px rgba(255,210,63,.6); background: #fff; }
.rooms .r.rb { width: 40px; height: 40px; border-radius: 10px; background: var(--red); }
.coins { display: flex; align-items: center; gap: 8px; font-size: 40px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  background: rgba(43,35,80,.5); padding: 4px 18px 4px 6px; border-radius: 40px; }
.coins svg { width: 54px; height: 54px; }
.dg-prompt { position: absolute; top: 14vh; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 20px; z-index: 21; }
.dg-prompt .pic { background: #fff; border: 5px solid var(--ink); border-radius: 50%; width: calc(var(--u) * 20); height: calc(var(--u) * 20);
  min-width: 112px; min-height: 112px; display: flex; align-items: center; justify-content: center; font-size: calc(var(--u) * 12); }
.fx { position: absolute; z-index: 40; pointer-events: none; }
.boss { position: absolute; right: 4vw; bottom: 44vh; width: min(26vw, 40vh); z-index: 6; }
.boss .mb, .boss .tongue { animation: hover 1.6s ease-in-out infinite; } @keyframes hover { 50% { transform: translateY(-5%); } }
.boss .dragon { position: relative; width: 100%; aspect-ratio: 1; }
.boss.hit { animation: hit .5s; } @keyframes hit { 0%, 100% { filter: none; } 20% { filter: brightness(2.2); transform: translateX(16px); } 50% { transform: translateX(-10px); } }
.boss.down { animation: bossdown 1.8s forwards; } @keyframes bossdown { 30% { transform: rotate(-20deg) scale(.9); } 100% { transform: translate(40vw, -70vh) rotate(720deg) scale(.2); opacity: 0; } }
.hp { position: absolute; top: -40px; left: 10%; right: 10%; display: flex; gap: 6px; }
.hp .seg { flex: 1; height: 26px; border: 4px solid var(--ink); border-radius: 10px; background: var(--red); transition: background .3s; }
.hp .seg.lost { background: #fff3; }
.bosspanel { position: absolute; left: 28vw; right: 0; bottom: 2vh; display: flex; flex-direction: column; align-items: center; z-index: 22; }
.bosspanel .slots { background: rgba(255,255,255,.85); border: 5px solid var(--ink); border-radius: 26px; padding: 10px 14px; }
.bosspanel .tiles { margin-top: 2vh; }
.bosspanel .card { min-width: 130px; min-height: 130px; font-size: calc(var(--u) * 9); }
.bosspanel .card.long { font-size: calc(var(--u) * 7); }
.shake-screen { animation: shakescr .4s; } @keyframes shakescr { 25% { transform: translate(-10px, 6px); } 50% { transform: translate(10px, -6px); } 75% { transform: translate(-6px, 4px); } }
.chest-wrap { position: absolute; left: 50%; bottom: 10vh; width: min(30vw, 44vh); transform: translateX(-50%); z-index: 8; cursor: pointer; }
.chest-wrap .chest { width: 100%; height: auto; overflow: visible; }
.chest .lid { transform-origin: 20px 80px; transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.chest.open .lid { transform: rotate(-70deg) translate(-10px, -10px); }
.chest.open .rays { opacity: 1; transition: opacity .4s; }

/* 보호자 화면 (글로 읽는 화면) */
.grown { justify-content: flex-start; align-items: stretch; background: #f6f3ff; font-size: 20px; }
.g-tabs { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: #fff; border-bottom: 3px solid #d9d3ee; flex: none; overflow-x: auto; touch-action: pan-x; }
.g-tab { min-height: 96px; min-width: 120px; padding: 0 18px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; font-size: 22px; font-weight: 800; flex: none; }
.g-tab.on { background: var(--yellow); }
.g-body { flex: 1; overflow-y: auto; touch-action: pan-y; padding: 16px 24px 80px; user-select: text; -webkit-user-select: text; }
.g-sec { background: #fff; border: 3px solid #d9d3ee; border-radius: 18px; padding: 14px 20px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.g-sec h3 { margin: 0; font-size: 24px; }
.g-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.g-btn { min-height: 96px; min-width: 120px; padding: 0 22px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; font-size: 21px; font-weight: 800; }
.g-btn.pri { background: var(--green); } .g-btn.warn { background: #ffd3cc; } .g-btn.on { background: var(--yellow); }
.g-in { font-size: 22px; padding: 12px; border: 3px solid #b9b0dd; border-radius: 12px; min-height: 64px; width: min(720px, 100%); font-family: inherit; }
select.g-in { min-height: 96px; width: auto; }
.g-note { color: #6a6390; font-size: 18px; }
.g-list { border-top: 2px dashed #e2dcf5; padding-top: 10px; width: 100%; }
.g-list input[type=radio], .g-sec > label input[type=radio] { width: 40px; height: 40px; }
.g-sec > label { min-height: 96px; }
.g-lines { color: #4a4370; font-size: 18px; margin: 4px 0 6px; }
.g-days { display: flex; gap: 14px; align-items: flex-end; height: 150px; }
.g-day { display: flex; flex-direction: column; align-items: center; font-size: 14px; gap: 4px; }
.g-daybar { width: 30px; background: var(--blue); border: 2px solid var(--ink); border-radius: 6px 6px 0 0; min-height: 2px; }
.g-bar { display: flex; gap: 10px; align-items: center; width: min(720px, 90vw); }
.g-bk { width: 140px; font-weight: 800; } .g-bv { height: 18px; background: var(--orange); border-radius: 9px; }
tr.now td { background: #fff6c8; }
.nb { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.nb-count { position: absolute; top: 30px; font-size: 28px; font-weight: 800; }
.nb-answer { font-size: calc(var(--u) * 11); font-weight: 900; text-align: center; max-width: 92vw; line-height: 1.2; word-break: keep-all; }
.nb-after { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.nb-in { width: min(700px, 80vw); text-align: center; font-size: 30px; }

/* 우주선 */
.ship { position: absolute; inset: 0; } .ship svg { width: 100%; height: 100%; }
.ship .blink circle { animation: blink 1.2s steps(2) infinite; } .ship .blink circle:nth-child(2) { animation-delay: .4s; } .ship .blink circle:nth-child(3) { animation-delay: .8s; }
@keyframes blink { 50% { opacity: .3; } }
.fuel { position: absolute; left: 3vw; top: 20vh; height: 52vh; width: 64px; border: 6px solid var(--ink); border-radius: 32px; background: #0b0d26; overflow: hidden; z-index: 5; }
.fuel-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#ffd23f, #5fd068); transition: height .6s cubic-bezier(.3,1.5,.5,1); }
.fuel-cap { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.35) 0 20%, transparent 20%); }
.cr-mate { position: absolute; left: 1vw; bottom: 3vh; width: min(14vw, 20vh); z-index: 6; }
.cr-mate svg, .cr-mate img { width: 100%; height: auto; }
.cr-line { position: absolute; left: 18vw; right: 2vw; bottom: 8vh; display: flex; justify-content: space-evenly; align-items: flex-end; z-index: 6; }
.crew-card { width: min(16vw, 25vh); min-width: 110px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.crew-card .cr-body svg { width: 100%; height: auto; }
.crew-card .cr-body { width: 100%; }
.cr-sign { background: #fff; border: 5px solid var(--ink); border-radius: 18px; padding: 4px 14px; font-weight: 900; font-size: calc(var(--u) * 8.5);
  box-shadow: 0 6px 0 var(--ink); margin-bottom: 8px; white-space: nowrap; min-width: 96px; text-align: center; line-height: 1.25; }
.cr-sign.l3 { font-size: calc(var(--u) * 6.5); } .cr-sign.l4 { font-size: calc(var(--u) * 5.2); }
.crew-card.glow .cr-sign { animation: glow .8s ease-in-out infinite alternate; }
.crew-card.real { animation: pop .5s; } .crew-card.real .cr-sign { background: var(--yellow); }
.crew-card.shrug { animation: wobble .5s; } .crew-card.gone { visibility: hidden; pointer-events: none; }
.crew-card .crewman .cb { transform-origin: 60px 130px; animation: breathe 1.5s ease-in-out infinite; }
.s-crew.warp .ship { animation: warp 1.6s ease-in forwards; }
@keyframes warp { 30% { transform: translateX(-8px); } 60% { transform: translateX(8px) scale(1.05); filter: brightness(1.4); } 100% { transform: scale(1.6); filter: brightness(3) blur(2px); opacity: .2; } }
.pmap-panel { flex-direction: row; gap: 30px; background: #14163a; }
.pmap { display: flex; gap: 22px; align-items: center; }
.planet { width: 64px; height: 64px; border-radius: 50%; border: 5px solid #fff; opacity: .35; position: relative; flex: none; }
.planet.been { opacity: 1; border-color: var(--ink); }
.planet.new { width: 110px; height: 110px; animation: pop .6s, bounce 1.2s .6s infinite; }
.planet .flag { position: absolute; width: 50px; left: 46%; bottom: 60%; }
.fx-static { width: 180px; height: 180px; animation: pop .6s; } .fx-static svg { width: 100%; height: 100%; }

/* 그리기 */
.draw-main { display: flex; align-items: center; gap: calc(var(--u) * 3); }
.palette { display: grid; grid-template-columns: repeat(3, 96px); gap: 12px; }
.crayon { width: 96px; height: 96px; border-radius: 50%; border: 5px solid var(--ink); box-shadow: 0 6px 0 var(--ink); cursor: pointer; }
.crayon.on, .palette .btn.on { transform: scale(1.12); box-shadow: 0 0 0 6px var(--yellow), 0 6px 0 var(--ink); }
.paper { width: min(66vh, 46vw); height: min(66vh, 46vw); background: #fff; border: 6px solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink);
  background-image: radial-gradient(#e8e2f7 2px, transparent 2px); background-size: 24px 24px; overflow: hidden; }
.draw-canvas { width: 100%; height: 100%; touch-action: none; display: block; }
.draw-side { display: flex; flex-direction: column; gap: 24px; }
.thumbs { display: flex; gap: 12px; margin-top: 2vh; max-width: 94vw; overflow-x: auto; touch-action: pan-x; padding: 6px 4px 12px; }
.thumb { width: 96px; height: 96px; flex: none; border: 4px solid var(--ink); border-radius: 18px; background: #fff; padding: 4px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.on { box-shadow: 0 0 0 5px var(--yellow); }
.dg-hero.atk img.mine, .dg-hero.walk img.mine { animation: squash .35s ease-in-out infinite; }
@keyframes squash { 50% { transform: scale(1.08, .9) translateY(4%); } }

/* 스티커 */
.st-grid { display: grid; grid-template-columns: repeat(8, min(11vw, 17vh)); gap: calc(var(--u) * 2.5); }
.st-cell { width: min(11vw, 17vh); height: min(11vw, 17vh); min-width: 96px; min-height: 96px; border-radius: 24px; background: rgba(255,255,255,.7);
  border: 4px dashed #d9c4e6; display: flex; align-items: center; justify-content: center; padding: 6px; }
.st-cell svg { width: 100%; height: 100%; }
.st-cell.not svg { filter: grayscale(1) brightness(1.6); opacity: .35; }
.st-cell.has { border-style: solid; border-color: var(--ink); background: #fff; }
.st-cell.wiggle-once { animation: wobble .6s; }
.st-count { font-size: 40px; font-weight: 900; margin-bottom: 3vh; }

/* 우주선: 엔진 고치기 */
.cr-engine { position: absolute; left: 15vw; bottom: 8vh; width: min(20vw, 30vh); z-index: 6; }
.cr-engine svg { width: 100%; height: auto; }
.cr-engine.block { animation: wobble .6s; }
.engine .gear { transform-box: fill-box; transform-origin: center; }
.engine .lamp { fill: #ff6b5b; }
.engine .smoke { animation: puff 1.6s ease-in-out infinite; }
@keyframes puff { 50% { transform: translateY(-6%); opacity: .6; } }
.cr-engine.fixed .lamp { fill: #5fd068; }
.cr-engine.fixed .smoke { display: none; }
.cr-engine.fixed .gear { animation: gearspin 1s linear infinite; }
.cr-engine.fixed .gear.back { animation-direction: reverse; }
@keyframes gearspin { to { transform: rotate(360deg); } }
