/* 요즘 부산은 너무 덥다 — 홍보 페이지 */

@font-face {
  font-family: 'DNF';
  src: url('assets/fonts/DNFBitBitv2.otf') format('opentype');
  font-display: swap;
}

:root {
  --cream: #fff6e4;
  --paper: #fbe8c8;
  --ink: #0e1222;
  --ink-soft: #3a3f52;
  --orange: #ff6a1a;
  --teal: #28c8be;
  --cobalt: #2346d9;
  --sea: #2fb3d9;
  --sand: #f6d7a0;
  --gutter: 16px;
  --radius: 14px;
  --shadow: 4px 4px 0 var(--ink);
  --pixel: 'DNF', 'Pretendard Variable', sans-serif;
  --body: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── 들어가기 전 대기 화면 ─────────────────── */
html.gate-open, html.gate-open body { overflow: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: #07080d; color: var(--cream);
  padding: var(--gutter);
}
.gate-static {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; opacity: .85; transition: opacity .6s;
}
.gate.on .gate-static { opacity: .1; }
.gate-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .35) 2px 4px);
  box-shadow: inset 0 0 160px rgba(0, 0, 0, .9);
}
.gate-tv {
  position: relative; z-index: 1;
  width: min(760px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center;
  opacity: 0; transform: scale(1.04);
  transition: opacity .4s, transform .4s;
}
.gate.on .gate-tv { opacity: 1; transform: none; }
.gate-hud {
  position: fixed; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; padding: 18px 22px;
  font-family: var(--pixel); font-size: 15px;
}
.gate-rec { display: flex; align-items: center; gap: 8px; color: #ff4a4a; }
.gate-rec i { width: 12px; height: 12px; border-radius: 50%; background: #ff3b3b; animation: blink 1s steps(2) infinite; }
.gate-live b { font-weight: normal; opacity: .8; }
.gate-logo { width: min(560px, 88vw); height: auto; filter: drop-shadow(0 0 30px rgba(255, 106, 26, .35)); }
.gate.on .gate-logo { animation: gate-glitch .7s steps(5) both; }
@keyframes gate-glitch {
  0% { clip-path: inset(0 0 100% 0); }
  25% { clip-path: inset(20% 0 50% 0); translate: -10px 0; }
  50% { clip-path: inset(0 0 30% 0); translate: 8px 0; filter: hue-rotate(60deg); }
  75% { clip-path: inset(40% 0 0 0); translate: -4px 0; }
  100% { clip-path: inset(0); translate: 0; }
}
.gate-lines { min-height: 7.6em; display: flex; flex-direction: column; gap: 4px; }
.gate-line { margin: 0; font-family: var(--pixel); font-size: clamp(16px, 3vw, 21px); line-height: 1.6; }
.gate-line.sfx { color: var(--teal); letter-spacing: .12em; }
.gate-line.reply { color: #fff; }
.gate-rec-tag { color: #ff3b3b; }
.gate-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.gate-btns[hidden] { display: none; }
.gate-q { flex-basis: 100%; margin: 0 0 4px; font-size: 15px; opacity: .8; }
.gate-btn {
  font-family: var(--pixel); font-size: 17px; cursor: pointer;
  padding: 13px 22px; border-radius: 12px;
  background: var(--orange); color: var(--cream);
  border: 3px solid var(--cream); box-shadow: 4px 4px 0 var(--teal);
  transition: transform .12s;
}
.gate-btn + .gate-btn { background: transparent; }
.gate-btn:hover, .gate-btn:focus-visible { transform: translate(-2px, -2px); outline: none; box-shadow: 6px 6px 0 var(--teal); }
.gate.burst .gate-static { opacity: 1; transition: none; }
.gate.burst .gate-tv { opacity: 0; transition: none; }
.gate.off { animation: tv-off .5s ease-in forwards; }
@keyframes tv-off {
  0% { clip-path: inset(0); }
  60% { clip-path: inset(49.5% 0 49.5% 0); filter: brightness(3); }
  100% { clip-path: inset(50% 50% 50% 50%); filter: brightness(3); }
}

/* ── 뉴스 띠 ───────────────────────────── */
.ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 var(--gutter);
  background: var(--ink);
  color: var(--cream);
  font-family: var(--pixel);
  font-size: 14px;
  overflow: hidden;
}
.rec { display: flex; align-items: center; gap: 6px; color: #ff4a4a; flex: none; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ticker-window { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: flex; gap: 56px; width: max-content; animation: ticker 70s linear infinite; white-space: nowrap; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ── 첫 화면 ───────────────────────────── */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle, rgba(255, 106, 26, .13) 1.5px, transparent 1.6px) 0 0 / 14px 14px,
    var(--cream);
  overflow: hidden;
}
.nav {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 8px;
  padding: 14px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav a {
  flex: none;
  font-family: var(--pixel);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
}
.nav a:hover { background: var(--ink); color: var(--cream); }
.sun {
  position: absolute;
  right: -12vw;
  top: 4vh;
  width: min(62vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 246, 228, .35) 2px, transparent 2.2px) 0 0 / 12px 12px,
    radial-gradient(circle at 40% 40%, #ffb13d, var(--orange) 70%);
  animation: sun 6s ease-in-out infinite;
}
@keyframes sun { 50% { transform: scale(1.04) rotate(3deg); } }
.hero-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px var(--gutter) calc(clamp(210px, 24vw, 320px) + 28px);
}
.kicker { margin: 0; font-family: var(--pixel); font-size: clamp(13px, 2.6vw, 18px); color: var(--cobalt); }
.logo { margin: 0; width: min(100%, 720px); }
.logo img { width: 100%; height: auto; animation: wobble 4s ease-in-out infinite; transform-origin: 30% 60%; }
@keyframes wobble { 50% { transform: rotate(-1.2deg) translateY(-4px); } }
.sub { margin: 0; font-size: clamp(15px, 2.4vw, 19px); font-weight: 600; max-width: 30em; }

.btn {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 17px;
  text-decoration: none;
  padding: 14px 26px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--orange);
  color: var(--cream);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }

/* 해변(기존 배경 그림을 도트화) + 걷는 도트 */
.beach {
  --beach-h: clamp(210px, 24vw, 320px);
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--beach-h); z-index: 1;
  background: url('assets/bg/beach.png') center bottom / cover;
  image-rendering: pixelated;
  border-top: 4px solid var(--ink);
}
.walkers { position: absolute; inset: 0; }
.walker {
  position: absolute;
  bottom: 6%;
  height: calc(var(--h) * var(--k, 1) * 1px);
  width: auto;
  max-width: none;
  image-rendering: pixelated;
  cursor: pointer;
  animation: walk-lr var(--dur) linear infinite;
  animation-delay: var(--delay);
  filter: drop-shadow(0 4px 0 rgba(14, 18, 34, .18));
}
.walker.rl { animation-name: walk-rl; }
@keyframes walk-lr { from { left: -12%; } to { left: 108%; } }
@keyframes walk-rl { from { left: 108%; } to { left: -12%; } }
.walker:hover { filter: drop-shadow(0 0 6px var(--c)) drop-shadow(0 4px 0 rgba(14, 18, 34, .18)); }

/* ── 공통 섹션 ─────────────────────────── */
.section { max-width: 1100px; margin: 0 auto; padding: 72px var(--gutter); }
.h2 { margin: 0 0 28px; font-family: var(--pixel); font-weight: normal; font-size: clamp(26px, 5vw, 40px); line-height: 1.25; }
.h2 span {
  display: inline-block;
  padding: 6px 16px 4px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 10px;
  transform: rotate(-1.5deg);
  box-shadow: 4px 4px 0 var(--orange);
}
.lead { margin: -8px 0 22px; font-size: 17px; font-weight: 600; }
.placeholder {
  display: grid; place-items: center; text-align: center;
  min-height: 220px; padding: 24px;
  border: 3px dashed var(--ink-soft); border-radius: var(--radius);
  color: var(--ink-soft); font-family: var(--pixel); font-size: 15px;
  background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(14, 18, 34, .04) 14px 28px);
}
.ratio-169 { aspect-ratio: 16 / 9; min-height: 0; }
.ratio-219 { aspect-ratio: 21 / 9; min-height: 0; }

/* ── PV ─────────────────────────────────── */
.pv-frame {
  position: relative; aspect-ratio: 16 / 9;
  border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  background: var(--ink); box-shadow: 8px 8px 0 var(--orange);
}
.pv-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pv-play {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px;
  border: 0; padding: 13% 0 0; cursor: pointer; color: var(--cream);   /* 표지 아래쪽 제목을 안 가리게 버튼을 위로 */
  background: radial-gradient(ellipse at center, rgba(14, 18, 34, .25), rgba(14, 18, 34, .65));
  font-family: var(--pixel);
}
.pv-play::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url('assets/noise.png') 0 0 / 160px 160px, repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .18) 2px 4px);
  opacity: .14; mix-blend-mode: screen; animation: static .35s steps(4) infinite;
}
.pv-play-rec { position: absolute; left: 14px; top: 12px; display: flex; align-items: center; gap: 6px; font-size: 14px; color: #ff6a6a; }
.pv-play-rec i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; animation: blink 1s steps(2) infinite; }
.pv-play-btn {
  position: relative; z-index: 1;
  font-size: clamp(16px, 4vw, 32px); padding: clamp(8px, 2vw, 14px) clamp(16px, 4vw, 28px); border-radius: 14px;
  background: var(--orange); border: 3px solid var(--cream); box-shadow: 5px 5px 0 var(--teal);
  transition: transform .15s;
}
.pv-play:hover .pv-play-btn, .pv-play:focus-visible .pv-play-btn { transform: scale(1.06) rotate(-1deg); }
.pv-play-sub {
  position: absolute; right: 12px; top: 10px; z-index: 1;
  font-size: 12px; padding: 3px 8px; border-radius: 8px; background: rgba(14, 18, 34, .7);
}
.pv-frame.playing .pv-play { display: none; }

