/* sajuzoo 테스트 공통 스타일. 허브와 모든 테스트 페이지가 함께 쓴다. */
:root {
  color-scheme: light dark;
  --ink: #1d1b3a; --soft: #5b5875; --bg: #f7f5fc; --card: #ffffff; --line: #e7e3f3; --chip: #f0ecff; --tint: #f4f0ff;
  --accent: #6a4cff; --good: #0f9f75; --bad: #e0436a;
  --g1: #6a4cff; --g2: #a55cff; --g3: #ff6fa5;
  --shadow: 0 10px 28px rgba(70, 50, 160, .13);
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f2f0fb; --soft: #b9b5d3; --bg: #13112a; --card: #1f1c37; --line: #34304f; --chip: #2b2750; --tint: #27234a;
    --accent: #9d87ff; --good: #3ddc97; --bad: #ff7896; --shadow: 0 10px 28px rgba(0, 0, 0, .35); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.6; word-break: keep-all; overflow-wrap: break-word; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }

/* 머리줄 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 560px; margin: 0 auto; padding: 12px 16px 4px; }
.back { color: var(--soft); text-decoration: none; font-size: 14px; white-space: nowrap; padding: 6px 0; }
.top .title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 28px; }

/* 테스트 첫 화면 */
.intro { text-align: center; }
.intro-hero { position: relative; overflow: hidden; margin-top: 6px; padding: 30px 18px 26px; border-radius: 28px; color: #fff;
  background: linear-gradient(150deg, var(--g1), var(--g2) 55%, var(--g3)); box-shadow: 0 18px 40px -18px var(--g1);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .16); }
.intro-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 12% 12%, rgba(255, 255, 255, .38) 0, transparent 32%),
    radial-gradient(circle at 92% 88%, rgba(255, 255, 255, .24) 0, transparent 36%); }
.intro-hero > * { position: relative; }
.big-emoji { font-size: 74px; line-height: 1.1; display: inline-block; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .18)); }
.emoji-row { font-size: 30px; letter-spacing: 6px; margin-top: 4px; }
.intro h1 { font-size: 27px; line-height: 1.3; margin: 10px 0 8px; letter-spacing: -0.03em; }
.intro .lead { margin: 0 auto; max-width: 420px; font-size: 15.5px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 0; }
.chips span { background: rgba(255, 255, 255, .24); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; font-weight: 700; }
.start { display: block; width: 100%; margin: 18px 0 6px; padding: 18px 16px; border: 0; border-radius: 22px; color: #fff; font-size: 20px; font-weight: 900;
  background: linear-gradient(135deg, #ff5fa2, #6a4cff); box-shadow: 0 14px 26px -12px rgba(106, 76, 255, .75);
  animation: breathe 2.2s ease-in-out infinite; }
.start:active { transform: scale(.98); }
.points { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; text-align: left; }
.points li { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 15px; }
.points .e { font-size: 24px; flex: none; }
.note { font-size: 12.5px; color: var(--soft); text-align: center; margin: 14px 4px; line-height: 1.55; }

/* 문제 화면 */
.qtop { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 0; background: var(--bg); }
.qback { flex: none; width: 46px; height: 46px; border-radius: 15px; border: 1px solid var(--line); background: var(--card); font-size: 20px; font-weight: 900; }
.qback:active { transform: scale(.94); }
.prog { flex: 1; min-width: 0; height: 12px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3));
  transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.qcount { flex: none; font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
.qcount b { color: var(--ink); font-size: 16px; }
.timer { flex: none; font-weight: 800; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--chip); font-variant-numeric: tabular-nums; }
.timer.hurry { background: #ffe1ea; color: #c92a5c; animation: breathe 1s ease-in-out infinite; }
.qstage { overflow-x: clip; padding-bottom: 6px; }
.qcard { text-align: center; padding: 6px 0 8px; }
.qcat { display: inline-block; margin: 4px 0 2px; padding: 3px 12px; border-radius: 999px; background: var(--chip); font-size: 13px; font-weight: 800; }
.qemoji { font-size: 62px; line-height: 1.15; margin: 6px 0 0; display: inline-block; animation: bob 2.6s ease-in-out infinite; }
.qnum { display: table; margin: 8px auto 4px; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2)); }
.qtext { font-size: 21px; line-height: 1.45; margin: 6px 4px 18px; letter-spacing: -0.02em; }
.qfig { margin: -4px auto 18px; }
.opts { display: grid; gap: 12px; text-align: left; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 20px;
  background: var(--card); font-size: 16.5px; font-weight: 650; line-height: 1.45; text-align: left; box-shadow: 0 3px 0 var(--line);
  transition: transform .12s ease, border-color .15s ease, background-color .15s ease; }
