:root {
  --ink: #211b17;
  --muted: #786f66;
  --paper: #fffaf1;
  --card: #fffdf8;
  --line: #ecd7bb;
  --line-strong: #d8b988;
  --gold: #be8c3d;
  --copper: #9f5b3b;
  --teal: #296f68;
  --sage: #dbe5d4;
  --shadow: 0 18px 45px rgba(71, 48, 26, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(41, 111, 104, 0.14), transparent 28rem),
    linear-gradient(135deg, #fffefd 0%, #fff6e8 52%, #f6fbf5 100%);
}

body:has(.menu-overlay:not([hidden])) {
  overflow: hidden;
}

button {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 40px);
}

.flow-board {
  width: min(430px, 100%);
}

.flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.stage {
  position: relative;
  display: none;
  opacity: 0;
  transform: translateX(18px);
}

.stage.is-active {
  display: block;
  opacity: 1;
  transform: translateX(0);
  animation: stageEnter 260ms ease both;
}

.stage.is-active .phone-screen {
  border-color: var(--gold);
  box-shadow: var(--shadow), 0 0 0 3px rgba(190, 140, 61, 0.18);
}

.stage-label {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stage-label strong {
  font-size: 18px;
  white-space: nowrap;
}

.stage-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  background: #191512;
  border-radius: 50%;
}

.phone-screen {
  min-height: 590px;
  padding: 70px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 14px 34px rgba(99, 71, 38, 0.09);
  transition: border-color 260ms ease, box-shadow 260ms ease;
}

.phone-header {
  height: 36px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
  font-weight: 800;
}

.icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-content: center;
  gap: 4px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
}

.icon-button span {
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.icon-button,
.menu-close,
.menu-item {
  cursor: pointer;
}

.icon-button:focus-visible,
.menu-close:focus-visible,
.menu-item:focus-visible {
  outline: 3px solid rgba(41, 111, 104, 0.42);
  outline-offset: 2px;
}

.menu-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(33, 27, 23, 0.32);
}

.menu-overlay[hidden] {
  display: none;
}

.app-menu {
  width: min(398px, 100%);
  min-height: 310px;
  padding: 27px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 24px 56px rgba(33, 27, 23, 0.24);
}

.menu-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 23px;
  border-bottom: 2px solid var(--ink);
}

.menu-heading strong {
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 900;
  letter-spacing: 0;
}

.menu-close {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  font-size: 31px;
  line-height: 1;
  background: transparent;
}

.menu-list {
  display: grid;
  margin-top: 10px;
}

.menu-item {
  min-height: 68px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  font-size: 18px;
  font-weight: 800;
  background: transparent;
}

.menu-item::after {
  content: "›";
  float: right;
  color: var(--gold);
  font-size: 27px;
  line-height: 18px;
}

.menu-item:hover {
  color: var(--teal);
}

.tag-scene {
  width: 100%;
  min-height: 345px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.8), rgba(219, 229, 212, 0.54)),
    radial-gradient(circle at center, rgba(190, 140, 61, 0.18), transparent 52%);
  perspective: 900px;
}

.nfc-select-grid {
  width: 100%;
  min-height: 345px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.86), rgba(219, 229, 212, 0.58)),
    radial-gradient(circle at center, rgba(190, 140, 61, 0.18), transparent 52%);
}

.nfc-select-card {
  position: relative;
  min-height: 105px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid rgba(45, 36, 28, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
  box-shadow: 0 10px 22px rgba(71, 48, 26, 0.1);
  cursor: pointer;
  letter-spacing: 0;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.nfc-select-card:nth-child(5) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 5px);
}