/* ── 세계관: 그림 + 한 줄 펀치라인 ─────────── */
.features { display: grid; gap: 34px; }
.feature {
  display: grid; gap: 18px; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  .features { gap: 56px; }
  .feature { grid-template-columns: 1.15fr 1fr; gap: 40px; }
  .feature:nth-child(even) .feature-pic { order: 2; }
}
.feature-pic {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  box-shadow: 8px 8px 0 var(--fc);
  aspect-ratio: 16 / 9;
}
.feature:nth-child(odd) .feature-pic { transform: rotate(-1deg); }
.feature:nth-child(even) .feature-pic { transform: rotate(1deg); }
.feature-pic img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform .5s; }
.feature-pic::after {                       /* TV 잡음: 평소엔 옅게, 마우스를 올리면 진하게 */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url('assets/noise.png') 0 0 / 160px 160px, repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .12) 2px 4px);
  opacity: .18; mix-blend-mode: screen;
  animation: static .35s steps(4) infinite;
  transition: opacity .2s;
}
@keyframes static { 25% { background-position: 40px 70px, 0 0; } 50% { background-position: 110px 20px, 0 0; } 75% { background-position: 60px 130px, 0 0; } }
.feature:hover .feature-pic::after { opacity: .5; }
.feature:hover .feature-pic img { transform: scale(1.04); }
.feature-no {
  position: absolute; left: 12px; top: 12px; z-index: 1;
  font-family: var(--pixel); font-size: 13px; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 8px;
  background: var(--ink); color: var(--cream); border: 2px solid var(--fc);
}
.feature-text h3 {
  margin: 0; font-family: var(--pixel); font-weight: normal;
  font-size: clamp(30px, 5vw, 44px); line-height: 1.15; color: var(--fc);
  text-shadow: 3px 3px 0 var(--ink);
  -webkit-text-stroke: 1px var(--ink);
}
.punch {
  margin: 10px 0 12px; font-family: var(--pixel); font-size: clamp(18px, 2.6vw, 24px); line-height: 1.45;
}
.punch span { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--fc) 35%, transparent) 58%); display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.feature-text p:last-child { margin: 14px 0 0; font-size: 16px; color: var(--ink-soft); }

