:root {
  --ink: #171711;
  --paper: #fffdf6;
  --yellow: #f5b83b;
  --orange: #f06a35;
  --blue: #3a64d8;
  --muted: #68675f;
  --line: #ded8c9;
  --shadow: 0 28px 80px #33220d2b;
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  background: #f5b83b;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, #ffe6a1, transparent 32rem),
    linear-gradient(145deg, #f7c44e, #ee8d3c);
  color: var(--ink);
}
button,
a {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 4px solid #3a64d866;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.shell {
  width: min(calc(100% - 30px), 720px);
  margin: auto;
  padding: 16px 0 30px;
}
header {
  display: flex;
  height: 52px;
  padding: 0 5px;
  align-items: center;
  justify-content: space-between;
}
header a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-decoration: none;
}
header span {
  font: 900 9px/1 monospace;
  letter-spacing: 0.15em;
}
.card {
  overflow: hidden;
  min-height: 720px;
  border: 2px solid #1d1b14;
  border-radius: 32px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.screen {
  padding: clamp(27px, 7vw, 52px);
  animation: enter 0.35s ease both;
}
.intro {
  text-align: center;
}
.hero {
  position: relative;
  overflow: hidden;
  height: 235px;
  margin-bottom: 27px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: #ffd864;
}
.hero svg {
  width: 290px;
  height: 220px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 8;
}
.hero:before,
.hero:after {
  position: absolute;
  border: 2px solid var(--ink);
  border-radius: 50%;
  content: "";
}
.hero:before {
  top: 35px;
  left: 28px;
  width: 20px;
  height: 20px;
  background: var(--orange);
}
.hero:after {
  right: 30px;
  bottom: 28px;
  width: 33px;
  height: 33px;
  background: var(--blue);
}
.timer-mark {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 54px;
  height: 54px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font: 950 24px/1 monospace;
  place-items: center;
  transform: rotate(8deg);
}
.eyebrow {
  margin: 0;
  color: #a74724;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.17em;
}
.intro h1 {
  margin: 10px 0 16px;
  font-size: clamp(39px, 10vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}
.intro h1 em {
  color: var(--orange);
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: #f5b83b;
  text-decoration-thickness: 8px;
  text-underline-offset: -2px;
}
.lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  word-break: keep-all;
}
.meta {
  display: flex;
  margin: 24px auto;
  max-width: max-content;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  gap: 10px;
  align-items: center;
}
.meta b {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink);
}
.primary,
.secondary {
  min-height: 58px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-weight: 900;
}
.primary {
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--yellow);
  color: white;
}
.secondary {
  background: white;
  color: var(--ink);
}
.intro .primary {
  width: 100%;
}
.text-button {
  min-height: 44px;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: #5f5d55;
  font-size: 12px;
  text-decoration: underline;
}
.note,
.privacy {
  color: #77736a;
  font-size: 10px;
}
.draw-top {
  display: flex;
  margin-bottom: 18px;
  align-items: end;
  justify-content: space-between;
}
.draw-top strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}
.timer {
  font: 950 38px/1 monospace;
}
.timer.urgent {
  color: #d64227;
}
.canvas-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 21px;
  background: white;
  box-shadow: 7px 7px 0 #ffd864;
  touch-action: none;
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.canvas-hint {
  position: absolute;
  inset: 0;
  display: grid;
  color: #aaa79e;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
  place-items: center;
}
.draw-actions {
  display: grid;
  margin-top: 22px;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
}
.draw-actions button:disabled {
  opacity: 0.35;
}
.privacy {
  text-align: center;
}
.alternative h2 {
  margin: 12px 0 8px;
  font-size: 35px;
}
.alternative > p {
  color: var(--muted);
}
.alt-progress {
  height: 8px;
  margin: 30px 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--orange) 25%, #e9e4d8 25%);
}
.alternative h3 {
  margin: 35px 0 20px;
  font-size: 25px;
  line-height: 1.4;
}
.alternative-answers {
  display: grid;
  gap: 10px;
}
.alternative-answers button {
  min-height: 64px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: white;
  font-weight: 800;
  text-align: left;
}
.result {
  text-align: center;
}
.result-badge {
  display: grid;
  width: 84px;
  height: 84px;
  margin: 10px auto 17px;
  border: 2px solid var(--ink);
  border-radius: 29% 71% 56% 44%/45% 38% 62% 55%;
  background: var(--yellow);
  font: 950 28px/1 monospace;
  place-items: center;
  transform: rotate(-5deg);
}
.result > p:not(.eyebrow):not(.status) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.result h2 {
  margin: 8px 0;
  color: var(--orange);
  font-size: clamp(37px, 9vw, 55px);
  letter-spacing: -0.055em;
}
.result h2:focus,
.alternative h2:focus {
  outline: none;
}
.result blockquote {
  margin: 0 auto 22px;
  max-width: 520px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
  word-break: keep-all;
}
.drawing-preview {
  overflow: hidden;
  margin: 0 auto 22px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: #fff;
}
.drawing-preview canvas {
  display: block;
  width: 100%;
  height: auto;
}
.drawing-preview p {
  margin: 0;
  padding: 13px;
  background: #f2eee3;
  color: #69665c;
  font-size: 11px;
}
.traits {
  display: flex;
  margin-bottom: 22px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}
.traits span {
  padding: 7px 10px;
  border: 1px solid #d7cdb6;
  border-radius: 99px;
  background: #fff2c9;
  font-size: 11px;
  font-weight: 800;
}
.analysis,
.tip {
  padding: 23px;
  border: 2px solid var(--ink);
  border-radius: 19px;
  text-align: left;
}
.analysis {
  background: white;
}
.analysis h3 {
  margin: 0;
}
.analysis > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.metrics {
  display: grid;
  margin-top: 18px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.metric {
  padding: 12px;
  border-radius: 11px;
  background: #f2eee3;
}
.metric span {
  display: block;
  color: #5f5b53;
  font-size: 10px;
  font-weight: 700;
}
.metric strong {
  font-size: 16px;
}
.tip {
  margin: 12px 0 24px;
  background: var(--ink);
  color: white;
}
.tip span {
  color: var(--yellow);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
}
.tip p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.actions .primary {
  grid-column: 1/-1;
}
.status {
  min-height: 20px;
  margin: 12px 0;
  color: #a74724;
  font-size: 12px;
  font-weight: 800;
}
.all-tests {
  display: block;
  margin-top: 10px;
  color: #5e5b53;
  font-size: 11px;
}
.result.shared .drawing-preview canvas,
.result.shared #save {
  display: none;
}
.result.shared .drawing-preview {
  border-style: dashed;
}
footer {
  padding: 20px 5px 0;
  color: #583f1c;
  font-size: 9px;
  text-align: center;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 560px) {
  .shell {
    width: 100%;
    padding: 0;
  }
  header {
    height: 58px;
    padding: 0 18px;
  }
  .card {
    min-height: calc(100vh - 58px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 27px 27px 0 0;
  }
  .screen {
    padding: 26px 19px 38px;
  }
  .hero {
    height: 205px;
  }
  .hero svg {
    width: 250px;
    height: 195px;
  }
  .draw-actions,
  .actions {
    grid-template-columns: 1fr;
  }
  .actions .primary {
    grid-column: auto;
  }
  footer {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
