:root {
  color-scheme: light;
  --ink: #14213d;
  --paper: #f6fbff;
  --blue: #46a7ff;
  --blue-soft: #dff2ff;
  --purple: #9476f4;
  --pink: #ff7f9f;
  --yellow: #ffe75c;
  --green: #80dfad;
  --line: #12234a;
  font-family: "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; touch-action: manipulation; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18px 18px, #8cb9ef30 2px, transparent 2.5px) 0 0 / 36px 36px,
    linear-gradient(145deg, #f8fcff, #f5efff 62%, #edfaff);
}
button, a { font: inherit; touch-action: manipulation; }
button { color: inherit; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease, filter .08s ease; }
button:active:not(:disabled) { transform: translate(3px, 3px) !important; box-shadow: 0 0 0 var(--line) !important; }
[hidden] { display: none !important; }

.page { width: min(100% - 28px, 1060px); margin: auto; padding: 12px 0 42px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 53px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 900; letter-spacing: -.04em; text-decoration: none; }
.brand img { width: 43px; height: 43px; object-fit: contain; }
.brand small { display: block; color: #65708a; font-size: 8px; letter-spacing: .1em; }
.header-links { display: flex; gap: 8px; }
.header-links a { padding: 7px 12px; border: 3px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; text-decoration: none; box-shadow: 3px 3px 0 var(--line); }
.header-links a:last-child { background: var(--yellow); }

.top-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 18px; margin-top: 14px; }
.main-column { min-width: 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 20px; min-height: 300px; padding: 28px; border: 5px solid var(--line); border-radius: 30px; background: linear-gradient(140deg, #7dc9ff, #a999ff 55%, #ffafd0); box-shadow: 7px 8px 0 var(--line); overflow: hidden; }
.eyebrow, .card-kicker { display: inline-block; padding: 5px 11px; border: 3px solid var(--line); border-radius: 999px; background: var(--yellow); color: var(--ink); font-family: "Gaegu", cursive; font-size: 17px; font-weight: 700; line-height: 1; box-shadow: 2px 2px 0 var(--line); transform: rotate(-1deg); }
.hero h1 { margin: 10px 0 12px; font-family: "Gaegu", cursive; font-size: clamp(48px, 7vw, 70px); line-height: .86; letter-spacing: -.07em; text-shadow: 2px 3px 0 #fff; }
.hero-copy > p { max-width: 500px; margin: 0; color: #10203d; font-size: 18px; font-weight: 700; line-height: 1.5; }
.hero-pills { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.hero-pills span { padding: 5px 10px; border: 3px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 800; box-shadow: 2px 2px 0 var(--line); }
.hero-pills span:nth-child(2) { background: var(--green); }
.hero-pills span:nth-child(3) { background: #f1ddff; }
.hero-art { position: relative; margin: 0; padding: 8px 8px 31px; border: 5px solid var(--line); border-radius: 28px; background: #fff; box-shadow: 5px 5px 0 var(--line); transform: rotate(2deg); }
.hero-art img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 3px solid var(--line); border-radius: 20px; }
.hero-art figcaption { position: absolute; right: 4px; bottom: 4px; left: 4px; font-family: "Gaegu", cursive; font-size: 15px; font-weight: 700; text-align: center; }

.quiz-card { position: relative; margin-top: 21px; padding: 24px; border: 5px solid var(--line); border-radius: 28px; background: #fff; box-shadow: 6px 7px 0 var(--line); }
.quiz-card h2 { margin: 15px 0 10px; font-family: "Gaegu", cursive; font-size: clamp(30px, 4vw, 40px); line-height: 1.06; letter-spacing: -.04em; }
.quiz-card > p { margin: 8px 0; font-size: 17px; line-height: 1.65; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 7px 18px; border: 4px solid var(--line); border-radius: 16px; font-family: "Gaegu", cursive; font-size: 21px; font-weight: 700; box-shadow: 4px 5px 0 var(--line); }
.primary-button { background: var(--yellow); }
.secondary-button { background: var(--blue-soft); }
.secondary-button:nth-of-type(3) { background: var(--green); }
.primary-button:focus-visible, .secondary-button:focus-visible, .text-button:focus-visible, .choice:focus-visible { outline: 4px dashed #ee4169; outline-offset: 4px; }
.small-note { margin-top: 14px !important; color: #58657e !important; font-size: 13px !important; }

.progress-head { display: flex; justify-content: space-between; gap: 10px; font-family: "Gaegu", cursive; font-size: 18px; font-weight: 700; }
.progress-head span:first-child { padding: 2px 9px; border: 2px solid var(--line); border-radius: 999px; background: var(--yellow); }
.progress-track { height: 20px; margin: 11px 0 23px; border: 4px solid var(--line); border-radius: 999px; background: #eef4ff; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple), var(--pink)); transition: width .18s; }
.choices { display: grid; gap: 14px; margin-top: 20px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 13px 16px; border: 4px solid var(--line); border-radius: 18px; background: #f8fbff; color: var(--ink); font-size: 18px; font-weight: 700; text-align: left; line-height: 1.45; box-shadow: 3px 4px 0 var(--line); }
.choice:nth-child(2) { background: #f4edff; }
.choice:hover, .choice[aria-pressed="true"] { background: #fff1a9; transform: translate(-1px, -1px); }
.choice-index { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 3px solid var(--line); border-radius: 50%; background: var(--blue); color: #fff; font-family: "Gaegu", cursive; font-size: 19px; }
.question-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.text-button { padding: 6px 9px; border: 0; border-bottom: 3px dashed var(--line); background: transparent; font-weight: 800; }
.text-button:disabled { opacity: .4; cursor: default; }

.capture-sticker { position: absolute; top: -14px; right: 15px; padding: 4px 11px; border: 3px solid var(--line); border-radius: 999px; background: var(--green); font-family: "Gaegu", cursive; font-size: 15px; font-weight: 700; box-shadow: 2px 2px 0 var(--line); transform: rotate(2deg); }
.result-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 22px; margin-top: 15px; padding: 15px; border: 4px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, #fff 0 56%, #e8e3ff 100%); box-shadow: 3px 4px 0 var(--line); }
.result-art { display: grid; width: 100%; aspect-ratio: 1; place-items: center; border: 4px solid var(--line); border-radius: 50%; background: radial-gradient(circle, #fff 0 56%, #c7edff 57% 100%); overflow: hidden; }
.result-art img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(3px 5px 1px #20315822); }
.result-heading { min-width: 0; }
.result-label { display: inline-block; margin: 0 0 4px !important; padding: 3px 9px; border: 2px solid var(--line); border-radius: 999px; background: var(--green); font-family: "Gaegu", cursive; font-size: 16px !important; font-weight: 700; }
.result-heading h2 { margin: 0; font-size: 48px; line-height: 1; }
.result-heading > p:not(.result-label) { margin: 7px 0 0; color: #5e43b9; font-family: "Gaegu", cursive; font-size: 21px; font-weight: 700; line-height: 1.2; }
.result-keywords { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.result-keywords span { padding: 4px 9px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 800; box-shadow: 1px 2px 0 var(--line); }
.result-summary { margin: 18px 0 0 !important; padding: 18px; border: 4px solid var(--line); border-radius: 17px; background: #fff; font-size: 17px !important; font-weight: 600; line-height: 1.72 !important; letter-spacing: -.025em; box-shadow: 3px 3px 0 var(--line); }
.retry-cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 60px; margin: 18px 0 4px; padding: 7px 16px; border: 5px solid var(--line); border-radius: 17px; background: var(--yellow); font-family: "Gaegu", cursive; font-size: 28px; font-weight: 700; box-shadow: 5px 6px 0 var(--line); }
.result-section-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 11px; font-family: "Gaegu", cursive; font-size: 27px; line-height: 1; }
.result-section-title span { display: grid; width: 36px; height: 36px; place-items: center; border: 3px solid var(--line); border-radius: 50%; background: var(--yellow); font-size: 18px; }
.result-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-details article { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 15px 13px; border: 4px solid var(--line); border-radius: 17px; background: var(--blue-soft); box-shadow: 3px 3px 0 var(--line); }
.result-details article:nth-child(2) { background: #ffe5ec; }
.result-details article:nth-child(3) { background: #e3f9e9; }
.detail-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: #fff; font-size: 18px; }
.result-details strong { display: block; color: #5740b5; font-family: "Gaegu", cursive; font-size: 19px; line-height: 1.1; }
.result-details p { margin: 7px 0 0; font-size: 14px; line-height: 1.58; letter-spacing: -.025em; }
.reply-matchups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reply-matchups article { min-width: 0; padding: 15px; border: 4px solid var(--line); border-radius: 18px; box-shadow: 3px 3px 0 var(--line); }
.reply-matchups .match-card { background: #dcf8e5; }
.reply-matchups .mismatch-card { background: #ffe2e9; }
.reply-matchups > article > span { display: block; font-family: "Gaegu", cursive; font-size: 18px; font-weight: 700; }
.match-person { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.match-person img { flex: 0 0 80px; width: 80px; height: 80px; object-fit: contain; }
.reply-matchups strong { display: block; font-family: "Gaegu", cursive; font-size: 27px; line-height: 1; }
.reply-matchups p { margin: 7px 0 0; font-size: 14px; line-height: 1.58; letter-spacing: -.025em; }
.score-area { margin-top: 19px; padding: 15px; border: 4px dashed var(--line); border-radius: 16px; background: #f9fbff; }
.score-area h3 { margin: 0 0 11px; font-family: "Gaegu", cursive; font-size: 24px; }
.score-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 75px; align-items: center; gap: 8px; margin-top: 9px; font-size: 14px; }
.score-track { height: 14px; border: 3px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.score-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple)); }
.score-area > p { margin: 11px 0 0; font-weight: 700; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 23px; }
.share-actions .primary-button { background: var(--pink); }
.result-card .small-note { padding: 9px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; }

.guide { margin-top: 28px; padding: 21px; border: 5px solid var(--line); border-radius: 25px; background: #fff; box-shadow: 5px 6px 0 var(--line); }
.guide h2 { margin: 0 0 10px; font-family: "Gaegu", cursive; font-size: 32px; }
.guide h3 { display: inline-block; margin: 22px 0 7px; padding-bottom: 2px; border-bottom: 4px solid var(--pink); font-family: "Gaegu", cursive; font-size: 24px; }
.guide p { margin: 0; font-size: 16px; line-height: 1.65; }
.guide a { color: #315acb; font-weight: 800; }
.type-list { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 15px; }
.type-list span { padding: 6px 10px; border: 3px solid var(--line); border-radius: 999px; background: var(--yellow); font-family: "Gaegu", cursive; font-size: 16px; font-weight: 700; box-shadow: 2px 2px 0 var(--line); }
.type-list span:nth-child(2n) { background: var(--blue-soft); }
.type-list span:nth-child(3n) { background: #e6dcff; }

.side-column { display: grid; gap: 14px; }
.desktop-ad[hidden], .mobile-ad[hidden] { display: none; }
.desktop-ad:not([hidden]) { display: grid; width: 300px; min-height: 268px; grid-template-rows: 12px 250px; place-items: center; gap: 6px; color: #6d7282; font-size: 9px; }
.adfit-label { color: #6d7282; font-size: 9px; font-weight: 700; }
.side-links { display: grid; gap: 8px; padding: 15px; border: 5px solid var(--line); border-radius: 22px; background: #e9e2ff; box-shadow: 5px 5px 0 var(--line); }
.side-links h2 { margin: 0; font-family: "Gaegu", cursive; font-size: 27px; }
.side-links a { display: flex; justify-content: space-between; gap: 8px; padding: 9px; border: 3px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; }
.mobile-ad { display: none; width: min(100%, 380px); min-height: 118px; grid-template-rows: 10px 100px; place-items: center; gap: 6px; margin: 23px auto 0; }
.mobile-ad[data-adfit-fluid] .kakao_ad_area { width: 100% !important; max-width: 100%; }
.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 35px; padding: 16px 10px 0; border-top: 4px dashed var(--line); font-family: "Gaegu", cursive; font-size: 17px; }
.site-footer nav { display: flex; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--ink); font-weight: 700; }

.shared-result .hero { display: none; }
.shared-result .top-layout { margin-top: 8px; }
.shared-result .result-card { margin-top: 0; }
.shared-result .retry-cta { animation: shared-cta-pop .5s ease both; }
@keyframes shared-cta-pop { from { transform: scale(.92); } to { transform: scale(1); } }

@media (max-width: 980px) {
  .top-layout { grid-template-columns: 1fr; }
  .side-column { display: none; }
  .mobile-ad:not([hidden]) { display: grid; }
  .result-details { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .page { width: min(100% - 18px, 1060px); padding-top: 7px; }
  .brand { font-size: 13px; }
  .brand img { width: 38px; height: 38px; }
  .header-links a { padding: 6px 9px; border-width: 2px; font-size: 12px; box-shadow: 2px 2px 0 var(--line); }
  .top-layout { margin-top: 10px; }
  .hero { grid-template-columns: minmax(0, 1fr) 110px; min-height: 0; gap: 10px; padding: 16px 14px; border-width: 4px; border-radius: 22px; box-shadow: 5px 6px 0 var(--line); }
  .hero h1 { margin: 8px 0; font-size: 43px; }
  .hero-copy > p { font-size: 15px; line-height: 1.45; }
  .eyebrow { font-size: 13px; }
  .hero-pills { margin-top: 10px; gap: 4px; }
  .hero-pills span { padding: 3px 6px; border-width: 2px; font-size: 11px; box-shadow: 1px 1px 0 var(--line); }
  .hero-art { padding: 4px 4px 24px; border-width: 4px; border-radius: 17px; box-shadow: 3px 3px 0 var(--line); }
  .hero-art img { border-width: 2px; border-radius: 13px; }
  .hero-art figcaption { font-size: 10px; }
  .quiz-card { margin-top: 17px; padding: 15px; border-width: 4px; border-radius: 21px; box-shadow: 4px 5px 0 var(--line); }
  .quiz-card h2 { font-size: 31px; }
  .quiz-card > p { font-size: 15px; }
  .primary-button, .secondary-button { min-height: 47px; padding: 5px 13px; border-width: 3px; font-size: 19px; box-shadow: 3px 4px 0 var(--line); }
  .choice { min-height: 58px; padding: 9px 10px; border-width: 3px; font-size: 16px; box-shadow: 2px 3px 0 var(--line); }
  .progress-track { height: 17px; margin-bottom: 17px; }
  .result-hero { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .result-art { width: min(64vw, 210px); margin: auto; }
  .result-heading { text-align: center; }
  .result-heading h2 { font-size: 44px; }
  .result-heading > p:not(.result-label) { font-size: 20px; }
  .result-keywords { justify-content: center; }
  .result-summary { padding: 15px !important; font-size: 16px !important; line-height: 1.67 !important; }
  .retry-cta { min-height: 54px; border-width: 4px; font-size: 24px; box-shadow: 4px 5px 0 var(--line); }
  .result-section-title { margin-top: 25px; font-size: 25px; }
  .result-details article { padding: 13px; }
  .capture-sticker { right: 5px; font-size: 12px; }
  .reply-matchups { grid-template-columns: 1fr; gap: 11px; }
  .reply-matchups article { padding: 13px; }
  .match-person img { flex-basis: 88px; width: 88px; height: 88px; }
  .reply-matchups strong { font-size: 28px; }
  .reply-matchups p { font-size: 15px; }
  .score-row { grid-template-columns: 1fr 65px; }
  .score-row > span { grid-column: 1 / -1; }
  .share-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .share-actions .primary-button { grid-column: 1 / -1; }
  .guide { padding: 15px; border-width: 4px; box-shadow: 4px 5px 0 var(--line); }
  .guide h2 { font-size: 28px; }
  .guide p { font-size: 15px; }
  .mobile-ad { position: relative; left: 50%; width: max(320px, calc(100vw - 10px)); margin-left: 0; transform: translateX(-50%); }
}

@media (max-width: 360px) {
  .header-links a:first-child { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr) 88px; }
  .hero h1 { font-size: 38px; }
  .hero-copy > p { font-size: 13px; }
  .hero-pills span:nth-child(2) { display: none; }
  .share-actions { grid-template-columns: 1fr; }
  .share-actions .primary-button, .share-actions .secondary-button { grid-column: 1; width: 100%; }
}
