/* 팩트 탐정과 같은 글꼴(Pretendard, Paperlogy). 어른 그림은 img/<look>-<face>.webp
   글꼴: Pretendard(CDN), Paperlogy(public/fonts, SIL OFL) */
@font-face { font-family: 'Paperlogy'; font-weight: 500; font-display: swap; src: url('fonts/Paperlogy-5Medium.woff2') format('woff2'); }
@font-face { font-family: 'Paperlogy'; font-weight: 600; font-display: swap; src: url('fonts/Paperlogy-6SemiBold.woff2') format('woff2'); }

:root {
  --font: 'Pretendard Variable', Pretendard, 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  --title: 'Paperlogy', var(--font);
  --bg: #eef1f7;
  --surface: #fff;
  --sunk: #f4f6fa;
  --ink: #1d2232;
  --ink-2: #565b6b;
  --ink-3: #868b99;
  --line: #e4e8f0;
  --line-2: #d5dce8;
  --brand: #3a5bd9;
  --brand-2: #2b46b4;
  --brand-soft: #eef1ff;
  --gold: #8f6a1e;
  --gold-soft: #fbf4e4;
  --done: #2f8064;
  --done-soft: #e9f6f0;
  --bad: #c0605d;
  --bad-soft: #fdefee;
  --role: #d0dafd;
  --shadow: 0 1px 2px #1d22320a, 0 8px 28px #1d22320f;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--ink);
  background: var(--bg) radial-gradient(900px 520px at 0% 0%, #e2e8ff 0, transparent 60%) fixed;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid #3a5bd955; outline-offset: 2px; }
#app { max-width: 1280px; margin: 0 auto; padding: 16px 18px 24px; }
.screen { display: none; }
.screen.active { display: block; animation: fade .3s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
svg { display: block; }

/* 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--sunk); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #4a6be6, var(--brand)); border-color: var(--brand-2); color: #fff; box-shadow: 0 6px 16px #3a5bd940, inset 0 1px 0 #ffffff30; }
.btn.primary:hover { background: linear-gradient(180deg, #4062df, var(--brand-2)); }
.btn:disabled { background: #e9edf3; border-color: #e9edf3; color: #a3a9b5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.block { display: flex; width: 100%; min-height: 56px; font-size: 18px; }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 14px; white-space: nowrap; border-radius: 12px; }
.btn.busy { background: #6c84e0; border-color: #6c84e0; color: #fff; cursor: progress; box-shadow: none; }
.dots3 { display: inline-flex; gap: 4px; }
.dots3 i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: hop 1s infinite; }
.dots3 i:nth-child(2) { animation-delay: .15s; }
.dots3 i:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* 어른 그림 */
.judge { width: 112px; aspect-ratio: 1; flex: 0 0 auto; position: relative; }
.judge img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.judge.talk img { animation: talk .45s ease-out; }
@keyframes talk { 40% { transform: translateY(-3px) scale(1.015); } }
.judge.think img { animation: think 1.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes think { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.judge.hop img { animation: jhop .5s ease-out 2; }
@keyframes jhop { 40% { transform: translateY(-12px); } }

.kicker { font-size: 13px; font-weight: 700; color: var(--brand); }
h1 { font-family: var(--title); font-weight: 600; font-size: 34px; letter-spacing: -.035em; line-height: 1.2; }

/* 시작 */
.start { max-width: 1160px; margin: 8px auto; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.3fr); gap: 16px; align-items: stretch; }
.start-side, .start-main { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.start-side { display: flex; flex-direction: column; padding: 12px; gap: 14px; }
.hero { flex: 1; position: relative; display: flex; align-items: flex-end; gap: 6px; min-height: 230px; padding: 22px 0 0 22px; border-radius: 18px; overflow: hidden; color: #fff; background: radial-gradient(360px 240px at 82% 40%, #5265c4 0, transparent 70%), linear-gradient(140deg, #1b2242, #2d3a78); }
.hero::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(#ffffff14 1px, transparent 1.3px); background-size: 16px 16px; pointer-events: none; }
.hero-text { position: relative; z-index: 1; flex: 1; align-self: center; padding-bottom: 16px; }
.hero .kicker { color: #b4c2ff; }
.hero h1 { font-size: 42px; margin-top: 6px; color: #fff; }
.lead { margin-top: 10px; color: #d5dbf3; font-size: 15.5px; line-height: 1.55; }
.hero-judge { position: relative; z-index: 1; width: 200px; border-radius: 46% 46% 0 0; overflow: hidden; background: #d0dafd; box-shadow: 0 0 0 6px #ffffff1a; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 4px; }
.steps li > div { min-width: 0; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--sunk); }
.steps .num { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #fff; color: var(--brand); font-size: 14px; font-weight: 800; box-shadow: 0 1px 3px #1d223218; }
.steps b { font-size: 15px; display: block; line-height: 1.3; }
.steps p { color: var(--ink-3); font-size: 13.5px; line-height: 1.35; }
.start-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 4px; margin-top: auto; }
.start-note { font-size: 14px; color: var(--ink-3); min-height: 1.5em; padding: 0 4px 4px; }
.start-note b { color: var(--done); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.field input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 14px; font-size: 17px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.field input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.shake { animation: shake .4s; border-color: var(--bad) !important; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.start-main { display: flex; flex-direction: column; min-width: 0; padding: 22px 22px 20px; }
.pick-title { font-family: var(--title); font-weight: 600; font-size: 24px; letter-spacing: -.03em; color: var(--ink); margin-bottom: 14px; }
.missions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mcard { position: relative; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 96px; padding: 10px 12px 10px 10px; border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .2s, transform .15s; }
@media (hover: hover) { .mcard:hover { border-color: #c3cdf0; box-shadow: 0 6px 18px #1d22320f; transform: translateY(-1px); } }
.mcard.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px #3a5bd926, 0 8px 20px #3a5bd91a; }
.mc-pic { flex: 0 0 58px; height: 58px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--c, var(--sunk)); }
.mc-pic img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15) translateY(7%); transition: transform .2s; }
.mcard.on .mc-pic img { transform: scale(1.22) translateY(5%); }
.mc-pic svg { width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mc-body { display: grid; gap: 2px; min-width: 0; }
.mc-who { font-family: var(--title); font-weight: 600; font-size: 16px; color: var(--ink); letter-spacing: -.02em; }
.mcard.on .mc-who { color: var(--brand-2); }
.mc-want { font-size: 14px; font-weight: 550; line-height: 1.38; color: var(--ink-2); }
.mcard.mine { border-style: dashed; border-color: var(--line-2); }
.mcard.mine .mc-pic { background: var(--gold-soft); border: 1.5px dashed #e3cf9f; }
.mc-done { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--done); color: #fff; box-shadow: 0 0 0 3px #fff; }
.mc-done svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mcard.won .mc-who { padding-right: 22px; }
.custom { display: grid; grid-template-columns: 130px 1fr; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 16px; background: var(--gold-soft); }
.custom .field input { height: 46px; font-size: 16px; }
.pick-note { margin: 12px 2px; font-size: 14.5px; color: var(--ink-2); min-height: 1.5em; }
.pick-note b { color: var(--brand-2); }
.start-actions { display: flex; gap: 8px; margin-top: auto; }
.start-actions .btn { min-height: 58px; font-size: 18px; }
.start-actions .btn.primary { flex: 1; }
.start-actions #btn-resume { flex: 0 1 auto; font-size: 15.5px; }

/* 위쪽 계기판 */
.hud { display: flex; align-items: center; gap: 16px; background: #fffffff0; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 8px 10px 8px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--title); font-weight: 600; font-size: 17px; white-space: nowrap; padding-right: 16px; border-right: 1px solid var(--line); }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='11' r='3.6'/%3E%3Ccircle cx='16' cy='11' r='3.6'/%3E%3Cpath d='M11.6 11h.8M6.5 18q5.5-3 11 0'/%3E%3C/svg%3E") center/20px no-repeat, linear-gradient(140deg, #1b2242, #2d3a78); }
.hud-item { display: grid; gap: 2px; min-width: 0; }
.hud-label { font-size: 12px; color: var(--ink-3); font-weight: 650; white-space: nowrap; }
.hud-label b { color: var(--brand); font-size: 14px; }
.mission-now { flex: 1; }
.m-want { font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; gap: 5px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cdd6f3; background: #fff; }
.dots i.used { background: var(--brand); border-color: var(--brand); }
.dots i.now { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill.nick { background: var(--gold-soft); color: var(--gold); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.pill.mock { background: var(--sunk); color: var(--ink-3); border: 1px dashed var(--line-2); }

/* 판정 무대와 쓰기 */
.play-grid { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 14px; align-items: start; }
.stage, .write { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 14px; }
.stage { display: flex; flex-direction: column; gap: 12px; }
.stage-top { position: relative; flex: 0 0 auto; display: flex; align-items: flex-end; gap: 4px; min-height: 192px; padding: 14px 14px 0 0; border-radius: 16px; background: var(--role); overflow: hidden; transition: background .3s; }
.judge-wrap { flex: 0 0 auto; align-self: flex-end; }
.stage-top .judge { width: 184px; }
.role { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 4px 12px; border-radius: 999px; background: #1d2232d0; color: #fff; font-size: 13px; font-weight: 750; white-space: nowrap; }
.bubble { position: relative; z-index: 1; flex: 1; min-width: 0; min-height: 96px; align-self: center; margin-bottom: 14px; display: flex; align-items: center; padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: 0 6px 18px #1d223214; border: 2px solid #fff; transition: border-color .2s; }
.bubble::before { content: ''; position: absolute; left: -12px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right: 12px solid #fff; border-left: 0; }
.bubble p { font-size: 17px; font-weight: 650; line-height: 1.5; }
.bubble.pop p { animation: pop .3s ease-out; }
.bubble.yes { border-color: #9fd1bb; }
.bubble.no { border-color: #ebbcb9; }
.bubble .dots3 { margin-left: 6px; color: var(--ink-3); vertical-align: middle; }

.meter { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--sunk); }
.gauge-head { display: flex; align-items: baseline; justify-content: space-between; }
.gauge-head > b { font-size: 14.5px; color: var(--ink-2); }
.gauge-head span { font-size: 14px; color: var(--ink-3); font-weight: 650; }
.gauge-head span b { font-size: 24px; color: var(--brand); font-variant-numeric: tabular-nums; }
.gauge { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.gauge i { height: 12px; border-radius: 6px; background: #e1e6f0; transition: background .3s, box-shadow .3s; }
.gauge i.on { background: linear-gradient(90deg, #7290f0, var(--brand)); box-shadow: 0 2px 6px #3a5bd933; }
.gauge.full i.on { background: linear-gradient(90deg, #52b08c, var(--done)); box-shadow: 0 2px 6px #2f806433; }
.marks { display: grid; gap: 6px; }
.mk { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border-radius: 12px; background: #fff; font-size: 14.5px; box-shadow: 0 1px 2px #1d22320a; }
.mk span { flex: 1; min-width: 0; color: var(--ink-2); font-weight: 600; }
.mk span small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 650; }
.mk b { flex: 0 0 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; line-height: 1; background: var(--sunk); color: var(--ink-3); }
.mk b.m2 { background: var(--done-soft); color: var(--done); }
.mk b.m1 { background: var(--brand-soft); color: var(--brand); }
.mk b.m0 { background: var(--bad-soft); color: var(--bad); }
.marks.fresh .mk b { animation: stamp .35s ease-out backwards; }
.marks.fresh .mk:nth-child(2) b { animation-delay: .15s; }
.marks.fresh .mk:nth-child(3) b { animation-delay: .3s; }
@keyframes stamp { from { transform: scale(1.8); opacity: 0; } }

.advice { display: grid; gap: 6px; }
.adv { display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: start; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.45; }
.adv b { font-size: 12.5px; font-weight: 800; padding-top: 1px; }
.adv.good { background: var(--done-soft); }
.adv.good b { color: var(--done); }
.adv.fix { background: var(--brand-soft); }
.adv.fix b { color: var(--brand-2); }
.adv.q { background: var(--gold-soft); }
.adv.q b { color: var(--gold); }
.adv-tip { padding: 12px 14px; border-radius: 12px; background: var(--sunk); color: var(--ink-2); font-size: 14.5px; }

.write { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.write-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.write-head b { font-family: var(--title); font-weight: 600; font-size: 21px; letter-spacing: -.03em; }
.write-head span { font-size: 13px; color: var(--ink-3); }
.w-field { display: grid; gap: 6px; position: relative; }
.w-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.w-label b { display: inline-flex; align-items: center; gap: 7px; font-size: 16px; color: var(--ink); }
.w-label b::before { content: ''; width: 5px; height: 16px; border-radius: 3px; background: var(--brand); }
.w-label > span { font-size: 13px; color: var(--ink-3); margin-right: auto; }
.frame { height: 30px; padding: 0 11px; border: 1px solid #cfd8f6; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.frame:hover { border-color: var(--brand); background: #e4e9ff; }
textarea { width: 100%; resize: none; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: #fbfcfe; font-size: 16.5px; line-height: 1.55; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea:focus { background: #fff; }
textarea::placeholder { color: #a9aebb; }
textarea:disabled { background: var(--sunk); color: var(--ink-2); }
.count { justify-self: end; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.count.near { color: var(--bad); font-weight: 700; }
.w-field > .count { position: absolute; right: 10px; bottom: 6px; background: #ffffffd0; padding: 0 4px; border-radius: 4px; }
.w-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.etype { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.etype select { height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 15px; font-weight: 600; }
.write .btn.block { margin-top: auto; }

/* 태블릿, 컴퓨터: 한 화면에 맞춘다 */
@media (min-width: 901px) {
  body[data-screen="screen-play"] #app { padding-top: 10px; padding-bottom: 10px; }
  #screen-play.active { display: flex; flex-direction: column; height: calc(100vh - 20px); height: calc(100dvh - 20px); }
  #screen-play .play-grid { flex: 1; min-height: 0; align-items: stretch; }
  .stage, .write { min-height: 0; overflow: auto; scrollbar-width: thin; }
  #screen-start.active, #screen-end.active { display: grid; align-content: center; min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px); }
  .start, .end { margin-top: 0; margin-bottom: 0; width: 100%; }
  .write .w-field { display: flex; flex-direction: column; flex: 1 1 0; min-height: 96px; }
  .write .w-field.f-claim { flex-grow: .7; min-height: 84px; }
  .write .w-field textarea { flex: 1; min-height: 52px; }
}
@media (min-width: 901px) and (min-height: 761px) {
  .stage-top { min-height: 236px; }
  .stage-top .judge { width: 228px; }
}
@media (min-width: 901px) and (max-height: 760px) {
  .stage-top { min-height: 150px; }
  .stage-top .judge { width: 146px; }
  .hero { min-height: 190px; }
  .hero-judge { width: 164px; }
  .write textarea { font-size: 16px; }
}

/* 결과 */
.end { max-width: 780px; margin: 16px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 12px 12px 22px; display: grid; gap: 14px; position: relative; overflow: hidden; }
.end > :not(.end-top) { margin: 0 12px; }
.end-top { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 0 22px 0 0; border-radius: 18px; background: var(--role); min-height: 170px; overflow: hidden; }
.end-judge { width: 176px; }
.end-title { flex: 1; min-width: 0; align-self: center; }
.end-title h1 { font-size: 32px; }
.end-mission { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.end-mission b { color: var(--ink); margin-right: 4px; }
.end-score { align-self: center; display: flex; align-items: baseline; gap: 4px; padding: 12px 18px; border-radius: 18px; background: #ffffffd0; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.end-score b { font-size: 52px; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.end-score.win b { color: var(--done); }
.end-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.end-box { padding: 14px; border-radius: 16px; background: var(--sunk); display: grid; gap: 8px; align-content: start; }
.end-label { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.trend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; height: 132px; }
.tcol { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; height: 100%; }
.tcol em { font-style: normal; font-weight: 800; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tbar { width: 40px; align-self: end; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #7d97f2, var(--brand)); min-height: 6px; }
.tcol.win .tbar { background: linear-gradient(180deg, #5bbd97, var(--done)); }
.tcol.none .tbar { background: transparent; border: 2px dashed var(--line-2); height: 100%; }
.tcol.none em { color: var(--ink-3); }
.tcol span { font-size: 12.5px; color: var(--ink-3); font-weight: 650; }
.marks.small .mk { padding: 5px 8px 5px 12px; font-size: 14px; }
.marks.small .mk b { flex-basis: 32px; height: 32px; font-size: 18px; }
.end-quote { position: relative; padding: 14px 16px 14px 46px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-2); font-weight: 650; font-size: 16px; }
.end-quote::before { content: '“'; position: absolute; left: 15px; top: 3px; font-family: var(--title); font-size: 40px; color: #9fb0ef; }
.end-claim { font-size: 14.5px; color: var(--ink-2); padding: 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.end-claim b { color: var(--ink); margin-right: 6px; }
.end-actions { display: flex; gap: 8px; }
.end-actions .btn { flex: 1; min-height: 56px; font-size: 17px; }
.end-actions .btn.primary { flex: 1.6; }

/* 축하 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* 창 */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: #1d233466; backdrop-filter: blur(3px); }
.sheet-card { width: min(440px, 100%); background: var(--surface); border-radius: 22px; box-shadow: 0 20px 60px #1d233440; animation: pop .25s ease-out; padding: 22px; display: grid; gap: 12px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.verdict { font-family: var(--title); font-weight: 600; font-size: 21px; }
.sheet-msg { color: var(--ink-2); font-size: 15px; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn { flex: 1; min-height: 50px; }
.sheet-actions .btn.primary { flex: 1.6; }

/* 알림 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 650; box-shadow: var(--shadow); width: max-content; max-width: calc(100vw - 32px); text-align: center; animation: pop .2s ease-out; }
.toast.bad { background: var(--bad); }

/* 좁은 화면 */
@media (max-width: 900px) {
  .start { grid-template-columns: 1fr; }
  .play-grid { grid-template-columns: 1fr; }
  .hud { flex-wrap: wrap; row-gap: 8px; }
  .mission-now { order: 5; flex-basis: 100%; }
  .start-actions { margin-top: 0; }
}
@media (max-width: 620px) {
  #app { padding: 10px; }
  .start { margin: 4px auto; gap: 10px; }
  .start-side, .start-main { border-radius: 20px; }
  .start-side { padding: 10px; gap: 12px; }
  .start-main { padding: 16px 12px; }
  .hero { min-height: 0; padding: 16px 0 0 16px; }
  .hero h1 { font-size: 30px; }
  .hero-judge { width: 118px; }
  .lead { font-size: 14px; }
  .steps { padding: 0; gap: 6px; }
  .steps li { padding: 8px 10px; gap: 8px; }
  .steps p { font-size: 12.5px; }
  .start-form { grid-template-columns: 1fr; padding: 0; }
  .pick-title { font-size: 21px; margin-bottom: 10px; }
  .missions { grid-template-columns: 1fr; gap: 8px; }
  .mcard { min-height: 0; padding: 8px 10px 8px 8px; }
  .mc-pic { flex-basis: 54px; height: 54px; }
  .custom { grid-template-columns: 1fr; }
  .start-actions { flex-direction: column-reverse; }
  .start-actions #btn-resume { min-height: 50px; }
  .brand { display: none; }
  .hud { gap: 8px; padding: 8px 10px; justify-content: space-between; }
  .pill { height: 32px; padding: 0 10px; font-size: 13px; }
  .pill.nick { max-width: 110px; }
  .stage, .write { padding: 10px; border-radius: 18px; }
  .stage-top { min-height: 0; padding-top: 10px; padding-right: 10px; }
  .stage-top .judge { width: 112px; }
  .role { font-size: 12px; left: 8px; top: 8px; padding: 3px 10px; }
  .bubble { min-height: 0; padding: 10px 12px; margin-bottom: 10px; }
  .bubble p { font-size: 15.5px; }
  .w-label > span { display: none; }
  .w-label b { margin-right: auto; }
  .end { padding: 10px 10px 16px; margin: 4px auto; }
  .end > :not(.end-top) { margin: 0 4px; }
  .end-top { padding-right: 12px; min-height: 0; gap: 8px 12px; }
  .end-judge { width: 116px; }
  .end-score { margin-left: auto; padding: 8px 12px; }
  .end-score b { font-size: 44px; }
  .end-title { order: 3; flex-basis: 100%; padding: 0 0 14px 14px; }
  .end-title h1 { font-size: 24px; }
  .end-grid { grid-template-columns: 1fr; }
  .trend { height: 100px; }
  .marks.small { grid-template-columns: repeat(3, 1fr); }
  .marks.small .mk { padding: 5px 6px 5px 10px; }
  .end-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
