/* 도트 게임 버전 — GBA 배틀 */
@font-face {
  font-family: 'DungGeunMo';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/DungGeunMo.woff')
    format('woff');
  font-display: swap;
}
:root {
  --ink: #1a1a1a;
  --paper: #f8f8f0;
  --green: #8fbc5a;
  --pink: #ffb3c7;
  --yellow: #f5c400;
  --cream: #fff7d6;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: #2b2b2b;
}
body {
  margin: 0;
  min-height: 100svh;
  background: #2b2b2b;
  color: var(--ink);
  font-family: 'DungGeunMo', 'Galmuri11', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}
:root {
  --fclean: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', system-ui, sans-serif;
}
::selection {
  background: var(--yellow);
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
button,
a {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.px {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
[hidden] {
  display: none !important;
}

.wrap {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 14px
    calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.gb {
  width: 100%;
  max-width: 400px;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow:
    0 0 0 4px var(--pink),
    0 0 0 8px var(--ink);
  position: relative;
}
.hint {
  margin: 14px 0 0;
  font-size: 11px;
  color: #8a8a7a;
  letter-spacing: 0.1em;
}

/* ---------- scene ---------- */
.scene {
  position: relative;
  aspect-ratio: 200 / 148;
  overflow: hidden;
  background: url(assets/battle_bg.png) center / cover no-repeat;
  image-rendering: pixelated;
}
.flash {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.scene.is-enter .flash {
  animation: encounter 1s steps(1) both;
}
@keyframes encounter {
  0% {
    opacity: 1;
    background: #1a1a1a;
  }
  15% {
    opacity: 1;
    background: #fff;
  }
  30% {
    opacity: 1;
    background: #1a1a1a;
  }
  45% {
    opacity: 1;
    background: #fff;
  }
  60% {
    opacity: 1;
    background: #1a1a1a;
  }
  75% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.scene.is-anim .flash {
  animation: hit 0.5s steps(1) both;
}
@keyframes hit {
  0%,
  100% {
    opacity: 0;
  }
  20%,
  60% {
    opacity: 0.55;
    background: #fff;
  }
  40%,
  80% {
    opacity: 0;
  }
}

.status {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.status__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px;
  background: rgba(248, 248, 240, 0.92);
  border: 2px solid var(--ink);
  border-radius: 2px;
}
.status--bride {
  left: 8px;
  top: 10px;
  width: 125px;
}
.status--groom {
  right: 8px;
  bottom: 12px;
  width: 125px;
}
.gauge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: #fff;
}
.gauge__tag {
  font-size: 9px;
  background: var(--ink);
  color: #fff;
  padding: 0 3px;
}
.gauge__bar {
  flex: 1;
  height: 6px;
  background: #dcdcd0;
  position: relative;
}
.gauge__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #e04040;
  transition: width 0.6s steps(8);
}
.balls {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 4px;
  background: rgba(248, 248, 240, 0.92);
  border: 2px solid var(--ink);
  border-radius: 2px;
}
.balls i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
}
.balls i.is-used {
  background: var(--yellow);
}
.status__rule {
  width: 100%;
  height: 3px;
  background: var(--ink);
  margin-top: 2px;
}
.status__tag {
  padding: 0 5px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  align-self: center;
}

/* 신부: 잔디 위에 선다 (발 위치 ≈ 74%) */
.platform {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  background: rgba(40, 80, 30, 0.22);
}
.platform--bride {
  right: 5%;
  top: 67%;
  width: 40%;
  height: 9%;
}
.bride {
  position: absolute;
  right: 9%;
  top: 29%;
  z-index: 3;
  width: 128px;
  height: 128px;
}
.bride.is-caught {
  z-index: 6;
}
.bride__sprite {
  width: 128px;
  height: 128px;
  background: url(assets/bride_idle_strip.png) 0 0 / 640px 128px no-repeat;
  image-rendering: pixelated;
  animation: brideFrames 1.8s steps(5) infinite;
  transform-origin: 50% 100%;
}
@keyframes brideFrames {
  to {
    background-position: -640px 0;
  }
}
.bride.is-happy {
  animation: gbBounce 0.9s ease-in-out 2;
}
.bride.is-dizzy .bride__sprite {
  background-image: url(assets/bride_dizzy_strip.png);
  animation:
    brideFrames 0.7s steps(5) infinite,
    brideWobble 1.1s ease-in-out infinite;
}
@keyframes brideWobble {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}
/* 반지 속으로: 몸 중심(반지 위치)을 축으로 회전하며 축소 */
.bride.is-caught .bride__sprite {
  transform-origin: 50% 50%;
  animation: gbCaught 0.85s cubic-bezier(0.55, 0, 0.85, 0.25) forwards;
}
@keyframes gbCaught {
  0% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: scale(0.03) rotate(900deg);
    opacity: 0;
  }
}
@keyframes gbBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-14px);
  }
  60% {
    transform: translateY(0);
  }
  80% {
    transform: translateY(-6px);
  }
}

