:root {
  --bg: #120c08;
  --bg-2: #1d130b;
  --ink: #fdeee2;
  --ink-dim: #b39a86;
  --line: rgba(255, 255, 255, 0.12);
  --gold: #ffd88a;

  --warrior: #ff4d4d;
  --archer: #4dff88;
  --mage: #8c5cff;
  --healer: #ffd24d;
  --bard: #ff6bd6;
  --rogue: #3ddad7;

  --accent: #ff7a2e;
  --accent-rgb: 255, 122, 46;
  --accent-hi: #ffb066;
  --fam: var(--accent);

  --radius: 16px;
  --maxw: 720px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  background: var(--bg);
  color: var(--ink);

  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

@font-face {
  font-family: 'Pretendard-Regular';
  font-weight: 400;
  font-display: swap;
  src:
    local('Pretendard Regular'),
    url('https://lwi.nexon.com/m_mabinogim/fonts/pretendard/Pretendard-Regular.woff2') format('woff2'),
    url('https://lwi.nexon.com/m_mabinogim/fonts/pretendard/Pretendard-Regular.woff') format('woff');
}
h1,
h2,
h3,
p {
  margin: 0;
}
button {
  font-family: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.bg-stars,
.bg-fog {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-stars {
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 255, 255, 0.7), transparent), radial-gradient(1.5px 1.5px at 70% 60%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.6), transparent), radial-gradient(1px 1px at 85% 20%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255, 255, 255, 0.45), transparent), radial-gradient(1px 1px at 10% 65%, rgba(255, 255, 255, 0.5), transparent);
  background-size: 100% 100%;
  animation: starDrift 60s linear infinite;
  opacity: 0.7;
}
.bg-fog {
  background:
    radial-gradient(60% 45% at 25% 20%, rgba(var(--accent-rgb), 0.16), transparent 70%), radial-gradient(55% 45% at 80% 75%, rgba(255, 60, 20, 0.12), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(255, 180, 90, 0.1), transparent 70%);
  animation: fogShift 24s ease-in-out infinite alternate;
}
@keyframes starDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-40px);
  }
}
@keyframes fogShift {
  from {
    transform: translate(-2%, 0) scale(1);
  }
  to {
    transform: translate(2%, -2%) scale(1.08);
  }
}

