:root {
  color-scheme: light;
  --page: #f7f8fb;
  --surface: #ffffff;
  --ink: #141821;
  --muted: #697283;
  --quiet: #8b94a4;
  --line: #d9dee8;
  --line-strong: #b7c0ce;
  --berry: #b83d72;
  --berry-dark: #8f2855;
  --berry-line: #e8bed1;
  --berry-soft: #fbedf4;
  --lavender: #6f63d9;
  --lavender-soft: #f1efff;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 12px 30px rgba(20, 24, 33, 0.06);
  --type-brand: 1.42rem;
  --type-hero: 3rem;
  --type-interstitial: 2.55rem;
  --type-dashboard-title: 1.32rem;
  --type-section-title: 1.32rem;
  --type-card-title: 1.24rem;
  --type-item-title: 1rem;
  --type-submission-word: 1.12rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, Aptos, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
.brand,
.brand-name,
.word,
.board-header h2,
.composer-label h2,
.stats-section h2,
.stats-list-item h3,
.stats-player-row h3 {
  font-family: "Space Grotesk", Inter, sans-serif;
}

button,
input,
select {
  min-height: 40px;
  border-radius: 6px;
  font: inherit;
}

button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: var(--ink);
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 13px;
  color: var(--ink);
  background: white;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(184, 61, 114, 0.16);
  outline-offset: 2px;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

.hidden {
  display: none !important;
}

body.invite-route-loading .masthead,
body.invite-route-loading .home-dashboard,
body.invite-route-loading .closed-room,
body.invite-route-loading .setup {
  display: none;
}

body.account-route-loading .home-dashboard,
body.account-route-loading .setup {
  display: none;
}

.invite-loading {
  display: none;
  min-height: min(620px, calc(100vh - 88px));
  place-items: center;
}

.home-loading {
  display: none;
  margin-bottom: 18px;
}

body.account-route-loading .home-loading {
  display: block;
}

body.invite-route-loading .invite-loading {
  display: grid;
}

.closed-room {
  display: grid;
  min-height: min(620px, calc(100vh - 88px));
  place-items: center;
}

.invite-loading-card {
  width: min(560px, 100%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.closed-room-card {
  width: min(660px, 100%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-loading-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-loading-card h2 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: var(--type-dashboard-title);
  line-height: 1.08;
}

.home-loading-card > p:last-of-type {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 560;
}

.home-loading-status-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.home-loading-spinner {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--berry);
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.home-loading-status-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.3;
}

.invite-loading-card h1,
.closed-room-card h1 {
  max-width: 14ch;
  margin: 10px 0 14px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: var(--type-interstitial);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0;
}

.closed-room-card h1 {
  max-width: 13ch;
}

.closed-room-card > p:not(.brand-name):not(.eyebrow) {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 560;
  line-height: 1.42;
}

.closed-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.invite-loading-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 560;
  line-height: 1.42;
}

.invite-loading-code {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin: 18px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--page);
  font-size: 0.86rem;
  font-weight: 750;
}

.invite-loading-status-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.invite-spinner {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--berry);
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.invite-loading-status-row .form-status {
  min-height: 0;
  margin: 0;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 26px;
  align-items: end;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.masthead-brand-row {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand {
  margin: 0;
  font-size: var(--type-brand);
  font-weight: 700;
  line-height: 1;
}

.brand-name {
  margin: 0;
  font-size: var(--type-brand);
  font-weight: 700;
  line-height: 1;
}

.brand-home-button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-home-button:hover,
.brand-home-button:focus-visible {
  color: var(--berry-dark);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.masthead h1,
.prompt-band h1 {
  max-width: 17ch;
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: var(--type-hero);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0;
}

.intro {
  margin: 0;
  border-left: 1px solid var(--line);
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.5;
}

.intro strong {
  color: var(--ink);
  font-weight: 750;
}

.intro-example {
  display: block;
  margin-top: 10px;
}

.home-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  overflow: visible;
  background: transparent;
}

.home-dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbf3f7;
  box-shadow: var(--shadow);
}

.home-dashboard-header h2 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: var(--type-dashboard-title);
  line-height: 1.08;
}

.home-dashboard-header .fine-print {
  margin-top: 10px;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.45;
}

.home-room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.home-room-section {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

#remembered-room-section {
  background: var(--surface);
}

.home-room-section-header h3,
.room-shortcut h4 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  line-height: 1.12;
}

.home-room-section-header h3 {
  font-size: var(--type-card-title);
}

.home-room-section-header p {
  margin: 6px 0 0;
  border-bottom: 2px solid var(--berry);
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.45;
}

.room-shortcut-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.room-shortcut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.room-shortcut h4 {
  overflow-wrap: anywhere;
  font-size: var(--type-item-title);
}

.room-shortcut-meta,
.room-shortcut-prompt,
.empty-shortcut {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 580;
  line-height: 1.32;
}

.room-shortcut-prompt {
  color: var(--ink);
  font-weight: 720;
}

