@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&display=swap");

:root {
  --bg: #06070d;
  --bg-2: #121428;
  --panel: rgba(16, 18, 34, 0.92);
  --panel-soft: rgba(16, 18, 34, 0.76);
  --line: rgba(255, 96, 134, 0.34);
  --line-soft: rgba(124, 181, 255, 0.22);
  --text: #f4f6ff;
  --muted: #a6adc8;
  --blue: #7fcbff;
  --mint: #9cf6d4;
  --danger: #ff6b93;
  --warning: #ffc879;
  --good: #83ecba;
  --shadow: 0 34px 78px rgba(0, 0, 0, 0.52);
  --radius: 18px;
  --accent: #7fcbff;
  --font-body: "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-display: "Sora", "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 560px at -8% -18%, rgba(255, 79, 133, 0.34), transparent 52%),
    radial-gradient(900px 520px at 112% -12%, rgba(119, 177, 255, 0.29), transparent 50%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 56%, #080913 100%);
  color: var(--text);
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 140, 170, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(137, 177, 255, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.76), transparent 86%);
}

body::after {
  background:
    radial-gradient(circle at 50% 120%, rgba(0, 0, 0, 0.6), transparent 52%),
    radial-gradient(circle at 50% -12%, rgba(255, 100, 150, 0.13), transparent 35%);
}

body[data-role-theme="crew"] {
  --accent: #8df7c7;
}

body[data-role-theme="impostor"] {
  --accent: #ff7e9a;
}

body[data-role-theme="neutral"] {
  --accent: #ffc971;
}

body[data-role-theme="host"] {
  --accent: #bca3ff;
}

.app-shell {
  width: min(1660px, 100%);
  margin: 0 auto;
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  position: sticky;
  top: 0.4rem;
  z-index: 50;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(125deg, rgba(255, 92, 140, 0.08), rgba(116, 169, 255, 0.08)),
    rgba(9, 11, 23, 0.9);
  backdrop-filter: blur(12px);
  padding: 0.7rem 0.8rem;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: linear-gradient(130deg, rgba(255, 99, 150, 0.16), rgba(132, 186, 255, 0.16));
  border-radius: 12px;
  padding: 0.58rem 0.86rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 22px rgba(0, 0, 0, 0.42);
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.hero-copy p {
  margin: 0.28rem 0 0;
  color: var(--muted);
}

.app-main {
  display: grid;
  gap: 1.1rem;
}

.hero-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

body.session-mode .hero-panels {
  display: none !important;
}

body.session-mode .header-links {
  display: none;
}

.hero-card,
.surface,
.panel {
  border: 1px solid color-mix(in srgb, var(--line-soft) 90%, rgba(255, 255, 255, 0.05));
  background:
    linear-gradient(148deg, rgba(255, 92, 140, 0.06), rgba(138, 184, 255, 0.06) 42%, transparent 75%),
    var(--panel);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 1.08rem 1.08rem 1.22rem;
}

.hero-card h2 {
  margin: 0;
}

.hero-card p {
  margin: 0.55rem 0 0.8rem;
  color: var(--muted);
}

.surface {
  padding: 1rem;
}

.surface-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.surface-head h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.host-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.panel {
  padding: 0.95rem;
  border-top: 2px solid color-mix(in srgb, var(--accent) 70%, rgba(255, 92, 140, 0.2));
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel h3,
.panel h4 {
  margin-top: 0;
  font-family: var(--font-display);
  letter-spacing: 0.015em;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 0.75rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #dce6ff;
  font-size: 0.92rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid color-mix(in srgb, var(--line-soft) 78%, transparent);
  background: rgba(7, 11, 22, 0.86);
  color: var(--text);
  border-radius: 10px;
  padding: 0.58rem 0.68rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 62%, rgba(255, 92, 140, 0.35));
  border-color: color-mix(in srgb, var(--accent) 72%, rgba(255, 92, 140, 0.4));
}

.check-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-grid label {
  flex-direction: row;
  align-items: center;
  gap: 0.42rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-links {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.row.wrap {
  flex-wrap: wrap;
}

.row.between {
  justify-content: space-between;
}

.row.align-end {
  align-items: flex-end;
}

.btn {
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.52rem 0.82rem;
  color: var(--text);
  transition: transform 0.18s ease, filter 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.26);
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(120deg, #ff7ca8, #8ac4ff);
  color: #12071c;
  border-color: rgba(255, 140, 180, 0.68);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background: linear-gradient(120deg, #82d5ff, #7ee9d4);
  color: #02243d;
  border-color: rgba(126, 215, 255, 0.62);
  font-weight: 700;
}

.btn-danger {
  background: linear-gradient(120deg, #ff5f8f, #ff7a5e);
  color: #2f0714;
  border-color: rgba(255, 95, 143, 0.76);
  font-weight: 700;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: color-mix(in srgb, var(--line-soft) 88%, transparent);
}

.notice {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 0.78rem 0.86rem;
}

.notice.success {
  border-color: rgba(125, 233, 166, 0.5);
  background: rgba(30, 94, 65, 0.35);
  color: #d7ffe7;
}

.notice.danger {
  border-color: rgba(255, 126, 154, 0.52);
  background: rgba(89, 24, 40, 0.42);
  color: #ffe2ea;
}

.station-list {
  display: grid;
  gap: 0.55rem;
}

.station-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.55rem;
  align-items: end;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.58rem;
  background: rgba(255, 255, 255, 0.03);
}

.hidden {
  display: none !important;
}

.pill {
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line-soft) 88%, transparent);
  padding: 0.25rem 0.64rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  font-size: 0.84rem;
}

.mobile-pane-tabs {
  display: none;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.mobile-pane-tab {
  flex: 1;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line-soft) 88%, transparent);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.46rem 0.72rem;
  cursor: pointer;
}

.mobile-pane-tab.active {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.06));
}