/* 스크롤하면 잡음 끼며 나타남 */
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .5s, transform .5s; }
.js .reveal.in .feature-pic { animation: glitch-in .6s steps(6) both; }
@keyframes glitch-in {
  0% { clip-path: inset(0 0 100% 0); }
  20% { clip-path: inset(30% 0 40% 0); translate: -8px 0; }
  40% { clip-path: inset(10% 0 20% 0); translate: 6px 0; }
  60% { clip-path: inset(0 0 50% 0); translate: -3px 0; }
  100% { clip-path: inset(0); translate: 0; }
}

/* ── 경보: 300m 거대 가로등 ─────────────────── */
.alert {
  --lamp: #3aa0ff;
  position: relative;
  overflow: hidden;
  padding: 72px var(--gutter);
  background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--lamp) 35%, transparent), transparent 60%), linear-gradient(#141a35, #241f48);
  color: var(--cream);
  border-block: 4px solid var(--ink);
  transition: background .5s;
}
.alert[data-level="1"] { --lamp: #3ccb6a; }
.alert[data-level="2"] { --lamp: #ffd23c; }
.alert[data-level="3"] { --lamp: #ff3b3b; background: radial-gradient(ellipse at 20% 0%, rgba(255, 59, 59, .45), transparent 60%), linear-gradient(#2a0a10, #4a1018); }
.alert[data-level="4"] { --lamp: #ff2a2a; background: #050507; }
.alert-inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; }
.alert-kicker { margin: 0; font-family: var(--pixel); font-size: 14px; color: var(--lamp); letter-spacing: .06em; }
.alert-title { margin: 6px 0 26px; font-family: var(--pixel); font-weight: normal; font-size: clamp(24px, 4.4vw, 40px); line-height: 1.3; }
.alert-body {
  display: grid; gap: 18px;
  grid-template-columns: 110px 1fr;
  grid-template-areas: "screen screen" "lamp info";
  align-items: center;
}
@media (min-width: 820px) {
  .alert-body { grid-template-columns: 200px 1.3fr 1fr; grid-template-areas: "lamp screen info"; gap: 28px; }
}
.alert-screen {
  grid-area: screen; position: relative; aspect-ratio: 21 / 9;
  border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 3px var(--lamp), 0 0 40px color-mix(in srgb, var(--lamp) 50%, transparent);
  transition: box-shadow .4s;
}
.alert-screen img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.alert-screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url('assets/noise.png') 0 0 / 160px 160px, repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .16) 2px 4px);
  opacity: .15; mix-blend-mode: screen; animation: static .35s steps(4) infinite;
}
.alert-screen.switch::after { opacity: .9; mix-blend-mode: normal; }
.alert-badge {
  position: absolute; right: 10px; top: 10px; z-index: 1;
  font-family: var(--pixel); font-size: 13px; padding: 3px 10px; border-radius: 6px;
  background: var(--lamp); color: var(--ink);
}
.alert[data-level="4"] .alert-badge { background: #000; color: #ff2a2a; border: 2px solid #ff2a2a; }
.alert-info { grid-area: info; }
.alert-level {
  margin: 0; font-family: var(--pixel); font-size: clamp(30px, 5.6vw, 52px); line-height: 1.1;
  color: var(--lamp); text-shadow: 0 0 22px var(--lamp);
}
.alert-desc { margin: 8px 0 0; font-size: 17px; font-weight: 700; min-height: 3.2em; }
.alert-citizen { margin: 6px 0 0; font-size: 14px; opacity: .75; }
.alert-gauge { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 26px; }
.alert-gauge button {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px; cursor: pointer;
  font-family: var(--pixel); font-size: clamp(11px, 1.8vw, 15px); color: var(--cream);
  background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .25); border-radius: 12px;
  transition: transform .15s, background .2s, border-color .2s;
}
.alert-gauge button i { width: 22px; height: 22px; border-radius: 50%; background: var(--dot); border: 2px solid var(--cream); }
.alert-gauge button[aria-pressed="true"] { background: rgba(255, 255, 255, .16); border-color: var(--dot); transform: translateY(-4px); box-shadow: 0 0 18px var(--dot); }
.alert-gauge button:hover { border-color: var(--cream); }

