:root {
  --red: #E0242E;       /* 브랜드 색은 인주 빨강 하나다 */
  --red-deep: #B81A23;
  --red-soft: #FFD3D5;
  --ink: #141414;
  --mute: #757575;
  --soft: #F4F4F4;
  --line: #E6E6E6;
  --dash: #D9D9D9;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --tabs: calc(64px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--red); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--red);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  letter-spacing: -0.025em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--red-soft); color: var(--ink); }
a { color: inherit; }
button { font: inherit; letter-spacing: inherit; color: inherit; }
.n { font-variant-numeric: tabular-nums; }
.loading { padding: 80px 20px; color: #fff; text-align: center; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }

/* 빨강 위 머리 */
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 20px 0; color: #fff; }
.head-title { min-width: 0; }
.head-title b { display: block; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-title span { display: block; font-size: 13px; font-weight: 650; color: var(--red-soft); }
.pill { flex: none; height: 36px; padding: 0 15px; border: 0; border-radius: 18px; background: rgba(0, 0, 0, 0.18); color: #fff; font-size: 14px; font-weight: 750; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; }
.pill.light { background: #fff; color: var(--red); }

/* 흰 카드 */
.card { background: #fff; border-radius: 26px; padding: 24px 22px; box-shadow: 0 24px 40px -20px rgba(80, 0, 4, 0.45); }
.page { padding: 18px 16px calc(var(--tabs) + 24px); }
.page.no-tabs { padding-bottom: 40px; }
.card + .card { margin-top: 14px; }
.card h2 { margin: 0; font-size: 22px; font-weight: 850; letter-spacing: -0.04em; }
.card .sub { margin: 4px 0 0; color: var(--mute); font-size: 14px; font-weight: 550; }

/* 입력 */
label, .label { display: block; margin: 18px 0 6px; font-size: 14px; font-weight: 750; }
input, textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  letter-spacing: -0.02em;
  caret-color: var(--red);
}
input:focus, textarea:focus { outline: none; border-color: var(--ink); background: #fff; }
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #A3A3A3; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.hint { margin: 8px 0 0; color: var(--mute); font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; margin-top: 12px; padding: 12px 18px; border: 0; border-radius: 16px; background: var(--soft); color: var(--ink); font-size: 16px; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.btn.red { background: var(--red); color: #fff; }
.btn.ink { background: var(--ink); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link-btn { display: block; margin: 16px auto 0; padding: 8px; border: 0; background: none; color: var(--mute); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.on-red .link-btn { color: var(--red-soft); }
.err { margin: 12px 0 0; padding: 11px 14px; border-radius: 12px; background: #FFF0F0; color: var(--red-deep); font-size: 14px; font-weight: 600; }
.note { margin: 10px 0 0; color: var(--mute); font-size: 14px; text-align: center; }

/* 첫 화면 */
.intro { padding: calc(40px + env(safe-area-inset-top)) 24px 8px; color: #fff; position: relative; }
.intro h1 { margin: 0; font-size: clamp(40px, 12vw, 52px); line-height: 1.08; font-weight: 900; letter-spacing: -0.055em; }
.intro p { margin: 14px 0 0; color: var(--red-soft); font-size: 16px; font-weight: 550; max-width: 30ch; }
.intro .seal { position: absolute; right: 22px; top: calc(28px + env(safe-area-inset-top)); transform: rotate(-12deg); }
.mine { display: grid; gap: 8px; margin-bottom: 14px; }
.mine a { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-radius: 18px; background: rgba(0, 0, 0, 0.16); color: #fff; font-weight: 750; text-decoration: none; }
.mine a span { color: var(--red-soft); font-size: 13px; font-weight: 600; }
.steps { margin: 22px 4px 0; padding: 0; list-style: none; color: #fff; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.25); font-size: 14.5px; font-weight: 550; }
.steps b { font-weight: 850; }
.foot { margin: 22px 8px 0; color: var(--red-soft); font-size: 12.5px; }
.foot a { color: #fff; }

/* 사람 */
.faces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.face { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--soft); font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; }
.face.me { background: var(--ink); color: #fff; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 12.5px; font-weight: 800; }

/* 도장판: 한 장씩 넘기는 카드 */
.dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 0; min-height: 4px; }
.dots i { width: 20px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); transition: background 0.2s; }
.dots i.on { background: #fff; }
.deck { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px 16px 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
.deck::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; }
.post { flex: 1; display: flex; flex-direction: column; min-height: 360px; position: relative; overflow: hidden; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.who em { margin-left: auto; font-style: normal; color: var(--mute); font-size: 13px; font-weight: 600; }
.item { margin: 20px 0 0; font-size: 32px; line-height: 1.15; font-weight: 850; letter-spacing: -0.05em; }
.price { margin: 4px 0 0; color: var(--red); font-size: 38px; line-height: 1.1; font-weight: 850; letter-spacing: -0.05em; }
.price small { font-size: 21px; margin-left: 1px; }
.why { margin: 12px 0 0; font-size: 16px; line-height: 1.5; color: #333; }
.shop { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--mute); font-size: 14px; font-weight: 650; text-underline-offset: 3px; }
.field { margin-top: auto; padding-top: 18px; display: grid; grid-template-columns: 1fr 1fr; min-height: 156px; }
.side { position: relative; border-top: 1.5px dashed var(--dash); padding: 12px 0 0; }
.side + .side { border-left: 1.5px dashed var(--dash); padding-left: 14px; }
.side h3 { margin: 0; font-size: 15px; font-weight: 850; }
.side .c { color: var(--mute); font-size: 12.5px; font-weight: 700; }
.side .empty { position: absolute; left: 0; right: 0; bottom: 20px; padding-left: inherit; color: var(--mute); font-size: 12.5px; font-weight: 650; text-align: center; }
.marks { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 2px; margin-top: 8px; }
.mark { width: 58px; text-align: center; font-size: 11.5px; font-weight: 750; line-height: 1.2; }
.mark svg { display: block; margin: 0 auto 1px; }
.mark.fresh svg { animation: stamp 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes stamp { from { opacity: 0; transform: scale(1.7) rotate(var(--r)); } to { opacity: 1; transform: scale(1) rotate(var(--r)); } }

/* 판정 */
.verdict { position: absolute; right: 14px; top: 54px; transform: rotate(-12deg); pointer-events: none; }
.verdict.fresh { animation: bigstamp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes bigstamp { from { opacity: 0; transform: rotate(-12deg) scale(1.8); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }
.line { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--soft); font-size: 15.5px; font-weight: 650; line-height: 1.45; }
.line b { display: block; color: var(--red); font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.post.done .field { min-height: 120px; }

/* 카드 아래 도장 버튼 */
.knobs { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 10px 28px; padding: 22px 16px 0; min-height: 132px; }
.knob { border: 0; background: none; padding: 0; color: #fff; font-size: 13px; font-weight: 750; text-align: center; cursor: pointer; }
.knob span { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; font-size: 24px; font-weight: 900; letter-spacing: -0.04em; box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.35); transition: transform 0.12s; }
.knob:active span { transform: scale(0.92); }
.knob.ink span { background: var(--ink); color: #fff; }
.knob.white span { background: #fff; color: var(--red); }
.knob[aria-pressed="true"] span { outline: 3px solid #fff; outline-offset: 4px; }
.knob:disabled { opacity: 0.6; cursor: default; }
.knob-note { align-self: center; color: #fff; font-size: 15px; font-weight: 650; text-align: center; }
.knob-note small { display: block; color: var(--red-soft); font-size: 13px; font-weight: 550; margin-top: 4px; }

/* 같이 참기, 결산 */
.big { margin: 10px 0 0; font-size: 44px; line-height: 1.08; font-weight: 900; letter-spacing: -0.055em; }
.big small { font-size: 22px; margin-left: 2px; }
.rule { margin: 12px 0 0; font-size: 26px; line-height: 1.25; font-weight: 850; letter-spacing: -0.04em; }
.board { margin: 16px 0 0; padding: 0; list-style: none; }
.board li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; font-weight: 650; }
.board li .v { margin-left: auto; font-weight: 800; }
.kings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.kings div { padding: 14px; border-radius: 16px; background: var(--soft); }
.kings dt { color: var(--mute); font-size: 13px; font-weight: 700; }
.kings dd { margin: 2px 0 0; font-size: 17px; font-weight: 850; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { height: 34px; padding: 0 13px; border: 0; border-radius: 17px; background: var(--soft); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.image-result img { display: block; width: 100%; margin-top: 14px; border-radius: 16px; border: 1px solid var(--line); }
.message-box { margin: 14px 0 0; padding: 14px; border-radius: 14px; background: var(--soft); font-size: 14.5px; white-space: pre-wrap; }
.fine { margin: 14px 0 0; color: var(--mute); font-size: 12.5px; }

/* 아래 탭 */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; height: var(--tabs); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-radius: 22px 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); z-index: 5; }
.tabs button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 750; color: #A3A3A3; cursor: pointer; }
.tabs button[aria-current="page"] { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .mark.fresh svg, .verdict.fresh { animation: none; }
  .deck { scroll-behavior: auto; }
}

/* 안내 글 */
.prose h2 { margin: 26px 0 8px; font-size: 18px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 15px; line-height: 1.65; color: #333; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
