:root {
  --paper: #f3efe6;
  --ink: #141414;
  --muted: #6b665c;
  --red: #ff4a2e;
  --yellow: #ffd84a;
  --line: #141414;
  --card: #fffdf7;
  --display: 'Black Han Sans', 'Pretendard Variable', sans-serif;
  --mono: 'Nanum Gothic Coding', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: 'Pretendard Variable', Pretendard, system-ui, sans-serif; -webkit-font-smoothing: antialiased; word-break: keep-all; }
#app { max-width: 460px; margin: 0 auto; padding: 20px 18px 56px; min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

.brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand a { font-family: var(--display); font-size: 20px; text-decoration: none; letter-spacing: -0.5px; }
.brand small { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.hero h1 { font-family: var(--display); font-weight: 400; font-size: 64px; line-height: 0.98; margin: 10px 0 14px; letter-spacing: -1.5px; }
.hero h1 em { font-style: normal; background: var(--yellow); padding: 0 6px; }
.hero p { font-size: 17px; line-height: 1.55; margin: 0 0 22px; color: #2c2a26; }
.stamp { display: inline-block; font-family: var(--display); color: var(--red); border: 3px solid var(--red); padding: 4px 10px; transform: rotate(-4deg); font-size: 18px; border-radius: 6px; }

.field { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.field label { font-weight: 700; font-size: 14px; }
.field input { border: 2.5px solid var(--line); border-radius: 12px; padding: 14px 14px; font-size: 18px; background: var(--card); outline: none; }
.field input:focus { box-shadow: 4px 4px 0 var(--ink); }
.hint { font-size: 13px; color: var(--muted); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 2.5px solid var(--line); background: var(--ink); color: #fff; border-radius: 14px; padding: 16px 18px; font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: 4px 4px 0 var(--red); transition: transform .08s, box-shadow .08s; text-decoration: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--red); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }

.how { margin: 30px 0 0; border-top: 2px dashed var(--ink); padding-top: 18px; }
.how h3 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0 0 10px; }
.how ol { margin: 0; padding-left: 20px; line-height: 1.8; font-size: 15px; }

.head h2 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.1; margin: 4px 0 6px; letter-spacing: -0.5px; }
.head .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.progress { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 14px 0 6px; }
.progress i { height: 10px; border: 2px solid var(--ink); border-radius: 3px; background: var(--card); }
.progress i.on { background: var(--ink); }
.progress i.dead { background: var(--red); border-color: var(--red); }

.scene { background: var(--card); border: 2.5px solid var(--ink); border-radius: 18px; padding: 18px; margin: 18px 0; box-shadow: 6px 6px 0 var(--ink); }
.scene .age { font-family: var(--mono); font-weight: 700; font-size: 13px; background: var(--ink); color: #fff; display: inline-block; padding: 3px 8px; border-radius: 6px; }
.scene h3 { font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.22; margin: 12px 0 16px; letter-spacing: -0.3px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { text-align: left; border: 2.5px solid var(--ink); background: #fff; border-radius: 12px; padding: 15px 16px; font-size: 18px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.opt b { font-family: var(--mono); font-size: 14px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.opt:hover { background: var(--yellow); }
.opt:active { transform: translate(2px, 2px); }
.opt[disabled] { opacity: .5; }

.reveal { text-align: center; padding: 26px 18px; }
.reveal .choice { font-size: 15px; color: var(--muted); }
.reveal .result { font-family: var(--display); font-size: 30px; line-height: 1.25; margin: 14px 0; }
.reveal .delta { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.reveal .verdict { margin-top: 16px; }
.reveal .verdict .stamp { animation: stamp .45s cubic-bezier(.2,1.6,.4,1) both; animation-delay: .5s; }
.reveal.dead .result { color: var(--red); }
@keyframes stamp { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }

.timeline { list-style: none; padding: 0; margin: 18px 0; border-left: 3px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 16px 18px; }
.timeline li::before { content: ''; position: absolute; left: -8px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); }
.timeline li.empty::before { background: var(--paper); border: 2.5px solid var(--ink); width: 8px; height: 8px; }
.timeline li.dead::before { background: var(--red); }
.timeline .t-age { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.timeline .t-main { font-weight: 800; font-size: 16px; margin: 2px 0; }
.timeline .t-res { font-size: 15px; }
.timeline .t-by { font-family: var(--mono); font-size: 12px; background: var(--yellow); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.timeline li.empty .t-main { color: var(--muted); font-weight: 600; }

.poster { margin: 18px auto; width: 100%; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 6px 6px 0 var(--ink); display: block; background: #222; }
.note { background: var(--card); border: 2px dashed var(--ink); border-radius: 12px; padding: 14px; font-size: 15px; line-height: 1.6; }
.past { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 6px 0 0; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; transition: transform .25s; max-width: 90vw; z-index: 9; }
#toast.on { transform: translateX(-50%) translateY(0); }

.loading { padding-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.sk { height: 56px; border-radius: 14px; background: linear-gradient(90deg, #e8e3d7, #f6f2ea, #e8e3d7); background-size: 200% 100%; animation: sk 1.2s infinite; }
.sk-title { height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }
.footer { margin-top: 36px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center; }