/* 별 궤도: 머리 둘레를 타원으로 돈다 */
.orbit {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 0;
  height: 0;
  pointer-events: none;
}
.orbit i {
  position: absolute;
  left: -14px;
  top: -14px;
  width: 28px;
  height: 28px;
  background: url(assets/fx_star.png) center / contain no-repeat;
  image-rendering: pixelated;
  animation: orbit 1.2s linear infinite;
}
.orbit i:nth-child(2) {
  animation-delay: -0.4s;
}
.orbit i:nth-child(3) {
  animation-delay: -0.8s;
}
@keyframes orbit {
  0% {
    transform: translate(52px, 0) scale(1);
    opacity: 1;
  }
  12.5% {
    transform: translate(37px, 12px) scale(1.08);
  }
  25% {
    transform: translate(0, 18px) scale(1.15);
    opacity: 1;
  }
  37.5% {
    transform: translate(-37px, 12px) scale(1.08);
  }
  50% {
    transform: translate(-52px, 0) scale(1);
    opacity: 1;
  }
  62.5% {
    transform: translate(-37px, -12px) scale(0.9);
  }
  75% {
    transform: translate(0, -18px) scale(0.82);
    opacity: 0.85;
  }
  87.5% {
    transform: translate(37px, -12px) scale(0.9);
  }
  100% {
    transform: translate(52px, 0) scale(1);
    opacity: 1;
  }
}
/* 하트: 머리 위로 떠오른다 */
.hearts {
  position: absolute;
  left: 0;
  top: -6px;
  width: 128px;
  height: 40px;
  pointer-events: none;
}
.hearts i {
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 24px;
  background: url(assets/fx_heart.png) center / contain no-repeat;
  image-rendering: pixelated;
  animation: heartUp 1.3s ease-out infinite;
  opacity: 0;
}
.hearts i:nth-child(1) {
  left: 22px;
}
.hearts i:nth-child(2) {
  left: 52px;
  animation-delay: 0.45s;
}
.hearts i:nth-child(3) {
  left: 82px;
  animation-delay: 0.9s;
}
@keyframes heartUp {
  0% {
    transform: translateY(6px) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-34px) scale(1.05);
    opacity: 0;
  }
}
/* 반지: 도착(불빛) → 잔디로 낙하 → 탭마다 발버둥 → 잠김 */
.ringfx {
  position: absolute;
  left: 41px;
  top: 40px;
  width: 48px;
  height: 48px;
  z-index: 4;
}
.ringfx.is-drop {
  animation: ringDrop 1.1s cubic-bezier(0.35, 0.8, 0.5, 1.25) both 0.55s;
}
@keyframes ringDrop {
  0% {
    transform: translateY(-4px) scale(0.7);
    opacity: 0;
  }
  18% {
    transform: translateY(-12px) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateY(34px) scale(1);
    opacity: 1;
  }
}
.ringfx__ring {
  display: block;
  width: 48px;
  height: 48px;
  background: url(assets/item_ring.png) center / contain no-repeat;
  image-rendering: pixelated;
  transform-origin: 50% 88%;
}
.ringfx.is-shake .ringfx__ring {
  animation: ringShake 0.75s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes ringShake {
  0% {
    transform: rotate(0) translateX(0);
  }
  14% {
    transform: rotate(-30deg) translateX(-4px);
  }
  32% {
    transform: rotate(26deg) translateX(4px);
  }
  50% {
    transform: rotate(-16deg) translateX(-2px);
  }
  68% {
    transform: rotate(9deg) translateX(1px);
  }
  84% {
    transform: rotate(-4deg);
  }
  100% {
    transform: rotate(0);
  }
}
.ringfx.is-locked .ringfx__ring {
  animation: ringLock 0.55s ease-out both;
}
@keyframes ringLock {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  30% {
    transform: scale(1.3);
    filter: brightness(1.8);
  }
  60% {
    transform: scale(0.92);
    filter: brightness(1);
  }
  100% {
    transform: scale(1);
  }
}

/* 신랑: 3배 확대 후 하반신은 프레임 아래로 (상반신만 보임) */
.groom {
  position: absolute;
  left: -30px;
  bottom: -132px;
  z-index: 4;
  width: 288px;
  height: 288px;
  pointer-events: none;
}
.groom__sprite {
  width: 288px;
  height: 288px;
  background: url(assets/groom_strip.png) -1728px 0 / 2016px 288px no-repeat;
  image-rendering: pixelated;
  transform: scaleX(-1);
}
.groom.is-throw .groom__sprite {
  animation: groomThrow 0.6s steps(5, end) forwards;
}
@keyframes groomThrow {
  from {
    background-position: -288px 0;
  }
  to {
    background-position: -1728px 0;
  }
}

.fly {
  position: absolute;
  left: 150px;
  bottom: 118px;
  z-index: 6;
  pointer-events: none;
}
.fly img {
  width: 64px;
  height: 64px;
  display: block;
}
.fly.is-throw {
  animation: gbThrow 0.8s ease-in-out forwards;
}
.fly.is-drop {
  animation: gbDrop 1.2s ease-in-out forwards;
}
@keyframes gbThrow {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  50% {
    transform: translate(56px, -96px) rotate(180deg);
  }
  100% {
    transform: translate(111px, -16px) rotate(360deg);
  }
}
@keyframes gbDrop {
  0% {
    transform: translate(111px, -280px);
  }
  70% {
    transform: translate(111px, -16px);
  }
  80% {
    transform: translate(111px, -30px);
  }
  100% {
    transform: translate(111px, -16px);
  }
}
@keyframes gbArrow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 하단 패널 (내용에 맞춘 높이: 메뉴는 항상 렌더되어 플레이 중 높이 고정) ---------- */
.panel {
  position: relative;
  border-top: 4px solid var(--ink);
  display: flex;
  flex-direction: column;
}
.textwrap {
  padding: 6px 6px 4px;
}
.textbox {
  position: relative;
  min-height: 85px;
  padding: 14px 16px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 4px var(--ink);
  font-size: 17px;
  line-height: 1.5;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.msg {
  white-space: pre-wrap;
  word-break: keep-all;
}
.arrow {
  position: absolute;
  right: 14px;
  bottom: 6px;
  font-size: 12px;
  animation: gbArrow 0.6s steps(1) infinite;
}
.menu {
  flex: 1;
  padding: 0 6px 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 5px 2px 4px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  font-size: 16px;
  line-height: 1.2;
  -webkit-font-smoothing: none;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.25s;
}
.item img {
  width: 48px;
  height: 48px;
}
.item:hover:not(:disabled) {
  background: var(--cream);
}
.item:active:not(:disabled) {
  transform: translateY(1px);
}
.item:disabled {
  opacity: 0.35;
  cursor: default;
}
.item.is-unlocked {
  background: var(--cream);
  box-shadow: inset 0 0 0 2px var(--yellow);
}
.item:hover:not(:disabled)::before {
  content: '▶';
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 9px;
  animation: gbArrow 0.6s steps(1) infinite;
}
.item span {
  font-size: 14px;
}

/* ---------- 포켓몬 메뉴식 버튼 ---------- */
.gbtn {
  position: relative;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px #fff,
    inset 0 0 0 2px var(--ink),
    3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s,
    color 0.12s;
}
.gbtn:hover {
  background: var(--cream);
}
.gbtn:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.gbtn:active {
  background: var(--ink);
  color: #fff;
  box-shadow:
    inset 0 0 0 1px var(--ink),
    inset 0 0 0 2px #fff;
  transform: translate(3px, 3px);
}
.gbtn--green {
  background: var(--green);
}
.gbtn--yellow {
  background: var(--yellow);
}
.gbtn--sm {
  flex: none;
  padding: 7px 10px;
  font-size: 16px;
}
.gbtn.is-done {
  background: var(--yellow);
}
.gbtn.is-done::before {
  content: '✓';
}

/* ---------- 미니 도감 (아이템 자리) ---------- */
.dexmini {
  flex: none;
  margin: 0 6px 6px;
  scroll-margin-top: 12px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 12px 8px 8px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 4px var(--ink);
  background: #fff;
  font-size: 16px;
  -webkit-font-smoothing: none;
  animation: fadeUp 0.4s both;
  min-height: 0;
}
.dexmini__pic {
  width: 72px;
  height: 72px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--cream) url(assets/battle_bg.png) center / cover;
  display: grid;
  place-items: center;
}
.dexmini__sprite {
  width: 48px;
  height: 48px;
  background: url(assets/bride.png) center / contain no-repeat;
  image-rendering: pixelated;
}
.dexmini__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.dexmini__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  white-space: nowrap;
}
.dexmini__head b {
  font-weight: 400;
}
.dexmini__no {
  padding: 0 5px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
}
.dexmini__badge {
  padding: 0 5px;
  background: var(--yellow);
  font-size: 16px;
}
.dexmini__list {
  margin: 0;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 6px;
  font-size: 16px;
  line-height: 1.2;
}
.dexmini__list dt {
  color: #7a7a6a;
}
.dexmini__list dd {
  margin: 0;
  word-break: keep-all;
}

