:root {
  --ink: #29235c;
  --purple: #aa8df1;
  --deep-purple: #6246b9;
  --yellow: #ffd954;
  --pink: #ff7b9e;
  --cream: #fffbed;
  --mint: #70d4c0;
  --line: 4px solid var(--ink);
  --shadow: 7px 7px 0 var(--ink);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: #a98bf3;
  background-image: radial-gradient(rgba(41, 35, 92, .18) 1.5px, transparent 1.5px);
  background-size: 13px 13px;
  font-family: "Noto Sans KR", sans-serif;
}

button { font: inherit; cursor: pointer; }

.page-shell { min-height: 100svh; padding: 20px; }
.top-bar { display: flex; align-items: center; justify-content: space-between; width: min(900px, 100%); margin: 0 auto 24px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.brand, .mission-chip { padding: 8px 12px; border: 3px solid var(--ink); border-radius: 9px; color: var(--ink); background: var(--cream); box-shadow: 3px 3px 0 var(--ink); font-family: "Jua", sans-serif; font-size: 13px; letter-spacing: .04em; text-decoration: none; }
.brand-heart { color: var(--pink); font-size: 17px; vertical-align: -1px; }
.mission-chip { color: white; background: var(--ink); box-shadow: none; font: 700 11px "Noto Sans KR", sans-serif; letter-spacing: .08em; }
.language-toggle { padding: 7px 10px; border: 3px solid var(--ink); border-radius: 9px; color: var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font: 14px "Jua", sans-serif; transition: transform .12s ease, box-shadow .12s ease; }
.language-toggle:hover, .language-toggle:focus-visible { outline: none; box-shadow: 1px 1px 0 var(--ink); transform: translate(2px, 2px); }

.game-wrap { display: grid; place-items: center; width: min(900px, 100%); min-height: calc(100svh - 104px); margin: 0 auto; }
.comic-card { position: relative; width: min(650px, 100%); overflow: hidden; border: var(--line); border-radius: 22px; background: var(--cream); box-shadow: 11px 11px 0 var(--ink); }
.comic-card::before { position: absolute; z-index: 0; top: -50px; left: -42px; width: 155px; height: 155px; border: 4px solid rgba(41, 35, 92, .2); border-radius: 50%; content: ""; }
.panel-content { position: relative; z-index: 1; padding: clamp(27px, 6vw, 52px); text-align: center; }

.burst { position: absolute; top: 25px; right: -28px; display: grid; width: 117px; height: 117px; place-items: center; color: var(--ink); background: var(--yellow); clip-path: polygon(50% 0%, 59% 28%, 76% 7%, 74% 34%, 100% 29%, 78% 48%, 100% 66%, 73% 64%, 78% 94%, 59% 71%, 50% 100%, 41% 72%, 20% 94%, 27% 65%, 0% 69%, 23% 49%, 0% 30%, 26% 35%, 21% 7%, 42% 29%); font: 17px/1 "Jua", sans-serif; transform: rotate(12deg); }
.eyebrow { margin: 0 0 10px; color: var(--deep-purple); font: 14px "Jua", sans-serif; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Jua", sans-serif; font-weight: 400; }
h1 { margin-bottom: 14px; font-size: clamp(39px, 9vw, 68px); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin-bottom: 14px; font-size: clamp(33px, 7vw, 53px); line-height: 1.16; letter-spacing: -.04em; }
.intro-copy, .question-subtitle { margin: 0 auto; font-size: 15px; font-weight: 700; line-height: 1.75; }

.cat-hero { display: block; width: min(360px, 85%); margin: 23px auto 20px; border: var(--line); border-radius: 20px; background: #c2a9ff; box-shadow: 5px 5px 0 var(--ink); transform: rotate(-2deg); }
.comic-button { display: inline-flex; min-width: 178px; align-items: center; justify-content: center; gap: 8px; padding: 15px 22px; border: var(--line); border-radius: 13px; color: var(--ink); background: var(--yellow); box-shadow: var(--shadow); font: 19px "Jua", sans-serif; transition: transform .12s ease, box-shadow .12s ease; }
.comic-button:hover, .comic-button:focus-visible { box-shadow: 3px 3px 0 var(--ink); outline: none; transform: translate(4px, 4px); }
.comic-button--pink { background: var(--pink); }
.comic-button--mint { background: var(--mint); }

.progress { display: flex; justify-content: center; gap: 9px; margin-bottom: 29px; }
.progress span { width: 44px; height: 10px; border: 2px solid var(--ink); border-radius: 20px; background: white; }
.progress span.is-active { background: var(--yellow); }
.progress span.is-done { background: var(--mint); }
.question-number { display: inline-block; margin-bottom: 10px; padding: 4px 10px; border: 2px solid var(--ink); border-radius: 100px; background: #ffd9e3; font: 12px "Jua", sans-serif; }
.affection-meter { display: flex; align-items: center; justify-content: center; gap: 9px; margin: -12px 0 19px; }
.affection-label { font: 12px "Jua", sans-serif; letter-spacing: .04em; }
.heart-track { display: flex; gap: 3px; }
.cat-heart { color: white; font-size: 21px; line-height: 1; text-shadow: 1px 1px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); transition: color .2s ease, transform .2s ease; }
.cat-heart.is-filled { color: var(--pink); transform: scale(1.13); }

.meme-box { display: grid; grid-template-columns: 58px 1fr; gap: 12px; max-width: 420px; margin: 23px auto; padding: 13px; border: 3px solid var(--ink); border-radius: 14px; background: #e5dcff; text-align: left; transform: rotate(.5deg); }
.meme-face { display: grid; width: 58px; height: 58px; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font-size: 34px; }
.meme-box strong { display: block; margin: 2px 0 3px; font: 16px "Jua", sans-serif; }
.meme-box p { margin: 0; font-size: 12px; font-weight: 700; line-height: 1.5; }

.answers { display: grid; gap: 11px; max-width: 430px; margin: 25px auto 0; }
.answer-button { width: 100%; padding: 14px 18px; border: 3px solid var(--ink); border-radius: 12px; color: var(--ink); background: white; box-shadow: 4px 4px 0 var(--ink); font-size: 15px; font-weight: 900; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.answer-button:hover, .answer-button:focus-visible { background: #fff2ae; outline: none; transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.answer-button[disabled] { cursor: default; opacity: .65; }
.answer-button.is-correct { color: var(--ink); background: var(--mint); }
.answer-button.is-wrong { background: #ffd9e3; }
.feedback { min-height: 45px; margin: 19px auto 0; font-size: 14px; font-weight: 900; line-height: 1.6; }
.feedback--wrong { display: flex; align-items: center; gap: 11px; min-height: 86px; padding: 9px 11px; border: 3px solid var(--ink); border-radius: 13px; background: #ffd9e3; text-align: left; box-shadow: 3px 3px 0 var(--ink); animation: shake .32s ease-in-out; }
.feedback--correct { display: flex; align-items: center; gap: 11px; min-height: 86px; padding: 9px 11px; border: 3px solid var(--ink); border-radius: 13px; background: #d7f8ed; text-align: left; box-shadow: 3px 3px 0 var(--ink); animation: pop-in .25s ease-out; }
.feedback--wrong .reaction-image, .feedback--correct .reaction-image { flex: 0 0 66px; width: 66px; height: 66px; border: 2px solid var(--ink); border-radius: 9px; object-fit: cover; background: white; }
.feedback--wrong strong, .feedback--correct strong { display: block; font: 17px "Jua", sans-serif; }
.feedback--wrong small, .feedback--correct small { display: block; margin-top: 2px; font-size: 11px; font-weight: 900; line-height: 1.4; }
@keyframes shake { 25% { transform: translateX(-5px) rotate(-1deg); } 50% { transform: translateX(5px) rotate(1deg); } 75% { transform: translateX(-3px); } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.94) rotate(-1deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.next-row { min-height: 54px; margin-top: 8px; }

.finish-card { background: #fff4aa; }
.finish-card::after { position: absolute; right: -30px; bottom: -50px; width: 160px; height: 160px; border: 28px dotted rgba(255, 123, 158, .46); border-radius: 50%; content: ""; }
.finish-card .panel-content { padding-bottom: 45px; }
.finish-cat { display: block; width: min(380px, 92%); margin: 18px auto; border: var(--line); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); }
.certificate { position: relative; max-width: 430px; margin: 25px auto; padding: 25px 78px 22px 25px; border: 4px dashed var(--ink); border-radius: 17px; background: #fffdf2; box-shadow: 5px 5px 0 var(--ink); text-align: left; }
.certificate-kicker { margin: 0 0 5px; color: var(--deep-purple); font: 12px "Jua", sans-serif; letter-spacing: .08em; }
.certificate h2 { margin: 0; font-size: 30px; }
.certificate-title { margin: 7px 0 9px; font: 20px/1.2 "Jua", sans-serif; }
.certificate-copy { margin: 0; font-size: 11px; font-weight: 900; line-height: 1.5; }
.certificate-seal { position: absolute; top: 17px; right: 13px; display: grid; width: 72px; height: 72px; place-items: center; border: 3px solid var(--ink); border-radius: 50%; color: var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font: 20px "Jua", sans-serif; transform: rotate(11deg); }
.fan-club-approval { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; padding-top: 11px; border-top: 2px solid var(--ink); font: 11px "Jua", sans-serif; letter-spacing: .03em; }
.fan-club-hearts { color: var(--pink); font-size: 16px; letter-spacing: -2px; text-shadow: 1px 1px 0 var(--ink); }
.jayden-note { max-width: 430px; margin: 30px auto; padding: 22px 18px; border: 3px solid var(--ink); border-radius: 16px; background: #e7deff; box-shadow: 5px 5px 0 var(--ink); }
.jayden-note-title { margin: 0 0 10px; font: 18px "Jua", sans-serif; }
.note-display { display: grid; min-height: 92px; place-items: center; margin-bottom: 14px; padding: 12px; border: 2px dashed var(--deep-purple); border-radius: 11px; background: rgba(255, 255, 255, .56); color: var(--deep-purple); font-size: 13px; font-weight: 900; }
.note-display-content { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 11px; width: 100%; color: var(--ink); text-align: left; }
.note-display-content img { width: 64px; height: 64px; border: 2px solid var(--ink); border-radius: 9px; object-fit: cover; }
.note-display-content strong { display: block; margin-bottom: 3px; font: 16px "Jua", sans-serif; }
.note-display-content p { margin: 0; font-size: 11px; font-weight: 900; line-height: 1.45; }
.jayden-note .comic-button { min-width: 0; padding: 11px 16px; font-size: 16px; }
.love-meme-label { margin: 2px 0 8px; color: var(--deep-purple); font: 13px "Jua", sans-serif; letter-spacing: .05em; }
.love-meme-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(380px, 92%); margin: 0 auto 24px; }
.love-meme-row img { width: 100%; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 10px; object-fit: cover; background: white; box-shadow: 2px 2px 0 var(--ink); }
.love-meme-row img:nth-child(1) { transform: rotate(-4deg); }
.love-meme-row img:nth-child(2) { transform: translateY(-3px) rotate(2deg); }
.love-meme-row img:nth-child(3) { transform: rotate(-2deg); }
.love-meme-row img:nth-child(4) { transform: translateY(2px) rotate(4deg); }
.final-note { max-width: 430px; margin: 0 auto 24px; font-size: 15px; font-weight: 900; line-height: 1.75; }
.stamp { display: inline-block; margin-bottom: 13px; padding: 6px 12px; border: 3px solid var(--ink); color: white; background: var(--deep-purple); font: 14px "Jua", sans-serif; letter-spacing: .08em; transform: rotate(-3deg); }
.memory-capsules { max-width: 500px; margin: 31px auto 28px; padding-top: 25px; border-top: 3px dashed rgba(41, 35, 92, .35); }
.memory-capsules h2 { margin: 2px 0 7px; font-size: 28px; }
.memory-capsules > p { margin: 0 0 16px; font-size: 12px; font-weight: 900; line-height: 1.5; }
.memory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; text-align: left; }
.memory-card { overflow: hidden; border: 3px solid var(--ink); border-radius: 12px; background: white; box-shadow: 3px 3px 0 var(--ink); }
.memory-photo, .memory-photo-placeholder { display: block; width: 100%; aspect-ratio: 1.25; object-fit: cover; }
.memory-photo-placeholder { display: grid; place-items: center; padding: 12px; color: var(--deep-purple); background: repeating-linear-gradient(-45deg, #fff5ae 0 10px, #ffe9e4 10px 20px); font: 15px/1.25 "Jua", sans-serif; text-align: center; }
.memory-card-copy { padding: 10px; }
.memory-card-copy strong { display: block; font: 15px "Jua", sans-serif; }
.memory-card-copy p { margin: 4px 0 0; color: #534d79; font-size: 11px; font-weight: 700; line-height: 1.45; }

.confetti-layer { position: fixed; z-index: 10; inset: 0; overflow: hidden; pointer-events: none; }
.confetti { position: absolute; top: -18px; width: 12px; height: 17px; border: 2px solid var(--ink); animation: fall 2.1s linear forwards; }
@keyframes fall { to { opacity: 0; transform: translate3d(var(--drift), 108vh, 0) rotate(600deg); } }
.easter-egg-layer { position: fixed; z-index: 20; inset: 0; overflow: hidden; pointer-events: none; }
.easter-egg-piece { position: absolute; top: -12vh; font-size: clamp(25px, 5vw, 48px); animation: secret-fall 2.5s linear forwards; }
@keyframes secret-fall { to { opacity: 0; transform: translate3d(var(--drift), 118vh, 0) rotate(540deg); } }
.easter-egg-toast { position: fixed; z-index: 30; top: 22px; left: 50%; max-width: calc(100vw - 32px); padding: 11px 16px; border: 3px solid var(--ink); border-radius: 12px; color: var(--ink); background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); font: 16px "Jua", sans-serif; opacity: 0; pointer-events: none; transform: translate(-50%, -18px); transition: opacity .2s ease, transform .2s ease; }
.easter-egg-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 480px) {
  .page-shell { padding: 12px; }
  .top-bar { margin-bottom: 15px; }
  .brand { font-size: 11px; }
  .top-actions { gap: 6px; }
  .language-toggle { padding: 6px 8px; font-size: 12px; }
  .mission-chip { padding: 7px 9px; font-size: 9px; }
  .game-wrap { min-height: calc(100svh - 79px); }
  .comic-card { border-radius: 17px; box-shadow: 7px 7px 0 var(--ink); }
  .panel-content { padding: 28px 18px; }
  .burst { top: 10px; right: -34px; width: 100px; height: 100px; font-size: 14px; }
  .cat-hero { margin-top: 17px; }
  .question-subtitle, .intro-copy { font-size: 13px; }
  .certificate { padding: 21px 73px 18px 18px; }
  .certificate h2 { font-size: 26px; }
  .fan-club-approval { align-items: flex-start; flex-direction: column; }
  .memory-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