/* 가로등 */
.lamp { grid-area: lamp; position: relative; height: 230px; border: 0; background: none; cursor: pointer; padding: 0; }
@media (min-width: 820px) { .lamp { height: 320px; } }
.lamp-pole {
  position: absolute; left: 50%; bottom: 0; width: 12px; height: calc(100% - 50px); transform: translateX(-50%);
  background: linear-gradient(90deg, #1b2038, #5a6185 45%, #1b2038); border-radius: 4px 4px 0 0;
}
.lamp-head {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 84px; height: 58px; background: #1b2038; border: 3px solid #5a6185;
  border-radius: 42px 42px 12px 12px; display: grid; place-items: end center; padding-bottom: 6px;
}
.lamp-light {
  width: 58px; height: 20px; border-radius: 0 0 30px 30px; background: var(--lamp);
  box-shadow: 0 0 24px 8px var(--lamp), 0 60px 120px 40px color-mix(in srgb, var(--lamp) 40%, transparent);
  transition: background .3s, box-shadow .3s;
}
.alert[data-level="4"] .lamp-light { background: #111; box-shadow: 0 0 0 2px #333; }
.lamp:hover .lamp-head, .lamp:focus-visible .lamp-head { border-color: var(--cream); }

/* 적색: 사이렌 빛이 훑고 지나감 / 흑색: 깜빡이며 흔들림 */
.alert-siren { position: absolute; inset: -50%; pointer-events: none; opacity: 0; }
.alert[data-level="3"] .alert-siren {
  opacity: 1;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 40, 40, .28) 80%, transparent 90%);
  animation: siren 1.6s linear infinite;
}
@keyframes siren { to { transform: rotate(1turn); } }
.alert[data-level="4"] .alert-title, .alert[data-level="4"] .alert-level { animation: flicker 2.4s steps(1) infinite; }
.alert[data-level="4"] .alert-screen { animation: tremble .25s steps(2) infinite; }
@keyframes flicker { 0%, 46%, 50%, 100% { opacity: 1; } 48% { opacity: .2; } 92% { opacity: .6; } }
@keyframes tremble { 50% { translate: 2px -1px; } }

