@font-face { font-family: 'Pretendard'; font-weight: 100 900; font-style: normal; font-display: swap; src: url(/fonts/pretendard-subset.woff2) format('woff2'); }
/* 레이아웃: 인트로는 결과를 가린 물음표 타일, 질문은 좌우 대결 카드, 결과는 인물 + 손/기계 두 묶음 + 맨 아래 공유 */
:root {
  --bg: #F4F2F1;
  --paper: #FEFEFE;
  --ink: #0A0909;
  --ink-2: #534C4B;
  --muted: #8A8280;
  --line: #E3DEDD;
  --accent: #F47B1A;
  --accent-deep: #B4520A;
  --accent-soft: #FFF1E5;
  --hand: #EFE3D0;
  --hand-ink: #7A4E2B;
  --auto: #E2EAEE;
  --auto-ink: #3E5560;
  --font: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; letter-spacing: inherit; }
.wrap { max-width: 920px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-bottom: max(56px, calc(24px + env(safe-area-inset-bottom, 0px))); display: grid; gap: 22px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 32px; }
.brand { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.brand b { color: var(--ink); font-weight: 800; }
.topbar .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.home { min-height: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
@media (hover: hover) { .home:hover { border-color: var(--ink-2); color: var(--ink); } }

/* 인트로 */
/* 홈 화면: 인스타 피드(4:5)에 그대로 올릴 수 있는 포스터 한 장 */
.intro { display: grid; justify-items: center; padding-top: 4px; container-type: inline-size; }
/* 첫 화면은 포스터 한 장이라 화면 가운데에 둔다 */
.wrap:has(> .intro:not([hidden])) { min-height: 100dvh; align-content: center; }
.poster { position: relative; isolation: isolate; width: 100%; max-width: min(540px, calc((100dvh - 40px) * .8)); min-height: calc(min(100cqi, 540px, (100dvh - 40px) * .8) * 1.25); border-radius: 28px; overflow: hidden; container-type: inline-size; display: grid; grid-template-rows: auto auto 1fr auto; padding: 24px; color: var(--ink); background: radial-gradient(120% 80% at 82% 16%, #FF9B4A 0%, var(--accent) 46%, #E5650A 100%); box-shadow: 0 30px 60px -34px rgba(10, 9, 9, .55); }
.poster::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(10, 9, 9, .12) 1.2px, transparent 1.5px); background-size: 14px 14px; }
.poster-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* 알고케어 공식 가로형 영문 워드마크, 디지털 Moon Black. 최소 가로 15mm(약 57px) 이상 */
.plogo { display: block; height: 24px; width: auto; color: var(--ink); }
.pchip { white-space: nowrap; font-size: clamp(10.5px, 2.4cqi, 12.5px); font-weight: 700; color: var(--paper); background: var(--ink); border-radius: 999px; padding: 5px 11px; }
.poster-head { margin: 22px 0 0; display: grid; font-weight: 900; letter-spacing: -.055em; line-height: 1.02; }
.poster-head .l1, .poster-head .l3 { font-size: clamp(20px, 8.9cqi, 48px); }
.poster-head .pct { font-size: clamp(60px, 36cqi, 196px); line-height: .9; letter-spacing: -.07em; color: var(--paper); text-shadow: 5px 6px 0 var(--ink); margin: 6px 0 4px -4px; font-variant-numeric: tabular-nums; }
.collage { position: relative; align-self: end; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 18px 4px 20px; }
.tile { aspect-ratio: 1; max-width: 100%; border-radius: 16px; overflow: hidden; border: 2.5px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); }
.tile svg { display: block; width: 100%; height: 100%; }
.tile.hand { background: var(--hand); }
.tile.auto { background: var(--auto); }
.tile:nth-child(1) { transform: rotate(-6deg) translateY(4px); }
.tile:nth-child(2) { transform: rotate(4deg) translateY(-6px); }
.tile:nth-child(3) { transform: rotate(-3deg) translateY(3px); }
.tile:nth-child(4) { transform: rotate(6deg) translateY(-4px); }
.vs-badge { position: absolute; left: 50%; top: 50%; z-index: 2; width: clamp(32px, 10cqi, 54px); height: clamp(32px, 10cqi, 54px); display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); border: 3px solid var(--paper); font-size: clamp(11px, 3.4cqi, 18px); font-weight: 900; letter-spacing: -.04em; transform: translate(-50%, -50%) rotate(-8deg); }
.poster-btn { width: 100%; min-height: 60px; background: var(--ink); color: var(--paper); font-size: 18px; font-weight: 800; }
@media (hover: hover) { .poster-btn:hover { background: #2A2524; } }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--accent-deep); }
h1 { font-weight: 800; font-size: clamp(36px, 7.4vw, 62px); line-height: 1.16; margin: 0; letter-spacing: -.045em; text-wrap: balance; word-break: keep-all; }
h1 .hl { color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .btn-primary:hover { background: #2A2524; } }
.btn-accent { background: var(--accent); color: #fff; }
@media (hover: hover) { .btn-accent:hover { background: #E06A0C; } }
.btn-light { background: var(--paper); color: var(--ink); }
@media (hover: hover) { .btn-light:hover { background: var(--accent-soft); } }
.btn:focus-visible, .card:focus-visible, .home:focus-visible, .undo:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }


/* 질문 */
.game { display: grid; gap: 16px; }
.match-head { display: grid; gap: 10px; }
.round-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.round { font-weight: 800; font-size: 22px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.round .cat { font-size: 12.5px; font-weight: 700; letter-spacing: 0; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; margin-left: 8px; vertical-align: 3px; }
.round .cat.supp { color: var(--accent-deep); border-color: #F7C9A1; background: var(--accent-soft); }
.undo { min-height: 44px; background: none; border: 0; color: var(--muted); font-size: 13.5px; cursor: pointer; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }
.track { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.track span { height: 6px; border-radius: 3px; background: var(--line); }
.track span.hand { background: var(--hand-ink); }
.track span.auto { background: var(--accent); }
.track span.now { background: var(--ink); }
.question { margin: 0; font-size: clamp(23px, 4.4vw, 32px); font-weight: 800; line-height: 1.35; letter-spacing: -.04em; text-align: center; text-wrap: balance; word-break: keep-all; padding-top: 6px; }
.final-tag { display: block; margin: 0 auto 8px; width: max-content; font-weight: 700; font-size: 12.5px; color: #fff; background: var(--ink); padding: 4px 12px; border-radius: 999px; letter-spacing: 0; }

.arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: 100%; max-width: 720px; margin: 0 auto; }
.card { position: relative; display: grid; gap: 0; text-align: left; border: 0; padding: 0; background: var(--paper); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: 0 1px 0 var(--line), 0 10px 26px -18px rgba(10, 9, 9, .35); transition: transform .25s ease, opacity .35s ease, box-shadow .25s; min-width: 0; }
/* 터치 화면은 누른 카드가 다음 질문에서도 떠 있지 않게 마우스일 때만 */
@media (hover: hover) { .card:hover { transform: translateY(-4px); box-shadow: 0 1px 0 var(--line), 0 18px 34px -18px rgba(10, 9, 9, .45); } }
.card:active { transform: scale(.98); }
.card .art { aspect-ratio: 1; display: block; }
.card.hand .art { background: var(--hand); }
.card.auto .art { background: var(--auto); }
.card .art svg { display: block; width: 100%; height: 100%; }
.card .txt { padding: 14px 16px 16px; display: grid; gap: 2px; }
.card .kind { font-size: 12px; font-weight: 700; }
.card.hand .kind { color: var(--hand-ink); }
.card.auto .kind { color: var(--auto-ink); }
.card .name { font-size: clamp(17px, 3.4vw, 21px); font-weight: 800; line-height: 1.3; letter-spacing: -.035em; word-break: keep-all; }
.card .desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; word-break: keep-all; }
.card .stamp { position: absolute; top: 14px; left: 50%; transform: translate(-50%, -8px) rotate(-8deg); opacity: 0; font-weight: 800; font-size: 19px; letter-spacing: -.03em; white-space: nowrap; padding: 3px 12px 4px; border: 3px solid currentColor; border-radius: 8px; transition: opacity .2s, transform .25s; pointer-events: none; background: rgba(254, 254, 254, .88); }
.card.won { transform: scale(1.03); box-shadow: 0 0 0 3px var(--accent), 0 18px 34px -18px rgba(10, 9, 9, .45); }
.card.won .stamp { opacity: 1; transform: translate(-50%, 0) rotate(-8deg); color: var(--accent-deep); }
.card.lost { opacity: .35; transform: scale(.96); }
.vs { font-weight: 900; font-size: 24px; letter-spacing: -.04em; color: var(--accent); line-height: 1; }
.arena.locked .card { pointer-events: none; }
.arena.enter .card { animation: rise .38s ease both; }
.arena.enter .card:last-child { animation-delay: .06s; }
@keyframes rise { from { transform: translateY(10px); opacity: .2; } to { transform: none; opacity: 1; } }

/* 결과 */
.result { display: grid; gap: 22px; }
.verdict { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: center; }
.portrait { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 1; max-width: 100%; background: var(--line); box-shadow: 0 18px 40px -26px rgba(10, 9, 9, .55); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait .year { position: absolute; left: 14px; bottom: 14px; background: rgba(10, 9, 9, .78); color: #fff; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.verdict-text { display: grid; gap: 12px; min-width: 0; }
.verdict-text h1 { font-size: clamp(34px, 6vw, 54px); }
.verdict-text h1 em { font-style: normal; color: var(--accent); }
.score { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score .big { font-weight: 900; font-size: 46px; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.score .big small { font-size: 17px; font-weight: 700; color: var(--muted); letter-spacing: -.01em; margin-left: 4px; }
.score span { font-size: 14.5px; color: var(--ink-2); }
.verdict-text p { margin: 0; font-size: 16px; color: var(--ink-2); word-break: keep-all; }
.supp-note { font-size: 15px !important; color: var(--accent-deep) !important; font-weight: 600; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bucket { border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.bucket.auto { background: var(--paper); border: 1px solid var(--line); }
.bucket.hand { background: var(--hand); }
.bucket h3 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15.5px; font-weight: 800; letter-spacing: -.02em; }
.bucket h3 b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bucket.auto h3 b { color: var(--accent-deep); }
.bucket.hand h3 b { color: var(--hand-ink); }
.bucket ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.bucket li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(10, 9, 9, .08); font-size: 14.5px; min-width: 0; }
.bucket li span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.bucket li b { font-weight: 600; word-break: keep-all; }
.bucket .empty { font-size: 14px; color: var(--muted); margin: 0; }

.cta { border-radius: 22px; padding: 24px; display: grid; gap: 12px; }
.cta.yes { background: var(--ink); color: var(--paper); }
.cta.no { background: var(--paper); border: 1.5px dashed var(--line); }
.cta .seal { justify-self: start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.cta.yes .seal { background: var(--accent); color: #fff; }
.cta.no .seal { background: var(--bg); color: var(--ink-2); }
.cta h2 { margin: 0; font-weight: 800; font-size: clamp(23px, 4.4vw, 31px); line-height: 1.3; letter-spacing: -.04em; text-wrap: balance; word-break: keep-all; }
.cta p { margin: 0; font-size: 15px; line-height: 1.65; max-width: 40em; word-break: keep-all; }
.cta.yes p { color: #D9D3D1; }
.cta.no p { color: var(--ink-2); }
.cta .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }

.share { display: grid; gap: 10px; }
.share .btn { width: 100%; min-height: 58px; font-size: 17px; }
.toast { font-size: 13.5px; color: var(--accent-deep); text-align: center; margin: 0; min-height: 1.4em; }
.share-text { width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; background: var(--paper); color: var(--ink); }

@media (max-width: 640px) {
  .poster { padding: 18px; border-radius: 22px; }
  .plogo { height: 20px; }
  .poster-head { margin-top: 16px; }
  .collage { gap: 7px; padding: 14px 2px 16px; }
  .tile { border-radius: 12px; border-width: 2px; box-shadow: 2px 3px 0 var(--ink); }
  .vs-badge { border-width: 2.5px; }
  .poster-btn { min-height: 54px; font-size: 17px; }
  .arena { gap: 8px; }
  .vs { font-size: 18px; }
  .card .txt { padding: 10px 11px 12px; }
  .card .desc { font-size: 12.5px; }
  .card .stamp { font-size: 14px; }
  .verdict { grid-template-columns: 1fr; gap: 18px; }
  .portrait { max-width: 360px; width: 100%; justify-self: center; }
  .split { grid-template-columns: 1fr; }
}
/* 가로로 눕힌 휴대폰: 카드를 그림 왼쪽·글 오른쪽으로 눕혀 한 화면에 질문과 두 카드가 다 들어오게 */
@media (orientation: landscape) and (max-height: 500px) {
  .wrap { gap: 12px; padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .game { gap: 10px; }
  .match-head { gap: 4px; }
  .question { font-size: 22px; padding-top: 0; }
  .final-tag { display: inline-block; margin: 0 8px 0 0; vertical-align: 4px; }
  .card { grid-template-columns: 42% minmax(0, 1fr); align-items: center; }
  .card .txt { padding: 10px 12px; }
  .card .stamp { top: 10px; font-size: 15px; }
  .verdict { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