#app {
  position: relative;
  z-index: 1;
}
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}
.screen.active {
  display: block;
}
#screen-quiz.active {
  display: flex;
  flex-direction: column;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.2s,
    background 0.2s;
}
.btn:active {
  transform: scale(0.96);
}
.btn-primary {
  background: var(--accent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff 10%));
  color: #1a0f07;
  box-shadow:
    0 0 24px color-mix(in srgb, var(--accent) 55%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn-link {
  background: transparent;
  color: var(--ink-dim);
  font-weight: 600;
  padding: 10px;
}
.btn-link:hover {
  color: var(--ink);
}
.btn-lg {
  padding: 18px 40px;
  font-size: 18px;
}

#screen-intro {
  display: none;
}
#screen-intro.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 22px;
}
.intro-inner {
  max-width: var(--maxw);
  text-align: center;
  animation: fadeUp 0.8s var(--ease) both;
}
.intro-eyebrow {
  color: var(--accent);
  letter-spacing: 0.3em;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.intro-title {
  font-size: clamp(34px, 11vw, 60px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, var(--accent-hi) 68%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(var(--accent-rgb), 0.35);
}
.intro-sub {
  margin-top: 16px;
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.intro-copy {
  margin: 26px auto 34px;
  color: var(--ink-dim);
  font-size: 15px;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-head {
  padding: 20px 20px 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.prog-dots {
  display: flex;
  gap: 6px;
  flex: 1;
}
.prog-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
.prog-dot.done {
  background: var(--accent);
}
.prog-dot.current {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.prog-label {
  color: var(--ink-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.question-host {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px 40px;
}
.q-card {
  width: 100%;
  max-width: var(--maxw);
}
.q-enter {
  opacity: 0;
  transform: translateY(24px);
}
.q-card {
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
  opacity: 1;
  transform: translateY(0);
}
.q-copy {
  font-size: clamp(20px, 5.6vw, 27px);
  font-weight: 800;
  text-align: center;
  line-height: 1.4;
  letter-spacing: -0.01em;
  white-space: pre-line;
}
.q-sub {
  text-align: center;
  color: var(--ink-dim);
  font-size: 14px;
  margin-top: 10px;
  white-space: pre-line;
}

.q-choices {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
.type-binary {
  grid-template-columns: 1fr;
}
.type-choice5 {
  grid-template-columns: 1fr;
}
.type-image4 {
  grid-template-columns: 1fr 1fr;
}

.choice {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  line-height: 1.4;
  -webkit-touch-callout: none;
  user-select: none;
  white-space: pre-line;
  transition:
    transform 0.15s var(--ease),
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.25s,
    opacity 0.3s;
}
.choice:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  transform: translateY(-2px);
}
.choice.chosen {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 55%, transparent);
}
.choice.dim {
  opacity: 0.35;
}

.choice-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 16px 12px;
}
.choice-art {
  width: 100%;
  max-width: 130px;
  min-height: 150px;
  aspect-ratio: 3 / 4;
  color: var(--ink-dim);
  display: grid;
  place-items: center;
}
.choice-art svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px currentColor);
}
.choice-art.fam-warrior {
  color: var(--warrior);
}
.choice-art.fam-archer {
  color: var(--archer);
}
.choice-art.fam-mage {
  color: var(--mage);
}
.choice-art.fam-healer {
  color: var(--healer);
}
.choice-art.fam-bard {
  color: var(--bard);
}
.choice-label {
  font-size: 14px;
}

.choice-final {
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  padding: 24px;
}

.countdown-ring {
  width: 120px;
  height: 120px;
  margin: 26px auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid var(--accent);
  box-shadow:
    0 0 30px color-mix(in srgb, var(--accent) 55%, transparent),
    inset 0 0 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.countdown-num {
  font-size: 54px;
  font-weight: 900;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.countdown-ring.pulse {
  animation: cdPulse 0.9s var(--ease);
}
.countdown-ring.expired {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255, 216, 138, 0.5);
}
.countdown-ring.expired .countdown-num {
  color: var(--gold);
  font-size: 40px;
}
@keyframes cdPulse {
  0% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.micro-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 700;
  color: var(--ink);
  background: rgba(6, 6, 14, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.26s var(--ease),
    visibility 0.26s;
  letter-spacing: -0.01em;
}
.micro-overlay.show {
  opacity: 1;
  visibility: visible;
}

.mg-host {
  margin-top: 26px;
}
.mg-arena {
  position: relative;
  width: 100%;
  height: 340px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 40%, rgba(var(--accent-rgb), 0.1), rgba(0, 0, 0, 0.25));
  overflow: hidden;
  touch-action: none;
}
.mg-timer {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 12px;
}
.mg-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform-origin: left;
  transform: scaleX(1);
}

.marble {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
  cursor: pointer;
  -webkit-touch-callout: none;
  user-select: none;
}
.marble-gold {
  background: radial-gradient(circle at 35% 30%, #fff6d8, #ffbf3f 55%, #a06b00);
  box-shadow: 0 0 22px rgba(255, 191, 63, 0.75);
}
.marble-silver {
  background: radial-gradient(circle at 35% 30%, #ffffff, #c8cfe0 55%, #7d8598);
  box-shadow: 0 0 18px rgba(200, 207, 224, 0.6);
}
.marble-bronze {
  background: radial-gradient(circle at 35% 30%, #ffd9ad, #c9762f 55%, #7a3d10);
  box-shadow: 0 0 16px rgba(201, 118, 47, 0.55);
}
.marble.caught {
  animation: marbleCatch 0.32s var(--ease) forwards;
}
@keyframes marbleCatch {
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}

.mg-grid {
  display: grid;
  gap: 8px;
}
.glyph {
  aspect-ratio: 1;
  min-height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  color: var(--accent);
  display: grid;
  place-items: center;
  padding: 8px;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
  transition:
    background 0.15s,
    transform 0.15s;
}
.glyph:hover {
  background: rgba(var(--accent-rgb), 0.1);
}
.glyph svg {
  width: 78%;
  height: 78%;
}
.glyph-wrong {
  animation: shakeX 0.3s;
}
.glyph-found {
  background: rgba(77, 255, 136, 0.22);
  box-shadow: 0 0 20px rgba(77, 255, 136, 0.6);
}
.glyph-reveal {
  background: rgba(255, 216, 138, 0.22);
  box-shadow: 0 0 20px rgba(255, 216, 138, 0.6);
  animation: pulseGlow 0.9s ease infinite alternate;
}
@keyframes shakeX {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}
@keyframes pulseGlow {
  to {
    box-shadow: 0 0 34px rgba(255, 216, 138, 0.9);
  }
}

.mg-flash {
  height: 360px;
  cursor: crosshair;
}
.mg-flash-count {
  text-align: center;
  margin-top: 10px;
  color: var(--ink-dim);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.flash-dot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, var(--accent) 60%, transparent);
  box-shadow:
    0 0 30px var(--accent),
    0 0 60px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: dotPop 0.18s var(--ease);
  cursor: pointer;
  -webkit-touch-callout: none;
  user-select: none;
}
@keyframes dotPop {
  from {
    transform: scale(0.3);
    opacity: 0.4;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.mg-charge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding-top: 10px;
}
.charge-meter {
  position: relative;
  width: 120px;
  height: 240px;
  border-radius: 60px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.charge-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(0deg, var(--accent), var(--gold));
  transition: none;
}
.charge-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}
.charge-over .charge-fill {
  background: linear-gradient(0deg, #ff6b6b, #ffd24d);
}
.charge-danger {
  animation: chargeShake 0.12s linear infinite;
}
.charge-shatter {
  animation: chargeBreak 0.4s var(--ease) forwards;
}
@keyframes chargeShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2px, 1px);
  }
  75% {
    transform: translate(2px, -1px);
  }
}
@keyframes chargeBreak {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
    filter: brightness(1.6);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
    opacity: 0.85;
  }
}
.charge-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 16px 34px;
  font-size: 17px;
  font-weight: 800;
  user-select: none;
  touch-action: none;
}
.charge-btn.pressing {
  background: rgba(var(--accent-rgb), 0.24);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 60%, transparent);
}
.charge-btn:disabled {
  opacity: 0.5;
}

#screen-result.active {
  display: block;
}
.stage {
  position: relative;
}
.fade-out {
  animation: fadeOut 0.5s var(--ease) forwards;
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.stage-analysis,
.stage-reading,
.stage-teaser {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05060c;
  padding: 30px;
}
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
  animation: scan 6s linear infinite;
}
@keyframes scan {
  from {
    background-position-y: 0;
  }
  to {
    background-position-y: 60px;
  }
}
.analysis-inner {
  width: 100%;
  max-width: 480px;
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
}
.analysis-title {
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 14px;
  margin-bottom: 22px;
  text-align: center;
  text-shadow: 0 0 12px var(--accent);
}
.analysis-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.an-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 12px;
  opacity: 0.4;
  transition: opacity 0.3s;
}
.an-row.shown {
  opacity: 1;
}
.an-label {
  color: var(--ink-dim);
  font-size: 14px;
  min-height: 1.2em;
}
.an-value {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.an-tag {
  grid-column: 2;
  color: var(--gold);
  font-size: 13px;
}
.an-gauge {
  grid-column: 1 / -1;
  display: flex;
  gap: 3px;
}
.an-gauge i {
  flex: 1;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.an-gauge i.on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.reading-inner {
  width: 100%;
  max-width: 540px;
}
.reading-line {
  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 18px;
  min-height: 1.4em;
  letter-spacing: -0.01em;
}
.reading-closer {
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 500;
  font-style: italic;
  margin-top: 6px;
}

.stage-teaser {
  flex-direction: column;
  gap: 30px;
}
.teaser-text {
  font-size: clamp(24px, 7vw, 40px);
  font-weight: 900;
  letter-spacing: -0.01em;
  animation: fadeUp 0.6s var(--ease) both;
}
.heartbeat {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.24) 14%, rgba(255, 255, 255, 0.08) 28%, transparent 48%),
    radial-gradient(circle at center, var(--fam) 0%, rgba(255, 255, 255, 0) 66%);
  box-shadow:
    0 0 12px 4px color-mix(in srgb, var(--fam) 55%, transparent),
    0 0 28px 14px color-mix(in srgb, var(--fam) 18%, transparent),
    inset 0 0 8px rgba(255, 255, 255, 0.18);
  animation: beat 1.8s var(--ease) forwards;
}
@keyframes beat {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  15% {
    transform: scale(1.35);
  }
  20% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.4);
  }
  45% {
    transform: scale(1);
  }
  62% {
    transform: scale(1.5);
  }
  66% {
    transform: scale(1);
  }
  80% {
    transform: scale(1.7);
  }
  84% {
    transform: scale(1);
  }
  100% {
    transform: scale(2.4);
    opacity: 1;
  }
}

