:root {
  color-scheme: dark;
  --bg: #090912;
  --card: rgba(25, 20, 39, 0.88);
  --line: rgba(255, 244, 204, 0.16);
  --cream: #fff4cc;
  --text: #fff7e8;
  --muted: rgba(255, 247, 232, 0.62);
  --green: #9fffcb;
  --red: #ff6173;
  --yellow: #ffe66b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

/* Shared dowenow.com project switcher. */
.portal-bar { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 8px; color: #fff7e8; background: rgba(15, 13, 25, .92); backdrop-filter: blur(16px); border: 1px solid rgba(255, 244, 204, .18); border-radius: 999px; padding: 6px 8px; box-shadow: 0 10px 34px rgba(0, 0, 0, .38); }
.portal-brand { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; white-space: nowrap; cursor: pointer; user-select: none; }
.portal-brand:hover { background: rgba(255, 255, 255, .07); }
.portal-brand img { width: 24px; height: 24px; border-radius: 6px; background: #fff; }
.portal-brand .chevron { color: rgba(255, 247, 232, .58); font-size: 10px; transition: transform .2s; }
.forme-badge { padding: 8px 14px; border-radius: 999px; color: #090912; background: #ffe66b; font-size: 12px; font-weight: 800; text-decoration: none; }
.site-switcher { position: absolute; top: calc(100% + 8px); left: 8px; display: none; min-width: 240px; padding: 10px; color: #fff7e8; background: #171322; border: 1px solid rgba(255, 244, 204, .16); border-radius: 12px; box-shadow: 0 18px 52px rgba(0, 0, 0, .48); }
.site-switcher.open { display: block; }
.site-switcher .ss-title { padding: 8px 12px 6px; color: rgba(255, 247, 232, .52); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.site-switcher a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: inherit; border-radius: 8px; text-decoration: none; }
.site-switcher a:hover { background: rgba(255, 255, 255, .07); }
.site-switcher .ss-icon { display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 8px; background: rgba(255, 230, 107, .08); font-size: 18px; }
.site-switcher .ss-label { font-size: 14px; font-weight: 700; }
.site-switcher .ss-desc { margin-top: 1px; color: rgba(255, 247, 232, .52); font-size: 11px; }
.site-switcher .current-indicator { margin-left: auto; padding: 3px 6px; color: #ffe66b; background: rgba(255, 230, 107, .1); border-radius: 999px; font-size: 10px; font-weight: 800; }
.app-shell { padding-top: 88px !important; }

@media (max-width: 760px) {
  .portal-bar { top: 8px; }
  .app-shell { padding-top: 76px !important; }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    filter 0.24s ease,
    box-shadow 0.24s ease;
}

.app-shell {
  position: relative;
  width: min(1180px, 100vw);
  min-height: 100dvh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow: visible;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13, 12, 25, 0.9), rgba(29, 9, 23, 0.96)),
    radial-gradient(circle at 10% 8%, rgba(159, 255, 203, 0.26), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(255, 230, 107, 0.18), transparent 23%),
    radial-gradient(circle at 75% 85%, rgba(255, 69, 104, 0.22), transparent 33%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 10px, rgba(0, 0, 0, 0.03) 10px 20px);
}

.topbar {
  position: relative;
  z-index: 1;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: var(--cream);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 0.96;
  font-weight: 950;
  letter-spacing: -0.06em;
  transform: rotate(-1.4deg);
  text-shadow: 0 5px 0 #391322, 0 18px 40px rgba(0, 0, 0, 0.42);
}

.tagline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.status-pill,
.ghost,
.privacy {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(20, 61, 45, 0.68);
  border: 2px solid rgba(159, 255, 203, 0.25);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.lang-toggle {
  padding: 10px 13px;
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 244, 204, 0.18);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.lang-toggle:hover {
  color: var(--green);
  border-color: rgba(159, 255, 203, 0.42);
  background: rgba(20, 61, 45, 0.5);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.screen {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: visible;
}

.hidden {
  display: none !important;
}

.is-busy .screen {
  filter: saturate(0.88) brightness(0.92);
  transition: filter 0.28s ease;
}

.home-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
}

.hero-card {
  grid-column: 1;
  grid-row: 1;
}

.room-entry {
  grid-column: 1;
  grid-row: 2;
}

.profile-card {
  grid-column: 1;
  grid-row: 2 / 4;
  align-self: start;
}

.action-grid {
  grid-column: 1;
  grid-row: 4;
}

.mode-grid {
  grid-column: 2;
  grid-row: 1 / 5;
}

.hero-card,
.profile-card,
.room-entry,
.table-panel,
.topic-panel,
.vote-panel,
.chat-card,
.stranger-card,
.solo-chat-card,
.guess-panel {
  border: 3px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 30px;
  min-height: 210px;
  background:
    radial-gradient(circle at 86% 24%, rgba(255, 230, 107, 0.2), transparent 24%),
    linear-gradient(135deg, rgba(255, 77, 91, 0.78), rgba(52, 20, 54, 0.9));
}

.hero-kicker {
  color: var(--green);
  font-weight: 950;
  letter-spacing: 0.12em;
  font-size: 13px;
}

.hero-card h1 {
  margin: 16px 0 12px;
  color: var(--cream);
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

.hero-card p {
  max-width: 420px;
  margin: 0;
  color: rgba(255, 247, 232, 0.76);
  font-size: 17px;
  line-height: 1.5;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.avatar,
.radar-face {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 44% 56% 50% 50%;
  color: #25120c;
  background: linear-gradient(145deg, var(--green), var(--yellow));
  border: 4px solid #20101c;
  font-size: 38px;
  font-weight: 950;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.16);
}

.id-card {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.id-card span {
  color: rgba(255, 247, 232, 0.72);
  font-size: 13px;
  font-weight: 850;
}

.id-card strong {
  color: var(--cream);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 950;
}

.id-card small {
  color: rgba(255, 247, 232, 0.55);
  font-weight: 750;
}

label {
  flex: 1;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 2px solid rgba(255, 244, 204, 0.14);
  outline: none;
  color: var(--text);
  background: rgba(5, 7, 14, 0.54);
}

input:focus {
  border-color: rgba(159, 255, 203, 0.5);
}

.mode-grid {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.mode-row.single {
  grid-template-columns: 1fr;
}

.mode-card {
  min-height: 0;
  padding: 16px;
  display: grid;
  justify-items: start;
  text-align: left;
  border-radius: 28px 22px 32px 24px;
  border: 4px solid #24101d;
  box-shadow: 0 8px 0 #0b0710, var(--shadow);
  transform: rotate(-0.5deg);
}

.mode-row:nth-child(2) .mode-card {
  transform: rotate(0.65deg);
}

.mode-card span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
  font-weight: 950;
}

.mode-card strong {
  margin-top: 12px;
  color: var(--cream);
  font-size: 26px;
  line-height: 1;
}

.mode-card em {
  margin-top: 8px;
  color: rgba(255, 247, 232, 0.76);
  font-style: normal;
  line-height: 1.45;
}

.mode-card.red {
  background: linear-gradient(135deg, #ff4e58, #6c1f40);
}

.mode-card.teal {
  background: linear-gradient(135deg, #39d5a5, #1e536c);
}

.mode-card.yellow {
  color: #28120c;
  background: linear-gradient(135deg, #ffd54d, #9d5c20);
}

.mode-card.yellow strong,
.mode-card.yellow span {
  color: #28120c;
}

.mode-card.active {
  border-color: var(--cream);
  box-shadow: 0 8px 0 #0b0710, 0 0 0 5px rgba(159, 255, 203, 0.28), var(--shadow);
}

.mode-card.disabled {
  cursor: not-allowed;
  filter: saturate(0.28) brightness(0.78);
  opacity: 0.58;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.wide {
  grid-column: 1 / -1;
}

.primary,
.secondary,
.danger {
  min-height: 58px;
  padding: 0 18px;
  border-radius: 18px;
  border: 3px solid #20101c;
  font-weight: 950;
  box-shadow: 0 7px 0 #0b0710, 0 18px 30px rgba(0, 0, 0, 0.24);
}

button.button-pulse {
  opacity: 0.68;
  transform: translateY(2px) scale(0.985);
}

button:disabled {
  cursor: not-allowed;
  filter: saturate(0.55);
  opacity: 0.72;
}

.primary {
  color: #25120c;
  background: linear-gradient(180deg, var(--yellow), #f59b2d);
}

.secondary {
  color: var(--text);
  background: linear-gradient(180deg, #455069, #25283d);
}

.danger {
  color: var(--text);
  background: linear-gradient(180deg, #ff6173, #b92243);
}

.room-entry {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.join-line {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 10px;
}

.room-screen,
.solo-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.room-head,
.solo-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-title {
  color: var(--cream);
  font-size: 28px;
  font-weight: 950;
  text-shadow: 0 4px 0 #391322;
}

.room-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.table-panel {
  flex: 0 0 auto;
  padding: 16px;
}

.phase-title,
.section-title {
  color: var(--cream);
  font-size: 22px;
  font-weight: 950;
}

.players {
  display: grid;
  grid-template-columns: repeat(7, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.player {
  min-height: 86px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 244, 204, 0.12);
}

.player.me {
  border-color: rgba(159, 255, 203, 0.7);
}

.player.dead {
  opacity: 0.45;
}

.player b {
  display: block;
  color: var(--cream);
}

.player span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.topic-panel,
.vote-panel {
  flex: 0 0 auto;
  padding: 14px;
}

.vote-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.vote-targets button {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 244, 204, 0.14);
}

.vote-targets button.active {
  color: #25120c;
  background: var(--yellow);
  border-color: #20101c;
}

.chat-card,
.solo-chat-card {
  flex: 1 1 auto;
  min-height: 300px;
  max-height: min(58dvh, 640px);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.chat-list {
  flex: 1 1 auto;
  min-height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}

.msg {
  max-width: min(76%, 680px);
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.msg.mine {
  margin-left: auto;
  border-radius: 20px 20px 6px 20px;
  background: linear-gradient(180deg, rgba(159, 255, 203, 0.24), rgba(57, 213, 165, 0.18));
  border-color: rgba(159, 255, 203, 0.28);
}

.msg.system {
  max-width: 100%;
  color: rgba(255, 247, 232, 0.8);
  background: rgba(255, 230, 107, 0.1);
}

.meta {
  margin-bottom: 4px;
  color: rgba(255, 247, 232, 0.48);
  font-size: 12px;
}

.composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 10px;
  padding-top: 12px;
}

.stranger-card {
  flex: 0 0 auto;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stranger-card strong,
.stranger-card span {
  display: block;
}

.stranger-card span {
  margin-top: 3px;
  color: var(--muted);
}

.radar-bar {
  width: min(460px, 54vw);
  height: 12px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.radar-bar i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}

.quick-row button {
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 247, 232, 0.78);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 244, 204, 0.16);
  font-size: 13px;
}

.guess-panel {
  flex: 0 0 auto;
  padding: 14px;
}

.guess-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.solo-result {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.74);
}

.judge-modal {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 38%, rgba(159, 255, 203, 0.16), transparent 28%),
    rgba(2, 2, 8, 0.72);
  backdrop-filter: blur(10px);
}

.judge-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 4px solid rgba(255, 244, 204, 0.24);
  border-radius: 30px 24px 34px 26px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 230, 107, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(32, 21, 48, 0.96), rgba(15, 12, 28, 0.96));
  box-shadow: 0 10px 0 #0b0710, 0 24px 70px rgba(0, 0, 0, 0.56);
  transform: rotate(-0.45deg);
}

.judge-kicker {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  color: #25120c;
  background: linear-gradient(135deg, var(--green), var(--yellow));
  font-size: 13px;
  font-weight: 950;
}

.judge-card h2 {
  margin: 14px 0 8px;
  color: var(--cream);
  font-size: clamp(32px, 7vw, 46px);
  line-height: 1;
  letter-spacing: -0.06em;
  text-shadow: 0 4px 0 #391322;
}

.judge-card p {
  margin: 0 0 18px;
  color: rgba(255, 247, 232, 0.7);
  line-height: 1.55;
}

.judge-answer .secondary {
  width: 100%;
  margin-top: 6px;
}

.pace-overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 36%, rgba(159, 255, 203, 0.13), transparent 27%),
    rgba(2, 2, 8, 0.58);
  backdrop-filter: blur(8px);
  animation: paceIn 0.28s ease both;
}

.pace-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 4px solid rgba(255, 244, 204, 0.22);
  border-radius: 28px 22px 30px 24px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 230, 107, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(31, 23, 48, 0.96), rgba(13, 10, 27, 0.96));
  box-shadow: 0 10px 0 #0b0710, 0 26px 70px rgba(0, 0, 0, 0.52);
}

.pace-spinner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 6px solid rgba(255, 244, 204, 0.15);
  border-top-color: var(--green);
  border-right-color: var(--yellow);
  animation: paceSpin 1.15s cubic-bezier(0.62, 0, 0.38, 1) infinite;
}

.pace-title {
  color: var(--cream);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.04em;
  text-shadow: 0 4px 0 #391322;
}

.pace-card p {
  margin: 5px 0 0;
  color: rgba(255, 247, 232, 0.68);
  line-height: 1.45;
}

@keyframes paceSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes paceIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: 100vw;
    min-height: 100svh;
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  }

  .topbar {
    height: 52px;
  }

  .brand {
    font-size: 34px;
    text-shadow: 0 4px 0 #391322, 0 12px 26px rgba(0, 0, 0, 0.42);
  }

  .tagline {
    display: none;
  }

  .top-actions {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .status-pill {
    padding: 7px 10px;
    font-size: 12px;
  }

  .lang-toggle {
    padding: 7px 9px;
    font-size: 12px;
  }

  .screen {
    min-height: calc(100svh - 64px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .home-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 8px;
  }

  .hero-card,
  .room-entry,
  .profile-card,
  .mode-grid,
  .action-grid {
    grid-column: 1;
  }

  .hero-card {
    grid-row: 1;
  }

  .room-entry {
    grid-row: 2;
  }

  .mode-grid {
    grid-row: 3;
  }

  .action-grid {
    grid-row: 4;
  }

  .hero-card {
    min-height: 80px;
    padding: 12px 14px;
    border-width: 2px;
    border-radius: 22px;
  }

  .hero-kicker {
    font-size: 11px;
  }

  .hero-card h1 {
    margin: 4px 0 0;
    font-size: 34px;
  }

  .hero-card p {
    display: none;
  }

  .profile-card {
    display: none;
  }

  .avatar,
  .radar-face {
    width: 54px;
    height: 54px;
    font-size: 30px;
  }

  input {
    height: 44px;
  }

  .mode-grid {
    grid-template-rows: repeat(3, auto);
    gap: 8px;
    min-height: auto;
  }

  .mode-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mode-card {
    min-height: 88px;
    padding: 12px 14px;
    border-width: 3px;
    border-radius: 24px 19px 26px 20px;
    box-shadow: 0 5px 0 #0b0710, var(--shadow);
  }

  .mode-card span {
    width: 48px;
    height: 48px;
    padding: 3px 9px;
    font-size: 11px;
  }

  .mode-card strong {
    margin-top: 7px;
    font-size: 25px;
  }

  .mode-card em {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.25;
  }

  .primary,
  .secondary,
  .danger {
    min-height: 44px;
    border-width: 2px;
    border-radius: 15px;
    box-shadow: 0 5px 0 #0b0710, 0 12px 22px rgba(0, 0, 0, 0.22);
  }

  .action-grid {
    gap: 8px;
  }

  .room-entry {
    padding: 8px;
    gap: 8px;
    border-width: 2px;
    border-radius: 20px;
  }

  .privacy {
    padding: 8px 12px;
  }

  .join-line {
    grid-template-columns: 1fr 86px;
    gap: 8px;
  }

  .room-title {
    font-size: 24px;
  }

  .players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 9px;
  }

  .player {
    min-height: 56px;
    padding: 8px;
    border-radius: 14px;
  }

  .player b {
    font-size: 13px;
  }

  .player span {
    margin-top: 3px;
  }

  .table-panel,
  .topic-panel,
  .vote-panel,
  .chat-card,
  .solo-chat-card,
  .guess-panel {
    padding: 12px;
    border-radius: 22px;
  }

  .stranger-card {
    padding: 10px;
  }

  .radar-bar {
    width: 52vw;
  }

  .msg {
    max-width: min(92%, 680px);
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 8px;
    padding-top: 8px;
  }

  .guess-panel .section-title {
    font-size: 18px;
  }

  .guess-row {
    gap: 8px;
  }

  .judge-modal {
    align-items: end;
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .judge-card {
    padding: 18px;
    border-width: 3px;
    border-radius: 26px 21px 29px 23px;
  }

  .judge-card h2 {
    font-size: 32px;
  }

  .pace-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border-width: 3px;
    border-radius: 24px 19px 26px 20px;
  }

  .pace-spinner {
    width: 46px;
    height: 46px;
    border-width: 5px;
  }

  .pace-title {
    font-size: 20px;
  }

  #pace-cancel {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-height: 720px) and (max-width: 760px) {
  .mode-card em,
  .quick-row {
    display: none;
  }

  .mode-card {
    min-height: 74px;
    padding: 10px 13px;
  }

  .mode-card strong {
    font-size: 23px;
  }

  .hero-card {
    min-height: 68px;
  }

  .hero-card h1 {
    font-size: 30px;
  }
}


/* 2026-07-07 flow/layout pass */
:root {
  --viewport-h: 100svh;
}

.context-label {
  display: none;
  margin-top: 5px;
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
}

.mobile-id {
  display: none;
  margin: 8px 0 2px;
  color: rgba(255, 247, 232, 0.82);
  font-size: 13px;
  font-weight: 850;
}

.mobile-id strong {
  color: var(--green);
  font-size: 16px;
  letter-spacing: 0;
}

.match-primary {
  min-height: clamp(104px, 16vh, 178px);
  font-size: 25px;
  border-radius: 24px;
}

.room-screen,
.solo-screen {
  height: calc(var(--viewport-h) - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 540px;
  overflow: hidden;
}

.room-head,
.solo-head {
  min-height: 44px;
}

.room-title {
  font-size: 22px;
  line-height: 1;
}

.room-meta {
  margin-top: 2px;
  font-size: 12px;
}

.table-panel {
  padding: 10px 12px;
}

.phase-title,
.section-title {
  font-size: 17px;
}

.players {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.player {
  min-height: 52px;
  padding: 8px 9px;
  border-radius: 13px;
}

.player b {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player span {
  margin-top: 2px;
  font-size: 11px;
}

.topic-panel,
.vote-panel {
  padding: 9px 12px;
  font-size: 13px;
}

.topic-panel small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.chat-card,
.solo-chat-card {
  min-height: 0;
  max-height: none;
  flex: 1 1 0;
  padding: 12px;
}

.chat-list {
  min-height: 0;
  padding-right: 4px;
}

.stranger-card {
  padding: 8px 11px;
  gap: 10px;
}

.stranger-card .radar-face {
  width: 48px;
  height: 48px;
  font-size: 27px;
  border-width: 3px;
}

.stranger-card strong {
  font-size: 15px;
}

.stranger-card span {
  margin-top: 1px;
  font-size: 12px;
}

.radar-bar {
  height: 8px;
  margin-top: 6px;
}

.composer {
  position: relative;
  z-index: 2;
  padding-top: 9px;
  padding-bottom: env(safe-area-inset-bottom);
}

.judge-card {
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 244, 204, 0.18);
  font-size: 22px;
  line-height: 1;
}

.continue-button {
  width: 100%;
  margin-top: 12px;
}

body.keyboard-open .app-shell {
  min-height: var(--viewport-h);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

body.keyboard-open .room-screen,
body.keyboard-open .solo-screen {
  height: calc(var(--viewport-h) - 68px - env(safe-area-inset-top));
  min-height: 0;
}

body.keyboard-open .topbar {
  height: 48px;
}

body.keyboard-open .stranger-card,
body.keyboard-open .topic-panel,
body.keyboard-open .vote-panel {
  display: none;
}

body.keyboard-open .table-panel {
  padding: 7px 9px;
}

body.keyboard-open .players {
  margin-top: 6px;
}

body.keyboard-open .player {
  min-height: 42px;
  padding: 6px 7px;
}

@media (max-width: 760px) {
  .app-shell {
    min-height: var(--viewport-h);
  }

  .topbar {
    align-items: center;
  }

  .context-label {
    display: block;
    font-size: 12px;
  }

  .mobile-id {
    display: block;
  }

  .profile-card {
    display: none;
  }

  .match-primary {
    min-height: 58px;
    font-size: 18px;
  }

  .room-screen,
  .solo-screen {
    height: calc(var(--viewport-h) - 64px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
    gap: 7px;
  }

  .room-head,
  .solo-head {
    min-height: 36px;
    gap: 8px;
  }

  .room-title {
    font-size: 18px;
    text-shadow: 0 3px 0 #391322;
  }

  .room-meta {
    font-size: 11px;
    max-width: 62vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .table-panel,
  .topic-panel,
  .vote-panel,
  .chat-card,
  .solo-chat-card {
    border-width: 2px;
    border-radius: 18px;
  }

  .table-panel {
    padding: 8px;
  }

  .phase-title,
  .section-title {
    font-size: 15px;
  }

  .players {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-top: 6px;
  }

  .player {
    min-height: 46px;
    padding: 6px;
    border-radius: 11px;
  }

  .player b,
  .player span {
    font-size: 10px;
  }

  .topic-panel,
  .vote-panel {
    padding: 7px 9px;
  }

  .topic-panel div:not(.section-title),
  .topic-panel small {
    font-size: 11px;
    line-height: 1.25;
  }

  .stranger-card {
    padding: 7px 9px;
    border-width: 2px;
    border-radius: 18px;
  }

  .stranger-card .radar-face {
    width: 40px;
    height: 40px;
    font-size: 23px;
  }

  .radar-bar {
    width: min(44vw, 230px);
  }

  .quick-row {
    display: none;
  }

  .chat-card,
  .solo-chat-card {
    padding: 9px;
  }

  .msg {
    max-width: min(94%, 680px);
    margin-bottom: 8px;
    padding: 9px 11px;
    border-radius: 15px;
    overflow-wrap: anywhere;
  }

  .meta {
    font-size: 10px;
  }

  input {
    height: 42px;
    border-radius: 13px;
    font-size: 16px;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 7px;
    padding-top: 7px;
  }

  .composer button {
    min-height: 42px;
    padding: 0 8px;
  }

  .judge-modal {
    padding: 10px 10px max(12px, env(safe-area-inset-bottom));
  }

  .judge-card {
    max-height: calc(var(--viewport-h) - 24px);
    overflow-y: auto;
  }

  .judge-card h2 {
    padding-right: 34px;
  }
}

@media (max-width: 380px) {
  .mode-card strong {
    font-size: 21px;
  }

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

  .player b,
  .player span {
    font-size: 11px;
  }
}


/* compact top context */
.topbar > div:first-child {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.topbar .tagline {
  margin-top: 0;
}

.context-label {
  display: block;
  min-height: 1em;
}

.room-head .room-title,
.solo-head .room-title {
  display: none;
}

.room-head,
.solo-head {
  padding-top: 0;
}
