:root {
  --bg: #050b18; --bg2: #0b1d3a; --ink: #e8f0ff; --dim: #93a4c8; --line: #24305a; --edge: #0e1228;
  --mint: #7fe7d8; --sun: #ffd166; --pink: #ff4fd8; --red: #ff5c7a; --moon: #7fa7ff;
  --font: "Galmuri11", "DungGeunMo", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { -webkit-text-size-adjust: 100%; word-break: keep-all; overflow-wrap: anywhere; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
.screen { display: none; min-height: 100dvh; padding: 16px; flex-direction: column; gap: 12px; }
.screen.active { display: flex; }
h1 { font-size: 28px; line-height: 1.25; margin: 4px 0 0; letter-spacing: -0.5px; text-shadow: 2px 2px 0 var(--edge); }
.kicker { color: var(--mint); margin: 0; font-size: 13px; letter-spacing: 1px; }
.lead { color: var(--ink); line-height: 1.6; margin: 0; }
.small { color: var(--dim); font-size: 12.5px; line-height: 1.55; margin: 0; }
.ai-note { color: #6e7fa6; font-size: 11.5px; line-height: 1.5; margin: 6px 0 0; }
b { color: #fff; }
.moon { color: var(--moon); }

.px-btn { font: inherit; font-size: 15px; color: var(--ink); background: #16224a; border: 0; padding: 11px 14px; cursor: pointer; text-align: center;
  box-shadow: 0 -3px 0 0 var(--edge), 0 3px 0 0 var(--edge), -3px 0 0 0 var(--edge), 3px 0 0 0 var(--edge), inset 0 -3px 0 0 #0c1534;
  margin: 3px; text-decoration: none; display: inline-block; touch-action: manipulation; }
.px-btn:active { transform: translateY(2px); box-shadow: 0 -3px 0 0 var(--edge), 0 3px 0 0 var(--edge), -3px 0 0 0 var(--edge), 3px 0 0 0 var(--edge); }
.px-btn.primary { background: var(--mint); color: #062027; box-shadow: 0 -3px 0 0 var(--edge), 0 3px 0 0 var(--edge), -3px 0 0 0 var(--edge), 3px 0 0 0 var(--edge), inset 0 -3px 0 0 #3fb3a3; }
.px-btn.big { font-size: 18px; padding: 14px; width: calc(100% - 6px); }
.px-btn:disabled, .px-btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; color: var(--sun); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; align-self: flex-start; padding: 4px 0; }
.row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.intro-sky { display: flex; justify-content: center; padding: 18px 0 4px; }
#intro-cv, #make-cv { width: 288px; height: 144px; image-rendering: pixelated; }
.steps { list-style: none; padding: 0; margin: 4px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.steps li { background: #0d1836; padding: 9px 10px; font-size: 13.5px; box-shadow: 0 0 0 2px var(--line); }
.steps span { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center; background: var(--sun); color: #2a1d00; margin-right: 6px; font-size: 12px; }

.bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 8px; border-bottom: 3px solid var(--line); }
.bar span { color: var(--dim); font-size: 13px; }

.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; min-height: 40vh; }
.msg { max-width: 86%; padding: 10px 12px; line-height: 1.55; font-size: 15px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.msg.host { align-self: flex-start; background: #12224a; box-shadow: 0 0 0 2px var(--line); }
.msg.host .q { display: block; color: var(--sun); margin-top: 6px; }
.msg.user { align-self: flex-end; background: var(--mint); color: #062027; }
.msg.typing { color: var(--dim); }
.quick { display: flex; flex-wrap: wrap; gap: 4px; }
.quick button { font: inherit; font-size: 13px; background: #0d1836; color: var(--ink); border: 2px solid var(--line); padding: 6px 9px; cursor: pointer; }
.chat-input { display: flex; gap: 6px; align-items: center; padding-bottom: env(safe-area-inset-bottom); }
.chat-input input { flex: 1; font: inherit; font-size: 16px; padding: 11px 10px; background: #0d1836; color: var(--ink); border: 3px solid var(--line); min-width: 0; }

.make-wrap { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.sprite-stage { position: relative; display: flex; justify-content: center; padding: 20px 0; background: radial-gradient(circle at 50% 60%, #12305a 0, #050b18 70%); box-shadow: 0 0 0 3px var(--line); }
.spin { position: absolute; bottom: 10px; display: flex; gap: 6px; }
.spin i { width: 8px; height: 8px; background: var(--mint); animation: blink 1s infinite steps(2); }
.spin i:nth-child(2) { animation-delay: .33s; } .spin i:nth-child(3) { animation-delay: .66s; }
@keyframes blink { 50% { opacity: .2; } }
.make-msg { text-align: center; margin: 0; color: var(--dim); }
.sheet { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; background: #0d1836; padding: 12px; box-shadow: 0 0 0 2px var(--line); font-size: 14px; }
.sheet dt { color: var(--dim); } .sheet dd { margin: 0; }
.sheet .sw { display: inline-block; width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; box-shadow: 0 0 0 2px var(--edge); }
.orig img { width: 160px; margin-top: 8px; }
.orig summary { color: var(--dim); cursor: pointer; font-size: 13px; }

#s-game { padding: 0; }
.game-wrap { position: relative; width: 100%; height: 100dvh; display: flex; justify-content: center; align-items: center; background: #02050c; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#game-cv { image-rendering: pixelated; height: 100dvh; max-width: 100vw; aspect-ratio: 270 / 480; object-fit: contain; touch-action: none; }
.banner { position: absolute; top: 46%; left: 0; right: 0; text-align: center; font-size: 20px; color: var(--sun); text-shadow: 2px 2px 0 var(--edge); pointer-events: none; }
.touch-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: rgba(232,240,255,.45); font-size: 12px; pointer-events: none; }
.quiz { position: absolute; left: 8px; right: 8px; bottom: 10px; max-width: 460px; margin: 0 auto; background: rgba(8,14,34,.94); padding: 10px 12px 12px;
  box-shadow: 0 0 0 3px var(--edge), 0 0 0 6px var(--sun); }
.q-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dim); }
.q-sec { color: var(--sun); font-size: 16px; }
.q-timer { height: 6px; background: #1a2350; margin: 6px 0 8px; }
.q-timer i { display: block; height: 100%; background: var(--sun); transform-origin: left; }
.q-text { margin: 0 0 8px; font-size: 16px; line-height: 1.45; word-break: keep-all; }
.q-opts { display: flex; flex-direction: column; gap: 4px; }
.q-opt { text-align: left; font-size: 14.5px; padding: 10px 12px; }
.q-opt.ok { background: #1d6b5f; } .q-opt.ng { background: #7a2335; }
.q-why { font-size: 12.5px; color: #cfe0ff; line-height: 1.5; margin: 8px 0 0; }

.end-wrap { display: flex; flex-direction: column; gap: 10px; }
#card-cv { width: 100%; height: auto; box-shadow: 0 0 0 3px var(--line); }
.cta { background: #0d1836; padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 0 0 2px var(--line); }
.cta-h { margin: 0 0 4px; color: var(--sun); }

.dex { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dex .slot { background: #0d1836; padding: 10px; text-align: center; box-shadow: 0 0 0 2px var(--line); font-size: 12.5px; color: var(--dim); min-height: 140px; }
.dex .slot canvas { width: 96px; height: 96px; image-rendering: pixelated; display: block; margin: 0 auto 6px; }
.dex .slot.got { color: var(--ink); box-shadow: 0 0 0 2px var(--sun); }
.dex .slot .lock { font-size: 34px; line-height: 96px; color: #2a3358; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.admin-stats div { background: #0d1836; padding: 8px; text-align: center; }
.admin-stats b { display: block; font-size: 20px; }
.admin-stats span { font-size: 11px; color: var(--dim); }
.table-wrap { overflow: auto; max-height: 60vh; }
table { border-collapse: collapse; font-size: 11px; }
td, th { border: 1px solid var(--line); padding: 3px 5px; white-space: nowrap; }