/* ── 캐릭터 포스터 ─────────────────────── */
.posters {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72vw, 300px);
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 18px;
  margin: 0 calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: thin;
}
@media (min-width: 960px) {
  .posters { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 6px 0 18px; }
}
.poster {
  scroll-snap-align: center;
  position: relative;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
  aspect-ratio: 940 / 1674;
}
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.poster:hover, .poster:focus-visible { transform: translateY(-6px) rotate(-1deg); box-shadow: 6px 10px 0 var(--c); outline: none; }
.poster:hover img { transform: scale(1.04); }

/* 조연(렉): 포스터보다 작은 정사각 칸, 점선 테두리 */
.sidekick {
  display: flex; align-items: flex-start; gap: 16px;
  max-width: 620px; margin: 22px 0 0; padding: 14px;
  border: 3px dashed var(--ink-soft); border-radius: var(--radius);
  background: rgba(255, 255, 255, .55);
}
.sidekick-pic {
  flex: none; width: 116px; height: 116px; object-fit: cover;
  border: 3px solid var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 #ff4a4a;
}
.sidekick-body { min-width: 0; }
.sidekick-head { margin: 0 0 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.sidekick-head b { font-family: var(--pixel); font-weight: normal; font-size: 22px; }
.sidekick-head small { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.sidekick-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--pixel); font-size: 12px; padding: 3px 8px; border-radius: 6px;
  background: var(--ink); color: #ff6a6a;
}
.sidekick-badge i { width: 7px; height: 7px; border-radius: 50%; background: #ff3b3b; animation: blink 1s steps(2) infinite; }
.sidekick-text { margin: 0; font-size: 14.5px; line-height: 1.6; }
.sidekick-tags { margin-top: 8px; }
.sidekick-tags li { font-size: 12px; padding: 2px 8px; }
@media (max-width: 480px) {
  .sidekick { gap: 12px; padding: 12px; }
  .sidekick-pic { width: 84px; height: 84px; }
  .sidekick-text { font-size: 13.5px; }
}

/* 캐릭터 카드(모달) */
.char-modal {
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--c, var(--orange));
  overflow: auto;
}
.char-modal::backdrop { background: rgba(14, 18, 34, .72); backdrop-filter: blur(3px); }
.char-modal[open] { animation: pop .22s ease-out; }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.cm-close {
  position: sticky; top: 10px; float: right; margin: 10px 10px -46px 0; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--cream); font-size: 16px; cursor: pointer;
}
.cm-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cm-body { grid-template-columns: 380px 1fr; } }
.cm-poster { background: var(--ink); }
.cm-poster img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 759px) { .cm-poster img { max-height: 62dvh; object-position: top; } }
.cm-info { padding: 22px 20px 24px; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 760px) { .cm-info { padding: 34px 32px; } }
.cm-no { margin: 0; font-family: var(--pixel); color: var(--c); font-size: 15px; }
.cm-title { display: flex; align-items: flex-end; gap: 12px; }
.cm-name { margin: 0; font-family: var(--pixel); font-weight: normal; font-size: clamp(34px, 6vw, 48px); line-height: 1; }
.cm-dot { height: 72px; width: auto; max-width: none; image-rendering: pixelated; }
.cm-meta { margin: 0; font-weight: 700; color: var(--ink-soft); }
.cm-line {
  margin: 6px 0 0; padding: 10px 14px;
  font-family: var(--pixel); font-size: 17px; line-height: 1.5;
  background: var(--c); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 10px;
}
.cm-intro { margin: 4px 0 0; }
.cm-tags { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cm-tags li { padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; background: #fff; }
.cm-nav { margin-top: auto; padding-top: 16px; display: flex; justify-content: space-between; gap: 10px; }
.btn-ghost {
  font-family: var(--pixel); font-size: 14px; padding: 8px 14px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 10px; background: transparent; color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); }

/* ── 비주얼노벨 ─────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vn {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow);
  outline: none;
}
.vn:focus-visible { box-shadow: 0 0 0 3px var(--orange), var(--shadow); }
.vn-stage {
  position: relative;
  aspect-ratio: 21 / 9;
  background: #222 center / cover no-repeat;
  image-rendering: pixelated;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
}
@media (max-width: 640px) { .vn-stage { aspect-ratio: 16 / 10; } }   /* 폰에선 양옆을 잘라 무대를 높게 */
.vn-stage.fade::after {
  content: ''; position: absolute; inset: 0; background: var(--ink);
  animation: vn-fade .45s ease-out forwards; pointer-events: none;
}
@keyframes vn-fade { to { opacity: 0; } }
.vn-stage.shake { animation: vn-shake .35s; }
@keyframes vn-shake { 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, -1px); } 80% { transform: translate(2px, 1px); } }
.vn-place, .vn-rec {
  position: absolute; top: 10px; z-index: 2;
  font-family: var(--pixel); font-size: clamp(11px, 1.6vw, 14px);
  padding: 4px 10px; border-radius: 8px;
  background: rgba(14, 18, 34, .78); color: var(--cream);
}
.vn-place { left: 10px; }
.vn-rec { right: 10px; display: flex; align-items: center; gap: 5px; color: #ff6a6a; }
.vn-rec i { width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; animation: blink 1s steps(2) infinite; }
.vn-rec b { font-weight: normal; color: var(--cream); }
.vn-sound {
  position: absolute; top: 44px; right: 10px; z-index: 2;
  font-family: var(--pixel); font-size: clamp(11px, 1.6vw, 14px);
  padding: 4px 10px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(14, 18, 34, .78); color: var(--teal);
}
.vn-sound.off { color: rgba(255, 246, 228, .55); text-decoration: line-through; }
.vn-sound:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.vn-stamp.new { animation: vn-stamp-in .5s steps(5, end); }
@keyframes vn-stamp-in {
  0% { transform: rotate(8deg) scale(2.4); opacity: 0; }
  60% { transform: rotate(8deg) scale(.9); opacity: 1; }
  100% { transform: rotate(8deg) scale(1); }
}
.vn-dot {
  position: absolute; bottom: 5%; left: var(--x);
  height: calc(48% * var(--rel));
  width: auto; max-width: none;
  transform: translateX(-50%);
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 0 rgba(14, 18, 34, .35));
  animation: vn-in .4s ease-out backwards;
}
@keyframes vn-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.vn-dot.talk { animation: vn-talk .5s ease-out; }
@keyframes vn-talk { 30% { transform: translate(-50%, -8px); } }
.vn-title {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-content: center; text-align: center;
  background: linear-gradient(rgba(14, 18, 34, .15), rgba(14, 18, 34, .55));
  pointer-events: none;
}
.vn-title p { margin: 0; font-family: var(--pixel); color: var(--cream); text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--teal); }
.vn-title-sub { font-size: clamp(13px, 2vw, 18px); }
.vn-title-main { font-size: clamp(34px, 7vw, 72px); line-height: 1.1; }