#oneThumbToggleBtn.active {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.06));
}

.game-layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 340px minmax(620px, 1fr) 420px;
  gap: 0.9rem;
}

.side {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.main {
  display: grid;
  gap: 0.85rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.metric-card {
  border: 1px solid color-mix(in srgb, var(--line-soft) 88%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(255, 92, 140, 0.07), rgba(137, 181, 255, 0.07)),
    rgba(255, 255, 255, 0.04);
  padding: 0.62rem 0.7rem;
  display: grid;
  gap: 0.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.metric-card strong {
  font-size: 1.3rem;
  line-height: 1;
}

.stack {
  display: grid;
  gap: 0.52rem;
}

.block {
  border: 1px solid color-mix(in srgb, var(--line-soft) 88%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  padding: 0.7rem;
}

.block h3,
.block h4 {
  margin: 0 0 0.35rem;
}

.role-instructions-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.58rem 0.62rem;
  display: grid;
  gap: 0.4rem;
}

.role-instructions-list {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.28rem;
  color: #d9e8ff;
  font-size: 0.86rem;
}

.action-grid .btn {
  width: 100%;
  justify-content: center;
}

.side-left,
.side-right {
  align-content: start;
}

.side-left {
  position: sticky;
  top: 5.6rem;
}

.side-right {
  position: sticky;
  top: 5.6rem;
}

.scroll {
  max-height: 390px;
  overflow: auto;
  padding-right: 0.3rem;
}

.tasks {
  min-height: 190px;
  max-height: 500px;
}

.task-scanner-quick-action {
  margin: 0.4rem 0 0.68rem;
}

.task-card,
.player-card,
.event-card,
.vote-card {
  border: 1px solid color-mix(in srgb, var(--line-soft) 88%, transparent);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  padding: 0.62rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.task-card:hover,
.player-card:hover,
.vote-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 72%, rgba(255, 255, 255, 0.15));
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.34);
}

.task-card.done {
  border-color: rgba(125, 233, 166, 0.4);
  background: rgba(45, 120, 82, 0.3);
}

.task-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  margin-top: 0.42rem;
}

.task-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff83ae, #89c6ff, #88f0d0);
  transition: width 0.3s ease;
}

.head-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

#statusBadge,
#winnerBadge,
#meetingTimer,
#meetingOverlayTimer {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sub {
  color: var(--muted);
  margin-top: 0.25rem;
  font-size: 0.88rem;
}

.challenge {
  border: 1px solid color-mix(in srgb, var(--line) 72%, rgba(255, 255, 255, 0.1));
  background: rgba(28, 19, 44, 0.44);
  border-radius: 12px;
  padding: 0.7rem;
}