/* ---------- 안내 (모바일 청첩장 구성, 프레임 안·도감 아래) ---------- */
.mobi {
  padding: 0 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeUp 0.5s both 0.15s;
  font-family: 'DungGeunMo', monospace;
  font-size: 16px;
  -webkit-font-smoothing: none;
}
.mobi .gbtn,
.mobi .gform input,
.mobi .gform textarea {
  font-family: 'DungGeunMo', monospace;
  font-size: 16px;
}
.mbox {
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 4px var(--ink);
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.mbox__h {
  margin: 0 0 4px;
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1px;
  border-radius: 3px;
}
.mbox__h::before {
  content: '▸ ';
  color: var(--yellow);
}
.mbox__quote {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px var(--cream),
    inset 0 0 0 2px var(--ink);
  background: var(--cream);
  font-size: 16px;
}
.mbox__quote span {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: #7a7a6a;
  text-align: center;
}
.mbox__p {
  margin: 0;
  word-break: keep-all;
}
.mbox__p b {
  font-size: 18px;
}
.mbox__p--dim {
  color: #6a6a5a;
  font-size: 16px;
}
.mbox__cast {
  margin-top: 2px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.mbox__cast small {
  margin-bottom: 8px;
}
.mbox__cast small:last-child {
  margin-bottom: 0;
}
.mbox__cast small {
  color: #6a6a5a;
  font-size: 16px;
}
.mbox__cast b {
  color: #000000;
  font-weight: 500;
}
.mbox__dday {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  color: #e8507a;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 6px;
  text-align: center;
  font-size: 16px;
}
.cal__dow {
  color: #8a8a7a;
  font-size: 16px;
}
.cal__dow--sun {
  color: #e04040;
}
.cal__dow--sat {
  color: #3b6fd6;
}
.cal__d {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.cal__d--sun {
  color: #e04040;
}
.cal__d--sat {
  color: #3b6fd6;
}
.cal__d--wed {
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
}
.gal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
/* 도감 항목 칸 */
.dexslot {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.dexslot__no {
  display: block;
  padding: 2px 6px;
  background: var(--ink);
  color: #9be36d;
  font-size: 16px;
  line-height: 1.1;
}
.dexslot__pic {
  position: relative;
  aspect-ratio: 1;
  background: var(--paper);
  overflow: hidden;
}
.dexslot__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}
.dexslot__q {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: #b8b8a8;
}
.dexslot--photo:hover .dexslot__pic img,
.dexslot--photo:focus-visible .dexslot__pic img {
  filter: brightness(1.06);
}
.dexslot--photo::after {
  content: '▶';
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 16px;
  color: #fff;
  text-shadow:
    1px 1px 0 var(--ink),
    -1px -1px 0 var(--ink),
    1px -1px 0 var(--ink),
    -1px 1px 0 var(--ink);
  opacity: 0;
}
.dexslot--photo:hover::after,
.dexslot--photo:focus-visible::after {
  opacity: 1;
  animation: gbArrow 0.6s steps(1) infinite;
}
.dexslot--empty {
  cursor: default;
}
.dexslot--empty .dexslot__no {
  color: #8a8a7a;
}
.gal__note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 16px;
  color: #8a8a7a;
}

/* ---------- 포켓몬 도감 미리보기 ---------- */
.pkdex {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
}
.pkdex__dim {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.78);
}
.pkdex__shell {
  position: relative;
  width: min(100%, 380px);
  border: 4px solid var(--ink);
  border-radius: 12px 12px 10px 10px;
  background: #e3350d;
  box-shadow:
    inset 0 0 0 3px #f5613f,
    inset 0 0 0 5px #a41f13,
    0 12px 0 #7d150d;
  padding: 12px 12px 14px;
  font-family: 'DungGeunMo', monospace;
  color: #fff;
  animation: dexIn 0.35s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
@keyframes dexIn {
  from {
    transform: translateY(24px) scale(0.94);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.pkdex__top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-bottom: 10px;
}
.pkdex__lens {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: radial-gradient(circle at 35% 35%, #dff2ff 0 6px, #5aa9ff 7px 14px, #1f5fbf 15px);
  box-shadow: 0 0 0 3px #fff;
  animation: lensGlow 2.4s ease-in-out infinite;
}
@keyframes lensGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 3px #fff,
      0 0 0 0 rgba(90, 169, 255, 0);
  }
  50% {
    box-shadow:
      0 0 0 3px #fff,
      0 0 10px 4px rgba(90, 169, 255, 0.55);
  }
}
.pkdex__leds {
  display: flex;
  gap: 5px;
  align-self: flex-start;
  margin-top: 2px;
}
.pkdex__leds i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}
.pkdex__leds i:nth-child(1) {
  background: #ff5050;
  animation: ledBlink 1.2s steps(1) infinite;
}
.pkdex__leds i:nth-child(2) {
  background: #ffd23f;
}
.pkdex__leds i:nth-child(3) {
  background: #52d97a;
}
@keyframes ledBlink {
  50% {
    background: #7a1a1a;
  }
}
.pkdex__title {
  margin-left: auto;
  margin-right: 8px;
  font-size: 16px;
  letter-spacing: 2px;
  color: #ffd6cc;
  text-shadow: 1px 1px 0 var(--ink);
}
.pkdex__close {
  width: 34px;
  height: 34px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #2b2b2b;
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 var(--ink);
}
.pkdex__close:active {
  transform: translateY(3px);
  box-shadow: none;
}
.pkdex__screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 4px solid var(--ink);
  border-radius: 6px 6px 6px 22px;
  background: #dedede;
  padding: 10px;
  box-shadow: inset 0 0 0 6px #f4f4f4;
  overflow: hidden;
}
.pkdex__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--ink);
  background: #000;
}
.pkdex__scan {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  height: 2px;
  background: rgba(155, 227, 109, 0.75);
  box-shadow: 0 0 8px 2px rgba(155, 227, 109, 0.5);
  animation: scan 1.1s ease-out both;
  pointer-events: none;
}
@keyframes scan {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(260px);
    opacity: 0;
  }
}
.pkdex__info {
  margin-top: 10px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  border-radius: 4px;
  min-height: 85px;
  background: #2b2b2b;
  color: #9be36d;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  font-size: 16px;
  line-height: 1.25;
}
.pkdex__no {
  color: #ffd23f;
}
.pkdex__name {
  color: #fff;
}
.pkdex__desc {
  grid-column: 1 / -1;
  color: #9be36d;
}
.pkdex__ctrl {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pkdex__pad {
  position: relative;
  width: 34px;
  height: 34px;
}
.pkdex__pad::before,
.pkdex__pad::after {
  content: '';
  position: absolute;
  background: #2b2b2b;
  border: 2px solid var(--ink);
  border-radius: 2px;
}
.pkdex__pad::before {
  left: 11px;
  top: 0;
  width: 12px;
  height: 34px;
}
.pkdex__pad::after {
  left: 0;
  top: 11px;
  width: 34px;
  height: 12px;
}
.pkdex__btn {
  flex: none;
  width: 44px;
  height: 36px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}
.pkdex__btn:active {
  transform: translateY(3px);
  box-shadow: none;
}
.pkdex__btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pkdex__count {
  flex: 1;
  text-align: center;
  font-size: 16px;
  color: #fff;
  text-shadow: 1px 1px 0 var(--ink);
}
.pkdex__ab {
  display: flex;
  gap: 6px;
}
.pkdex__ab i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}
.pkdex__ab .a {
  background: #52d97a;
}
.pkdex__ab .b {
  background: #5aa9ff;
}
@media (prefers-reduced-motion: reduce) {
  .pkdex__shell,
  .pkdex__lens,
  .pkdex__leds i,
  .pkdex__scan {
    animation: none;
  }
}