.family-flash {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  animation: flashIn 0.5s var(--ease);
}
.family-flash.fade-out {
  animation: fadeOut 0.7s var(--ease) forwards;
}
@keyframes flashIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.particle-layer {
  position: fixed;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.18) 30%, transparent 65%);
  filter: blur(var(--blur, 1.4px));
  mix-blend-mode: screen;
  opacity: 0.95;
  animation: burst var(--d, 1s) var(--delay, 0s) ease-out forwards;
}
.particle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tail, 28px);
  height: 4px;
  transform-origin: left center;
  transform: translateX(8px) translateY(-50%) rotate(var(--r, 0deg));
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.14) 60%, transparent);
  opacity: 0.85;
  filter: blur(0.95px);
}
.particle.sparkle {
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.55) 40%, transparent 90%);
  filter: blur(0.8px);
  opacity: 0.95;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}
.particle.sparkle::after {
  display: none;
}
.particle.core {
  width: 12px;
  height: 12px;
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.35),
    inset 0 0 10px rgba(255, 255, 255, 0.35);
}
@keyframes burst {
  0% {
    transform: translate(0, 0) scale(0.35) rotate(var(--r, 0deg));
    opacity: 1;
  }
  35% {
    transform: translate(calc(var(--tx) * 0.8), calc(var(--ty) * 0.8)) scale(1.05) rotate(var(--r, 0deg));
    opacity: 0.98;
  }
  65% {
    transform: translate(calc(var(--tx) * 1.05), calc(var(--ty) * 1.05)) scale(0.75) rotate(var(--r, 0deg));
    opacity: 0.7;
  }
  100% {
    transform: translate(calc(var(--tx) * 1.25), calc(var(--ty) * 1.25)) scale(0.22) rotate(var(--r, 0deg));
    opacity: 0;
  }
}