.task-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.task-choice-btn.selected {
  border-color: rgba(141, 247, 199, 0.7);
  background: rgba(141, 247, 199, 0.22);
}

.task-multi-btn.selected {
  border-color: rgba(141, 247, 199, 0.7);
  background: rgba(141, 247, 199, 0.22);
}

.memory-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.memory-pad {
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  color: #0d1220;
  font-weight: 700;
  padding: 0.6rem 0.45rem;
  text-transform: capitalize;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.16);
}

.memory-pad.pad-red { background: linear-gradient(140deg, #ff9aa5, #ff5f72); }
.memory-pad.pad-blue { background: linear-gradient(140deg, #9cd6ff, #62a9ff); }
.memory-pad.pad-green { background: linear-gradient(140deg, #a9f5cf, #6ddfa8); }
.memory-pad.pad-yellow { background: linear-gradient(140deg, #ffe8a3, #ffd368); }
.memory-pad.pad-purple { background: linear-gradient(140deg, #d9c2ff, #b18cff); }
.memory-pad.pad-orange { background: linear-gradient(140deg, #ffd2a3, #ffaf66); }

.memory-pad.selected {
  outline: 2px solid rgba(124, 249, 208, 0.9);
  outline-offset: 1px;
}

.memory-pad.flash {
  animation: memoryPadFlash 0.38s ease;
}

.trace-board {
  position: relative;
  height: 230px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 118, 166, 0.12), transparent 42%),
    radial-gradient(circle at 72% 80%, rgba(126, 190, 255, 0.14), transparent 40%),
    rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.trace-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line-soft) 88%, transparent);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

.trace-node.selected {
  border-color: rgba(124, 249, 208, 0.9);
  background: rgba(124, 249, 208, 0.18);
}

.trace-node[data-step]::after {
  content: attr(data-step);
  position: absolute;
  right: -6px;
  top: -6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(11, 17, 34, 0.95);
  color: #dff4ff;
  font-size: 0.68rem;
  line-height: 18px;
  text-align: center;
}

.trace-node.flash {
  animation: traceNodeFlash 0.35s ease;
}

.rotate-lock-wrap {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.65rem 0.66rem;
  display: grid;
  gap: 0.48rem;
}

.rotate-lock-dial {
  position: relative;
  width: min(220px, 70vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--line-soft) 86%, transparent);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.07) 0 30%, transparent 30%),
    conic-gradient(from 0deg, rgba(255, 123, 171, 0.2), rgba(129, 195, 255, 0.22), rgba(255, 123, 171, 0.2));
}

.rotate-lock-needle,
.rotate-lock-target {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 100%;
}

.rotate-lock-needle {
  width: 4px;
  height: 42%;
  border-radius: 99px;
  background: linear-gradient(180deg, #8de7ff, #4fb7ff);
  box-shadow: 0 0 12px rgba(79, 183, 255, 0.7);
}

.rotate-lock-target {
  width: 4px;
  height: 46%;
  border-radius: 99px;
  background: linear-gradient(180deg, #ffd56f, #ff9f3f);
  box-shadow: 0 0 12px rgba(255, 176, 90, 0.6);
  opacity: 0.95;
}

.rotate-lock-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(8, 12, 24, 0.95);
}

.task-sequence-display {
  border: 1px dashed var(--line-soft);
  border-radius: 10px;
  padding: 0.42rem 0.5rem;
  margin-bottom: 0.45rem;
  color: #d7e8ff;
}

.meeting-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.meeting-panel {
  display: grid;
  gap: 0.6rem;
}

.meeting-body {
  color: var(--muted);
}

.meeting-breakdown,
.meeting-voters {
  display: grid;
  gap: 0.55rem;
}

.meeting-vote-state {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.52rem 0.56rem;
  background: rgba(255, 255, 255, 0.04);
}

.meeting-vote-state .pill {
  font-size: 0.72rem;
}

.recap-panel {
  display: grid;
  gap: 0.62rem;
}

.recap-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.recap-stat {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.5rem 0.56rem;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 0.24rem;
}

.recap-stat span {
  font-size: 0.78rem;
  color: var(--muted);
}

.recap-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recap-share-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.58rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.5rem;
}

.recap-share-preview {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.58rem 0.62rem;
  background:
    linear-gradient(135deg, rgba(255, 103, 157, 0.12), rgba(124, 187, 255, 0.12)),
    rgba(10, 15, 28, 0.88);
  display: grid;
  gap: 0.42rem;
}

.recap-share-preview h4 {
  margin: 0;
  font-size: 1.06rem;
}

.recap-share-line {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.recap-share-line span:last-child {
  font-weight: 700;
}

.recap-timeline-controls {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.56rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.45rem;
}

.recap-players {
  display: grid;
  gap: 0.45rem;
  max-height: 260px;
  overflow: auto;
  padding-right: 0.25rem;
}

.recap-player-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.52rem 0.56rem;
  background: rgba(255, 255, 255, 0.03);
}

.player-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  display: inline-block;
  vertical-align: middle;
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  padding: 0.7rem 0.88rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 62%, rgba(137, 184, 255, 0.55));
  background: rgba(20, 20, 38, 0.98);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
  max-width: 450px;
}

.toast.error {
  border-color: rgba(255, 126, 154, 0.48);
  background: rgba(86, 24, 40, 0.95);
}

.live-pop-layer {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10001;
  display: grid;
  gap: 0.5rem;
  width: min(420px, calc(100vw - 1.2rem));
  pointer-events: none;
}

.live-pop {
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(130deg, rgba(255, 97, 146, 0.14), rgba(126, 180, 255, 0.14)),
    rgba(10, 14, 28, 0.97);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.36);
  padding: 0.6rem 0.66rem;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  animation: livePopIn 0.22s ease forwards;
}

.live-pop.tone-good {
  border-color: rgba(125, 233, 166, 0.55);
}

.live-pop.tone-warning {
  border-color: rgba(255, 201, 113, 0.58);
}

.live-pop.tone-danger {
  border-color: rgba(255, 126, 154, 0.6);
}

.live-pop.out {
  animation: livePopOut 0.36s ease forwards;
}

.meeting-overlay {
  position: fixed;
  inset: 0;
  z-index: 10920;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 96, 146, 0.2), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(133, 185, 255, 0.18), transparent 40%),
    rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.meeting-overlay-card {
  width: min(760px, 96vw);
  max-height: min(88dvh, 860px);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 74%, rgba(255, 108, 158, 0.42));
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 84, 138, 0.12), rgba(133, 185, 255, 0.12)),
    rgba(10, 13, 27, 0.97);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  padding: 1.05rem 1.1rem;
  display: grid;
  gap: 0.62rem;
  pointer-events: auto;
}