@media (hover: hover) { .opt:hover { border-color: var(--g1); } }
.opt:active { transform: translateY(2px) scale(.99); box-shadow: 0 1px 0 var(--line); }
.opt .ob { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 900; background: var(--chip); }
.opt .ot { flex: 1; min-width: 0; }
.opt.picked { border-color: var(--g1); background: var(--tint); background: color-mix(in srgb, var(--g1) 15%, var(--card)); animation: pick .28s ease; }
.opt.picked .ob { color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); }
.opts.grid { grid-template-columns: 1fr 1fr; }
.opts.grid .opt { position: relative; flex-direction: column; justify-content: center; min-height: 118px; padding: 12px 8px; text-align: center; }
.opts.grid .opt .ob { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 10px; font-size: 14px; }
.opts.grid .opt .ot { flex: none; display: grid; place-items: center; }

/* 결과 화면 */
.rhead { text-align: center; font-weight: 900; font-size: 18px; margin: 12px 0 12px; }
.scard { position: relative; overflow: hidden; text-align: center; color: #fff; padding: 22px 20px 16px; border-radius: 30px;
  background: linear-gradient(150deg, var(--c1), var(--c2) 55%, var(--c3)); box-shadow: 0 22px 44px -20px var(--c1);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .2); animation: pop .6s cubic-bezier(.3, 1.5, .5, 1) both; }