.mapf__naver { position: absolute !important; inset: 0; width: 100%; height: 100%; z-index: 2; }
.mapf__naver[hidden] { display: none !important; }
/* 지도 마커: 텍스트 창 프레임 + 픽셀 핀 */
.nvmk { width: 200px; height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; font-family: 'DungGeunMo', monospace; -webkit-font-smoothing: none; }
.nvmk__box { padding: 5px 10px; border: 3px solid var(--ink); background: #fff; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--ink); font-size: 16px; line-height: 1.25; text-align: center; color: var(--ink); white-space: nowrap; }
.nvmk__pin { display: block; width: 52px; height: 64px; image-rendering: pixelated; animation: pinBob 1.2s steps(2) infinite; }
@keyframes pinBob { 50% { transform: translateY(-4px); } }
.mapf {
  position: relative;
  height: 220px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
}
.mapf::before {
  content: '지도를 불러오는 중… 안 뜨면 아래 버튼으로 열어주세요';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1.4;
  color: #8a8a7a;
}
.mapf iframe {
  position: relative;
}
.mapf iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.mrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mrow .gbtn {
  flex: 1 1 auto;
}
.way {
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px 8px;
  font-size: 16px;
  align-items: start;
}
.way dt {
  padding: 2px 4px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  text-align: center;
  font-size: 16px;
}
.way dd {
  margin: 0;
  word-break: keep-all;
}
.way small {
  color: #6a6a5a;
}
.acct {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 6px 8px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px var(--paper),
    inset 0 0 0 2px var(--ink);
  background: var(--paper);
  font-size: 16px;
}
.acct__tag {
  grid-row: 1;
  grid-column: 1;
}
.acct b {
  grid-row: 1;
  grid-column: 2;
}
.acct .gbtn {
  grid-row: 1;
  grid-column: 3;
}
.acct__num {
  grid-row: 2;
  grid-column: 1 / -1;
}
.acct b {
  font-weight: 600;
}
.acct__tag {
  padding: 1px 6px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
}
.acct__num {
  color: #3a3a2a;
  font-size: 16px;
}
.gbook {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gbook__item {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px var(--cream),
    inset 0 0 0 2px var(--ink);
  background: var(--cream);
  font-size: 16px;
  word-break: break-word;
}
.gbook__item b {
  display: block;
  margin-bottom: 2px;
  font-weight: 400;
  font-size: 16px;
  color: #e8507a;
}
.gform {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gform input,
.gform textarea {
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px #fff,
    inset 0 0 0 2px var(--ink);
  background: #fff;
  resize: none;
}
.gform input:focus,
.gform textarea:focus {
  outline: none;
  box-shadow:
    inset 0 0 0 1px #fff,
    inset 0 0 0 2px var(--ink),
    0 0 0 3px var(--yellow);
}
.gbtn--kakao {
  background: #fee500;
}
.gbtn--kakao:hover {
  background: #ffef66;
}
.mbox__fin {
  margin: 4px 0 0;
  text-align: center;
  font-size: 16px;
  color: #e8507a;
}
.mbox__links {
  margin: 6px 0 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  color: #9a9a8a;
}
.tlink {
  padding: 0;
  border: 0;
  background: none;
  color: #6a6a5a;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font: inherit;
}
.tlink:hover::before,
.tlink:focus-visible::before {
  content: '▶ ';
  font-size: 9px;
}
.tlink:hover {
  color: var(--ink);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  translate: -50% 0;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 4px var(--ink);
  background: #fff;
  font-size: 16px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.25s;
  z-index: 20;
}
.toast.is-show {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .scene.is-enter .flash,
  .scene.is-anim .flash,
  .arrow,
  .orbit i,
  .hearts i,
  .ringfx.is-shake .ringfx__ring,
  .bride.is-happy,
  .bride__sprite,
  .groom.is-throw .groom__sprite {
    animation: none;
  }
  .ringfx.is-drop {
    animation-duration: 0.01s;
    animation-delay: 0s;
  }
  .hearts i {
    opacity: 1;
  }
  .fly.is-throw,
  .fly.is-drop {
    animation-duration: 0.01s;
  }
  .gauge__fill {
    transition: none;
  }
}

/* ---------- 엔딩 장면: 손잡은 두 사람 ---------- */
.scene.is-final .status,
.scene.is-final .groom,
.scene.is-final .bride,
.scene.is-final .platform--bride,
.scene.is-final .fly {
  display: none;
}
.couple {
  position: absolute;
  left: 50%;
  bottom: 20%;
  translate: -50% 0;
  z-index: 3;
  width: 256px;
  height: 128px;
  animation: coupleIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes coupleIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.couple__sprite {
  width: 256px;
  height: 128px;
  background: url(assets/couple.png) center / contain no-repeat;
  image-rendering: pixelated;
}
@keyframes coupleBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
.hearts--couple {
  left: 16px;
  top: -14px;
  width: 224px;
  height: 40px;
}
.hearts--couple i:nth-child(1) {
  left: 30px;
  animation-duration: 1.7s;
}
.hearts--couple i:nth-child(2) {
  left: 84px;
  animation-delay: 0.5s;
  animation-duration: 1.9s;
}
.hearts--couple i:nth-child(3) {
  left: 138px;
  animation-delay: 1s;
  animation-duration: 1.6s;
}
.hearts--couple i:nth-child(4) {
  left: 186px;
  animation-delay: 1.4s;
  animation-duration: 2s;
}
.scene.is-final .platform--couple {
  display: block;
}

/* ---------- 엔딩 문구 (하늘) ---------- */
.fin {
  position: absolute;
  left: 0;
  right: 0;
  top: 11%;
  z-index: 3;
  text-align: center;
  pointer-events: none;
  animation: finIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.6s;
}
.fin__line {
  display: inline-block;
  font-size: 21px;
  letter-spacing: 1px;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap;
}
@keyframes finIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 잡았다! 별 폭죽 + 배너 ---------- */
.burst {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}
.burst i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 20px);
  height: var(--s, 20px);
  margin: -10px;
  background: url(assets/fx_star.png) center / contain no-repeat;
  image-rendering: pixelated;
  animation: burst var(--t, 0.9s) cubic-bezier(0.1, 0.8, 0.3, 1) both;
  animation-delay: var(--d, 0s);
  opacity: 0;
}
.burst i.h {
  background-image: url(assets/fx_heart.png);
}
@keyframes burst {
  0% {
    transform: translate(0, 0) scale(0.3) rotate(0);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1.05) rotate(200deg);
    opacity: 0;
  }
}
.banner {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 9;
  translate: -50% -50%;
  font-size: 36px;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
  white-space: nowrap;
  animation: pop 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both;
  pointer-events: none;
}
@keyframes pop {
  0% {
    transform: scale(0.2) rotate(-8deg);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(-3deg);
    opacity: 1;
  }
}
.banner.is-out {
  animation: bannerOut 0.4s ease-in both;
}
@keyframes bannerOut {
  to {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* ---------- 타이틀 화면 ---------- */
.title {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  overflow: hidden;
}
.title > * {
  position: relative;
}
.title__pre {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #e8507a;
  animation: fadeUp 0.6s both;
}
.title__logo {
  margin: 0;
  font-size: 44px;
  line-height: 1.12;
  font-weight: 400;
  color: var(--ink);
  text-shadow:
    4px 4px 0 #ffb3c7,
    7px 7px 0 #ffe066;
  animation: logoIn 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both 0.15s;
}
@keyframes logoIn {
  from {
    transform: scale(0.4) translateY(-30px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.title__sub {
  margin: 0;
  font-size: 15px;
  color: #c98a1e;
  animation: fadeUp 0.6s both 0.5s;
}
.title__art {
  width: 256px;
  height: 128px;
  margin: 6px 0;
  animation: fadeUp 0.6s both 0.7s;
}
.title__couple {
  width: 256px;
  height: 128px;
  background: url(assets/couple.png) center / contain no-repeat;
  image-rendering: pixelated;
}
.title__date {
  margin: 0;
  font-size: 12px;
  color: #5c5c68;
  letter-spacing: 0.1em;
  animation: fadeUp 0.6s both 0.85s;
}
.title__start {
  margin-top: 6px;
  padding: 12px 22px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2px #fff,
    inset 0 0 0 4px var(--ink),
    4px 4px 0 #ffb3c7;
  animation: blinkSlow 1.2s steps(1) infinite;
}
.title__start:hover {
  background: var(--cream);
}
.title.is-starting .title__start {
  animation: blinkFast 0.45s steps(1) 3;
  background: var(--ink);
  color: #fff;
}
.title__note {
  margin: 0;
  font-size: 10px;
  color: #9a9a8a;
  animation: fadeUp 0.6s both 1s;
}
@keyframes blinkSlow {
  0%,
  60% {
    opacity: 1;
  }
  61%,
  100% {
    opacity: 0.25;
  }
}
@keyframes blinkFast {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.2;
  }
}
.title.is-done {
  animation: titleOut 0.35s ease-in both;
  pointer-events: none;
}
@keyframes titleOut {
  to {
    opacity: 0;
  }
}

/* ---------- 구름 (두 층 시차) ---------- */
.clouds {
  position: absolute;
  left: 0;
  width: 200%;
  z-index: 1;
  pointer-events: none;
  background: url(assets/clouds.png) 0 0 / 50% 100% repeat-x;
  image-rendering: pixelated;
  animation: drift linear infinite;
}
.clouds--far {
  top: 3%;
  height: 15%;
  opacity: 0.55;
  animation-duration: 150s;
}
.clouds--near {
  top: 12%;
  height: 21%;
  animation-duration: 85s;
}
@keyframes drift {
  to {
    transform: translateX(-50%);
  }
}
.scene.is-final .clouds {
  z-index: 1;
}

/* ---------- 타이틀 이펙트: 꽃가루·부케·폭죽 ---------- */
.title > .petals,
.title > .bouquets,
.title > .burst--title {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.petals i {
  position: absolute;
  left: var(--x);
  top: -12px;
  width: var(--s);
  height: var(--s);
  background: var(--c);
  opacity: 0;
  animation: petal var(--t) linear infinite;
  animation-delay: var(--d);
}
.petals i.r {
  border-radius: 50% 0;
}
@keyframes petal {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 0;
  }
  6% {
    opacity: 0.95;
  }
  25% {
    transform: translate(10px, 140px) rotate(90deg);
  }
  50% {
    transform: translate(-8px, 280px) rotate(200deg);
  }
  75% {
    transform: translate(10px, 420px) rotate(290deg);
  }
  96% {
    opacity: 0.9;
  }
  100% {
    transform: translate(0, 560px) rotate(360deg);
    opacity: 0;
  }
}
.bouquets i {
  position: absolute;
  left: -56px;
  top: 60%;
  width: 48px;
  height: 48px;
  background: url(assets/item_flower.png) center / contain no-repeat;
  image-rendering: pixelated;
  opacity: 0;
  animation: toss 4.2s cubic-bezier(0.3, 0.1, 0.6, 1) infinite;
}
.bouquets i:nth-child(2) {
  animation-delay: 1.6s;
  animation-duration: 4.8s;
  top: 70%;
  transform: scaleX(-1);
  animation-name: tossBack;
}
.bouquets i:nth-child(3) {
  animation-delay: 3.1s;
  animation-duration: 5.2s;
  top: 56%;
}
@keyframes toss {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  50% {
    transform: translate(230px, -260px) rotate(360deg);
  }
  95% {
    opacity: 1;
  }
  100% {
    transform: translate(480px, 40px) rotate(720deg);
    opacity: 0;
  }
}
@keyframes tossBack {
  0% {
    transform: translate(480px, 0) rotate(0);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  50% {
    transform: translate(250px, -280px) rotate(-360deg);
  }
  95% {
    opacity: 1;
  }
  100% {
    transform: translate(0, 40px) rotate(-720deg);
    opacity: 0;
  }
}
.title > * {
  position: relative;
}
.title > .petals,
.title > .bouquets,
.title > .burst--title {
  position: absolute;
}

/* ---------- 등장 슬라이드 ---------- */
.bride,
.groom,
.status--bride,
.status--groom,
.platform--bride {
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.4s;
}
.scene.is-intro .bride {
  transform: translateX(260px);
}
.scene.is-intro .platform--bride {
  opacity: 0;
}
.scene.is-intro .groom {
  transform: translateX(-340px);
}
.scene.is-intro .status--bride {
  transform: translateY(-70px);
  opacity: 0;
}
.scene.is-intro .status--groom {
  transform: translateY(70px);
  opacity: 0;
}
.scene.is-intro .status {
  transition-delay: 0.35s;
}
.bride.is-happy {
  transition: none;
}

/* ---------- 사운드 버튼 ---------- */
.snd {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 6;
  width: 30px;
  height: 30px;
  padding: 4px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: rgba(248, 248, 240, 0.92);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.snd svg {
  width: 18px;
  height: 18px;
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.snd .snd__wave,
.snd .snd__x {
  fill: none;
}
.snd .snd__x {
  display: none;
}
.snd[aria-pressed='false'] .snd__wave {
  display: none;
}
.snd[aria-pressed='false'] .snd__x {
  display: block;
}
.scene.is-final .snd {
  display: grid;
}

@media (prefers-reduced-motion: reduce) {
  .title__logo,
  .title__start,
  .title.is-starting .title__start,
  .clouds,
  .fin,
  .petals i,
  .bouquets i {
    animation: none;
  }
  .bride,
  .groom,
  .status--bride,
  .status--groom,
  .platform--bride {
    transition-duration: 0.01s;
  }
}