.result-detail {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 80px;
  animation: fadeUp 0.6s var(--ease) both;
}

.hero-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.15s ease;
}

.hero-card.is-poster {
  border-radius: 28px;
  padding: 0;
  min-height: clamp(400px, 115vw, 480px);
  background: #0b0b12;
  background: radial-gradient(120% 95% at 68% 22%, color-mix(in srgb, var(--fam) 42%, #0b0b12) 0%, color-mix(in srgb, var(--fam) 16%, #0a0a10) 42%, #08080e 72%, #050509 100%);
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.hero-card.reveal-in {
  animation: heroIn 0.7s var(--ease) both;
}
@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(70% 55% at 68% 22%, color-mix(in srgb, var(--fam) 40%, transparent), transparent 70%);
}
.hero-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 66%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 5, 11, 0.5) 40%, rgba(5, 5, 11, 0.92) 100%);
}
.hero-holo {
  position: absolute;
  top: -30%;
  left: -60%;
  width: 220%;
  height: 160%;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.45;
  background: repeating-linear-gradient(120deg, transparent 0%, transparent 30%, rgba(255, 255, 255, 0.16) 38%, transparent 46%, transparent 76%);
  animation: holo 4s linear infinite;
  will-change: transform;
}
@keyframes holo {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-76%, 0, 0);
  }
}

