:root {
  --bg: #e9efe2;
  --ink: #1f2a22;
  --muted: #5e6b5f;
  --card: #ffffff;
  --zombie: #9fd08a;
  --zombie-deep: #4f8a3c;
  --heart: #e5484d;
  --heart-empty: #d9ded4;
  --warn: #fff3c4;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
main { max-width: 480px; margin: 0 auto; padding: 28px 16px 24px; }
.hidden { display: none !important; }

.card { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--ink); }
.btn {
  display: block; width: 100%; padding: 16px; border-radius: 16px; border: 3px solid var(--ink);
  background: #fff; color: var(--ink); font: inherit; font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--zombie-deep); color: #fff; }

/* 시작 */
#start { text-align: center; }
.hero { width: 180px; height: 180px; margin: 0 auto 12px; }
.hero svg { width: 100%; height: 100%; display: block; }
.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--zombie); font-size: 13px; font-weight: 800; }
h1 { margin: 12px 0 8px; font-size: 32px; font-weight: 900; letter-spacing: -0.03em; }
.lead { margin: 0 0 20px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.how { padding: 18px; margin-bottom: 18px; }
.how p { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.fine { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* 하트 */
.hearts { display: flex; gap: 4px; }
.hearts.big { justify-content: center; gap: 6px; }
.hearts svg { width: 26px; height: 26px; display: block; }
.hearts.big svg { width: 34px; height: 34px; }
.hearts .lose { animation: lose 0.5s ease; }
.hearts .gain { animation: gain 0.5s ease; }
@keyframes lose { 0% { transform: scale(1.3); } 40% { transform: scale(0.8) rotate(-12deg); } 100% { transform: scale(1); } }
@keyframes gain { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* 장면 */
.play-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.step { font-size: 13px; font-weight: 800; color: var(--muted); }
.scene { padding: 14px 14px 20px; margin-bottom: 18px; }
.scene .when { margin-left: 6px; }
.scene .scene-text { padding: 0 6px; }
.when { display: inline-block; font-size: 12px; font-weight: 800; color: var(--zombie-deep); background: #eaf5e3; padding: 4px 10px; border-radius: 999px; }
.scene-text { margin: 12px 0 0; font-size: 19px; font-weight: 800; line-height: 1.55; letter-spacing: -0.02em; }
.choices { display: grid; gap: 12px; }
.choices .btn { text-align: left; font-size: 16px; font-weight: 700; line-height: 1.45; }
@media (hover: hover) { .choices .btn:hover { background: #f1f8ec; } }

.outcome { padding: 20px; border-radius: var(--radius); border: 3px dashed var(--ink); background: #fff; }
.delta { margin: 0 0 8px; font-size: 15px; font-weight: 900; }
.delta.down { color: var(--heart); }
.delta.up { color: var(--zombie-deep); }
.delta.dead { font-size: 20px; color: var(--heart); }
.outcome-text { margin: 0 0 16px; font-size: 16px; line-height: 1.6; font-weight: 600; }

/* 결과 */
.shared-note { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.r-head { padding: 26px 20px 24px; text-align: center; background: var(--zombie); }
.r-label { margin: 0; font-size: 14px; font-weight: 800; }
.r-time { margin: 6px 0 12px; font-size: 44px; font-weight: 900; letter-spacing: -0.03em; }
.r-quote { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.45; }
.r-twist { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; }
.r-sec { margin-top: 18px; padding: 20px; }
.r-sec h3 { margin: 0 0 10px; font-size: 17px; font-weight: 900; }
.r-sec p { margin: 0; font-size: 15px; line-height: 1.7; }
.last { background: var(--warn); }

.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ladder li { display: grid; grid-template-columns: 26px 92px 1fr; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 12px; background: #f3f6ef; font-size: 13px; line-height: 1.4; }
.ladder .no { font-weight: 900; color: var(--muted); }
.ladder .t { font-weight: 900; }
.ladder .q { color: var(--muted); }
.ladder li.me { background: var(--ink); color: #fff; }
.ladder li.me .no, .ladder li.me .q { color: var(--zombie); }

.actions { margin-top: 20px; display: grid; gap: 10px; }
.actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 10;
}

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 36px; }
footer p { margin: 0 0 6px; }
footer a { color: var(--ink); font-weight: 700; }

/* 장면 그림: 낡은 TV 화면 (도트 그림 + 지지직 노이즈 + 주사선) */
.tv { position: relative; margin-bottom: 14px; padding: 8px; border-radius: 16px; background: #2b2f2a; border: 3px solid var(--ink); }
.tv-screen { position: relative; aspect-ratio: 40 / 24; border-radius: 10px; overflow: hidden; background: #0e1410; }
.tv-screen svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; shape-rendering: crispEdges;
  filter: drop-shadow(1px 0 rgba(255, 60, 60, 0.35)) drop-shadow(-1px 0 rgba(60, 160, 255, 0.35)) saturate(0.9);
  animation: jitter 4s steps(1) infinite; }
/* 주사선 */
.tv-screen::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px); }
/* 노이즈 + 가장자리 어둡게 */
.tv-screen::after { content: ""; position: absolute; inset: -50%; z-index: 3; pointer-events: none; opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: static 0.35s steps(4) infinite; }
.tv-vignette { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: 10px;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.55); }
/* 그림이 없는 장면: 화면 전체가 지지직 */
.tv-screen.nosignal::after { opacity: 0.55; }
.tv-screen.nosignal { background: #3a4039; }
/* 장면이 바뀔 때 잠깐 크게 지지직 */
.tv-screen.switch::after { opacity: 0.7; }
.tv-screen.switch svg { animation: roll 0.35s steps(3) 1; }
@keyframes static { 0% { transform: translate(0, 0); } 25% { transform: translate(-6%, 4%); } 50% { transform: translate(5%, -7%); } 75% { transform: translate(-3%, -5%); } 100% { transform: translate(4%, 6%); } }
@keyframes jitter { 0%, 92%, 100% { transform: none; } 93% { transform: translateX(2px) skewX(-2deg); } 95% { transform: translateX(-2px); } }
@keyframes roll { 0% { transform: translateY(-12%) skewX(4deg); opacity: 0.4; } 50% { transform: translateY(6%); } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tv-screen svg, .tv-screen::after { animation: none; } }

/* 결과: 유형 분석 */
.why { background: #eaf5e3; }
.style-bars { display: grid; gap: 10px; }
.sbar { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sbar span:last-child { text-align: right; }
.sbar .on { color: var(--zombie-deep); font-weight: 900; }
.sbar .track { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.sbar .track i { display: block; height: 100%; background: var(--zombie-deep); }
.style-note { margin-top: 12px !important; font-size: 14px !important; color: var(--muted); }
.style-note b { color: var(--ink); }
.sw { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sw-box { padding: 14px; border-radius: 16px; border: 2.5px solid var(--ink); }
.sw-box.good { background: #eaf5e3; }
.sw-box.bad { background: #fde8e6; }
.sw-box h4, .item h4 { margin: 0 0 8px; font-size: 14px; font-weight: 900; }
.sw-box ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.item { margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--warn); border: 2.5px solid var(--ink); }
.item p { font-size: 15px !important; font-weight: 700; }
.acts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.acts li { padding: 11px 14px; border-radius: 12px; background: #f3f6ef; font-size: 15px; font-weight: 600; line-height: 1.5; }
.partner { padding: 14px; border-radius: 16px; border: 2.5px solid var(--ink); }
.partner + .partner { margin-top: 10px; }
.partner.best { background: #eaf5e3; }
.partner.worst { background: #fde8e6; }
.partner .p-label { display: inline-block; font-size: 12px; font-weight: 900; padding: 3px 10px; border-radius: 999px; background: var(--ink); color: #fff; margin-bottom: 8px; }
.partner b { display: block; font-size: 16px; font-weight: 900; line-height: 1.4; }
.partner small { display: block; margin: 2px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.partner p { font-size: 14px !important; }
