:root {
  --ink: #28231f;
  --cream: #fff8e8;
  --yellow: #ffd34e;
  --coral: #f26b4f;
  --green: #26735c;
  --line: #302820;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: #ffc95c;
  background-image: radial-gradient(circle at 10% 15%, #fff4bd 0 7%, transparent 7.2%), radial-gradient(circle at 90% 80%, #f59265 0 11%, transparent 11.2%), linear-gradient(135deg, #ffd66d, #ffb55d);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}

button { font: inherit; }
.hidden { display: none !important; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.shell {
  flex: 1;
  width: min(100%, 520px);
  margin: auto;
  padding: 28px 18px 16px;
  display: grid;
  place-items: center;
}

.card {
  position: relative;
  width: 100%;
  background: var(--cream);
  border: 3px solid var(--line);
  border-radius: 26px;
  box-shadow: 9px 10px 0 rgba(48, 40, 32, .92);
  padding: 34px 24px;
  overflow: hidden;
}

.intro { text-align: center; padding-top: 46px; }
.sticker { position: absolute; top: 14px; left: -7px; background: var(--green); color: white; padding: 7px 16px; transform: rotate(-3deg); font-size: .78rem; font-weight: 700; }
.moon { font-size: 4.6rem; filter: drop-shadow(4px 5px 0 #e9aa29); animation: float 2.8s ease-in-out infinite; }
.eyebrow, .situation { color: var(--coral); font-weight: 800; letter-spacing: .08em; font-size: .82rem; text-transform: uppercase; }

h1, h2 { font-family: "Arial Black", "Apple SD Gothic Neo", sans-serif; font-weight: 900; margin: 0; line-height: 1.12; word-break: keep-all; letter-spacing: -.04em; }
h1 { font-size: clamp(2.7rem, 11vw, 4.1rem); margin-top: 8px; }
h1 span { color: var(--coral); text-shadow: 2px 2px 0 var(--line); -webkit-text-stroke: 1px var(--line); }
.lead { line-height: 1.7; margin: 20px 0 24px; word-break: keep-all; }

.primary, .secondary {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .12s, box-shadow .12s;
}
.primary { background: var(--green); color: white; box-shadow: 4px 5px 0 var(--line); font-size: 1.06rem; }
.secondary { background: transparent; color: var(--ink); }
button:hover { transform: translateY(-2px); }
button:active { transform: translate(2px, 3px); box-shadow: none; }
button:focus-visible { outline: 4px solid #378fe9; outline-offset: 3px; }
.micro { font-size: .76rem; color: #756d63; margin: 17px 0 0; }

.progress-row { display: flex; justify-content: space-between; font-size: .77rem; font-weight: 800; }
.progress { height: 10px; margin: 9px 0 30px; border: 2px solid var(--line); border-radius: 99px; overflow: hidden; background: #e8dfcc; }
.progress div { height: 100%; width: 0; background: var(--coral); transition: width .25s ease; }
.quiz h2 { font-size: clamp(1.75rem, 7vw, 2.35rem); margin: 8px 0 25px; }
.answers { display: grid; gap: 11px; }
.answers button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--ink); background: white; border: 2px solid var(--line); border-radius: 14px; padding: 13px; cursor: pointer; font-weight: 700; line-height: 1.4; word-break: keep-all; box-shadow: 3px 3px 0 #d9ceba; }
.answers span { flex: 0 0 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); border: 1.5px solid var(--line); font-family: sans-serif; font-weight: 900; }

.result { text-align: center; }
.result-emoji { font-size: 5rem; margin: 8px 0; animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
.result h2 { font-size: clamp(2rem, 9vw, 3.1rem); color: var(--green); }
.score { display: inline-block; margin: 14px 0; background: var(--yellow); border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 900; }
.result-copy { line-height: 1.65; word-break: keep-all; }
.tip { margin: 20px 0; padding: 15px; background: #f2e7ce; border: 2px dashed var(--line); border-radius: 14px; display: grid; gap: 7px; word-break: keep-all; }
.tip b { color: var(--coral); font-size: .78rem; }
.actions { display: grid; gap: 11px; }
.toast { min-height: 1.2em; margin: 12px 0 0; color: var(--green); font-size: .82rem; font-weight: 800; }

footer { text-align: center; font-size: .78rem; padding: 18px; color: #5c3923; font-weight: 700; }

@keyframes float { 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }

@media (max-width: 380px) {
  .card { padding: 30px 18px; }
  .lead { font-size: .92rem; }
}

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