/* 07 QUEST — 배관 던전 */
:root {
  --ink: #16133d;
  --sky: #3bb4ff;
  --sky2: #a9e8ff;
  --sun: #ffd21f;
  --sun2: #fff3a6;
  --hot: #ff3d6a;
  --leaf: #22c96b;
  --aqua: #19dcf0;
  --grape: #5b3cf0;
  --night: #16133d;
  --paper: #ffffff;
  --navy: #2c55c9;
  --orange: #ff8a1f;
  --px: 'Galmuri11', 'Galmuri14', 'Pretendard Variable', sans-serif;
  --body: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --hud: 56px;
  --b: 4px;
  --shadow: 6px 6px 0 var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hud) + 8px); -webkit-text-size-adjust: 100%; }
html { overflow-x: clip; } /* 모바일: 튀어나온 요소가 페이지 폭을 늘리지 않게 */
body { margin: 0; background: var(--sky); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.65; word-break: keep-all; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
img[data-spr], canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--px); font-weight: 700; line-height: 1.25; margin: 0; letter-spacing: 0; }
p { margin: 0; }
.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; position: relative; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--sun); padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; }

.ico-phone { width: 1em; height: 1em; display: inline-block; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath d='M1 0h2v1h1v2H3v1h1v1h1V4h2v1h1v2H7v1H5V7H4V6H3V5H2V4H1V3H0V1h1z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath d='M1 0h2v1h1v2H3v1h1v1h1V4h2v1h1v2H7v1H5V7H4V6H3V5H2V4H1V3H0V1h1z'/%3E%3C/svg%3E") center/contain no-repeat; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0 0 auto 0; height: var(--hud); z-index: 50; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 16px; font-family: var(--px); }
.hud__brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
.hud__brand img { width: 30px; height: auto; }
.hud__nav { display: flex; gap: 2px; margin: 0 auto; }
.hud__nav a { text-decoration: none; font-size: 14px; padding: 6px 10px; color: #cfd6ff; }
.hud__nav a:hover, .hud__nav a.on { color: var(--ink); background: var(--sun); }
.hud__nav a.on::before { content: '▶'; font-size: 10px; margin-right: 4px; }
.hud__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hud__coins { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--sun); min-width: 54px; }
.hud__coins canvas { width: 20px; height: 20px; }
.hud__coins.bump b { animation: bump .35s steps(3); display: inline-block; }
@keyframes bump { 50% { transform: translateY(-5px) scale(1.3); } }
.hud__crt { background: none; border: 2px solid #5d5a99; color: #cfd6ff; font-family: var(--px); font-size: 12px; padding: 3px 7px; cursor: pointer; }
.hud__crt[aria-pressed="true"] { background: var(--aqua); color: var(--ink); border-color: var(--aqua); }
.hud__call { display: flex; align-items: center; gap: 8px; background: var(--sun); color: var(--ink); text-decoration: none; font-weight: 700; padding: 8px 14px; font-size: 16px; box-shadow: inset 0 -4px 0 #c79a00; }
.hud__call:hover { background: #fff; }
.hud__short { display: none; }
.hud__exp { position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: #2a2570; border-bottom: 2px solid var(--ink); }
.hud__exp i { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--leaf) 0 10px, #4fe08f 10px 12px); }
.hud__exp span { position: absolute; right: 8px; top: 12px; font-size: 11px; color: var(--ink); background: var(--sun); padding: 0 6px; font-family: var(--px); line-height: 18px; border: 2px solid var(--ink); }

/* ---------- 공통 버튼 ---------- */
.btn-call { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; text-decoration: none; background: var(--sun); color: var(--ink);
  border: var(--b) solid var(--ink); box-shadow: var(--shadow), inset 0 -6px 0 #e3a800, inset 0 4px 0 var(--sun2); padding: 12px 22px 16px; font-family: var(--px); position: relative; transition: transform .08s steps(2); }
.btn-call__top { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.btn-call__sub { font-size: 14px; }
.btn-call:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink), inset 0 -6px 0 #e3a800, inset 0 4px 0 var(--sun2); }
.btn-call:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink), inset 0 -2px 0 #e3a800; }
.btn-call::after { content: ''; position: absolute; right: -14px; top: -14px; width: 22px; height: 22px; background: var(--hot); border: 3px solid var(--ink);
  clip-path: polygon(40% 0, 60% 0, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%); animation: twinkle 1.2s steps(2) infinite; }
@keyframes twinkle { 50% { transform: scale(.6) rotate(45deg); } }
.btn-call--sm .btn-call__top { font-size: 20px; }
.btn-call--sm::after { display: none; }
.btn-call--xl .btn-call__top { font-size: clamp(30px, 6vw, 52px); }
.btn-call--xl .btn-call__sub { font-size: 18px; }
.btn-ghost { font-family: var(--px); font-size: 15px; color: var(--ink); text-decoration: none; padding: 10px 14px; border: 3px solid var(--ink); background: rgba(255,255,255,.85); }
.btn-ghost:hover { background: #fff; }

/* ---------- 대화창 ---------- */
.dlg { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: var(--b) solid var(--ink); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--ink), var(--shadow); padding: 14px 16px; position: relative; }
.dlg__face { width: 54px; flex: none; background: var(--sky2); border: 3px solid var(--ink); padding: 3px; }
.dlg__name { display: inline-block; font-family: var(--px); font-size: 13px; background: var(--ink); color: var(--sun); padding: 1px 8px; margin-bottom: 4px; }
.dlg__text { font-family: var(--px); font-size: 15px; line-height: 1.7; min-height: 1.7em; }
.dlg__text .caret { display: inline-block; width: .55em; height: 1em; background: var(--ink); vertical-align: -2px; animation: blink .6s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.dlg__next { position: absolute; right: 12px; bottom: 6px; font-size: 12px; animation: nudge .6s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

.bubble { position: relative; background: #fff; border: 3px solid var(--ink); padding: 10px 14px; font-family: var(--px); font-size: 14px; box-shadow: 4px 4px 0 var(--ink); }
.bubble::before { content: ''; position: absolute; left: -12px; bottom: 12px; width: 12px; height: 12px; background: var(--ink); clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.bob { animation: bob 1s steps(2) infinite; }
.bob--late { animation-delay: -.5s; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ---------- 섹션 공통 ---------- */
.sec { position: relative; padding: 96px 0 104px; }
.sec::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px; background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='16' shape-rendering='crispEdges'%3E%3Cpath d='M0 16V8h8V0h16v8h8v8h8V8h8V4h8v4h8v8z'/%3E%3C/svg%3E") 0 0/64px 16px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='16' shape-rendering='crispEdges'%3E%3Cpath d='M0 16V8h8V0h16v8h8v8h8V8h8V4h8v4h8v8z'/%3E%3C/svg%3E") 0 0/64px 16px repeat-x; }
.sec__head { margin-bottom: 40px; max-width: 760px; }
.sec__head h2 { font-size: clamp(30px, 4.4vw, 48px); margin-top: 14px; }
.sec__lead { margin-top: 14px; font-size: 17px; }
.sign { display: inline-block; font-family: var(--px); font-weight: 700; font-size: 15px; background: var(--sun); color: var(--ink); border: 3px solid var(--ink); padding: 4px 14px; box-shadow: 4px 4px 0 var(--ink); position: relative; }
.sign::before, .sign::after { content: ''; position: absolute; top: 50%; width: 6px; height: 6px; background: var(--ink); margin-top: -3px; }
.sign::before { left: 4px; } .sign::after { right: 4px; }
.sign--aqua { background: var(--aqua); }
.sign--ink { background: var(--ink); color: var(--sun); box-shadow: 4px 4px 0 rgba(22,19,61,.35); }
.sign--ink::before, .sign--ink::after { background: var(--sun); }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .5s steps(5), transform .5s steps(5); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 히어로 ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 1000px; overflow: hidden; background: linear-gradient(#3bb4ff, #a9e8ff); padding-top: calc(var(--hud) + 10px); }
.hero__scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__fallback { display: none; }
.no-canvas .hero__fallback { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: var(--leaf); border-top: 8px solid #128a47; }
.hero__copy { position: relative; z-index: 2; width: min(1180px, 100% - 32px); margin: 0 auto; padding-top: clamp(16px, 5vh, 64px); max-width: 1180px; }
.hero__copy > * { max-width: 560px; }
.hero__kicker { font-family: var(--px); font-size: 14px; color: var(--ink); background: rgba(255,255,255,.9); display: inline-block; padding: 2px 10px; border: 2px solid var(--ink); }
.hero__title { font-size: clamp(34px, 5.2vw, 64px); margin-top: 12px; color: #fff; text-shadow: 4px 4px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 0 4px 0 var(--ink); max-width: 640px !important; }
.hero__title .ln { display: block; }
.hero__title em { font-style: normal; color: var(--sun); }
.hero__sub { margin-top: 12px; font-size: 18px; font-weight: 600; background: rgba(255,255,255,.92); border-left: 6px solid var(--ink); padding: 8px 12px; }
.hero__cta { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.hero__dlg { margin-top: 22px; }
.hero__boss-tag { position: absolute; z-index: 3; display: none; transform: translate(-50%, -100%); text-align: center; font-family: var(--px); pointer-events: none; }
.hero__boss-tag.on { display: block; }
.hero__boss-tag b { display: inline-block; background: var(--hot); color: #fff; font-size: 14px; padding: 1px 8px; border: 3px solid var(--ink); }
.hpbar { display: block; width: 130px; height: 14px; margin: 4px auto 0; background: var(--ink); border: 3px solid var(--ink); position: relative; }
.hpbar i { position: absolute; inset: 0; width: 100%; background: linear-gradient(var(--leaf) 50%, #149a50 50%); transition: width .25s steps(4); }
.hpbar i.mid { background: linear-gradient(var(--sun) 50%, #d1a400 50%); }
.hpbar i.low { background: linear-gradient(var(--hot) 50%, #b8173f 50%); }
.hero__hint { position: absolute; z-index: 2; right: 24px; bottom: 18px; font-family: var(--px); font-size: 13px; color: #fff; background: var(--ink); padding: 4px 10px; animation: blink 1s steps(1) infinite; }

/* ---------- 퀘스트 ---------- */
.sec--quests { --bg: var(--grape); background: var(--grape); color: #fff; }
.sec--quests .sec__lead { color: #e5dcff; }
.quests { display: grid; grid-template-columns: repeat(6, 1fr); gap: 22px; }
.qc { grid-column: span 2; background: #fff; color: var(--ink); border: var(--b) solid var(--ink); box-shadow: 8px 8px 0 var(--ink); display: flex; flex-direction: column; position: relative; transition: transform .1s steps(2); }
.qc:nth-child(1) { grid-column: span 3; }
.qc:nth-child(2) { grid-column: span 3; }
.qc__top { display: flex; align-items: flex-end; gap: 14px; padding: 16px 16px 12px; background: var(--c); border-bottom: var(--b) solid var(--ink); position: relative; overflow: hidden; min-height: 150px; }
.qc__top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 16px, transparent 16px 32px); }
.qc__spr { width: 128px; height: auto; position: relative; z-index: 1; flex: none; }
.qc:hover .qc__spr { animation: hurt .4s steps(4); }
@keyframes hurt { 25% { transform: translateX(-6px); filter: brightness(3); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); filter: brightness(3); } }
.qc__id { position: relative; z-index: 1; padding-bottom: 6px; }
.qc__svc { font-family: var(--px); font-size: 13px; background: var(--ink); color: #fff; padding: 1px 8px; display: inline-block; }
.qc__name { font-size: 26px; margin-top: 6px; color: var(--ink); }
.qc__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.qc__freq { font-family: var(--px); font-size: 13px; }
.qc__freq-row { display: flex; justify-content: space-between; align-items: baseline; }
.qc__freq-row b { font-size: 20px; }
.freqbar { height: 16px; border: 3px solid var(--ink); background: #e8e6f5; margin-top: 4px; position: relative; overflow: hidden; }
.freqbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--hot) 0 8px, #ff7095 8px 10px); transition: width 1s steps(12); }
.qc.in .freqbar i { width: var(--w); }
.qc__signs { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.qc__signs li { padding-left: 18px; position: relative; }
.qc__signs li::before { content: '!'; position: absolute; left: 0; top: 0; font-family: var(--px); color: var(--hot); font-weight: 700; }
.qc__how { font-size: 15px; background: #f1f8ff; border-left: 5px solid var(--navy); padding: 8px 10px; }
.qc__how b { font-family: var(--px); font-size: 13px; display: block; color: var(--navy); }
.qc__photo { margin: 0; position: relative; border: 3px solid var(--ink); }
.qc__photo img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.qc__photo figcaption { font-size: 12px; position: absolute; left: 0; bottom: 0; background: var(--ink); color: #fff; padding: 2px 8px; font-family: var(--px); }
.qc__go { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-family: var(--px); font-weight: 700; background: var(--ink); color: var(--sun); padding: 10px; font-size: 16px; }
.qc__go:hover { background: var(--hot); color: #fff; }
.qc__hp { position: absolute; right: 12px; top: 12px; z-index: 2; font-family: var(--px); font-size: 11px; color: var(--ink); text-align: right; }
.qc__hp .hpbar { width: 90px; height: 12px; border-width: 2px; margin: 2px 0 0 auto; }
.qc:nth-child(-n+2) .qc__photo img { aspect-ratio: 2/1; }
.quests__npc { display: flex; align-items: center; gap: 18px; margin-top: 40px; color: var(--ink); }
.quests__npc img { width: 56px; }

/* ---------- 필살기 ---------- */
.sec--skill { --bg: var(--night); background: var(--night); color: #fff; overflow: hidden; }
.skill { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.skill__copy h2 { font-size: clamp(32px, 4.6vw, 54px); margin: 14px 0 18px; color: var(--aqua); text-shadow: 4px 4px 0 #000; }
.skill__copy p b { color: var(--sun); }
.quote { margin: 20px 0 0; font-family: var(--px); font-size: 14px; line-height: 1.8; border: 3px dashed #4c4795; padding: 12px 14px; color: #dfe3ff; }
.quote cite { display: block; font-style: normal; color: #8f8bd0; font-size: 12px; margin-top: 6px; }
.shot { margin: 22px 0 0; border: var(--b) solid #fff; position: relative; }
.shot img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.shot figcaption { position: absolute; left: 0; top: 0; background: #fff; color: var(--ink); font-family: var(--px); font-size: 12px; padding: 2px 8px; }
.arena { position: relative; border: var(--b) solid #fff; background: #0c0a2a; aspect-ratio: 16/10; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.arena canvas { width: 100%; height: 100%; display: block; }
.arena__gauge { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; align-items: center; gap: 12px; font-family: var(--px); }
.gauge { flex: 1; height: 20px; background: #000; border: 3px solid #fff; position: relative; }
.gauge i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--aqua), var(--sun) 70%, var(--hot)); }
.gauge__limit { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--hot); left: 88.3%; display: none; }
.gauge__limit::after { content: 'PVC 한계'; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--hot); white-space: nowrap; margin-top: 2px; }
.pvc .gauge__limit { display: block; }
.arena__gauge b { font-size: 22px; min-width: 104px; text-align: right; color: var(--sun); }
.arena__gauge small { font-size: 12px; margin-left: 2px; }
.arena__msg { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-family: var(--px); font-size: 15px; pointer-events: none; }
.arena__msg span { background: var(--ink); padding: 3px 10px; border: 2px solid #fff; }
.shake { animation: shake .3s steps(6); }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 3px); } }
.arena__ctrl { display: flex; gap: 16px; align-items: stretch; margin-top: 16px; flex-wrap: wrap; }
.pipe-pick { border: 3px solid #fff; margin: 0; padding: 4px 12px 8px; display: flex; gap: 14px; font-family: var(--px); font-size: 15px; }
.pipe-pick legend { font-size: 12px; padding: 0 4px; color: #b9b5f2; }
.pipe-pick label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.pipe-pick input { accent-color: var(--aqua); width: 18px; height: 18px; }
.btn-charge { flex: 1; min-width: 220px; font-family: var(--px); font-weight: 700; font-size: 17px; background: var(--aqua); color: var(--ink); border: var(--b) solid #fff; box-shadow: inset 0 -6px 0 #0fa3b4; padding: 14px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.btn-charge.on { background: var(--sun); transform: translateY(3px); box-shadow: inset 0 -2px 0 #c79a00; }
.btn-charge.again { background: var(--sun); box-shadow: inset 0 -6px 0 #c79a00; animation: blink-ready 1s steps(2) infinite; }
@keyframes blink-ready { 50% { background: #fff; } }
.arena__note { font-size: 14px; color: #b9b5f2; margin-top: 10px; }

/* ---------- 튜토리얼 ---------- */
.sec--tut { --bg: var(--aqua); background: var(--aqua); }
.tut { position: relative; }
.tut__road { position: relative; height: 72px; border-bottom: 8px solid var(--ink); margin-bottom: 34px;
  background: linear-gradient(transparent 60px, #0fa3b4 60px); }
.tut__road i { position: absolute; left: 0; bottom: 0; height: 12px; width: 0; background: repeating-linear-gradient(90deg, var(--sun) 0 12px, transparent 12px 20px); }
.tut__road img { position: absolute; bottom: 0; left: 0; width: 72px; transform: translateX(-50%); transition: left .12s linear; }
.tut__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.lv { background: #fff; border: var(--b) solid var(--ink); box-shadow: var(--shadow); position: relative; }
.lv figure { margin: 0; border-bottom: var(--b) solid var(--ink); }
.lv figure img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.lv > div { padding: 14px 16px 18px; }
.lv h3 { font-size: 20px; margin: 8px 0 6px; }
.lv p { font-size: 15px; }
.lv__badge { font-family: var(--px); font-size: 12px; background: var(--navy); color: #fff; padding: 2px 8px; }
.lv.done .lv__badge { background: var(--leaf); color: var(--ink); }
.lv.done .lv__badge::after { content: ' 클리어'; }

/* ---------- 클리어 기록 ---------- */
.sec--records { --bg: var(--sun); background: var(--sun); }
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.ss { margin: 0; background: var(--ink); border: var(--b) solid var(--ink); box-shadow: var(--shadow); position: relative; color: #fff; }
.ss--ba { grid-column: span 2; }
.ss img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.ss--ba .ss__ba { position: relative; }
.ss--ba img { aspect-ratio: 16/10; }
.ss__after { position: absolute; inset: 0; height: 100%; clip-path: inset(0 0 0 100%); transition: clip-path .5s steps(8); }
.ss--ba:hover .ss__after, .ss--ba.flip .ss__after { clip-path: inset(0 0 0 0); }
.ss figcaption { padding: 8px 12px 10px; font-size: 14px; }
.ss figcaption b { font-family: var(--px); color: var(--sun); display: block; font-size: 15px; }
.ss figcaption span { display: block; font-size: 12px; color: #b9b5f2; }
.ss::before { content: 'CLEAR'; position: absolute; z-index: 2; right: 10px; top: 10px; font-family: var(--px); font-weight: 700; font-size: 13px; background: var(--hot); color: #fff; padding: 2px 8px; border: 3px solid #fff; transform: rotate(6deg); }
.log { margin-top: 48px; background: #fff; border: var(--b) solid var(--ink); box-shadow: var(--shadow); padding: 20px 22px 24px; }
.log__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.log__head h3 { font-size: 22px; }
.log__head small { font-family: var(--body); font-weight: 500; font-size: 14px; margin-left: 6px; }
.log__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.log__tabs button { font-family: var(--px); font-size: 13px; border: 3px solid var(--ink); background: #fff; padding: 4px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.log__tabs button img { width: 22px; }
.log__tabs button[aria-selected="true"] { background: var(--ink); color: var(--sun); }
.log__list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.log__list li { break-inside: avoid; border-bottom: 2px dashed #d6d3ea; }
.log__list a { display: grid; grid-template-columns: 28px 88px 1fr auto; align-items: center; gap: 10px; padding: 8px 4px; text-decoration: none; font-size: 15px; }
.log__list a:hover { background: var(--sun2); }
.log__list img { width: 28px; }
.log__date { font-family: var(--px); font-size: 12px; color: #5c5890; }
.log__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log__ok { font-family: var(--px); font-size: 11px; color: var(--leaf); font-weight: 700; }
.log__list li.new { animation: pop .4s steps(4); }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } }
.btn-more { margin-top: 16px; font-family: var(--px); font-size: 15px; background: var(--sun); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 8px 18px; cursor: pointer; }
.btn-more[hidden] { display: none; }

/* ---------- 오락실 (히어로 바로 아래) ---------- */
.sec--bonus { --bg: var(--hot); background: var(--hot); color: #fff; padding: 72px 0 88px; }
.arcade__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 28px; }
.arcade__head h2 { font-size: clamp(26px, 3.4vw, 40px); text-shadow: 4px 4px 0 var(--ink); word-break: keep-all; }
.arcade__head p { flex-basis: 100%; font-weight: 600; }
.arcade { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: stretch; }
.cab { display: flex; flex-direction: column; background: var(--ink); border: var(--b) solid var(--ink); box-shadow: 8px 8px 0 rgba(22,19,61,.45); }
.cab__top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-family: var(--px); border-bottom: 3px solid #2c2a6a; }
.cab__top h3 { font-size: 18px; color: #fff; word-break: keep-all; }
.cab__tag { flex: none; font-size: 12px; font-weight: 700; color: var(--ink); background: var(--sun); padding: 2px 8px; }
.cab__best { margin-left: auto; font-size: 13px; color: #c9c6ff; white-space: nowrap; }
.cab__best b { color: var(--sun); }
.cab__foot { padding: 10px 14px; font-family: var(--px); font-size: 13px; color: #c9c6ff; }
.cab .mg { flex: none; border: 0; box-shadow: none; }
.adv { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px; color: #fff; text-decoration: none; }
.adv__stage { position: relative; flex: 1; min-height: 190px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px 14px 12px;
  background: linear-gradient(#3bb4ff 0 62%, #22c96b 62% 70%, #8a5a2b 70%); border: 3px solid #2c2a6a; overflow: hidden; }
.adv__next { position: absolute; left: 14px; top: 14px; right: 14px; display: flex; align-items: center; gap: 8px; font-family: var(--px); font-size: 14px; color: var(--ink); background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 6px 10px; }
.adv__next b { color: var(--hot); }
.adv__next img { width: 28px; image-rendering: pixelated; }
.adv__hero { width: 64px; image-rendering: pixelated; animation: bob 1s steps(2) infinite; }
.adv__bosses { display: grid; grid-template-columns: repeat(5, auto); gap: 6px; align-items: end; }
.adv__bosses img { width: 40px; image-rendering: pixelated; filter: grayscale(1) brightness(.55); transition: transform .15s steps(2); }
.adv__bosses img.on { filter: none; }
.adv:hover .adv__bosses img, .adv:focus-visible .adv__bosses img { transform: translateY(-4px); }
.adv__desc { font-size: 15px; line-height: 1.6; color: #e6e4ff; word-break: keep-all; }
.adv__prog { display: flex; align-items: center; gap: 10px; font-family: var(--px); font-size: 14px; }
.adv__stars { color: var(--sun); letter-spacing: 2px; font-size: 16px; }
.adv__btn { align-self: flex-start; text-align: center; }
.adv:hover .adv__btn { background: #fff; }
.mg { position: relative; border: var(--b) solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: #1d1850; aspect-ratio: 4/3; overflow: hidden; touch-action: manipulation; }
.mg canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.mg__ui { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; padding: 8px 12px; font-family: var(--px); font-size: 14px; background: rgba(22,19,61,.8); }
.mg__ui b { color: var(--sun); }
.mg__over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(22,19,61,.72); text-align: center; padding: 20px; font-family: var(--px); }
.mg__over[hidden] { display: none; }
.btn-start { font-family: var(--px); font-weight: 700; font-size: 20px; background: var(--sun); color: var(--ink); border: var(--b) solid #fff; padding: 10px 26px; cursor: pointer; box-shadow: inset 0 -5px 0 #c79a00; }

/* ---------- 월드맵 ---------- */
.sec--map { --bg: #2f8fe0; background: #2f8fe0; color: #fff; }
.sec--map .sec__lead { color: #e2f2ff; }
.world { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 28px; align-items: start; }
.world__map { position: relative; }
.world__map svg { width: 100%; height: auto; display: block; overflow: visible; }
.node { cursor: pointer; }
.node:focus { outline: none; }
.node:focus-visible .node__flag, .node.on .node__flag { fill: var(--sun); }
.node text { font-family: var(--px); font-weight: 700; paint-order: stroke; stroke: var(--ink); stroke-width: 5px; fill: #fff; }
.node.on text { fill: var(--sun); }
.node__ring { animation: ring 1.4s steps(4) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.world__panel { background: #fff; color: var(--ink); border: var(--b) solid var(--ink); box-shadow: var(--shadow); padding: 18px 20px; min-height: 280px; }
.world__hint { font-family: var(--px); }
.wp__stage { font-family: var(--px); font-size: 13px; background: var(--ink); color: var(--sun); display: inline-block; padding: 1px 8px; }
.wp__name { font-size: 28px; margin: 8px 0 4px; }
.wp__count { font-family: var(--px); font-size: 15px; }
.wp__count b { font-size: 26px; color: var(--hot); }
.wp__list { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; }
.wp__list li { border-top: 2px dashed #d6d3ea; }
.wp__list a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; text-decoration: none; }
.wp__list a:hover { color: var(--navy); text-decoration: underline; }
.wp__list span { font-family: var(--px); font-size: 11px; color: #5c5890; white-space: nowrap; }
.wp__note { font-size: 13px; color: #5c5890; margin-top: 12px; }

/* ---------- FAQ ---------- */
.sec--faq { --bg: var(--leaf); background: var(--leaf); }
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.faq__menu { background: var(--ink); color: #fff; border: var(--b) solid var(--ink); box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px #fff, var(--shadow); padding: 14px 10px; }
.faq__menu button { display: flex; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px 8px 26px; font-family: var(--px); font-size: 14px; line-height: 1.5; cursor: pointer; position: relative; color: #cfd6ff; }
.faq__menu button[aria-selected="true"], .faq__menu button:hover { color: var(--sun); }
.faq__menu button[aria-selected="true"]::before { content: '▶'; position: absolute; left: 8px; animation: nudgeX .6s steps(2) infinite; }
@keyframes nudgeX { 50% { transform: translateX(3px); } }
.faq__stage { display: flex; flex-direction: column; gap: 20px; }
.faq__talk { display: flex; align-items: flex-end; gap: 14px; }
.faq__talk .dlg { flex: 1; }
.faq__talk--hero { padding-left: 40px; }
.faq__face { width: 88px; flex: none; }
.faq__talk--npc .faq__face { background: #fff; border: 3px solid var(--ink); padding: 4px; }
.dlg--hero { background: #fffbe0; }
#faqA { min-height: 6.8em; font-family: var(--body); font-size: 16px; font-weight: 500; }
.faq__plain dt { font-weight: 700; margin-top: 12px; }

/* ---------- 최종 ---------- */
.sec--final { --bg: var(--night); background: var(--night); color: #fff; text-align: center; overflow: hidden; padding-bottom: 80px; }
.final__stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.final { display: flex; flex-direction: column; align-items: center; }
.final__cont { font-family: var(--px); font-size: 22px; color: var(--hot); }
.final__cont b { color: var(--sun); font-size: 30px; }
.final h2 { font-size: clamp(36px, 6vw, 72px); margin: 10px 0 14px; text-shadow: 5px 5px 0 var(--grape); }
.final__sub { margin-bottom: 30px; font-size: 18px; color: #dfe3ff; }
.party { display: flex; align-items: flex-end; gap: 18px; margin-top: 48px; flex-wrap: wrap; justify-content: center; }
.party > img:first-child { width: 125px; }
.party > img:nth-child(2) { width: 70px; }
.party__ko { display: flex; align-items: flex-end; gap: 8px; margin-left: 20px; }
.party__ko img { width: auto; height: 58px; transform: scaleY(-1); opacity: .9; filter: grayscale(.35); }
.party__ko::after { content: 'zZ'; font-family: var(--px); color: var(--aqua); font-size: 14px; align-self: flex-start; animation: bob 1.2s steps(2) infinite; }

/* ---------- 푸터 ---------- */
.foot { background: #0b0926; color: #b9b5f2; padding: 36px 0 120px; font-size: 14px; }
.foot__in { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.foot b { color: #fff; font-family: var(--px); font-size: 16px; }

/* ---------- 도크 / 조수 ---------- */
.dock { position: fixed; z-index: 45; left: 16px; right: 16px; bottom: 16px; pointer-events: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.buddy { display: flex; align-items: flex-end; gap: 8px; pointer-events: auto; cursor: pointer; }
.buddy img { width: 42px; animation: bob 1s steps(2) infinite; }
.buddy__say { background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-family: var(--px); font-size: 13px; padding: 6px 10px; max-width: 300px; margin-bottom: 26px; word-break: keep-all; overflow-wrap: anywhere; transition: opacity .2s; }
.buddy__say.hide { opacity: 0; }
.dock__call { pointer-events: auto; display: none; align-items: center; gap: 8px; text-decoration: none; background: var(--sun); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink), inset 0 -4px 0 #e3a800; font-family: var(--px); font-weight: 700; font-size: 17px; padding: 10px 14px; white-space: nowrap; }
.dock__call small { font-size: 12px; font-weight: 400; }

/* ---------- FX 오버레이 ---------- */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.fxtext { position: fixed; inset: 0; pointer-events: none; z-index: 61; overflow: hidden; }
.dmg { position: absolute; font-family: var(--px); font-weight: 700; font-size: 26px; color: #fff; text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); animation: dmg .9s steps(9) forwards; white-space: nowrap; transform: translate(-50%, -50%); }
.dmg--crit { color: var(--sun); font-size: 36px; }
.dmg--coin { color: var(--sun); font-size: 18px; }
.dmg--warn { color: var(--hot); font-size: 22px; }
@keyframes dmg { 0% { transform: translate(-50%, -20%) scale(.6); opacity: 1; } 25% { transform: translate(-50%, -80%) scale(1.15); } 100% { transform: translate(-50%, -190%) scale(1); opacity: 0; } }
.banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: var(--px); font-weight: 700; font-size: clamp(34px, 7vw, 76px); color: var(--sun); text-shadow: 5px 5px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink); white-space: nowrap; animation: banner 1.6s steps(12) forwards; }
.banner small { display: block; font-size: .36em; color: #fff; text-align: center; }
@keyframes banner { 0% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -70%); opacity: 0; } }
.toast { position: fixed; z-index: 62; left: 50%; top: calc(var(--hud) + 22px); transform: translate(-50%, -20px); opacity: 0; font-family: var(--px); font-weight: 700; background: var(--leaf); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 6px 14px; font-size: 15px; transition: transform .3s steps(3), opacity .3s steps(3); pointer-events: none; white-space: nowrap; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* CRT */
.crt { position: fixed; inset: 0; pointer-events: none; z-index: 70; display: none;
  background: repeating-linear-gradient(rgba(0,0,0,.16) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.35)); }
.crt-on .crt { display: block; }
.crt-on main, .crt-on .hud { filter: saturate(1.15) contrast(1.05); }

.coin-pick { position: absolute; width: 30px; height: 30px; cursor: pointer; z-index: 5; background: none; border: 0; padding: 0; }
.coin-pick canvas { width: 100%; height: 100%; }

/* ---------- 반응형 ---------- */
@media (max-width: 1180px) {
  .hud__nav { display: none; }
}
@media (max-width: 1024px) {
  .quests { grid-template-columns: repeat(2, 1fr); }
  .qc, .qc:nth-child(1), .qc:nth-child(2) { grid-column: span 1; }
  .qc:nth-child(5) { grid-column: span 2; }
  .tut__list { grid-template-columns: repeat(2, 1fr); }
  .skill, .world, .faq, .arcade { grid-template-columns: 1fr; }
  .sec--bonus { padding: 56px 0 64px; }
  .adv__stage { min-height: 150px; }
  .adv__bosses img { width: 32px; }
  .adv__hero { width: 52px; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .log__list { columns: 1; }
}
@media (max-width: 720px) {
  :root { --hud: 52px; }
  body { font-size: 16px; }
  .sec { padding: 72px 0 80px; }
  .hud { gap: 8px; padding: 0 10px; }
  .hud__brand span { font-size: 15px; }
  .hud__crt { display: none; }
  .hud__num { display: none; }
  .hud__short { display: inline; }
  .hud__call { padding: 7px 10px; font-size: 15px; }
  .hero { height: auto; min-height: 0; max-height: none; padding-bottom: 300px; }
  .hero__copy { padding-top: 18px; }
  .hero__title { font-size: 34px; }
  .hero__sub { font-size: 15px; }
  .hero__cta { margin-top: 14px; }
  .btn-call__top { font-size: 26px; }
  .hero__dlg { display: none; }
  .hero__hint { right: 12px; bottom: 12px; font-size: 12px; }
  .quests { grid-template-columns: 1fr; }
  .qc:nth-child(5) { grid-column: span 1; }
  .qc__spr { width: 104px; }
  .qc__name { font-size: 22px; }
  .tut__list { grid-template-columns: 1fr; }
  .lv { display: grid; grid-template-columns: 120px 1fr; }
  .lv figure { border-bottom: 0; border-right: var(--b) solid var(--ink); }
  .lv figure img { height: 100%; aspect-ratio: auto; }
  .lv > div { padding: 12px; }
  .lv h3 { font-size: 17px; }
  .lv p { font-size: 14px; }
  .shots { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ss--ba { grid-column: span 2; }
  .ss figcaption { font-size: 12px; padding: 6px 8px; }
  .log { padding: 14px 12px 18px; }
  .log__list a { grid-template-columns: 24px 1fr; grid-template-rows: auto auto; row-gap: 0; column-gap: 8px; }
  .log__list img { grid-row: span 2; width: 24px; }
  .log__date { grid-column: 2; }
  .log__t { grid-column: 2; white-space: normal; }
  .log__ok { display: none; }
  .arena { aspect-ratio: 4/3; }
  .arena__gauge b { font-size: 17px; min-width: 80px; }
  .faq__talk--hero { padding-left: 0; }
  .faq__face { width: 60px; }
  .party > img:first-child { width: 90px; }
  .party__ko { margin-left: 0; }
  .dock__call { display: flex; }
  .buddy__say { position: absolute; left: 0; bottom: 62px; max-width: calc(100vw - 32px); width: max-content; font-size: 13px; margin: 0; }
  .buddy img { width: 36px; }
  .foot { padding-bottom: 110px; }
}

@media (min-width: 721px) and (max-height: 760px) { .hero__dlg { display: none; } .hero__copy { padding-top: 12px; } }

/* ---------- 모션 줄이기 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .fx, .fxtext { display: none; }
}