.meeting-overlay-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meeting-overlay-vote-tablet {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.62rem;
  display: grid;
  gap: 0.48rem;
}

#meetingOverlayVoteStatus {
  margin: 0;
}

.meeting-overlay-result {
  border: 1px solid color-mix(in srgb, var(--accent) 72%, rgba(255, 255, 255, 0.16));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.66rem 0.72rem;
  display: grid;
  gap: 0.24rem;
}

.meeting-result-inline {
  margin-top: 0.48rem;
  border: 1px solid color-mix(in srgb, var(--accent) 62%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 0.58rem;
  display: grid;
  gap: 0.2rem;
}

.meeting-result-inline span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d8e7ff;
}

.meeting-overlay-vote-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.meeting-overlay-vote-choice {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.62rem;
  display: grid;
  gap: 0.18rem;
  justify-items: start;
  text-align: left;
  cursor: pointer;
}

.meeting-overlay-vote-choice:hover {
  border-color: color-mix(in srgb, var(--accent) 64%, transparent);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.meeting-overlay-vote-choice .pill {
  font-size: 0.75rem;
}

.meeting-overlay-vote-choice .player-avatar {
  width: 24px;
  height: 24px;
}

.task-overlay {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 10940;
  width: min(900px, calc(100vw - 1rem));
  pointer-events: none;
}

.task-overlay-card {
  border: 1px solid color-mix(in srgb, var(--accent) 70%, rgba(120, 190, 255, 0.35));
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(130, 187, 255, 0.16), rgba(255, 136, 175, 0.1)),
    rgba(10, 14, 28, 0.97);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  padding: 0.85rem 0.95rem;
  display: grid;
  gap: 0.52rem;
  pointer-events: auto;
}

.task-overlay-card h3 {
  margin: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-overlay-card #taskChallengeBox {
  border-color: color-mix(in srgb, var(--line) 76%, rgba(255, 255, 255, 0.08));
  background: rgba(16, 23, 39, 0.6);
}