.vn-box {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  min-height: 150px;
  padding: 16px 18px 26px;
  background: var(--cream);
  border-top: 3px solid var(--ink);
  cursor: pointer;
}
.vn-box[hidden], .vn-title[hidden], .vn-map[hidden] { display: none; }
.vn-face {
  width: clamp(60px, 11vw, 104px); aspect-ratio: 1; object-fit: cover;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--paper);
}
.vn-face[hidden] { display: none; }
.vn-talk { grid-column: 2; min-width: 0; }
.vn-face[hidden] + .vn-talk { grid-column: 1 / -1; }
.vn-name {
  display: inline-block; margin: 0 0 6px; padding: 2px 12px 1px;
  font-family: var(--pixel); font-size: 15px;
  background: var(--nc); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px;
}
.vn-name[hidden] { display: none; }
.vn-text { margin: 0; font-size: clamp(15px, 2vw, 18px); font-weight: 600; line-height: 1.65; min-height: 3.3em; }
.vn-box.narr .vn-text { color: var(--ink-soft); font-weight: 500; }
.vn-box.sfx .vn-text { font-family: var(--pixel); font-size: 22px; color: var(--cobalt); letter-spacing: .1em; }
.vn-box.sing .vn-text { color: #b0369c; }
.vn-box.mutter .vn-text { color: var(--ink-soft); font-weight: 500; }
.vn-tag { font-family: var(--pixel); font-size: .85em; }
.vn-tag.is-rec { color: #ff3b3b; }
.vn-next { position: absolute; right: 16px; bottom: 6px; font-size: 14px; animation: blink 1s steps(2) infinite; }
.vn-next[hidden] { display: none; }
.vn-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vn-choices:empty { display: none; }
.vn-choice {
  font-family: var(--pixel); font-size: 15px; text-decoration: none;
  padding: 10px 16px; cursor: pointer;
  background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
}
.vn-choice:hover, .vn-choice:focus-visible { background: var(--ink); color: var(--cream); outline: none; }
.vn-choice.start { background: var(--orange); color: var(--cream); }
.vn-choice.start:hover { background: var(--ink); }

.vn-map { padding: 16px 18px 20px; background: var(--cream); border-top: 3px solid var(--ink); }
.vn-map-head { margin: 0 0 12px; font-family: var(--pixel); font-size: 18px; }
.vn-map-head span { font-size: 13px; color: var(--ink-soft); margin-left: 6px; }
.vn-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .vn-cards { grid-template-columns: repeat(3, 1fr); } }
.vn-card {
  position: relative; aspect-ratio: 21 / 9; min-height: 74px;
  border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--bg) center / cover; image-rendering: pixelated;
  text-align: left; padding: 0;
  box-shadow: 3px 3px 0 var(--c, var(--ink));
  transition: transform .12s;
}
.vn-card:hover, .vn-card:focus-visible { transform: translateY(-3px); outline: none; }
.vn-card-name, .vn-card-who {
  position: absolute; left: 6px; z-index: 1;
  font-family: var(--pixel); background: rgba(14, 18, 34, .8); color: var(--cream);
  border-radius: 6px; padding: 2px 8px;
}
.vn-card-name { top: 6px; font-size: 14px; }
.vn-card-who { bottom: 6px; font-size: 11px; color: var(--c, #ff6a6a); }
.vn-card img { position: absolute; right: 8%; bottom: 4%; height: 78%; width: auto; max-width: none; image-rendering: pixelated; }
.vn-card.done { filter: saturate(.55); }
.vn-stamp {
  position: absolute; right: 6px; top: 6px; z-index: 1;
  font-family: var(--pixel); font-size: 11px; color: #ff3b3b;
  border: 2px solid #ff3b3b; border-radius: 6px; padding: 1px 6px;
  background: rgba(255, 246, 228, .9); transform: rotate(8deg);
}
.vn-finish { margin-top: 14px; }

/* ── 변조자 등록 ─────────────────────────── */
.mt {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    repeating-linear-gradient(transparent 0 31px, rgba(35, 70, 217, .07) 31px 32px),
    #fffdf6;
  box-shadow: var(--shadow);
}
.mt-desk {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 18px; background: var(--ink); color: var(--cream);
  font-family: var(--pixel); font-size: clamp(14px, 2.4vw, 18px);
}
.mt-window-no { font-size: 13px; padding: 3px 10px; border-radius: 6px; background: var(--teal); color: var(--ink); flex: none; }
.mt-clerk {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px; border-bottom: 2px dashed rgba(14, 18, 34, .25);
}
.mt-clerk-name {
  flex: none; font-family: var(--pixel); font-size: 14px;
  padding: 3px 10px 2px; border: 2px solid var(--ink); border-radius: 8px; background: #d9dde6;
}
.mt-clerk-line { margin: 1px 0 0; font-weight: 600; color: var(--ink-soft); }
.mt-clerk-line.pop { animation: mt-pop .35s ease-out; }
@keyframes mt-pop { from { opacity: 0; transform: translateY(4px); } }
.mt-stage { padding: 22px 18px 26px; min-height: 260px; }
@media (min-width: 760px) { .mt-stage { padding: 28px 32px 32px; } }

.mt-label { display: block; font-family: var(--pixel); font-size: 15px; margin-bottom: 8px; }
.mt-name-row { display: flex; flex-wrap: wrap; gap: 10px; }
.mt-input {
  flex: 1 1 200px; min-width: 0;
  font: inherit; font-size: 18px; font-weight: 700;
  padding: 12px 14px; border: 3px solid var(--ink); border-radius: 10px; background: #fff;
}
.mt-input:focus { outline: none; box-shadow: 0 0 0 3px var(--teal); }
.mt-btn {
  font-family: var(--pixel); font-size: 16px; text-decoration: none; cursor: pointer;
  padding: 12px 18px; border-radius: 10px;
  background: var(--orange); color: var(--cream);
  border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.mt-btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.mt-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.mt-btn.ghost { background: #fff; color: var(--ink); }
.mt-btn.crack { background: var(--ink); color: var(--cream); box-shadow: 3px 3px 0 var(--teal); }

.mt-progress { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 14px; }
.mt-progress i { flex: 1; height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: linear-gradient(90deg, var(--teal) var(--p), #fff var(--p)); }
.mt-question { margin: 18px 0 16px; font-family: var(--pixel); font-size: clamp(19px, 3.4vw, 26px); line-height: 1.45; }
.mt-opts { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .mt-opts { grid-template-columns: 1fr 1fr; } }
.mt-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  padding: 14px 16px; background: #fff;
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, background .15s;
}
.mt-opt:hover:not(:disabled) { transform: translate(-2px, -2px); background: #fff3e6; }
.mt-opt:disabled { cursor: default; }
.mt-check { flex: none; width: 22px; height: 22px; border: 3px solid var(--ink); border-radius: 4px; background: #fff; position: relative; }
.mt-opt.on { background: #ffe9d6; }
.mt-opt.on .mt-check::after { content: '✓'; position: absolute; inset: -6px 0 0 2px; font-size: 22px; font-weight: 900; color: #d62626; }

.mt-proc { max-width: 520px; margin: 10px auto 0; }
.mt-proc-log { min-height: 150px; font-family: var(--pixel); font-size: 16px; }
.mt-proc-log p { margin: 0 0 6px; animation: mt-pop .3s ease-out; }
.mt-proc-log p.sfx { color: var(--cobalt); letter-spacing: .06em; }
.mt-proc-bar { height: 16px; border: 3px solid var(--ink); border-radius: 8px; background: #fff; overflow: hidden; }
.mt-proc-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--orange) 0 10px, #ff8f4f 10px 20px); transition: width .4s; }

/* 등록증 발급기 */
.mt-result { max-width: 620px; margin: 0 auto; }
.mt-issuer { position: relative; }
.mt-slot {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  background: linear-gradient(#2a3150, #0e1222); color: #aab3cf;
  border: 3px solid var(--ink); border-radius: 12px;
  font-family: var(--pixel); font-size: 12px;
  box-shadow: inset 0 -6px 0 #05070f;
}
.mt-slot i { width: 9px; height: 9px; border-radius: 50%; background: #3ccb6a; box-shadow: 0 0 8px #3ccb6a; animation: blink 0.6s steps(2) infinite; }
.mt-issuer.stamped .mt-slot i { animation: none; }
.mt-window { overflow: hidden; margin: -4px 10px 0; padding: 0 0 14px; }
.mt-cardbox { position: relative; transform: translateY(-103%); }
.mt-issuing .mt-cardbox, .mt-issuer.issuing .mt-cardbox { animation: eject 1.7s steps(16) forwards; }
@keyframes eject { to { transform: translateY(0); } }
.mt-card { display: block; width: 100%; height: auto; border-radius: 4.5% / 7%; box-shadow: 0 10px 24px rgba(14, 18, 34, .28); }
.mt-issuer.stamped .mt-cardbox { animation: eject 0s forwards, thump .35s ease-out; }
@keyframes thump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(0) scale(.975) rotate(-.4deg); } 100% { transform: translateY(0) scale(1); } }
.mt-holo {
  position: absolute; inset: 0; border-radius: 4.5% / 7%; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .55) 44%, rgba(120, 255, 240, .35) 50%, rgba(255, 150, 255, .3) 56%, transparent 68%) no-repeat;
  background-size: 260% 100%; background-position: 130% 0;
  mix-blend-mode: screen; opacity: 0;
}
.mt-issuer.shine .mt-holo { animation: holo 1.8s ease-in-out forwards; }
@keyframes holo { 0% { opacity: 1; background-position: 130% 0; } 100% { opacity: 1; background-position: -40% 0; } }
.mt-issuer.stamped .mt-window::after {
  content: ''; position: absolute; inset: 0; background: #fff; pointer-events: none;
  animation: flash .35s ease-out forwards;
}
@keyframes flash { from { opacity: .55; } to { opacity: 0; } }
.mt-window { position: relative; }

.mt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.mt-toast { min-height: 1.5em; margin: 10px 0 0; text-align: center; font-weight: 700; color: var(--cobalt); opacity: 0; }
.mt-toast.show { animation: toast 3s forwards; }
@keyframes toast { 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
.mt-summary { margin: 14px 0 0; padding: 14px 16px; border: 2px dashed rgba(14, 18, 34, .3); border-radius: 12px; background: #fff; display: grid; gap: 8px; }
.mt-summary div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; font-size: 14px; }
.mt-summary dt { font-family: var(--pixel); color: var(--ink-soft); }
.mt-summary dd { margin: 0; font-weight: 600; }
.mt-grade { padding: 1px 8px; border-radius: 6px; background: var(--g); border: 2px solid var(--ink); font-family: var(--pixel); font-weight: normal; }

/* ── 마무리 ─────────────────────────────── */
.final {
  padding: 80px var(--gutter) 40px;
  text-align: center;
  background:
    radial-gradient(circle, rgba(255, 246, 228, .07) 1.5px, transparent 1.6px) 0 0 / 14px 14px,
    var(--ink);
  color: var(--cream);
}
.final-text { margin: 0 auto 28px; max-width: 26em; font-family: var(--pixel); font-size: clamp(19px, 3.6vw, 28px); line-height: 1.6; }
.final .btn { box-shadow: 4px 4px 0 var(--teal); }
.final .small { margin: 56px 0 0; font-size: 13px; opacity: .55; }
.final .credit { margin: 10px 0 0; font-size: 11.5px; line-height: 1.6; opacity: .45; }
.final .credit a { color: inherit; }

/* ── 누르는 자리 도트 이펙트(fx.js) ───────── */
.tapfx { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.tapfx i { position: absolute; display: block; pointer-events: none; }
.tapfx-ring {
  width: 46px; height: 46px;
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 2px var(--ink);
}
.tapfx-px { width: 8px; height: 8px; box-shadow: 0 0 0 1.5px var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