.hero-img {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
}
.is-poster .hero-img {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  z-index: 0;
  overflow: hidden;
}
.is-poster .hero-img.is-illustration {
  display: block;
  max-width: none;
  height: auto;
}
.hero-img .emblem-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 16px var(--fam));
}
.is-poster .hero-img .emblem-svg {
  width: 58%;
  height: 58%;
}
.hero-img .class-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--fam) 70%, transparent));
}
.is-poster .hero-img .class-photo {
  object-position: 60% 20%;
}
.hero-img .hero-icon-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.14;
  filter: blur(1px);
  transform: scale(1.35);
}

.hero-img .hero-line-wrap {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  /* transform은 object-fit이 없는 이 래퍼에만 건다 — object-fit+transform을 한 엘리먼트에
     같이 걸면 iOS(WebKit)에서 위치 계산이 렌더 박스가 아니라 이미지 원본 크기 기준으로
     어긋나는 경우가 있어 분리함(클래스별 원본 비율 편차가 커서 더 도드라짐). */
  transform: translateY(var(--line-shift, 0)) scale(var(--line-scale, 1));
  transform-origin: var(--line-origin, top center);
}
.hero-img .hero-line {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: var(--line-pos, center bottom);
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.6));
}

.hero-family {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fam);
  letter-spacing: 0.2em;
  font-size: 14px;
  font-weight: 700;
}
.hero-family-icon {
  display: none;
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px var(--fam));
}
.hero-family-icon.is-loaded {
  display: block;
}
.hero-title {
  position: relative;
  margin-top: 8px;
  font-size: 17px;
  color: var(--ink-dim);
  font-weight: 600;
}
.hero-name {
  position: relative;
  font-size: clamp(34px, 10vw, 50px);
  font-weight: 900;
  line-height: 1.1;
  margin-top: 2px;
  text-shadow: 0 0 30px color-mix(in srgb, var(--fam) 60%, transparent);
}
.hero-match {
  position: relative;
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-dim);
  font-weight: 600;
}
.is-poster .hero-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  text-align: left;
  padding: 24px 26px 26px;
}
.is-poster .hero-family {
  text-transform: uppercase;
  font-weight: 800;
}
.is-poster .hero-name {
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}
.is-poster .hero-match {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.hero-match-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.hero-match-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--fam);
  background: linear-gradient(90deg, color-mix(in srgb, var(--fam) 55%, #000), var(--fam));
  box-shadow: 0 0 14px color-mix(in srgb, var(--fam) 70%, transparent);
  transition: width 0.9s var(--ease);
}
.hero-match-num {
  flex: none;
}
.hero-match-num b {
  font-size: 30px;
  font-weight: 900;
  color: var(--fam);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .hero-card.is-poster {
    min-height: clamp(360px, 118vw, 460px);
  }
  .is-poster .hero-meta {
    padding: 20px 20px 22px;
  }
}

.detail-block {
  margin-top: 26px;
}
.block-title {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--fam);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.why-who {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}
.why-why {
  margin-top: 10px;
  color: var(--ink-dim);
  font-size: 15px;
}
.why-evidence {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--fam);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0 12px 12px 0;
  font-size: 15px;
  color: var(--ink);
}

.tip-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--fam) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--fam) 30%, transparent);
}
.tip-icon {
  color: var(--fam);
  font-size: 20px;
}
.tip-text {
  font-weight: 700;
}