.start-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 11160;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 92, 140, 0.24), transparent 35%),
    radial-gradient(circle at 50% 100%, rgba(126, 180, 255, 0.2), transparent 38%),
    rgba(5, 7, 15, 0.94);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.start-intro-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.start-intro-card {
  width: min(980px, 94vw);
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 96, 146, 0.13), rgba(137, 183, 255, 0.13)),
    rgba(7, 11, 22, 0.95);
  box-shadow: 0 42px 92px rgba(0, 0, 0, 0.62);
  padding: 1.4rem 1.2rem;
  text-align: center;
}

.start-intro-title {
  margin: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: clamp(2rem, 9vw, 5rem);
  color: #fff2f8;
  text-shadow: 0 0 18px rgba(255, 120, 166, 0.46), 0 0 34px rgba(130, 185, 255, 0.32);
}

.start-intro-subtitle {
  margin: 0.42rem 0 0;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d9e7ff;
  opacity: 0.9;
}

.start-intro-countdown {
  margin-top: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 14vw, 6.4rem);
  line-height: 1;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(255, 120, 166, 0.54), 0 0 36px rgba(130, 185, 255, 0.42);
}

.start-intro-overlay.pulse .start-intro-title {
  animation: introTitlePulse 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.start-intro-countdown.pop {
  animation: introCountPop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.role-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 11130;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 99, 152, 0.18), transparent 42%),
    radial-gradient(circle at 84% 88%, rgba(115, 187, 255, 0.18), transparent 44%),
    rgba(4, 8, 16, 0.88);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.role-reveal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.role-reveal-card {
  width: min(900px, 95vw);
  border: 1px solid color-mix(in srgb, var(--line-soft) 85%, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  background:
    linear-gradient(140deg, rgba(255, 98, 148, 0.14), rgba(128, 188, 255, 0.14)),
    rgba(8, 12, 26, 0.96);
  box-shadow: 0 34px 92px rgba(0, 0, 0, 0.56);
  padding: 1rem 1.05rem;
  display: grid;
  gap: 0.62rem;
  animation: roleRevealIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.role-reveal-card h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-reveal-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.role-reveal-head-row h3 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: 0.03em;
}

.role-reveal-players {
  border: 1px solid color-mix(in srgb, var(--line-soft) 74%, rgba(255, 255, 255, 0.1));
  background: rgba(12, 20, 37, 0.58);
  border-radius: 14px;
  padding: 0.55rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 0.45rem;
  max-height: min(42vh, 380px);
  overflow: auto;
}

.role-reveal-player-card {
  border: 1px solid color-mix(in srgb, var(--line-soft) 76%, rgba(255, 255, 255, 0.06));
  background: rgba(12, 22, 40, 0.82);
  border-radius: 12px;
  padding: 0.45rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.role-reveal-player-card.is-you {
  border-color: color-mix(in srgb, var(--accent) 74%, rgba(255, 255, 255, 0.2));
  box-shadow: 0 10px 24px rgba(104, 178, 255, 0.18);
}

.role-reveal-player-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line-soft) 74%, rgba(255, 255, 255, 0.18));
  background: rgba(16, 29, 52, 0.78);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  overflow: hidden;
  flex-shrink: 0;
}

.role-reveal-player-avatar .player-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.role-reveal-player-avatar-empty {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px dashed color-mix(in srgb, #9fb3d6 68%, transparent);
  opacity: 0.72;
}

.role-reveal-player-info {
  min-width: 0;
  display: grid;
  gap: 0.14rem;
}

.role-reveal-player-info strong {
  font-size: 0.93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-briefing-overlay {
  position: fixed;
  inset: 0;
  z-index: 11110;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 102, 156, 0.16), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(119, 188, 255, 0.18), transparent 42%),
    rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.role-briefing-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.role-briefing-card {
  width: min(760px, 94vw);
  border: 1px solid color-mix(in srgb, var(--line-soft) 84%, rgba(255, 255, 255, 0.12));
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(255, 96, 146, 0.12), rgba(136, 188, 255, 0.12)),
    rgba(8, 13, 27, 0.96);
  box-shadow: 0 36px 86px rgba(0, 0, 0, 0.48);
  padding: 1rem 1.05rem;
  display: grid;
  gap: 0.56rem;
  animation: roleBriefIn 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.role-briefing-card h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-briefing-tips {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.34rem;
  color: #dbe9ff;
}

.cinematic-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(4, 10, 18, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.cinematic-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cinematic-card {
  width: min(760px, 94vw);
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(255, 96, 146, 0.12), rgba(136, 188, 255, 0.12)),
    rgba(8, 13, 27, 0.96);
  box-shadow: 0 36px 86px rgba(0, 0, 0, 0.48);
  padding: 1.2rem 1.3rem;
  text-align: center;
}

.cinematic-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.7rem);
  letter-spacing: 0.03em;
}