.nfc-select-card::after {
  content: "NFC";
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  color: #fff;
  background: rgba(33, 27, 23, 0.84);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.nfc-select-card:hover,
.nfc-select-card.is-selected {
  transform: translateY(-2px);
  border-color: var(--teal);
  background: #f3fbf7;
  box-shadow:
    0 12px 24px rgba(41, 111, 104, 0.16),
    0 0 0 3px rgba(41, 111, 104, 0.13);
}

.nfc-select-card.is-completed {
  color: #6d5b48;
  border-color: rgba(190, 140, 61, 0.44);
  background: #f3eadc;
  box-shadow: none;
}

.nfc-select-card.is-completed:hover {
  transform: none;
  border-color: rgba(190, 140, 61, 0.44);
  background: #f3eadc;
  box-shadow: none;
}

.nfc-select-card.is-completed::after {
  content: "완료";
  background: #d64239;
}

.nfc-select-card:disabled {
  cursor: default;
}

.nfc-select-card:not(.is-selected):disabled:not(.is-completed) {
  opacity: 0.58;
}

.nfc-select-card strong {
  position: relative;
  z-index: 1;
  max-width: 100%;
  padding-inline: 5px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.16;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.nfc-complete-badge {
  position: absolute;
  z-index: 2;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(214, 66, 57, 0.28);
  border-radius: 999px;
  color: #a62c25;
  background: #fff7e7;
  font-size: 10px;
  font-weight: 900;
}

.nfc-complete-badge[hidden] {
  display: none;
}

.nfc-choice-mark {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  display: block;
  border: 3px solid #1b1713;
  border-radius: 50%;
  background: #f7dfb9;
  box-shadow:
    inset -6px -5px 0 rgba(33, 27, 23, 0.08),
    0 8px 12px rgba(41, 32, 24, 0.16);
}

.nfc-choice-mark::before,
.nfc-choice-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nfc-choice-mark::before {
  top: 8px;
  width: 31px;
  height: 18px;
  border-radius: 17px 17px 8px 8px;
  background: #1f1a16;
}

.nfc-choice-mark::after {
  bottom: 6px;
  width: 36px;
  height: 17px;
  border-radius: 13px 13px 10px 10px;
  background: #2d241c;
}

.nfc-choice-face {
  position: absolute;
  top: 19px;
  left: 50%;
  width: 27px;
  height: 24px;
  transform: translateX(-50%);
  border: 2px solid #1b1713;
  border-radius: 45% 45% 48% 48%;
  background: #f0c8a2;
}

.nfc-choice-face::before,
.nfc-choice-face::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 3px;
  height: 4px;
  border-radius: 50%;
  background: #1b1713;
}

.nfc-choice-face::before {
  left: 7px;
}

.nfc-choice-face::after {
  right: 7px;
}

.nfc-choice-wave {
  position: absolute;
  top: -5px;
  right: -7px;
  width: 24px;
  height: 24px;
  border: 3px solid var(--teal);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(45deg);
}

.nfc-choice-wave::before,
.nfc-choice-wave::after {
  content: "";
  position: absolute;
  border: 3px solid var(--teal);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}

.nfc-choice-wave::before {
  inset: 4px;
}

.nfc-choice-wave::after {
  inset: 11px;
}

.figure-yoon .nfc-choice-mark {
  background: #f7dfb9;
}

.figure-kim .nfc-choice-mark {
  background: #d6e4df;
}

.figure-kim .nfc-choice-mark::after {
  background: #1f4f4b;
}

.figure-yu .nfc-choice-mark {
  background: #f3d7df;
}

.figure-yu .nfc-choice-mark::after {
  background: #753b4d;
}

.figure-yun .nfc-choice-mark {
  background: #e8d7bb;
}

.figure-yun .nfc-choice-mark::after {
  background: #8a4a35;
}

.figure-ahn .nfc-choice-mark {
  background: #d8e0ef;
}

.figure-ahn .nfc-choice-mark::after {
  background: #2f4059;
}

.nfc-select-card:focus-visible,
.back-button:focus-visible,
.restart-button:focus-visible,
.answer-choice:focus-visible,
.next-action:focus-visible,
.primary-action:focus-visible,
.level-choice:focus-visible,
.quiz-answer-choice:focus-visible,
.keyword-action:focus-visible {
  outline: 3px solid rgba(41, 111, 104, 0.45);
  outline-offset: 3px;
}

.keyring-model {
  position: relative;
  width: 236px;
  height: 290px;
  transform-style: preserve-3d;
  animation: floatKeyring 3.4s ease-in-out infinite;
}

.ring {
  position: absolute;
  top: 3px;
  left: 86px;
  width: 64px;
  height: 64px;
  border: 8px solid #2b2926;
  border-top-color: #5d5a54;
  border-radius: 50%;
  transform: rotateX(58deg) rotateZ(-24deg);
  box-shadow: 0 12px 14px rgba(31, 27, 23, 0.22);
}

.chain-link {
  position: absolute;
  display: block;
  border: 5px solid #2c2926;
  border-radius: 18px;
  transform-style: preserve-3d;
}

.link-a {
  top: 57px;
  left: 101px;
  width: 34px;
  height: 54px;
  transform: rotateZ(24deg) rotateY(-22deg);
}

.link-b {
  top: 94px;
  left: 111px;
  width: 30px;
  height: 45px;
  transform: rotateZ(-18deg) rotateY(18deg);
}

.charm {
  position: absolute;
  left: 14px;
  bottom: 0;
  width: 208px;
  height: 210px;
  transform: rotateY(-12deg) rotateX(5deg) rotateZ(-3deg);
  transform-style: preserve-3d;
}

.charm::before {
  content: "";
  position: absolute;
  inset: 22px 12px 0;
  background: #fffdf9;
  border: 5px solid #171411;
  border-radius: 42px 42px 32px 32px;
  box-shadow:
    inset 9px -8px 0 rgba(190, 140, 61, 0.12),
    15px 20px 28px rgba(42, 35, 26, 0.18);
  transform: translateZ(-10px);
}

.person {
  position: absolute;
  left: 18px;
  bottom: 12px;
  width: 104px;
  height: 176px;
  transform: translateZ(28px);
}

.hair {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 75px;
  height: 58px;
  background: #1f1a16;
  border-radius: 46% 54% 48% 45%;
  box-shadow: inset -10px -3px 0 #3b3027;
}

.face {
  position: absolute;
  top: 43px;
  left: 21px;
  width: 62px;
  height: 62px;
  background: #f0c8a2;
  border: 4px solid #191512;
  border-radius: 47% 48% 44% 45%;
}

.face::before,
.face::after {
  content: "";
  position: absolute;
  top: 25px;
  width: 7px;
  height: 10px;
  background: #191512;
  border-radius: 50%;
}

.face::before {
  left: 15px;
}

.face::after {
  right: 15px;
}

.body {
  position: absolute;
  top: 96px;
  left: 18px;
  width: 68px;
  height: 66px;
  background: linear-gradient(90deg, #1c1a18 0 45%, #fff 45% 55%, #2d2825 55%);
  border: 4px solid #191512;
  border-radius: 20px 20px 10px 10px;
}

.leg {
  position: absolute;
  bottom: 0;
  width: 23px;
  height: 36px;
  background: #171411;
  border-radius: 0 0 9px 9px;
}

.leg.left {
  left: 26px;
}

.leg.right {
  right: 24px;
}

.nfc-card {
  position: absolute;
  right: 6px;
  bottom: 19px;
  width: 94px;
  height: 148px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 5px solid #171411;
  border-radius: 18px;
  box-shadow: 10px 16px 18px rgba(32, 27, 22, 0.17);
  transform: translateZ(18px) rotateZ(-7deg);
}

.nfc-wave {
  position: absolute;
  border: 4px solid #191512;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(45deg);
}

.wave-a {
  width: 30px;
  height: 30px;
}

.wave-b {
  width: 50px;
  height: 50px;
}

.wave-c {
  width: 70px;
  height: 70px;
}

.nfc-text {
  position: absolute;
  bottom: 24px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.scan-status {
  min-height: 78px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 10px;
  align-items: center;
}

.scan-status strong {
  font-size: 18px;
}

.scan-status span:last-child {
  grid-column: 2;
  color: #2e2721;
  font-size: 15px;
}

.final-gate-action {
  width: 100%;
  margin-top: 12px;
}

.final-gate-action[hidden] {
  display: none;
}

.reset-all-action {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border: 1px solid rgba(45, 36, 28, 0.22);
  border-radius: 8px;
  color: #2e2721;
  background: #fff7e7;
  cursor: pointer;
  font-weight: 900;
}

.reset-all-action:hover {
  background: #fff0d4;
}

.nfc-icon {
  grid-row: span 2;
  width: 35px;
  height: 35px;
  position: relative;
}

.nfc-icon::before,
.nfc-icon::after {
  content: "";
  position: absolute;
  border: 3px solid var(--ink);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(45deg);
}

.nfc-icon::before {
  inset: 6px;
}

.nfc-icon::after {
  inset: 0;
}

.quiz-panel,
.answer-panel,
.guide-panel,
.level-panel,
.play-panel,
.explain-panel,
.introduction-panel,
.stamp-panel,
.shop-panel,
.share-panel,
.final-panel,
.facility-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quiz-panel h1,
.answer-panel h1,
.guide-panel h1,
.level-panel h1,
.play-panel h1,
.explain-panel h1,
.introduction-panel h1,
.stamp-panel h1,
.shop-panel h1,
.share-panel h1,
.final-panel h1,
.facility-panel h1 {
  margin: 12px 0 18px;
  text-align: center;
  font-size: 20px;
  line-height: 1.45;
}

.mystery-portrait {
  position: relative;
  width: 134px;
  height: 134px;
  margin-bottom: 18px;
  overflow: hidden;
  background: #e8decc;
  border-radius: 50%;
}

.mystery-head {
  position: absolute;
  top: 28px;
  left: 43px;
  width: 48px;
  height: 58px;
  background: #281f16;
  border-radius: 46% 46% 42% 43%;
}

.mystery-body {
  position: absolute;
  left: 28px;
  bottom: 7px;
  width: 78px;
  height: 60px;
  background: #281f16;
  border-radius: 36px 36px 12px 12px;
}

.hint-list {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.hint {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e7;
  color: #3a3027;
}

.hint p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.hint-icon {
  width: 18px;
  height: 18px;
  justify-self: center;
  position: relative;
  border: 2px solid var(--gold);
  border-radius: 50% 50% 44% 44%;
  background: #fff4d4;
}

.hint-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -6px;
  height: 6px;
  border: 2px solid var(--gold);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  background: #fff4d4;
}

.answer-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.answer-choice {
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #362a20;
  background: #fff6e4;
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.answer-choice:hover,
.answer-choice.is-selected {
  color: #fff;
  background: #33251b;
  border-color: #33251b;
  transform: translateY(-2px);
}

.answer-choice.is-wrong {
  color: #fff;
  background: var(--copper);
  border-color: var(--copper);
  animation: shake 260ms ease;
}

.answer-choice.is-correct {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.answer-choice.is-auto {
  box-shadow: 0 0 0 5px rgba(41, 111, 104, 0.17);
}

.yoon-card {
  width: 142px;
  height: 148px;
  display: block;
  object-fit: cover;
  object-position: center top;
  background: #d8d5ce;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #d5d1cb;
}

.yoon-card[hidden],
.answer-symbol[hidden] {
  display: none;
}

.answer-symbol {
  width: 142px;
  height: 148px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #241d17;
  background:
    radial-gradient(circle at 50% 35%, #1f1a16 0 24px, transparent 25px),
    radial-gradient(circle at 50% 72%, #34261e 0 38px, transparent 39px),
    linear-gradient(150deg, #fff7e7, #eaf4ef);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.answer-panel h2 {
  margin: 12px 0 2px;
  font-size: 15px;
}

.date {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.bio {
  max-width: 235px;
  min-height: 68px;
  margin: 0 0 14px;
  text-align: center;
  color: #3f352b;
  font-size: 13px;
  line-height: 1.55;
}

.next-card {
  width: 100%;
  min-height: 80px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff7e7;
  cursor: pointer;
  text-align: left;
}

.next-card span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--gold);
  border-radius: 6px;
}

.next-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.next-card:hover,
.primary-action:hover,
.level-choice:hover,
.quiz-answer-choice:hover {
  transform: translateY(-2px);
}

.guide-list {
  width: 100%;
  display: grid;
  gap: 12px;
  margin: 10px 0 16px;
}

.guide-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.guide-item strong {
  font-size: 17px;
  line-height: 1.45;
}

.guide-icon {
  width: 48px;
  height: 48px;
  display: block;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fffaf1;
}

.list-icon::before,
.checklist-icon::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 19px;
  width: 18px;
  height: 3px;
  background: var(--ink);
  box-shadow: 0 9px 0 var(--ink), 0 18px 0 var(--ink);
}

.list-icon::after,
.checklist-icon::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 9px 0 var(--ink), 0 18px 0 var(--ink);
}

.stamp-icon::before {
  content: "";
  position: absolute;
  left: 13px;
  bottom: 10px;
  width: 22px;
  height: 15px;
  background: var(--ink);
  border-radius: 12px 12px 5px 5px;
}

.stamp-icon::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 16px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.level-preview {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 16px;
}

.level-preview span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff6e4;
  font-size: 11px;
  font-weight: 800;
}

.quiz-note {
  width: 100%;
  margin: 4px 0 18px;
  padding: 16px 10px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  text-align: center;
}

.quiz-note p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 800;
}

.primary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fffaf1;
  background: #2d241c;
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease;
}

.level-choice-grid {
  width: 100%;
  max-width: 230px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-items: center;
  gap: 14px 22px;
  margin: 20px 0 30px;
}

.level-choice {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #2e2721;
  background: #fff6e4;
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease;
}

.level-choice:nth-child(5) {
  grid-column: 1 / -1;
}

.level-choice.is-selected {
  color: #fffaf1;
  background: #33251b;
  border-color: #33251b;
}

.level-start-copy {
  max-width: 260px;
  margin: -4px 0 18px;
  text-align: center;
  color: #3f352b;
  font-size: 14px;
  line-height: 1.55;
}

.level-flow-grid {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 26px;
}

.level-chip {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff6e4;
  color: #3f352b;
  font-size: 12px;
  font-weight: 900;
}

.level-chip.is-active {
  color: #fffaf1;
  background: #33251b;
  border-color: #33251b;
}

.start-quiz-action {
  margin-top: 16px;
}

.stamp-board {
  width: 100%;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.stamp-board strong {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

.stamp-row {
  display: grid;
  grid-template-columns: repeat(5, 22px) 1fr;
  align-items: center;
  gap: 8px;
}

.stamp-row span {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fffaf1;
}

.stamp-row b {
  justify-self: end;
}

.stamp-map-image {
  width: 100%;
  max-height: 315px;
  display: block;
  object-fit: contain;
}

.quiz-progress {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9dfce;
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: #4a96f0;
}

.overall-counter {
  width: 100%;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.play-answer-grid {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.quiz-answer-choice {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #2e2721;
  background: #fffdf8;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.quiz-answer-choice:disabled {
  cursor: default;
}

.quiz-answer-choice.is-selected,
.quiz-answer-choice.is-correct {
  color: #0b64d8;
  border-color: #4a96f0;
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px #4a96f0;
}

.quiz-answer-choice.is-wrong {
  color: #fff;
  background: var(--copper);
  border-color: var(--copper);
  animation: shake 260ms ease;
}

.quiz-feedback {
  width: 100%;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #c9defc;
  border-radius: 8px;
  color: #2d5585;
  background: #edf6ff;
  font-size: 12px;
  line-height: 1.45;
}

.quiz-feedback.is-success {
  color: #155b51;
  border-color: rgba(41, 111, 104, 0.35);
  background: #eef8f3;
}

.quiz-next-action {
  margin-top: 12px;
}

.red-portrait,
.stamp-medal {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 5px solid #cc342b;
  border-radius: 50%;
  background: #fff7f0;
  box-shadow: 0 8px 18px rgba(121, 40, 32, 0.14);
}

.red-portrait img,
.stamp-medal img {
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: center top;
  filter: sepia(0.45) saturate(1.6) hue-rotate(320deg) contrast(1.05);
  opacity: 0.95;
}

.red-portrait img[hidden],
.red-portrait span[hidden] {
  display: none;
}

.red-portrait span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 18px;
  color: #fffaf1;
  background: #cc342b;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.explain-box {
  width: 100%;
  margin: 22px 0 18px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e7;
}

.explain-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.explain-box p {
  margin: 0;
  color: #3f352b;
  font-size: 13px;
  line-height: 1.55;
}

.stamp-panel h1 {
  font-size: 15px;
}

.stamp-map {
  position: relative;
  width: min(100%, 230px);
  height: auto;
  margin: 0 auto 14px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 0;
}

.stamp-map::before,
.stamp-map::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.stamp-map::before {
  content: none;
}

.stamp-map::after {
  content: none;
}

.map-route {
  display: none;
}

.map-stamp-slot {
  position: absolute;
  z-index: 2;
  width: 25%;
  height: auto;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(117, 80, 43, 0.5);
  border-radius: 50%;
  color: #7b6249;
  background: rgba(255, 253, 248, 0.62);
  transform: translate(-50%, -50%);
}

.map-stamp-slot::before {
  content: attr(data-short);
  font-size: 11px;
  font-weight: 900;
}

.map-stamp-slot.is-earned {
  border-style: solid;
  border-color: #be3029;
  color: #fffaf1;
  background: #d64239;
  box-shadow: 0 8px 16px rgba(127, 40, 34, 0.18);
}

.map-stamp-slot.is-current {
  z-index: 3;
}

.map-stamp-slot.is-earned::before {
  content: "";
}

.stamp-face {
  position: absolute;
  inset: 5px;
  display: none;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 250, 241, 0.88);
  border-radius: 50%;
  background: #fff7f0;
}

.map-stamp-slot.is-earned .stamp-face {
  display: grid;
}

.map-stamp-slot.is-current .stamp-face {
  animation: stampPop 360ms ease both;
}

.stamp-face img {
  width: 108%;
  height: 108%;
  object-fit: cover;
  object-position: center top;
  filter: sepia(0.48) saturate(1.45) hue-rotate(320deg) contrast(1.08);
}

.stamp-face b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1px 0 2px;
  color: #fffaf1;
  background: rgba(180, 38, 33, 0.82);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

.stamp-face-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fffaf1;
  background: #b92f29;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.slot-yoon {
  top: 32%;
  left: 30.5%;
}

.slot-kim {
  top: 31%;
  left: 68.2%;
}

.slot-yu {
  top: 52%;
  left: 48.5%;
}

.slot-yun {
  top: 70.5%;
  left: 29.5%;
}

.slot-ahn {
  top: 70.5%;
  left: 68.2%;
}

.stamp-medal {
  margin: 8px 0 18px;
}

.stamp-board.is-earned {
  margin-top: 0;
  margin-bottom: 14px;
}

.stamp-row .earned,
.stamp-row .is-earned {
  position: relative;
  border-color: #d64239;
  background: #d64239;
}

.stamp-row .earned::before,
.stamp-row .is-earned::before {
  content: "★";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
}

.coupon-strip {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e7;
}

.coupon-strip p {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.shop-panel h1 strong {
  color: #d3352c;
  font-size: 28px;
}

.shop-visual {
  position: relative;
  width: 250px;
  height: 190px;
  margin: 8px 0 10px;
}

.introduction-panel {
  padding: 2px 4px 0;
}

.introduction-stage {
  margin: 4px 0 2px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
}

.introduction-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.introduction-panel .red-portrait {
  width: 142px;
  height: 142px;
  margin: 2px 0 13px;
}

.introduction-panel h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
}

.introduction-date {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.introduction-achievement {
  width: 100%;
  margin-bottom: 18px;
  padding: 16px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7e7;
}

.introduction-achievement strong {
  display: block;
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 14px;
}

.introduction-achievement p {
  margin: 0;
  color: #3f352b;
  font-size: 14px;
  line-height: 1.6;
}

.keyring-product-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.keyring-product-grid img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(45, 36, 28, 0.15);
  border-radius: 10px;
  background: #f2e8df;
  box-shadow: 0 5px 10px rgba(75, 58, 38, 0.12);
}

.keyring-product-grid img:nth-child(4) {
  transform: translateX(50%);
}

.keyring-product-grid img:nth-child(5) {
  transform: translateX(50%);
}

.mini-keyring {
  position: absolute;
  left: 20px;
  bottom: 4px;
  width: 128px;
  height: 190px;
}

.mini-keyring::before {
  content: "";
  position: absolute;
  top: 0;
  left: 42px;
  width: 48px;
  height: 48px;
  border: 7px solid #1c1916;
  border-radius: 50%;
  transform: rotateX(55deg) rotateZ(-18deg);
}

.mini-person {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 72px;
  height: 132px;
  border-radius: 34px 34px 10px 10px;
  background:
    radial-gradient(circle at 50% 25%, #edc59e 0 18px, transparent 19px),
    radial-gradient(circle at 50% 9%, #1f1a16 0 26px, transparent 27px),
    linear-gradient(90deg, #191715 0 44%, #fff 44% 56%, #2a2521 56%);
  border: 3px solid #191512;
}

.mini-mask {
  position: absolute;
  right: 4px;
  bottom: 36px;
  width: 62px;
  height: 62px;
  border: 3px solid #191512;
  border-radius: 50%;
  background:
    radial-gradient(circle at 22px 26px, #191512 0 4px, transparent 5px),
    radial-gradient(circle at 40px 26px, #191512 0 4px, transparent 5px),
    #fff;
}

.shop-copy {
  margin: 0 0 12px;
  text-align: center;
  color: #3f352b;
  font-size: 13px;
  line-height: 1.45;
}

.share-panel h1 {
  font-size: 15px;
}

.share-hero {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  position: relative;
  margin: 2px 0 16px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 28px 24px, #f15b50 0 3px, transparent 4px),
    radial-gradient(circle at 92px 22px, #4a96f0 0 3px, transparent 4px),
    radial-gradient(circle at 22px 88px, #f0b545 0 3px, transparent 4px),
    radial-gradient(circle at 106px 92px, #296f68 0 3px, transparent 4px),
    #fffdf8;
}

.share-symbol {
  width: 58px;
  height: 70px;
  display: block;
  position: relative;
  border: 4px solid #bfa46d;
  border-radius: 6px;
  background: #eef8f3;
}

.share-symbol::before,
.share-symbol::after {
  content: "";
  position: absolute;
  background: #2ca35c;
}

.share-symbol::before {
  top: 20px;
  left: 18px;
  width: 23px;
  height: 4px;
  transform: rotate(-28deg);
  box-shadow: 9px 18px 0 #2ca35c;
}

.share-symbol::after {
  top: 12px;
  left: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 28px -11px 0 #2ca35c, 34px 28px 0 #2ca35c;
}

.share-action {
  margin-bottom: 14px;
}

.reward-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.reward-item {
  min-height: 98px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.reward-item strong {
  font-size: 13px;
}

.reward-mask {
  position: relative;
  width: 58px;
  height: 48px;
  display: block;
  border: 3px solid #191512;
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(ellipse at 30% 45%, #191512 0 5px, transparent 6px),
    radial-gradient(ellipse at 70% 45%, #191512 0 5px, transparent 6px),
    radial-gradient(ellipse at 50% 72%, #d9493d 0 7px, transparent 8px),
    #fff8e8;
  transform: rotate(-6deg);
}

.reward-mask::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: 4px;
  width: 13px;
  height: 18px;
  border: 3px solid #191512;
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

.reward-flute {
  position: relative;
  width: 66px;
  height: 16px;
  display: block;
  border: 3px solid #2b251f;
  border-radius: 999px;
  background:
    radial-gradient(circle at 18px 50%, #201b17 0 3px, transparent 4px),
    radial-gradient(circle at 31px 50%, #201b17 0 3px, transparent 4px),
    radial-gradient(circle at 44px 50%, #201b17 0 3px, transparent 4px),
    linear-gradient(90deg, #b88b4b, #d9b36c 52%, #9c713b);
  transform: rotate(-12deg);
  box-shadow: 5px 5px 0 rgba(48, 38, 30, 0.12);
}

.reward-flute::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 1px;
  width: 7px;
  height: 10px;
  border-radius: 0 6px 6px 0;
  background: #2b251f;
}

.keyword-action {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #2e2721;
  background: #fff6e4;
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease;
}

.keyword-action:hover {
  transform: translateY(-2px);
  background: #fff0d4;
}

.keyword-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.final-panel h1 {
  font-size: 17px;
}

.independence-banner {
  width: 100%;
  margin: 8px 0 18px;
  padding: 12px;
  border: 1px solid #d0a26d;
  border-radius: 8px;
  background: #fffaf1;
  box-shadow: inset 0 0 0 4px rgba(255, 253, 248, 0.72), 0 12px 22px rgba(105, 70, 35, 0.1);
}

.independence-banner img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

.facility-panel h1 {
  margin-bottom: 8px;
  font-size: 19px;
}

.facility-origin {
  width: 100%;
  margin: 0 0 12px;
  color: #3f352b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.facility-map {
  width: 100%;
  height: 276px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #e8efe7;
  color: #3f352b;
  font-size: 12px;
  font-weight: 800;
}

.facility-current-marker {
  width: 14px;
  height: 14px;
  display: block;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1769ff;
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.22);
}

.facility-popup strong {
  display: block;
  margin-bottom: 4px;
}

.facility-popup span {
  display: block;
  color: #4a4035;
  font-size: 12px;
}

.facility-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e7;
}

.facility-summary strong,
.facility-summary span {
  font-size: 12px;
  font-weight: 900;
}

.facility-summary span {
  color: var(--muted);
}

.facility-list {
  width: 100%;
  max-height: 255px;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.facility-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.facility-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.facility-list strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.35;
}

.facility-list p {
  margin: 0;
  color: #3f352b;
  font-size: 11px;
  line-height: 1.45;
}

.facility-list a {
  display: inline-block;
  margin-top: 6px;
  color: #0b64d8;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.facility-source {
  width: 100%;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.flow-arrow {
  display: none;
}

.flow-controls {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.back-button,
.restart-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(45, 36, 28, 0.28);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.back-button {
  color: #2d241c;
  background: #fff7e7;
}

.restart-button {
  color: #fffaf1;
  background: #2d241c;
}

.back-button:disabled {
  color: #9b8c7b;
  background: #eee3d4;
  cursor: default;
  opacity: 0.72;
}

.step-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #c9baa8;
  transition: width 220ms ease, background 220ms ease;
}

.dot.is-active {
  width: 26px;
  border-radius: 999px;
  background: var(--teal);
}

.dot.is-complete {
  background: var(--gold);
}

.app[data-reading="true"] .nfc-select-card.is-selected .nfc-choice-mark {
  animation: tagPulse 880ms ease-in-out infinite;
}

@keyframes floatKeyring {
  0%,
  100% {
    transform: rotateY(-7deg) rotateX(4deg) translateY(0);
  }

  50% {
    transform: rotateY(8deg) rotateX(-3deg) translateY(-10px);
  }
}

@keyframes tagPulse {
  0%,
  100% {
    transform: rotateY(-10deg) rotateX(3deg) scale(1);
  }

  50% {
    transform: rotateY(12deg) rotateX(-4deg) scale(1.04);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-6px);
  }

  70% {
    transform: translateX(6px);
  }
}

@keyframes stampPop {
  0% {
    transform: scale(0.72);
  }

  70% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes stageEnter {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 980px) {
  .flow-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-screen {
    min-height: 570px;
  }
}

@media (max-width: 430px) {
  .app {
    padding: 14px;
  }

  .phone-screen {
    min-height: calc(100vh - 120px);
    padding-inline: 12px;
  }

  .stage-label strong {
    max-width: 220px;
    overflow-wrap: anywhere;
    font-size: 17px;
  }

  .nfc-select-grid {
    min-height: 330px;
    gap: 8px;
    padding: 8px;
  }

  .nfc-select-card {
    min-height: 98px;
  }

  .nfc-select-card:nth-child(5) {
    width: calc(50% - 4px);
  }

  .nfc-select-card strong {
    font-size: 14px;
  }

  .nfc-choice-mark {
    width: 50px;
    height: 50px;
  }

  .keyring-model {
    transform: scale(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