.scard::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 10% 8%, rgba(255, 255, 255, .4) 0, transparent 30%),
    radial-gradient(circle at 95% 90%, rgba(255, 255, 255, .26) 0, transparent 36%),
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, .16) 0, transparent 20%); }
.scard > * { position: relative; }
.sc-kick { display: inline-block; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, .24); border-radius: 999px; padding: 3px 12px; }
.sc-emoji { font-size: 96px; line-height: 1.12; margin: 10px 0 2px; display: inline-block; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .22)); }
.sc-code { font-size: 21px; font-weight: 900; }
.sc-code.latin { font-size: 22px; letter-spacing: .16em; }
.sc-name { font-size: 31px; font-weight: 900; line-height: 1.25; letter-spacing: -0.03em; }
.sc-sum { margin: 8px auto 16px; max-width: 330px; font-size: 16px; font-weight: 650; line-height: 1.5; }
.sc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 800; opacity: .9; border-top: 1px dashed rgba(255, 255, 255, .5); padding-top: 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px; }
.btn { min-height: 56px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 15.5px; padding: 10px 8px; line-height: 1.3; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, #ff5fa2, #6a4cff); box-shadow: 0 12px 22px -12px rgba(106, 76, 255, .8); }
.btn:active { transform: scale(.97); }
.copybox { margin: 4px 0 10px; text-align: center; }
.copybox input { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 2px solid var(--accent); border-radius: 14px; padding: 10px 12px; }
.copybox small { color: var(--soft); }
.sec { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px; margin: 14px 0; }
.sec h3 { margin: 0 0 10px; font-size: 18px; letter-spacing: -0.02em; }
.sec p { margin: 0 0 10px; }
.sec p:last-child { margin-bottom: 0; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { display: flex; gap: 10px; align-items: flex-start; background: var(--tint); border-radius: 14px; padding: 10px 12px; font-size: 15px; }
.list .e { flex: none; font-size: 20px; line-height: 1.35; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { display: block; text-decoration: none; text-align: center; padding: 14px 10px; border-radius: 20px; color: #fff;
  background: linear-gradient(145deg, var(--c1), var(--c2) 60%, var(--c3)); text-shadow: 0 1px 8px rgba(0, 0, 0, .18); }
.mini .e { display: block; font-size: 42px; line-height: 1.2; }
.mini b { display: block; font-size: 15px; line-height: 1.35; }
.mini small { display: block; font-size: 12.5px; line-height: 1.45; margin-top: 4px; opacity: .96; }
.allgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.allgrid a { text-decoration: none; text-align: center; padding: 8px 2px 7px; border-radius: 14px; background: var(--tint); font-size: 11.5px; font-weight: 700; line-height: 1.3; }
.allgrid a .e { display: block; font-size: 26px; line-height: 1.3; }
.allgrid a.on { box-shadow: inset 0 0 0 2px var(--accent); }
.fine { font-size: 12.5px; color: var(--soft); margin: 10px 0 0; }
.more h3 { font-size: 18px; margin: 26px 0 8px; }
.mt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; color: #fff; text-decoration: none; margin: 8px 0;
  background: linear-gradient(135deg, var(--c1), var(--c2) 65%, var(--c3)); text-shadow: 0 1px 8px rgba(0, 0, 0, .18); }
.mt .e { font-size: 32px; flex: none; }
.mt .tx { flex: 1; min-width: 0; }
.mt b { display: block; font-size: 15.5px; }
.mt small { display: block; font-size: 12.5px; opacity: .95; }
.mt .go { flex: none; font-size: 24px; font-weight: 900; }
.all-link { display: block; text-align: center; margin: 12px 0 0; font-weight: 800; color: var(--accent); text-decoration: none; padding: 8px; }

/* 아래쪽 안내 (모든 페이지 공통) */
.foot { width: 100%; max-width: 560px; margin: 0 auto; padding: 10px 16px 30px; text-align: center; color: var(--soft); font-size: 13px; }
.foot .dm { margin: 0; padding: 18px 16px; border-radius: 22px; background: linear-gradient(135deg, #ffe7f1, #efe9ff); color: #2a2450; font-size: 14.5px; line-height: 1.65; }
.foot .dm b { display: block; font-size: 18px; margin-bottom: 4px; }
.foot .dm a { color: #4a33d6; font-weight: 800; }
.foot .sign { font-size: 12px; margin: 16px 0 0; }

/* 알림, 꽃가루 */
.toast { position: fixed; left: 16px; right: 16px; bottom: 22px; z-index: 60; width: fit-content; max-width: 480px; margin: 0 auto; padding: 12px 18px;
  border-radius: 18px; background: #1d1b3a; color: #fff; font-weight: 700; font-size: 14.5px; text-align: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  opacity: 0; transform: translateY(24px); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.confetti { position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; }
.confetti span { position: absolute; top: -48px; animation: fall 2s cubic-bezier(.25, .6, .45, 1) both; }

/* 움직임 */
.in-r { animation: inR .36s cubic-bezier(.2, .8, .2, 1) both; }
.in-l { animation: inL .36s cubic-bezier(.2, .8, .2, 1) both; }
.in-up { animation: inUp .4s cubic-bezier(.2, .8, .2, 1) both; }
.fade-up { animation: inUp .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes inR { from { opacity: 0; transform: translateX(32px); } }
@keyframes inL { from { opacity: 0; transform: translateX(-32px); } }
@keyframes inUp { from { opacity: 0; transform: translateY(18px); } }
@keyframes bob { 50% { transform: translateY(-7px) rotate(-3deg); } }
@keyframes breathe { 50% { transform: scale(1.025); } }
@keyframes pick { 50% { transform: scale(1.025); } }
@keyframes pop { 0% { opacity: 0; transform: scale(.75) rotate(-2deg); } 60% { opacity: 1; transform: scale(1.03); } 100% { transform: none; } }
@keyframes fall { to { transform: translate(var(--dx), 108vh) rotate(var(--r)); } }
@keyframes grow { from { width: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