.cinematic-card p {
  margin: 0.5rem 0 0;
  color: #d1e1f6;
  font-size: 1rem;
}

.winner-card {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  animation: winnerCardIn 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

#winnerCinematic.burst .winner-card {
  animation: winnerCardIn 0.52s cubic-bezier(0.22, 1, 0.36, 1), winnerCardPulse 1.12s ease-in-out;
}

.winner-cinematic-stats {
  margin-top: 0.68rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.winner-stat {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.48rem 0.55rem;
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

.winner-stat span {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.winner-stat strong {
  font-size: 1rem;
  color: var(--text);
}

#winnerCinematic.tone-crew .winner-card {
  --accent: #8df7c7;
}

#winnerCinematic.tone-impostor .winner-card {
  --accent: #ff7e9a;
}

#winnerCinematic.tone-neutral .winner-card {
  --accent: #ffc971;
}

#winnerCinematic.tone-manual .winner-card {
  --accent: #bca3ff;
}

#killCinematic {
  background: rgba(25, 4, 10, 0.78);
}

.kill-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 126, 154, 0.78);
  background:
    radial-gradient(circle at 18% -30%, rgba(255, 131, 95, 0.22), transparent 42%),
    radial-gradient(circle at 100% 130%, rgba(255, 87, 146, 0.18), transparent 48%),
    rgba(26, 8, 16, 0.97);
  animation: killCardIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.kill-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 92, 138, 0.16), transparent 62%);
  animation: killPulse 1.24s ease-in-out infinite;
}

.kill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 126, 154, 0.65);
  background: rgba(255, 116, 158, 0.14);
  color: #ffd7e4;
  padding: 0.25rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kill-killer {
  margin: 0.45rem 0 0;
  color: #ffd8e8;
  font-weight: 700;
}

.kill-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 11120;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.78), rgba(255, 96, 150, 0.22) 52%, transparent 80%);
  opacity: 0;
}

.kill-flash-overlay.show {
  animation: killFlashPulse 0.62s ease-out forwards;
}

.palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 10800;
  background: rgba(3, 8, 14, 0.66);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 9vh;
}

.palette-card {
  width: min(760px, 94vw);
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 96, 146, 0.1), rgba(137, 183, 255, 0.1)),
    rgba(8, 14, 26, 0.97);
  box-shadow: 0 32px 78px rgba(0, 0, 0, 0.45);
  padding: 0.9rem;
  display: grid;
  gap: 0.6rem;
}