.mbti-card {
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.mbti-guess {
  font-size: 20px;
  font-weight: 700;
}
.mbti-guess b {
  color: var(--gold);
  letter-spacing: 0.06em;
}
.mbti-conf {
  color: var(--ink-dim);
  font-size: 14px;
  font-weight: 600;
}
.mbti-gauges {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mbti-axis {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 10px;
}
.mbti-axis span {
  font-weight: 800;
  color: var(--ink-dim);
  text-align: center;
}
.mbti-axis .active {
  color: var(--gold);
}
.mx-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.mx-bar i {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  border-radius: 999px;
}
.mbti-disc {
  margin-top: 16px;
  color: var(--ink-dim);
  font-size: 13px;
  font-style: italic;
}

.runner-row {
  display: grid;
  gap: 12px;
}
.runner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.runner-emblem {
  width: 52px;
  height: 52px;
  flex: none;
}
.runner-emblem .emblem-svg {
  width: 100%;
  height: 100%;
}
.runner-emblem .runner-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.runner-title {
  font-size: 13px;
  color: var(--ink-dim);
}
.runner-name {
  font-size: 18px;
  font-weight: 800;
}
.runner-fam {
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 600;
}
.runner-match {
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}
.runner-card.fam-warrior {
  border-color: color-mix(in srgb, var(--warrior) 45%, transparent);
}
.runner-card.fam-archer {
  border-color: color-mix(in srgb, var(--archer) 45%, transparent);
}
.runner-card.fam-mage {
  border-color: color-mix(in srgb, var(--mage) 45%, transparent);
}
.runner-card.fam-healer {
  border-color: color-mix(in srgb, var(--healer) 45%, transparent);
}
.runner-card.fam-bard {
  border-color: color-mix(in srgb, var(--bard) 45%, transparent);
}
.runner-card.fam-rogue {
  border-color: color-mix(in srgb, var(--rogue) 45%, transparent);
}
.runner-card.fam-warrior .runner-match {
  color: var(--warrior);
}
.runner-card.fam-archer .runner-match {
  color: var(--archer);
}
.runner-card.fam-mage .runner-match {
  color: var(--mage);
}
.runner-card.fam-healer .runner-match {
  color: var(--healer);
}
.runner-card.fam-bard .runner-match {
  color: var(--bard);
}
.runner-card.fam-rogue .runner-match {
  color: var(--rogue);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-top: 34px;
}
.actions .btn {
  width: 100%;
  max-width: 320px;
}
.share-status {
  color: var(--gold);
  font-size: 13px;
  text-align: center;
  min-height: 1.2em;
  margin-top: 4px;
  white-space: pre-line;
}

.shared-banner {
  text-align: center;
  margin: 0 auto 22px;
  padding: 12px 18px;
  max-width: 720px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--fam) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--fam) 14%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--fam) 25%, transparent);
  animation: fadeUp 0.6s var(--ease) both;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 60;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #1a0f07;
  background: linear-gradient(135deg, var(--accent), var(--accent-hi));
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(var(--accent-rgb), 0.5);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease);
  max-width: 86vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.result-detail.fam-warrior {
  --accent: var(--warrior);
}
.result-detail.fam-archer {
  --accent: var(--archer);
}
.result-detail.fam-mage {
  --accent: var(--mage);
}
.result-detail.fam-healer {
  --accent: var(--healer);
}
.result-detail.fam-bard {
  --accent: var(--bard);
}
.result-detail.fam-rogue {
  --accent: var(--rogue);
}

@media (min-width: 720px) {
  .type-image4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .type-binary {
    grid-template-columns: 1fr 1fr;
  }
  .mg-arena {
    height: 400px;
  }
  .runner-row {
    grid-template-columns: 1fr 1fr;
  }
  .choice-art {
    max-width: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-stars,
  .bg-fog,
  .scanlines,
  .hero-holo {
    animation: none !important;
  }
  .heartbeat {
    animation: none !important;
    opacity: 1;
  }
  .particle {
    display: none;
  }
  .q-card,
  .intro-inner,
  .result-detail,
  .hero-card.reveal-in,
  .teaser-text {
    animation: none !important;
  }
  .choice,
  .btn {
    transition: none;
  }
  * {
    scroll-behavior: auto !important;
  }
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  width: 100%;
  padding: 20px 0;
}
.footer.--dark {
  background: #000;
}
.footer.--dark ._logo ._links ._link1 {
  background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1016_exhibition_49D270734A336817/pc/logo1_pc_white.png);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
}
.footer.--dark ._logo ._links ._link2 {
  background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1016_exhibition_49D270734A336817/pc/logo2_pc_white.png);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
}
.footer.--dark ._logo ._copyright {
  color: #ffffff80;
}

