:root {
  color-scheme: dark;
  --ink: #11110f;
  --ink-2: #191916;
  --ink-3: #24231f;
  --paper: #f6f2e8;
  --muted: #aaa89f;
  --line: rgba(246, 242, 232, .16);
  --coral: #ff5d52;
  --coral-dark: #c93631;
  --yellow: #ffd447;
  --cyan: #26c6da;
  --green: #36c98f;
  --blue: #4f8cff;
  --bad: #ff4d67;
  --shadow: 0 18px 48px rgba(0, 0, 0, .32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #11110f; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--paper);
  background-color: var(--ink);
  background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 26px 26px;
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button { min-height: 44px; cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
button, input, select, fieldset { border: 0; }
h1, h2, h3, p { margin: 0; letter-spacing: 0; }
h1 { font-size: 3.1rem; line-height: .96; font-weight: 950; }
h2 { font-size: 1.45rem; line-height: 1.08; font-weight: 900; }
h3 { font-size: 1.05rem; font-weight: 850; }
p { color: var(--muted); line-height: 1.48; }

.app-shell {
  width: min(100%, 660px);
  min-height: 100dvh;
  margin: 0 auto;
  background: rgba(17, 17, 15, .88);
  border-inline: 1px solid rgba(255, 255, 255, .04);
}
.screen {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(88px, env(safe-area-inset-bottom));
}
.center-screen { align-content: center; }
.home-screen { padding: 0; align-content: center; }
.play-screen { padding-bottom: 116px; }
.role-screen, .reveal-screen { align-content: start; }

.icon { width: 21px; height: 21px; flex: none; }
.brand-logo {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(255, 93, 82, .22);
}
.brand-logo.large { width: 84px; height: 84px; }
.brand-logo.hero-logo { width: 58px; height: 58px; }
.topbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; }
.brand > div { min-width: 0; }
.brand strong { display: block; font-size: 1.05rem; overflow-wrap: anywhere; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.connection { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .64rem; font-weight: 800; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.connection.live i { background: var(--green); }
.connection.offline { color: #ff9aab; }
.connection.offline i { background: var(--bad); }
.tiny { font-size: .76rem; }
.eyebrow { color: var(--yellow); font-size: .72rem; font-weight: 900; letter-spacing: .11em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }

.btn {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--paper);
  background: var(--ink-3);
  font-weight: 850;
  transition: transform .14s ease, background-color .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { border-color: rgba(246, 242, 232, .36); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.loading { opacity: .7; }
.btn.large { min-height: 56px; font-size: 1.02rem; }
.btn.compact { min-height: 38px; width: auto; padding: 7px 12px; }
.btn.primary { color: #15130f; background: var(--yellow); border-color: var(--yellow); }
.btn.primary:hover { background: #ffe06f; }
.btn.light { color: var(--ink); background: var(--paper); border-color: var(--paper); }
.btn.good { color: #09261c; background: var(--green); border-color: var(--green); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.subtle { background: transparent; }
.btn.danger-outline { color: #ff8d9d; background: transparent; border-color: rgba(255, 77, 103, .5); }
.btn.text-btn, .text-btn { min-height: 36px; color: var(--muted); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 4px; }
.icon-btn {
  width: 46px;
  height: 46px;
  min-height: 46px;
  flex: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.icon-btn.small { width: 36px; height: 36px; min-height: 36px; }
.icon-btn.good { color: #09261c; background: var(--green); border-color: var(--green); }
.primary-actions { display: grid; gap: 10px; }

label { display: grid; gap: 7px; color: var(--muted); font-size: .86rem; font-weight: 750; }
input, select {
  width: 100%;
  min-width: 0;
  min-height: 49px;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--paper);
  background: var(--ink-2);
  outline: none;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(38, 198, 218, .38); outline-offset: 2px; }
.code-input { font-size: 1.65rem; font-weight: 900; letter-spacing: .16em; text-align: center; }
fieldset { min-width: 0; margin: 0; padding: 0; }
legend { margin-bottom: 8px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.form-stack { display: grid; gap: 18px; }

.home-stage {
  position: relative;
  min-height: 620px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 22px;
  overflow: hidden;
  padding: max(210px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background-color: #13130f;
  isolation: isolate;
}
.home-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--hero-art);
  background-repeat: no-repeat;
  background-position: center 20px;
  background-size: 176px auto;
}
.home-stage > * { position: relative; z-index: 2; }
.home-copy { width: min(100%, 420px); min-width: 0; display: grid; gap: 12px; }
.home-copy h1 { max-width: 100%; overflow-wrap: anywhere; font-size: 3rem; line-height: 1; text-transform: uppercase; }
.home-copy h1 span { color: var(--coral); }
.home-lead { max-width: 330px; color: var(--paper); font-size: 1.08rem; font-weight: 650; }
.home-actions { width: min(100%, 420px); min-width: 0; display: grid; gap: 10px; }
.brand-trigger { width: 48px; height: 48px; justify-self: start; padding: 0; border: 0; border-radius: 8px; background: transparent; touch-action: manipulation; }
.brand-trigger .brand-logo { width: 48px; height: 48px; }
.home-copy .eyebrow { font-size: .68rem; letter-spacing: 0; }
.home-actions .btn { white-space: normal; overflow-wrap: anywhere; text-align: center; }

.profile-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 112px;
  padding: 16px;
  color: var(--ink);
  background: var(--cyan);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.profile-preview p { color: rgba(17, 17, 15, .65); }
.avatar {
  width: 45px;
  height: 45px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--player-color, var(--blue));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: 1.48rem;
  line-height: 1;
}
.avatar.big { width: 72px; height: 72px; font-size: 2.35rem; }
.avatar.xl { width: 106px; height: 106px; font-size: 3.5rem; border-radius: 8px; }
.color-grid, .emoji-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.swatch, .emoji-choice {
  aspect-ratio: 1;
  min-height: 0;
  border-radius: 8px;
  border: 2px solid transparent;
  color: var(--paper);
  background: var(--ink-2);
}
.swatch { background: var(--swatch); }
.emoji-choice { font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 1.45rem; }
.swatch.active, .emoji-choice.active { border-color: var(--paper); box-shadow: 0 0 0 3px rgba(246, 242, 232, .15); }

.section-block {
  display: grid;
  gap: 14px;
  padding-block: 18px;
  border-block: 1px solid var(--line);
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head > .icon { color: var(--yellow); }
.room-code-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: var(--shadow);
}
.room-code-band p { color: rgba(17, 17, 15, .66); font-size: .68rem; font-weight: 900; letter-spacing: .1em; }
.room-code-band .icon-btn { color: var(--ink); background: rgba(17, 17, 15, .08); border-color: rgba(17, 17, 15, .18); }
.code { display: block; margin-top: 2px; font-size: 2.45rem; font-weight: 950; letter-spacing: .1em; }
.player-list, .leaderboard { display: grid; gap: 8px; }
.player-row, .leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px;
  border-radius: 8px;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.player-row.offline { opacity: .56; }
.player-row p, .leader-row p { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.score-mini, .leader-score, .score-chip { display: grid; justify-items: end; line-height: 1; }
.score-mini strong, .leader-score strong { font-size: 1.25rem; }
.score-mini span, .leader-score span, .score-chip span { color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.status-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #55544f; box-shadow: 0 0 0 4px rgba(255, 255, 255, .04); }
.status-dot.ready { background: var(--green); box-shadow: 0 0 0 4px rgba(54, 201, 143, .12); }
.badge, .count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--paper);
  background: var(--ink-3);
  border: 1px solid var(--line);
  font-size: .73rem;
  font-weight: 800;
}
.count-badge { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }

.settings-grid { display: grid; gap: 2px; }
.setting-row {
  min-width: 0;
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(246, 242, 232, .08);
}
.setting-row > span { min-width: 0; display: grid; gap: 2px; color: var(--paper); }
.setting-row small { color: var(--muted); font-size: .68rem; font-weight: 600; }
.setting-row input[type="number"] { min-height: 42px; text-align: center; }
.toggle-row { grid-template-columns: minmax(0, 1fr) 48px; }
.toggle-row input[type="checkbox"] {
  position: relative;
  width: 46px;
  height: 26px;
  min-height: 26px;
  appearance: none;
  padding: 0;
  border-radius: 999px;
  background: #43423d;
  transition: background-color .15s ease;
}
.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform .15s ease;
}
.toggle-row input[type="checkbox"]:checked { background: var(--green); }
.toggle-row input[type="checkbox"]:checked::after { transform: translateX(20px); }
.setting-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.host-dock {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 12;
  display: grid;
  grid-template-columns: 52px repeat(3, 1fr);
  gap: 5px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(25, 25, 22, .96);
  border: 1px solid rgba(255, 212, 71, .28);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.host-label { display: grid; place-items: center; gap: 1px; color: var(--yellow); font-size: .62rem; font-weight: 900; }
.tool-btn {
  min-width: 0;
  min-height: 46px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 6px;
  color: var(--paper);
  background: var(--ink-3);
  border: 1px solid transparent;
}
.tool-btn .icon { width: 18px; height: 18px; }
.tool-btn span { max-width: 100%; overflow: hidden; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.tool-btn.danger { color: #ff8d9d; }
.notice-panel, .vote-banner {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-left: 4px solid var(--cyan);
  border-radius: 0 8px 8px 0;
  background: #1d2526;
}
.join-requests { border-left-color: var(--yellow); }
.request-row { display: flex; align-items: center; gap: 8px; }
.vote-banner {
  position: fixed;
  z-index: 16;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(628px, calc(100% - 24px));
  transform: translateX(-50%);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-left-color: var(--coral);
  box-shadow: var(--shadow);
}

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.category-card {
  position: relative;
  min-width: 0;
  min-height: 88px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 13px;
  border-radius: 8px;
  color: var(--paper);
  text-align: left;
  background: var(--ink-2);
  border: 1px solid var(--line);
  transition: transform .14s ease, border-color .14s ease, background-color .14s ease;
}
.category-card:hover { transform: translateY(-1px); border-color: rgba(246, 242, 232, .35); }
.category-card span { min-width: 0; overflow-wrap: anywhere; font-weight: 900; }
.category-card small { color: var(--muted); font-size: .67rem; }
.category-card > .icon { position: absolute; top: 9px; right: 9px; }
.category-card.active { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.category-card.active small { color: rgba(17, 17, 15, .66); }
.results-stage { padding-block: 8px; }
.category-results { display: grid; gap: 8px; }
.result-category {
  min-height: 68px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.result-category > span { color: var(--coral); font-size: 1.1rem; font-weight: 950; }
.result-category > strong { overflow-wrap: anywhere; font-size: 1.05rem; }
.result-category > small { color: var(--muted); }

.identity-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.identity-strip p { font-size: .68rem; }
.score-chip { min-width: 55px; padding-left: 10px; border-left: 1px solid var(--line); }
.score-edit-row { display: flex; align-items: center; gap: 12px; }
.score-sheet { max-height: 85dvh; overflow-y: auto; }
.score-edit-row input { max-width: 160px; }
.accused-list { display: grid; gap: 12px; }
.score-chip strong { font-size: 1.35rem; }
.role-reminder { padding: 10px 12px; border-left: 4px solid var(--player-color, var(--cyan)); border-radius: 0 8px 8px 0; background: var(--ink-2); }
.role-reminder summary { cursor: pointer; color: var(--muted); font-size: .78rem; font-weight: 850; }
.role-reminder[open] { display: grid; gap: 4px; }
.role-reminder p { margin-top: 8px; font-size: .68rem; }
.role-reminder strong { max-width: 100%; overflow-wrap: anywhere; font-size: 1.35rem; }
.waiting-stage, .pause-stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: 30px 8px;
}
.waiting-stage.compact { padding: 24px 8px; }
.waiting-stage h1, .pause-stage h1 { font-size: 2.65rem; }
.waiting-stage > p:last-of-type, .pause-stage > p:last-of-type { max-width: 390px; }
.pulse-line { width: 170px; height: 4px; overflow: hidden; background: var(--ink-3); }
.pulse-line::after { content: ""; display: block; width: 42%; height: 100%; background: var(--yellow); animation: pulse-line 1.2s ease-in-out infinite alternate; }
@keyframes pulse-line { from { transform: translateX(-100%); } to { transform: translateX(240%); } }

.role-card {
  min-width: 0;
  color: var(--role-ink, #000000);
  background: var(--player-color, #17bebb);
  min-height: 340px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 15px;
  overflow: hidden;
  padding: 26px 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.role-card p { color: currentColor; }
.role-label { font-size: .72rem; font-weight: 950; letter-spacing: 0; }
.impostor-title { max-width: 100%; font-size: 2.2rem; line-height: 1.15; overflow-wrap: anywhere; letter-spacing: 0; }
.role-divider { width: 70px; height: 2px; background: currentColor; opacity: .32; }
.sealed-role { display: grid; justify-items: center; gap: 14px; }
.sealed-role > .icon { width: 56px; height: 56px; }
.sealed-role .btn { margin-top: 10px; }
.secret-word, .clue-word { max-width: 100%; overflow-wrap: anywhere; font-size: 2.65rem; line-height: .98; font-weight: 950; }
.no-clue { max-width: 270px; padding: 12px; border: 1px dashed currentColor; font-weight: 800; }
.progress-copy, .handoff { text-align: center; font-weight: 800; }

.turn-stage {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 12px;
  text-align: center;
}
.turn-stage.your-turn { border-block: 3px solid var(--yellow); background: rgba(255, 212, 71, .035); }
.turn-status { color: var(--yellow); font-size: .75rem; font-weight: 950; letter-spacing: .14em; }
.turn-stage h1 { max-width: 100%; overflow-wrap: anywhere; font-size: 2.75rem; }
.timer {
  --timer: 100%;
  width: 164px;
  height: 164px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  margin-top: 6px;
  border-radius: 50%;
  background: conic-gradient(var(--yellow) var(--timer), var(--ink-3) 0);
  box-shadow: inset 0 0 0 12px var(--ink), var(--shadow);
}
.timer span { color: var(--paper); font-size: 2.35rem; font-weight: 950; }
.timer small { color: var(--muted); font-size: .65rem; }
.turn-progress { font-weight: 850; }
.turn-actions { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.5fr); gap: 10px; }
.turn-actions.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.turn-actions.three .btn { min-width: 0; padding-inline: 8px; }
.discussion-head { display: flex; align-items: center; gap: 16px; padding: 13px 0; }
.compact-timer { width: 92px; height: 92px; flex: none; box-shadow: inset 0 0 0 8px var(--ink); }
.compact-timer span { font-size: 1.32rem; }
.suspect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.suspect {
  position: relative;
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 12px;
  border-radius: 8px;
  color: var(--paper);
  text-align: left;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.suspect strong { overflow-wrap: anywhere; }
.suspect > .icon { position: absolute; top: 8px; right: 8px; }
.suspect.selected { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.vote-confirmed { display: flex; justify-content: center; align-items: center; gap: 7px; color: var(--green); font-weight: 850; }
.waiting-vote { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; }
.waiting-vote .icon { width: 44px; height: 44px; color: var(--cyan); }

.victory-stage { display: grid; justify-items: center; gap: 16px; padding: 26px 18px; border-radius: 8px; text-align: center; box-shadow: var(--shadow); }
.victory-stage.players-win { color: #08291e; background: var(--green); }
.victory-stage.impostor-win { color: var(--paper); background: var(--coral-dark); }
.victory-stage p { color: currentColor; opacity: .72; }
.victory-stage h1 { font-size: 2.8rem; }
.accused { display: grid; grid-template-columns: auto 72px auto; align-items: center; gap: 10px; }
.accused span { font-size: .72rem; font-weight: 800; }
.reveal-facts { width: 100%; display: grid; gap: 1px; margin-top: 4px; }
.reveal-facts > div { min-height: 58px; display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid currentColor; }
.reveal-facts span { text-align: left; opacity: .68; }
.reveal-facts strong { overflow-wrap: anywhere; text-align: right; }
.confetti { position: fixed; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.confetti i {
  --x: calc((var(--i) * 41) % 100);
  position: absolute;
  top: -16px;
  left: calc(var(--x) * 1%);
  width: 8px;
  height: 18px;
  background: var(--yellow);
  animation: confetti-fall 2.3s calc((var(--i) % 8) * .08s) ease-in forwards;
}
.confetti i:nth-child(3n) { background: var(--coral); }
.confetti i:nth-child(3n + 1) { background: var(--cyan); }
@keyframes confetti-fall { to { transform: translate(calc((var(--i) - 12) * 4px), 105vh) rotate(720deg); opacity: .15; } }

.leader-row.winner { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.leader-row.winner p, .leader-row.winner .leader-score span { color: rgba(17, 17, 15, .63); }
.rank { width: 28px; flex: none; color: var(--coral); font-size: 1.25rem; font-weight: 950; text-align: center; }
.leader-row.winner .rank { color: var(--ink); }
.champion-band { display: grid; justify-items: center; gap: 8px; padding: 24px 12px; color: var(--ink); text-align: center; background: var(--yellow); border-radius: 8px; box-shadow: var(--shadow); }
.champion-band > .icon { width: 50px; height: 50px; }
.champion-band .eyebrow, .champion-band p { color: rgba(17, 17, 15, .68); }
.champion-band h1 { max-width: 100%; overflow-wrap: anywhere; font-size: 2.6rem; }
.share-block { display: grid; gap: 14px; padding-block: 18px; border-block: 1px solid var(--line); }
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.social {
  min-width: 0;
  min-height: 64px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 7px;
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-size: 1.05rem;
  font-weight: 950;
}
.social span { max-width: 100%; overflow: hidden; font-size: .62rem; text-overflow: ellipsis; }
.social.facebook { background: #1877f2; border-color: #1877f2; }
.social.messenger { background: #1769ff; border-color: #1769ff; }
.social.instagram { background: #c13584; border-color: #c13584; }
.social.tiktok { background: #080808; }
.social.native { color: var(--ink); background: var(--cyan); border-color: var(--cyan); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-grid > div { min-width: 0; display: grid; gap: 3px; padding: 13px 8px; border-radius: 8px; text-align: center; background: var(--ink-2); border: 1px solid var(--line); }
.stat-grid strong { overflow-wrap: anywhere; font-size: 1.45rem; }
.stat-grid span { color: var(--muted); font-size: .66rem; }
.stat-list { display: grid; gap: 1px; }
.stat-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(246, 242, 232, .08); }
.stat-list .warning { color: var(--bad); }
.pause-stage > .icon { width: 76px; height: 76px; color: var(--yellow); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; align-items: end; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.bottom-sheet { width: min(100%, 660px); display: grid; gap: 13px; margin: 0 auto; padding: 10px 16px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--ink-2); box-shadow: 0 -20px 50px rgba(0, 0, 0, .45); animation: sheet-in .2s ease both; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 5px; border-radius: 999px; background: #5c5a54; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.toast { position: fixed; z-index: 50; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); width: min(560px, calc(100% - 28px)); padding: 12px 14px; border-radius: 8px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); transform: translate(-50%, 150%); transition: transform .2s ease; font-weight: 750; }
.toast.show { transform: translate(-50%, 0); }
.drag-handle { display: grid; place-items: center; color: var(--muted); touch-action: none; cursor: grab; }
.drag-handle .icon { width: 18px; }
.empty-state { display: grid; justify-items: center; gap: 14px; text-align: center; }

.player-surface.player-row, .player-surface.leader-row,
.player-surface.profile-preview, .player-surface.identity-strip,
.player-surface.suspect {
  color: var(--role-ink, #000000);
  background: var(--player-color, var(--blue));
  border-color: var(--player-color, var(--blue));
}
.player-surface p, .player-surface .rank, .player-surface .drag-handle,
.player-surface .score-mini span, .player-surface .leader-score span,
.player-surface .score-chip span { color: inherit; }
.player-surface .score-chip { border-color: currentColor; }
.player-surface .status-dot { outline: 1px solid currentColor; }
.suspect.player-surface.selected { border-color: currentColor; box-shadow: inset 0 0 0 2px currentColor; }

@media (min-width: 720px) {
  .app-shell { width: min(100%, 1040px); }
  .screen { padding-inline: 28px; }
  .home-screen { padding: 0; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .settings-grid > .setting-pair { grid-column: span 2; }
  .suspect-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .social-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .role-card { min-height: 410px; }
}

@media (min-width: 960px) {
  .home-stage { min-height: 620px; padding: 48px; align-content: center; justify-items: start; }
  .home-stage::before { background-position: right 36px center; background-size: 400px auto; }
  .home-copy, .home-actions { width: 420px; }
  .home-copy h1 { font-size: 3.4rem; }
}

@media (max-width: 380px) {
  h1 { font-size: 2.65rem; }
  .home-copy h1 { font-size: 2.5rem; }
  .home-actions .btn.large { font-size: .92rem; }
  .impostor-title { font-size: 1.85rem; }
  .code { font-size: 2rem; }
  .host-dock { grid-template-columns: 42px repeat(3, 1fr); }
  .tool-btn span { font-size: .56rem; }
  .setting-pair { grid-template-columns: 1fr; }
  .accused { grid-template-columns: 1fr; justify-items: center; }
  .vote-banner { grid-template-columns: 1fr; }
  .connection b { display: none; }
}

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

.host-dock { grid-template-columns: 38px repeat(4, minmax(0, 1fr)); }
.tool-btn { min-width: 0; padding-inline: 3px; }
@media (display-mode: standalone) {
  html, body { background-color: #11110f; overscroll-behavior-y: none; }
  body::after { content: ""; position: fixed; inset: auto 0 0; height: env(safe-area-inset-bottom, 0px); background: #11110f; pointer-events: none; z-index: 25; }
}

