:root {
  --ink: #171715;
  --paper: #f3f0e8;
  --acid: #d9ff4f;
  --coral: #ff6d50;
  --muted: #77766f;
  --line: rgba(23, 23, 21, .17);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: "DM Sans", sans-serif; background: radial-gradient(circle at 18% 20%, #fff 0, transparent 33%), var(--paper); }
button, input { font: inherit; }
button { color: inherit; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .15; z-index: 10; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E"); }
.topbar { height: 78px; padding: 0 clamp(22px, 6vw, 82px); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.brand { color: inherit; text-decoration: none; font-weight: 800; letter-spacing: .16em; display: flex; align-items: center; gap: 11px; font-size: .83rem; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid; border-radius: 50% 46% 52% 45%; transform: rotate(-7deg); font-family: "Playfair Display"; font-size: 1.1rem; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
main { width: min(1080px, calc(100% - 40px)); margin: auto; }
.screen { display: none; min-height: calc(100vh - 125px); animation: enter .45s ease both; }
.screen.active { display: flex; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.setup-screen { padding: clamp(50px, 8vw, 105px) 0 70px; align-items: flex-start; gap: clamp(50px, 9vw, 130px); }
.setup-screen > * { flex: 1; }
.eyebrow, .kicker { font-weight: 700; font-size: .68rem; letter-spacing: .2em; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; }
.eyebrow span { width: 26px; border-top: 2px solid var(--coral); }
h1, .ready-screen h2 { margin: 0; font: 700 clamp(4.4rem, 9.6vw, 7.2rem)/.78 "Playfair Display", serif; letter-spacing: -.065em; }
h1 em, .ready-screen h2 em { color: var(--coral); font-weight: 700; }
.intro { color: var(--muted); max-width: 440px; line-height: 1.7; margin-top: 38px; }
.setup-card { background: #fff; border: 1px solid var(--line); box-shadow: 12px 12px 0 var(--ink); padding: clamp(24px, 4vw, 38px); max-width: 470px; transform: rotate(1deg); }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.step { color: var(--coral); font-weight: 700; font-size: .7rem; }
h2 { font-family: "Playfair Display"; font-size: 2rem; margin: 5px 0 0; }
.player-count { background: var(--acid); border-radius: 100px; padding: 7px 12px; font-size: .72rem; }
.add-player-form { padding-top: 22px; }
.add-player-form > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.add-player-row { display: flex; border: 1px solid var(--ink); }
.add-player-row input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 0 14px; background: #faf9f5; }
.add-player-row button { width: 92px; min-height: 48px; border: 0; background: var(--acid); font-weight: 800; cursor: pointer; }
.add-player-row button:disabled { opacity: .45; cursor: default; }
.player-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 18px 0; }
.player-field { display: flex; align-items: center; gap: 9px; padding: 6px 8px; background: #f5f3ed; border: 1px solid transparent; }
.avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .7rem; border: 1px solid rgba(0,0,0,.16); overflow: hidden; }
.avatar svg, .big-avatar svg { width: 100%; height: 100%; }
.player-field strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; white-space: nowrap; }
.player-number { margin-left: auto; color: var(--muted); font-size: .65rem; }
.setup-message { margin: 0 0 10px; color: var(--muted); font-size: .72rem; }
.primary-button:disabled { opacity: .4; cursor: not-allowed; transform: none; background: var(--ink); }
.hidden { display: none !important; }
.primary-button, .secondary-button { min-height: 54px; border: 1px solid var(--ink); padding: 0 22px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.primary-button { width: 100%; background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; }
.primary-button:hover { background: var(--coral); transform: translateY(-2px); }
.primary-button span { font-size: 1.3rem; }
.game-screen { flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 0 80px; }
.round-meta { position: absolute; top: 102px; width: min(620px, calc(100% - 40px)); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; text-transform: uppercase; font-size: .65rem; font-weight: 700; letter-spacing: .16em; }
.progress-track { height: 3px; background: #d2cfc6; }
.progress-track span { display: block; height: 100%; width: 16.67%; background: var(--coral); transition: width .35s ease; }
.reveal-state { display: none; width: min(480px, 100%); animation: enter .3s ease both; }
.reveal-state.active { display: flex; flex-direction: column; align-items: center; }
.kicker { color: var(--muted); }
.big-avatar { width: 116px; height: 116px; border-radius: 50%; margin: 22px 0 16px; border: 3px solid var(--ink); overflow: hidden; box-shadow: 7px 7px 0 var(--acid); }
.reveal-state h2 { font-size: clamp(2.4rem, 6vw, 3.8rem); }
.reveal-state > p:not(.kicker) { color: var(--muted); }
.reveal-button { margin-top: 25px; user-select: none; justify-content: center; gap: 18px; }
.reveal-state small { margin-top: 10px; color: var(--muted); font-size: .68rem; }
.role-card { background: white; border: 1px solid var(--ink); width: 100%; padding: 62px 20px; margin: 25px 0; box-shadow: 10px 10px 0 var(--acid); }
.role-card.imposter { color: white; background: var(--coral); box-shadow: 10px 10px 0 var(--ink); }
.role-card span { font-size: .66rem; letter-spacing: .2em; font-weight: 700; }
.role-card strong { display: block; font: 700 clamp(3rem, 9vw, 5rem)/1 "Playfair Display"; margin: 14px 0; }
.role-card p { margin: 0; font-size: .8rem; }
.ready-screen { text-align: center; flex-direction: column; align-items: center; justify-content: center; padding: 70px 0; }
.ready-screen h2 { font-size: clamp(4rem, 9vw, 6.8rem); }
.ready-screen > p:not(.kicker) { color: var(--muted); max-width: 490px; line-height: 1.7; }
.burst { font-size: 3rem; color: var(--coral); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.round-actions { display: flex; gap: 12px; width: min(480px, 100%); margin-top: 22px; }
.round-actions button { flex: 1; }
.secondary-button { background: transparent; }
.secondary-button:hover { background: white; }
.answer { min-height: 32px; margin-top: 22px; font-family: "Playfair Display"; font-size: 1.35rem; }
footer { height: 47px; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; gap: 25px; font-size: .6rem; letter-spacing: .22em; }

@media (max-width: 760px) {
  .setup-screen { flex-direction: column; gap: 45px; padding-top: 45px; }
  .setup-card { width: calc(100% - 10px); align-self: center; }
  h1 { font-size: clamp(4.2rem, 21vw, 6.5rem); }
  .round-meta { top: 96px; }
}
@media (max-width: 430px) {
  main { width: calc(100% - 28px); }
  .player-inputs { grid-template-columns: 1fr; }
  .setup-card { box-shadow: 7px 7px 0 var(--ink); }
  .round-actions { flex-direction: column; }
  .game-screen { padding-top: 95px; }
}