.palette-list {
  display: grid;
  gap: 0.45rem;
  max-height: 48vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.palette-item {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  padding: 0.55rem 0.62rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.palette-item:hover {
  border-color: color-mix(in srgb, var(--accent) 66%, transparent);
  transform: translateY(-1px);
}

@keyframes livePopIn {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes livePopOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(-10px) scale(0.96);
    opacity: 0;
  }
}

@keyframes killCardIn {
  0% {
    opacity: 0;
    transform: scale(0.93) translateY(18px);
    filter: saturate(1.3);
  }
  55% {
    opacity: 1;
    transform: scale(1.015) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes killPulse {
  0%,
  100% {
    transform: scale(0.86);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.88;
  }
}

@keyframes killFlashPulse {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  22% {
    opacity: 1;
    transform: scale(1.015);
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
  }
}

@keyframes introTitlePulse {
  0% {
    opacity: 0.2;
    transform: scale(0.9);
    filter: blur(2px);
  }
  55% {
    opacity: 1;
    transform: scale(1.04);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes introCountPop {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  60% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes roleRevealIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes roleBriefIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes memoryPadFlash {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  35% {
    transform: translateY(-1px) scale(1.05);
    filter: brightness(1.32);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes traceNodeFlash {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
  }
  35% {
    transform: translate(-50%, -50%) scale(1.14);
    box-shadow: 0 0 0 6px rgba(124, 249, 208, 0.18), 0 14px 28px rgba(0, 0, 0, 0.34);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
  }
}

@keyframes headerAura {
  0%,
  100% {
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  }
  50% {
    box-shadow:
      0 20px 46px rgba(0, 0, 0, 0.48),
      0 0 22px rgba(255, 112, 158, 0.22),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
}

@keyframes winnerCardIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes winnerCardPulse {
  0%,
  100% {
    box-shadow: 0 36px 86px rgba(0, 0, 0, 0.48);
  }
  50% {
    box-shadow: 0 42px 92px color-mix(in srgb, var(--accent) 30%, rgba(0, 0, 0, 0.42));
  }
}

.app-header {
  animation: headerAura 7s ease-in-out infinite;
}

.scanner-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 14, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9000;
}

.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 14, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9050;
}

.vote-tablet-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 14, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9070;
}

body.mobile-immersive {
  padding: 0;
}

body.mobile-immersive .app-header {
  display: none;
}

body.fullscreen-session .app-header {
  display: none;
}

body.mobile-immersive .app-shell {
  width: 100%;
  margin: 0;
}

body.mobile-immersive .surface {
  border-radius: 0;
  min-height: 100dvh;
}

body.focus-mobile {
  padding: 0;
  overflow: hidden;
}

body.focus-mobile .app-shell {
  width: 100%;
  margin: 0;
  height: 100dvh;
}

body.focus-mobile .app-main {
  height: 100dvh;
}

body.focus-mobile .surface {
  border-radius: 0;
  min-height: 100dvh;
  padding: 0.5rem;
}

body.focus-mobile #gameSection.surface {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

body.focus-mobile #gameSection .surface-head {
  margin-bottom: 0.25rem;
}

body.focus-mobile .mobile-pane-tabs {
  display: flex;
  position: static;
  top: auto;
  margin-bottom: 0.3rem;
}

body.focus-mobile .game-layout {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

body.focus-mobile [data-mobile-pane] {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.focus-mobile .panel {
  padding: 0.58rem;
}

body.focus-mobile .block {
  padding: 0.52rem;
}

body.focus-mobile .metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

body.focus-mobile .metric-card {
  padding: 0.42rem 0.48rem;
}

body.focus-mobile .metric-card strong {
  font-size: 1rem;
}

body.focus-mobile .scroll {
  max-height: none;
  overflow: auto;
  padding-right: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

body.focus-mobile .tasks {
  min-height: 0;
}

body.focus-mobile [data-mobile-pane="social"] #playerList.players {
  max-height: calc(100dvh - 230px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  align-content: start;
}

body.focus-mobile [data-mobile-pane="social"] #playerList.players .player-card {
  padding: 0.5rem;
}

body.focus-mobile .side-right .block:nth-child(2) {
  display: none;
}

body.focus-mobile .meeting-overlay {
  padding: 0.55rem;
}

body.focus-mobile .task-overlay {
  width: calc(100vw - 0.4rem);
  left: 0.2rem;
  transform: none;
  bottom: 0.2rem;
}

.scanner-card {
  width: min(740px, 92vw);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.qr-card {
  width: min(520px, 92vw);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  display: grid;
  gap: 0.68rem;
}

.vote-tablet-card {
  width: min(900px, 94vw);
  max-height: 90dvh;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  display: grid;
  gap: 0.62rem;
}

.vote-tablet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  overflow: auto;
  max-height: calc(90dvh - 160px);
  padding-right: 0.2rem;
}

.vote-tablet-choice {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.62rem;
  display: grid;
  gap: 0.2rem;
  justify-items: start;
  text-align: left;
  cursor: pointer;
}

.vote-tablet-choice:hover {
  border-color: color-mix(in srgb, var(--accent) 64%, transparent);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
}

.vote-tablet-choice .pill {
  font-size: 0.75rem;
}

.vote-tablet-choice .player-avatar {
  width: 28px;
  height: 28px;
}

.qr-preview-wrap {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
}

#joinQrCanvas {
  width: min(320px, 78vw);
  height: min(320px, 78vw);
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(10, 20, 30, 0.2);
}

#joinQrLinkInput {
  flex: 1;
  min-width: 220px;
}

#scannerVideo {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: #000;
  max-height: 65vh;
  object-fit: cover;
}

@media (max-width: 1380px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .recap-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-left,
  .side-right {
    position: static;
    top: auto;
  }

  .host-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    padding: 0.65rem;
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .hero-panels,
  .grid.two,
  .grid.three,
  .station-row,
  .metric-strip,
  .recap-summary,
  .task-choice-grid {
    grid-template-columns: 1fr;
  }

  .mobile-pane-tabs {
    display: flex;
    position: sticky;
    top: 0.5rem;
    z-index: 70;
    backdrop-filter: blur(8px);
  }

  body.one-thumb-mode #gameSection.surface {
    padding-bottom: calc(5.4rem + env(safe-area-inset-bottom));
  }

  body.one-thumb-mode .mobile-pane-tabs {
    position: fixed;
    left: 0.4rem;
    right: 0.4rem;
    top: auto;
    bottom: calc(0.35rem + env(safe-area-inset-bottom));
    z-index: 220;
    margin: 0;
    padding: 0.3rem;
    border: 1px solid color-mix(in srgb, var(--line-soft) 88%, transparent);
    border-radius: 999px;
    background: rgba(7, 11, 22, 0.94);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(10px);
  }

  body.one-thumb-mode .mobile-pane-tab {
    min-height: 44px;
    font-size: 0.92rem;
  }

  body.one-thumb-mode [data-mobile-pane="status"] {
    overflow: auto;
    padding-bottom: calc(5.8rem + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  body.one-thumb-mode .controls-block {
    margin-top: auto;
    position: sticky;
    bottom: calc(5.2rem + env(safe-area-inset-bottom));
    z-index: 60;
    background: rgba(8, 13, 27, 0.96);
    border-color: color-mix(in srgb, var(--line-soft) 86%, transparent);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  }

  body.one-thumb-mode .controls-block .action-grid {
    gap: 0.45rem;
  }

  body.one-thumb-mode .controls-block .btn {
    min-height: 50px;
    font-size: 0.95rem;
    font-weight: 700;
  }

  .btn {
    padding: 0.62rem 0.86rem;
  }

  body[data-mobile-pane="status"] [data-mobile-pane="game"],
  body[data-mobile-pane="status"] [data-mobile-pane="social"],
  body[data-mobile-pane="game"] [data-mobile-pane="status"],
  body[data-mobile-pane="game"] [data-mobile-pane="social"],
  body[data-mobile-pane="social"] [data-mobile-pane="status"],
  body[data-mobile-pane="social"] [data-mobile-pane="game"] {
    display: none !important;
  }

  .game-layout {
    gap: 0.55rem;
  }

  .surface {
    padding: 0.72rem;
  }

  .scroll {
    max-height: unset;
  }

  .palette-overlay {
    padding-top: 3vh;
  }

  .live-pop-layer {
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
  }

  .role-briefing-card {
    width: min(100vw, 100%);
    border-radius: 14px;
    padding: 0.82rem;
  }

  .role-reveal-card {
    width: min(100vw, 100%);
    border-radius: 14px;
    padding: 0.82rem;
  }

  .role-reveal-players {
    grid-template-columns: 1fr;
    max-height: min(38vh, 300px);
  }

  .role-reveal-head-row h3 {
    font-size: 0.9rem;
  }

  .meeting-overlay {
    padding: 0.55rem;
  }

  .task-overlay {
    width: calc(100vw - 0.6rem);
    left: 0.3rem;
    transform: none;
    bottom: 0.3rem;
  }

  .meeting-overlay-vote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .winner-cinematic-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vote-tablet-card {
    width: min(100vw, 100%);
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 0.65rem;
  }

  .vote-tablet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: calc(100dvh - 146px);
  }
}

@media (max-width: 520px) {
  body.focus-mobile [data-mobile-pane="social"] #playerList.players {
    grid-template-columns: 1fr;
  }

  .meeting-overlay-vote-grid {
    grid-template-columns: 1fr;
  }

  .winner-cinematic-stats {
    grid-template-columns: 1fr;
  }

  .vote-tablet-grid {
    grid-template-columns: 1fr;
  }
}
