:root {
  --ink: #17151d;
  --muted: #77737f;
  --line: #e9e6ef;
  --soft: #f7f6fa;
  --accent: #6c4cff;
  --accent-soft: #eeeaff;
  --success: #27a36a;
  --radius: 24px;
  font-family: Pretendard, "Apple SD Gothic Neo", Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #fff; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 3px; }

.app-shell { min-height: 100svh; }
.topbar { height: 72px; padding: 0 clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 20; background: rgba(255,255,255,.9); backdrop-filter: blur(18px); }
.brand { border: 0; background: none; display: flex; align-items: center; gap: 11px; font-weight: 850; font-size: 16px; cursor: pointer; }
.brand-mark { width: 26px; height: 18px; border: 2px solid var(--ink); border-radius: 100% 0 100% 0; transform: rotate(45deg); display: grid; place-items: center; }
.brand-mark i { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.round-status { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; }
.status-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.sound-toggle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: white; cursor: pointer; font-weight: 800; }
main { min-height: calc(100svh - 72px); }

.split-screen { min-height: calc(100svh - 72px); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); }
.poster-panel { background: var(--ink); color: white; padding: clamp(44px, 7vw, 110px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; position: relative; }
.poster-panel::after { content: "?"; position: absolute; right: -3vw; bottom: -13vw; font-size: clamp(260px, 35vw, 600px); line-height: .8; font-weight: 900; color: rgba(255,255,255,.025); }
.eyebrow, .step-kicker { margin: 0 0 24px; color: #a997ff; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.poster-panel h1, .lobby-intro h1, .matching h1, .reveal-copy h1 { margin: 0; font-size: clamp(48px, 6.1vw, 96px); line-height: .99; letter-spacing: -.065em; }
.poster-panel h1 em, .reveal-copy h1 em { color: #a997ff; font-style: normal; }
.poster-chat { margin-top: clamp(48px, 8vh, 100px); width: min(570px, 90%); display: grid; grid-template-columns: 40px 1fr; gap: 16px 14px; position: relative; z-index: 2; }
.poster-chat span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); font-weight: 800; }
.poster-chat p { margin: 0; padding: 10px 16px; border: 1px solid rgba(255,255,255,.14); border-radius: 5px 18px 18px 18px; width: fit-content; color: #dcd9e4; }
.poster-chat .mystery { background: var(--accent); }
.profile-panel { padding: clamp(44px, 7vw, 110px); display: flex; flex-direction: column; justify-content: center; gap: 28px; max-width: 720px; width: 100%; margin: auto; }
.profile-panel h2, .topic-stage h2, .vote-header h2, .result-screen h2 { margin: 0 0 12px; font-size: clamp(34px, 3.5vw, 56px); line-height: 1.06; letter-spacing: -.045em; }
.muted { color: var(--muted); }
.avatar-picker { border: 0; padding: 0; margin: 0; }
.avatar-picker legend { font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.avatar-picker label { display: inline-block; margin-right: 8px; }
.avatar-picker input { position: absolute; opacity: 0; }
.avatar-picker span { width: 52px; height: 52px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 25px; border: 2px solid transparent; cursor: pointer; transition: .2s ease; }
.avatar-picker input:checked + span { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.field { display: grid; gap: 9px; font-size: 13px; font-weight: 800; }
.field small { display: inline; color: var(--muted); font-weight: 500; }
.field input { border: 0; border-bottom: 1px solid #cfcbd6; padding: 13px 1px; font-size: 18px; background: transparent; }
.field input:focus { border-color: var(--accent); outline-width: 0; }
.primary, .secondary { min-height: 52px; border-radius: 999px; border: 0; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; gap: 22px; font-weight: 850; cursor: pointer; transition: transform .2s ease, background .2s ease, opacity .2s; }
.primary { background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: #5738ed; transform: translateY(-2px); }
.primary:disabled { opacity: .35; cursor: not-allowed; }
.secondary { background: var(--soft); }
.wide { width: 100%; justify-content: space-between; }
.fine-print { margin: -16px 0 0; text-align: center; font-size: 11px; color: var(--muted); }

.lobby { max-width: 1180px; margin: auto; padding: clamp(42px, 7vw, 90px) clamp(20px, 4vw, 48px); }
.lobby-intro { display: flex; justify-content: space-between; align-items: end; margin-bottom: 56px; }
.lobby-intro h1 { font-size: clamp(48px, 7vw, 90px); }
.online-note { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.online-note span { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 5px #e9f8f0; }
.quick-match { background: var(--ink); color: white; border-radius: 28px; padding: clamp(30px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.quick-match h2 { margin: 12px 0 6px; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.04em; }
.quick-match p { margin: 0; color: #aaa6b1; }
.mode-tag { color: #b7a7ff; font-size: 12px; font-weight: 800; }
.room-section { margin-top: 48px; }
.join-panel { margin-top: 48px; padding: 34px 0; border-top: 1px solid var(--ink); display: flex; align-items: end; justify-content: space-between; gap: 36px; }
.join-panel h2 { margin: 0 0 8px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.04em; }
.join-panel .eyebrow { margin-bottom: 12px; }
.join-panel p:last-child { margin-bottom: 0; }
.join-panel form { display: flex; align-items: center; gap: 10px; }
.join-panel input { width: 180px; height: 52px; border: 1px solid var(--line); border-radius: 999px; padding: 0 22px; text-align: center; text-transform: uppercase; font-size: 20px; font-weight: 900; letter-spacing: .14em; }
.section-heading { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.section-heading h2 { font-size: 18px; }
.text-button { border: 0; background: none; color: var(--accent); font-weight: 800; cursor: pointer; }
.room-row { width: 100%; min-height: 78px; display: grid; grid-template-columns: 1fr 100px 110px 30px; align-items: center; gap: 16px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; cursor: pointer; transition: padding .2s, background .2s; }
.room-row:hover { background: var(--soft); padding-inline: 14px; }
.room-row span:first-child { display: grid; gap: 5px; }
.room-row small { color: var(--muted); }

.matching { min-height: calc(100svh - 72px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }
.matching h1 { font-size: clamp(44px, 7vw, 80px); }
.radar { width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 50%; position: relative; margin-bottom: 34px; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 13px; border: 1px solid var(--line); border-radius: 50%; }
.radar::after { inset: 27px; }
.radar span { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; transform: translate(-50%,-50%); }
.radar i { position: absolute; inset: 0 50% 50% 0; transform-origin: bottom right; background: linear-gradient(135deg, transparent 50%, rgba(108,76,255,.35)); animation: radar 1.4s linear infinite; }
.match-slots { display: flex; margin: 48px 0 20px; }
.match-slots span { width: 62px; height: 62px; border: 4px solid white; margin-left: -10px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 28px; animation: pop .45s var(--delay) both; }
.match-slots .ai-slot { background: var(--ink); color: white; font-size: 13px; font-weight: 900; }
.room-wait .eyebrow { margin-bottom: 12px; }
.room-code { border: 0; background: none; color: var(--accent); font-size: clamp(44px, 8vw, 84px); font-weight: 950; letter-spacing: .09em; cursor: pointer; display: grid; gap: 5px; margin-bottom: 30px; }
.room-code small { color: var(--muted); font-size: 11px; letter-spacing: 0; font-weight: 600; }
.room-start { min-width: 240px; margin-top: 24px; }
.waiting-copy { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.waiting-copy i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 8px var(--accent-soft); animation: typing .8s infinite alternate; margin-bottom: 30px; }
.waiting-copy h2 { margin: 0 0 14px; }
.waiting-copy p, .waiting-host { color: var(--muted); }

.game-layout { min-height: calc(100svh - 72px); display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.28fr); }
.game-aside { background: var(--ink); color: white; padding: clamp(48px, 6vw, 90px); display: flex; flex-direction: column; justify-content: center; }
.game-aside h1 { margin: 0 0 20px; font-size: clamp(44px, 5vw, 74px); line-height: .98; letter-spacing: -.06em; }
.game-aside > p:not(.eyebrow) { max-width: 360px; color: #aaa6b1; line-height: 1.65; }
.progress-dots { display: flex; gap: 8px; margin-top: 46px; }
.progress-dots i { width: 24px; height: 4px; border-radius: 9px; background: #3a3741; }
.progress-dots i.active { background: #a997ff; }
.game-stage { padding: clamp(42px, 7vw, 96px); align-self: center; width: min(860px, 100%); margin: auto; }
.system-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.system-line span { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.topic-options { margin: 40px 0; border-top: 1px solid var(--ink); }
.topic-options button { width: 100%; min-height: 92px; border: 0; border-bottom: 1px solid var(--line); background: white; display: grid; grid-template-columns: 52px 1fr 30px; align-items: center; text-align: left; cursor: pointer; transition: padding .2s, background .2s; }
.topic-options button:hover { background: var(--accent-soft); padding-inline: 12px; }
.topic-options b { color: var(--accent); font-size: 12px; }
.topic-options span { font-size: clamp(17px, 2vw, 22px); font-weight: 750; }
.custom-topic > label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 10px; }
.custom-topic > div { display: flex; border: 1px solid var(--line); border-radius: 18px; padding: 8px; }
.custom-topic input { flex: 1; min-width: 0; border: 0; padding: 10px; }
.custom-topic input:focus { outline: 0; }
.custom-topic button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--ink); color: white; cursor: pointer; }
.topic-message { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 46px; }
.topic-message span { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--accent); color: white; display: grid; place-items: center; font-weight: 900; }
.topic-message p { margin: 0; background: var(--soft); padding: 17px 20px; border-radius: 6px 20px 20px 20px; font-size: clamp(18px, 2.2vw, 25px); font-weight: 750; line-height: 1.45; }
.timer-row, .composer-footer { display: flex; justify-content: space-between; align-items: center; }
.timer-row { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.timer-row strong { color: var(--accent); font-size: 18px; font-variant-numeric: tabular-nums; }
.answer-stage textarea { width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--line); border-radius: 22px; padding: 24px; font-size: 19px; line-height: 1.6; }
.composer-footer { margin-top: 14px; color: var(--muted); font-size: 12px; }
.typing-row { display: flex; align-items: center; gap: 5px; margin-top: 36px; color: var(--muted); font-size: 12px; }
.typing-row i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite alternate; }
.typing-row i:nth-child(2) { animation-delay: .2s; }.typing-row i:nth-child(3) { animation-delay: .4s; margin-right: 5px; }

.vote-screen, .result-screen, .final-screen { width: min(1040px, 100%); margin: auto; padding: clamp(42px, 6vw, 80px) clamp(20px, 4vw, 48px); }
.vote-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.vote-header p { color: var(--muted); line-height: 1.6; }
.answer-list { border-top: 1px solid var(--ink); }
.answer-row { width: 100%; min-height: 104px; border: 0; border-bottom: 1px solid var(--line); background: white; display: grid; grid-template-columns: 54px 1fr 36px; align-items: center; gap: 18px; text-align: left; cursor: pointer; animation: rise .4s var(--delay) both; transition: background .2s, padding .2s; }
.answer-row:hover, .answer-row.selected { background: var(--accent-soft); padding-inline: 16px; }
.answer-row:disabled { cursor: default; }
.answer-letter { width: 42px; height: 42px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 900; }
.answer-row.selected .answer-letter { background: var(--accent); color: white; }
.answer-row p { font-size: clamp(15px, 1.8vw, 18px); line-height: 1.55; }
.select-ring { width: 22px; height: 22px; border: 2px solid #d4d0db; border-radius: 50%; }
.answer-row.selected .select-ring { border: 6px solid var(--accent); }
.sticky-action { position: sticky; bottom: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); padding: 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.sticky-action > span { color: var(--muted); font-size: 13px; }

.result-screen { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px 80px; align-items: start; }
.result-screen header > p:last-child { color: var(--muted); line-height: 1.6; }
.vote-bars { border-top: 1px solid var(--ink); padding-top: 16px; }
.vote-bar { display: grid; grid-template-columns: 28px 1fr 42px; align-items: center; gap: 12px; min-height: 54px; }
.vote-bar > span, .vote-bar strong { font-size: 13px; }
.vote-bar > div { height: 9px; background: var(--soft); border-radius: 10px; overflow: hidden; }
.vote-bar i { display: block; width: var(--width); height: 100%; background: #c9c5d1; border-radius: inherit; animation: bar .7s ease both; }
.vote-bar.mine i { background: var(--accent); }
.score-note { grid-column: 1 / -1; background: var(--soft); border-radius: 20px; padding: 24px; display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; }
.score-note strong { color: var(--accent); }
.score-note small { grid-column: 1 / -1; color: var(--muted); }
.next-round { grid-column: 1 / -1; }

.final-screen { display: grid; grid-template-columns: .9fr 1.1fr; gap: 46px 90px; }
.reveal-copy { align-self: center; }
.reveal-copy h1 { font-size: clamp(46px, 6vw, 82px); }
.reveal-copy > p:last-child { max-width: 480px; color: var(--muted); line-height: 1.7; }
.identity-list { border-top: 1px solid var(--ink); }
.identity-row { min-height: 78px; display: grid; grid-template-columns: 48px 50px 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); animation: rise .5s var(--delay) both; }
.identity-row .avatar { width: 44px; height: 44px; display: grid; place-items: center; background: var(--soft); border-radius: 50%; font-size: 23px; }
.identity-row div { display: grid; gap: 3px; }
.identity-row small { color: var(--muted); }
.identity-row > b { font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.identity-row.is-ai { background: var(--accent-soft); margin-inline: -14px; padding-inline: 14px; border-radius: 14px; }
.identity-row.is-ai > b, .identity-row.is-ai small { color: var(--accent); }
.final-score { grid-column: 1 / -1; border-top: 1px solid var(--ink); padding-top: 22px; display: flex; align-items: baseline; gap: 24px; }
.final-score > span { font-weight: 800; }.final-score > strong { font-size: 64px; letter-spacing: -.05em; }.final-score small { font-size: 18px; }.final-score p { margin-left: auto; color: var(--muted); }
.final-actions { grid-column: 1 / -1; display: flex; gap: 12px; }.final-actions button { flex: 1; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 13px 20px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.screen-enter { animation: fade .35s ease both; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { opacity: 0; transform: scale(.65); } }
@keyframes typing { to { opacity: .2; transform: translateY(-3px); } }
@keyframes radar { to { transform: rotate(360deg); } }
@keyframes bar { from { width: 0; } }

@media (max-width: 800px) {
  .topbar { height: 62px; }.round-status { top: 64px; left: 0; width: 100%; height: 32px; transform: none; justify-content: center; background: white; border-bottom: 1px solid var(--line); }.round-status:not([hidden]) + .sound-toggle { margin-left: auto; }
  main { min-height: calc(100svh - 62px); }
  .split-screen { grid-template-columns: 1fr; }.poster-panel { min-height: 45svh; padding: 44px 24px; }.poster-chat { display: none; }.profile-panel { padding: 42px 24px; }
  .lobby { padding-top: 44px; }.lobby-intro { align-items: start; flex-direction: column; gap: 24px; }.quick-match { align-items: stretch; flex-direction: column; }.quick-match .primary { width: 100%; justify-content: space-between; }
  .join-panel { align-items: stretch; flex-direction: column; }.join-panel form { align-items: stretch; flex-direction: column; }.join-panel input, .join-panel button { width: 100%; }
  .room-row { grid-template-columns: 1fr 55px 24px; }.room-row span:nth-child(3) { display: none; }
  .matching { min-height: calc(100svh - 62px); }
  .game-layout { grid-template-columns: 1fr; padding-top: 32px; }.game-aside { background: white; color: var(--ink); padding: 34px 20px 8px; }.game-aside .eyebrow { margin-bottom: 10px; }.game-aside h1 { font-size: 36px; margin-bottom: 8px; }.game-aside > p:not(.eyebrow) { color: var(--muted); margin: 0; }.progress-dots { margin-top: 20px; }.game-stage { padding: 28px 20px 50px; }
  .vote-screen, .result-screen, .final-screen { padding-top: 58px; }.vote-header { align-items: start; flex-direction: column; }.vote-header > p { margin: 0; }.answer-row { grid-template-columns: 44px 1fr 26px; gap: 10px; min-height: 112px; }.sticky-action { flex-direction: column; align-items: stretch; }.sticky-action > span { text-align: center; }
  .result-screen, .final-screen { grid-template-columns: 1fr; gap: 34px; }.result-screen header, .vote-bars, .reveal-copy, .identity-list { grid-column: 1; }.final-score, .final-actions { grid-column: 1; }.final-score { flex-wrap: wrap; }.final-score p { width: 100%; margin: 0; }.identity-row { grid-template-columns: 44px 48px 1fr auto; }.final-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