.footer ._downs {
  display: none;
  align-items: center;
  justify-content: center;
  column-gap: 10px;
}
.footer ._downs ._down1 {
  width: 134px;
  height: 40px;
  background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1113_thankyou_adventurer_9241F3A0754E10BF/common/appStore.png);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
}
.footer ._downs ._down2 {
  width: 134px;
  height: 40px;
  background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1113_thankyou_adventurer_9241F3A0754E10BF/common/google.png);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
}
.footer ._downs ._down3 {
  width: 147px;
  height: 40px;
  background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1113_thankyou_adventurer_9241F3A0754E10BF/common/galaxyStore.png);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
}
.footer ._logo {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  column-gap: 24px;
}
.footer ._logo ._links {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  column-gap: 24px;
}
.footer ._logo ._links ._link1 {
  width: 84px;
  height: 24px;
  background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1016_exhibition_49D270734A336817/pc/logo1.png);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
}
.footer ._logo ._links ._link2 {
  width: 96px;
  height: 20px;
  background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1016_exhibition_49D270734A336817/pc/logo2.png);
  background-size: contain;
  background-position: top center;
  background-repeat: no-repeat;
}
.footer ._logo ._copyright {
  color: #80889a;
  font-family: 'Pretendard-Regular', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.15px;
}

@media (max-width: 1024px) {
  .footer {
    row-gap: 32px;
    padding: 48px 0 40px;
    background: #070707;
  }
  .footer ._downs {
    display: flex;
    column-gap: 2.2222222222vw;
  }
  .footer ._downs ._down1 {
    width: 29.6666666667vw;
    height: 8.8888888889vw;
    max-width: 267px;
    max-height: 80px;
  }
  .footer ._downs ._down2 {
    width: 29.6666666667vw;
    height: 8.8888888889vw;
    max-width: 267px;
    max-height: 80px;
  }
  .footer ._downs ._down3 {
    width: 32.6666666667vw;
    height: 8.8888888889vw;
    max-width: 294px;
    max-height: 80px;
  }
  .footer ._logo {
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    row-gap: 12px;
    column-gap: 0;
  }
  .footer ._logo ._links {
    column-gap: 48px;
  }
  .footer ._logo ._links ._link1 {
    width: 118px;
    height: 36px;
    background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1016_exhibition_49D270734A336817/pc/logo1_white.png);
  }
  .footer ._logo ._links ._link2 {
    width: 138px;
    height: 28px;
    background-image: url(https://lwi.nexon.com/m_mabinogim/event/2025/1016_exhibition_49D270734A336817/pc/logo2_white.png);
  }
  .footer ._logo ._copyright {
    color: #888;
    font-size: 20px;
    letter-spacing: -0.2px;
  }
}

@media (max-width: 720px) {
  .footer {
    row-gap: 5vw;
    padding: 7.5vw 0 6.25vw;
  }
  .footer ._logo {
    column-gap: 7.5vw;
    row-gap: 1.875vw;
  }
  .footer ._logo ._links {
    column-gap: 7.5vw;
  }
  .footer ._logo ._links ._link1 {
    width: 18.4375vw;
    height: 5.625vw;
  }
  .footer ._logo ._links ._link2 {
    width: 21.5625vw;
    height: 4.375vw;
  }
  .footer ._logo ._copyright {
    font-size: 3.125vw;
    letter-spacing: -0.03125vw;
  }
}

@media (max-width: 640px) {
  .footer ._downs {
    column-gap: 1.5625vw;
  }
}

@media (max-width: 768px) {
  .intro-inner {
    padding: 0 20px;
    box-sizing: border-box;
  }
  .intro-title,
  .intro-copy {
    word-break: keep-all;
  }

  .btn,
  #start-btn,
  .charge-btn {
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    white-space: normal;
    word-break: keep-all;
  }

  .question-host {
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .choice {
    white-space: normal;
    word-break: keep-all;
    min-width: 0;
  }

  .type-image4 {
    gap: 8px;
  }
  .choice-img {
    padding: 12px 8px;
  }
  .choice-art {
    min-height: auto;
    max-height: 150px;
  }
  .choice-label {
    font-size: 13px;
  }

  .mg-grid {
    gap: 4px;
  }
  .glyph {
    min-height: 0;
    padding: 4px;
    border-radius: 8px;
  }

  .hero-img .hero-line-wrap {
    transform: translateY(var(--line-shift, 0px));
  }
}