.room-shortcut-last-crime {
  color: var(--quiet);
  font-weight: 560;
}

.home-dashboard-header .subtle-button,
.masthead-account-button,
#owned-room-list .room-shortcut-action {
  border-color: var(--berry);
  color: white;
  background: var(--berry);
  font-weight: 800;
}

.home-dashboard-header .subtle-button:hover,
.masthead-account-button:hover,
#owned-room-list .room-shortcut-action:hover {
  border-color: var(--berry);
  color: white;
  background: #a73666;
}

.room-shortcut-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 750;
  text-decoration: none;
}

.room-shortcut-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.room-shortcut-action:hover {
  border-color: var(--berry);
  color: var(--berry);
}

.room-shortcut-close {
  min-height: 36px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 720;
}

.room-shortcut-close:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.setup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.error {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid rgba(180, 35, 24, 0.32);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--danger);
  background: var(--danger-soft);
  font-weight: 700;
}

.invite-notice {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.invite-notice h2 {
  margin-bottom: 8px;
  font-size: var(--type-card-title);
  line-height: 1.1;
}

.invite-notice p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.primary-panel {
  border: 2px solid var(--ink);
}

.panel h2 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: var(--type-card-title);
  line-height: 1.1;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.bot-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-button {
  min-height: 54px;
  border-color: var(--berry);
  padding: 0 22px;
  color: white;
  background: var(--berry);
  font-size: 1rem;
  font-weight: 800;
}

.submit-button:hover {
  border-color: var(--berry);
  background: #a73666;
}

.form-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: white;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

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

.room-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
}

.room-meta {
  display: flex;
  gap: 7px 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.25;
}

.room-meta > span:not(:last-child)::after {
  content: "•";
  margin-left: 10px;
  color: var(--quiet);
}

.room-meta .ownership-pill {
  min-height: 24px;
  border: 1px solid var(--berry-line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--berry-dark);
  background: var(--berry-soft);
  font-size: 0.76rem;
  font-weight: 750;
}

.room-meta .ownership-pill::after {
  content: "";
  margin: 0;
}

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

.subtle-button {
  min-height: 36px;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}

.subtle-button.owner-action {
  border-color: var(--berry-line);
  color: var(--berry-dark);
  background: var(--berry-soft);
}

.subtle-button.owner-action:hover {
  border-color: var(--berry);
}

.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 20px;
  align-items: start;
}

.prompt-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.prompt-pair {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.composer-prompt {
  margin-top: 0;
}

.composer-prompt .category {
  padding: 9px 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 760;
}

.composer-prompt .plus {
  color: var(--berry);
  font-size: 1.18rem;
  font-weight: 850;
}

.category {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 10px;
  background: var(--page);
  font-size: 0.94rem;
  font-weight: 760;
}

.plus {
  color: var(--berry);
  font-size: 1.1rem;
  font-weight: 850;
}

.timer {
  min-width: 132px;
  border-left: 1px solid var(--line);
  padding-left: 17px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 520;
  line-height: 1.3;
}

.timer strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 760;
}

.composer {
  margin: 16px 0 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.composer-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.composer-label h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.1;
}

.composer-tagline {
  color: var(--quiet);
  font-size: 0.82rem;
  font-weight: 550;
  white-space: nowrap;
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.composer input {
  min-height: 54px;
  border-color: var(--line-strong);
  padding: 0 15px;
  font-size: 1.04rem;
  font-weight: 650;
}

.composer input::placeholder {
  color: #9aa2af;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.36;
}

.board-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 20px 0 10px;
}

.board-header h2 {
  margin: 0;
  font-size: var(--type-section-title);
  line-height: 1.08;
}

.sort-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.room-status {
  min-height: 19px;
  margin: -3px 0 9px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.feed {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.submission {
  display: grid;
  gap: 8px;
}

.submission-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.empty-submission {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.submission-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.word {
  margin: 0;
  font-size: var(--type-submission-word);
  font-weight: 700;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.byline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 520;
}

.time {
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 400;
  white-space: nowrap;
}

.reactions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.reaction {
  min-height: 29px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 620;
  line-height: 1;
}

.reaction.add {
  color: #414854;
  background: #f2f4f7;
  border-color: var(--line);
  font-weight: 500;
}

.reaction.selected {
  opacity: 0.62;
}

.reaction-picker {
  display: flex;
  flex-basis: 100%;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.reaction-picker button {
  min-width: 38px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 999px;
}

.comments {
  display: grid;
  gap: 8px;
  margin: 0 0 0 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}

.comment {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.36;
}

.comment-block {
  display: grid;
  gap: 7px;
  padding-left: 2px;
}

.comment strong {
  color: var(--ink);
  font-weight: 700;
}

.comment-reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.comment-reaction {
  min-height: 26px;
  padding: 0 8px;
  font-size: 0.8rem;
}

.comment-action {
  justify-self: start;
  min-height: 30px;
  border-color: #ddd8ff;
  color: var(--lavender);
  background: var(--lavender-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.inline-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-comment-form input,
.inline-comment-form button {
  min-height: 38px;
}

.sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.side-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.side-section h2 {
  margin-bottom: 10px;
  font-size: 1rem;
  line-height: 1.15;
}

.invite-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.invite-box input {
  min-width: 0;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.copy-status {
  min-height: 19px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.room-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.room-list strong {
  color: var(--ink);
  font-weight: 700;
}

.players {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.player {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--page);
  font-size: 0.76rem;
  font-weight: 700;
}

.player.owner {
  border-color: var(--berry-line);
  color: var(--berry-dark);
  background: var(--berry-soft);
}

.player.current {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(184, 61, 114, 0.18);
}

.fine-print {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
}

.room-main-view,
.room-stats-view {
  min-width: 0;
}

.stats-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stats-page-header h1 {
  margin: 0;
  font-size: var(--type-section-title);
  line-height: 1.08;
}

.stats-page-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.38;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.stats-summary-grid div,
.stats-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stats-summary-grid div {
  padding: 14px;
}

.stats-summary-grid dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.stats-summary-grid dd {
  margin: 5px 0 0;
  font-size: 1.7rem;
  font-weight: 850;
  line-height: 1;
}

.stats-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stats-section {
  padding: 16px;
}

.stats-section-header {
  border-bottom: 2px solid var(--berry);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.stats-section h2 {
  margin: 0;
  font-size: var(--type-card-title);
  line-height: 1.12;
}

.stats-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-list-item,
.stats-player-row,
.stats-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.stats-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.stats-list-item h3,
.stats-player-row h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.stats-list-item p,
.stats-player-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 520;
  line-height: 1.28;
}

.stats-list-item > strong {
  justify-self: end;
  min-width: 92px;
  border: 1px solid var(--berry-line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--berry-dark);
  background: var(--berry-soft);
  font-size: 0.82rem;
  font-weight: 780;
  text-align: center;
}

.stats-reaction-preview {
  letter-spacing: 0;
}

.stats-player-list {
  display: grid;
  gap: 10px;
}

.stats-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.stats-player-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats-player-metrics span {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 650;
}

.stats-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 520;
  line-height: 1.35;
}

.stats-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(20, 24, 33, 0.32);
}

.stats-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(20, 24, 33, 0.18);
}

.stats-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.stats-card-header h2 {
  margin: 0;
  font-size: var(--type-dashboard-title);
  line-height: 1.08;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.stats-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--page);
}

.stats-grid dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.stats-grid dd {
  margin: 5px 0 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.account-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-form,
.settings-section,
.access-form {
  display: grid;
  gap: 12px;
}

.account-form h3,
.settings-section h3,
.access-form h3,
.member-management h3 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1rem;
  line-height: 1.12;
}

.account-signed-in {
  display: grid;
  gap: 12px;
}

.member-management {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.access-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.access-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: var(--page);
  font-size: 0.86rem;
  font-weight: 560;
  line-height: 1.35;
}

.access-option input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--berry);
}

.access-option strong {
  display: block;
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 750;
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--page);
}

.member-row p {
  margin: 0;
}

.member-name {
  color: var(--ink);
  font-weight: 720;
  overflow-wrap: anywhere;
}

.member-role {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
}

.member-role-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.73rem;
  font-weight: 650;
}

.member-role-badge.claimed-owner,
.member-role-badge.original-creator {
  border-color: var(--berry-line);
  color: var(--berry-dark);
  background: var(--berry-soft);
}

.member-role-badge.you {
  color: var(--ink);
  background: #f2f4f7;
}

.empty-member-list {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: var(--page);
  font-size: 0.84rem;
  font-weight: 550;
}

.join-request-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-button {
  min-height: 32px;
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.danger-button:hover {
  border-color: var(--danger);
}

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

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

  .side-section:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  :root {
    --type-brand: 1.36rem;
    --type-hero: 2.15rem;
    --type-interstitial: 2rem;
    --type-dashboard-title: 1.24rem;
    --type-section-title: 1.24rem;
    --type-card-title: 1.18rem;
  }

  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .setup,
  .masthead,
  .home-dashboard-header,
  .home-room-grid,
  .room-topbar,
  .prompt-band,
  .composer-label,
  .composer-row,
  .submission-main,
  .invite-box,
  .inline-comment-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: start;
  }

  .timer {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  .intro {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  button {
    width: 100%;
  }

  .subtle-button,
  .comment-action,
  .reaction,
  .reaction-picker button {
    width: auto;
  }

  .composer-tagline,
  .time {
    white-space: normal;
  }

  .sidebar,
  .stats-grid,
  .stats-summary-grid,
  .stats-section-grid,
  .stats-page-header,
  .stats-list-item,
  .stats-player-row,
  .account-forms,
  .room-shortcut,
  .member-row {
    grid-template-columns: 1fr;
  }

  .closed-room-actions,
  .room-shortcut-actions,
  .stats-player-metrics {
    justify-content: start;
  }

}
