/* Final cascade overrides for the production-readiness pass. */
.host-control-grid {
  grid-template-columns: minmax(330px, .78fr) minmax(440px, 1.22fr);
  gap: 20px;
  align-items: start;
}

.dashboard-quiz {
  grid-template-columns: 84px minmax(170px, 1fr) auto;
}

.quizzes-panel {
  width: 100%;
  max-width: none;
}

.dashboard-quiz .row-actions {
  max-width: none;
  flex-wrap: nowrap;
}

.mini-lobby strong {
  font-size: clamp(22px, 2.2vw, 30px);
  overflow-wrap: anywhere;
}

.current-account-label {
  color: #176b50 !important;
  padding: 7px 10px;
  background: #d9faec;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

html,
body,
#app {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.app-shell,
.workspace,
.topbar,
.topbar > div,
.editor-grid,
.editor-main,
.settings-panel,
.round-block,
.question-block,
.form-grid,
.title-grid,
.options-editor,
.option-line,
.host-control-grid,
.screen-preview-panel,
.admin-grid,
.users-panel,
.user-row {
  min-width: 0;
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  max-width: 100%;
}

input,
select,
textarea {
  min-width: 0;
}

.nav-item {
  min-width: 0;
}

.nav-item span,
.quiz-row-main,
.user-row > div,
.question-title,
.round-head > div {
  min-width: 0;
}

.access-notice {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  margin-bottom: 18px;
  padding: 15px 17px;
  color: #4f3b12;
  background: #fff3c4;
  border: 2px solid #e8c95a;
  border-radius: 20px;
}

.access-notice > i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: white;
  background: #b77916;
  border-radius: 14px;
  font-size: 21px;
}

.access-notice strong,
.access-notice p {
  display: block;
  margin: 0;
}

.access-notice p {
  margin-top: 3px;
  color: #72591f;
  font-size: 13px;
}

.permission-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px;
  color: var(--ink);
  background: #eef1ff;
  border: 2px solid #cfd7ff;
  border-radius: 16px;
  cursor: pointer;
}

.permission-choice input {
  width: 20px;
  min-height: 20px;
  margin-top: 2px;
}

.permission-choice strong,
.permission-choice small {
  display: block;
}

.permission-choice small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

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

.access-toggle {
  display: inline-grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 164px;
  padding: 8px 10px;
  color: #7b4b12;
  text-align: left;
  background: #fff4df;
  border: 2px solid #e8c991;
  border-radius: 15px;
}

.access-toggle.active {
  color: #176b50;
  background: #e4fbf2;
  border-color: #8edbbb;
}

.access-toggle:hover {
  transform: none;
  border-color: currentColor;
}

.access-toggle strong,
.access-toggle small {
  display: block;
}

.access-toggle strong {
  font-size: 12px;
  line-height: 1.15;
}

.access-toggle small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
}

.switch-track {
  position: relative;
  display: block !important;
  width: 40px;
  height: 24px;
  margin: 0 !important;
  background: #c9b58d;
  border-radius: 999px;
  transition: background 160ms ease;
}

.switch-track i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(18, 24, 39, .25);
  transition: transform 160ms ease;
}

.access-toggle.active .switch-track {
  background: var(--qz-color-blue);
}

.access-toggle.active .switch-track i {
  transform: translateX(16px);
}

.leaderboard-current {
  border-left-color: var(--gold);
}

@media (max-width: 1180px) {
  .getting-started,
  .host-control-grid {
    grid-template-columns: 1fr;
  }

  .mini-stage {
    min-height: 300px;
  }

  .dashboard-quiz {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .dashboard-quiz .quiz-meta,
  .dashboard-quiz .row-actions {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .sidebar .nav-item {
    gap: 10px;
    padding-inline: 14px;
    font-size: 15px;
  }

  .sidebar .nav-item span {
    white-space: nowrap;
  }
}

@media (max-width: 980px) {
  .sidebar-account {
    position: static;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    box-shadow: none;
  }

  .sidebar-account > strong,
  .sidebar-account > span {
    display: none;
  }

  .sidebar-logout {
    margin: 0;
  }

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

  .user-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sidebar .brand {
    grid-column: 1 / -1;
  }

  .sidebar .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    justify-content: center;
    gap: 7px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .sidebar .nav-item[data-view="admin"] {
    grid-column: 1 / -1;
  }

  .sidebar-account {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  .workspace,
  .panel,
  .editor-main,
  .settings-panel,
  .round-block,
  .question-block {
    width: 100%;
    max-width: 100%;
  }

  .topbar,
  .round-head,
  .question-head {
    min-width: 0;
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .primary-btn {
    flex: 1 1 180px;
  }

  .question-title {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .question-title strong,
  .round-head strong,
  .quiz-row-main strong,
  .quiz-row-main span {
    overflow-wrap: anywhere;
  }

  .question-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .compact-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .compact-toolbar .ghost-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }

  .option-line {
    grid-template-columns: 28px minmax(0, 1fr) 40px;
    width: 100%;
  }

  .option-line input[placeholder="URL картинки"] {
    grid-column: 2 / -1;
  }

  .access-notice {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 13px;
  }

  .access-notice > i {
    width: 38px;
    height: 38px;
  }

  .host-screen-launcher {
    align-items: stretch;
    flex-direction: column;
  }

  .host-screen-launcher .primary-btn {
    width: 100%;
  }

  .mini-stage {
    min-height: 280px;
    padding: 18px;
  }

  .mini-lobby {
    grid-template-columns: 122px 1fr;
    gap: 16px;
  }

  .mini-lobby strong {
    font-size: 19px;
  }

  .mini-options {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .user-row .ghost-btn,
  .user-actions,
  .current-account-label {
    grid-column: 1 / -1;
  }

  .user-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .access-toggle,
  .user-actions .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .auth-card h1 {
    font-size: 27px;
  }

  .control-panel .panel-head,
  .screen-preview-panel .panel-head {
    display: flex;
  }
}

@media (max-width: 420px) {
  .dashboard-quiz .row-actions {
    flex-wrap: wrap;
  }

  .sidebar .nav-item {
    gap: 5px;
    padding-inline: 7px;
    font-size: 12px;
  }

  .compact-toolbar {
    grid-template-columns: 1fr;
  }

  .round-block,
  .question-block {
    padding: 14px;
  }

  .mini-lobby {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mini-lobby .qr-image,
  .mini-lobby canvas {
    width: min(190px, 100%);
    margin-inline: auto;
  }
}

/* Journey fixes: entry, editor, launch, host controls and player feedback. */
.entry-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(145deg, #fff9df 0%, #f3f5ff 48%, #e8fff6 100%);
}

.entry-card {
  width: min(720px, 100%);
  padding: clamp(28px, 5vw, 54px);
  background: rgba(255, 255, 255, .94);
  border: 2px solid #dce2ff;
  border-radius: 32px;
  box-shadow: 0 28px 70px rgba(34, 45, 96, .14);
}

.entry-brand,
.entry-brand > div,
.entry-copy,
.entry-choice > span {
  display: grid;
}

.entry-brand {
  grid-template-columns: 66px 1fr;
  align-items: center;
  gap: 14px;
}

.entry-brand img {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.entry-brand strong {
  font-family: "Unbounded Variable", sans-serif;
  font-size: 22px;
}

.entry-brand span,
.entry-choice small {
  color: var(--muted);
}

.entry-copy {
  gap: 8px;
  margin: 38px 0 26px;
}

.entry-copy h1,
.entry-copy p {
  margin: 0;
}

.entry-copy h1 {
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.04;
}

.entry-copy p {
  max-width: 520px;
  color: var(--muted);
  font-size: 17px;
}

.entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.entry-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  min-height: 92px;
  padding: 17px;
  color: var(--ink);
  text-align: left;
  background: #f6f7ff;
  border: 2px solid #d9dfff;
  border-radius: 20px;
}

.entry-choice.primary-choice {
  background: #e7fff5;
  border-color: #9fe6c8;
}

.entry-choice > i:first-child {
  font-size: 28px;
}

.entry-choice strong {
  font-size: 16px;
}

.entry-choice small {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.3;
}

.auth-back {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.auth-card {
  position: relative;
}

.validation-summary,
.launch-check,
.mode-explainer,
.late-join-notice,
.lobby-readiness {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.validation-summary {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 2px solid;
  border-radius: 17px;
}

.validation-summary.ready,
.launch-check.ready,
.lobby-readiness.ready {
  color: #16664d;
  background: #e5fbf2;
  border-color: #a8e4cc;
}

.validation-summary.has-errors,
.launch-check.has-errors {
  color: #8b4c0e;
  background: #fff5d9;
  border-color: #efd078;
}

.validation-summary > i,
.launch-check > i,
.mode-explainer > i,
.late-join-notice > i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: white;
  background: #b77916;
  border-radius: 12px;
}

.validation-summary.ready > i,
.launch-check.ready > i {
  background: #19815f;
}

.mode-explainer > i {
  background: #327aab;
}

.validation-summary > i::before,
.launch-check > i::before,
.mode-explainer > i::before,
.late-join-notice > i::before {
  color: white;
}

.validation-summary strong,
.validation-summary p,
.launch-check strong,
.launch-check small,
.mode-explainer strong,
.mode-explainer small,
.late-join-notice strong,
.late-join-notice small {
  display: block;
  margin: 0;
}

.validation-summary p,
.launch-check small,
.mode-explainer small,
.late-join-notice small {
  margin-top: 3px;
  color: inherit;
  opacity: .78;
  font-size: 12px;
  line-height: 1.4;
}

.round-block.has-errors,
.question-block.has-errors {
  border-color: #e9bd53;
}

.round-head {
  align-items: center;
  margin-bottom: 0;
}

.round-summary,
.question-title {
  min-width: 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
}

.round-summary {
  display: grid;
  grid-template-columns: 34px minmax(100px, auto) minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
}

.disclosure-caret {
  display: grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  line-height: 1;
  transform-origin: center;
}

.round-summary > .disclosure-caret,
.question-title > .disclosure-caret {
  color: var(--muted);
  transition: transform 160ms ease;
}

.round-block:not(.collapsed) .round-summary > .disclosure-caret {
  transform: rotate(180deg);
}

.question-block:not(.collapsed) .question-title > .disclosure-caret {
  transform: rotate(180deg);
}

.round-actions,
.question-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.round-body,
.question-body-fields {
  min-width: 0;
}

.round-body {
  margin-top: 16px;
}

.question-title {
  flex: 1 1 320px;
}

.question-title > span:not(.question-number) {
  display: grid;
  min-width: 0;
}

.question-title strong,
.question-title em {
  overflow-wrap: anywhere;
}

.question-title em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.question-body-fields {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.inline-validation {
  display: grid;
  gap: 7px;
  padding: 12px;
  color: #7a4308;
  background: #fff6dd;
  border-radius: 13px;
}

.inline-validation span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.bottom-add-round {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  margin-top: 18px;
  color: #34499d;
  background: #f2f4ff;
  border: 2px dashed #aebaf0;
  border-radius: 18px;
}

.bottom-add-round > span,
.bottom-add-round strong,
.bottom-add-round small {
  display: block;
  text-align: left;
}

.bottom-add-round small {
  margin-top: 3px;
  color: var(--muted);
}

.bottom-item-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 0 !important;
  padding-top: 14px;
  border-top: 1px dashed #cfd6ef;
}

.toolbar-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  background: #eef1f8;
  border-radius: 15px;
}

.mode-switch button {
  padding: 11px 9px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 11px;
}

.mode-switch button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 5px 14px rgba(34, 45, 96, .12);
}

.mode-switch strong,
.mode-switch small {
  display: block;
}

.mode-switch small {
  margin-top: 3px;
  color: inherit;
  font-size: 10px;
  line-height: 1.25;
}

.mode-explainer,
.late-join-notice {
  padding: 12px;
  color: #265172;
  background: #eaf6ff;
  border-radius: 14px;
}

.timing-grid {
  display: grid;
  gap: 8px;
}

.timing-grid .metric-field,
.default-points-field {
  grid-template-columns: 20px minmax(0, 1fr) 68px 31px;
  gap: 8px;
  padding: 10px;
  background: #f7f8fc;
  border: 1px solid #e1e5f1;
  border-radius: 13px;
}

.timing-grid .metric-field span,
.default-points-field span,
.question-points > div:first-child span {
  min-width: 0;
}

.timing-grid strong,
.timing-grid small,
.default-points-field strong,
.default-points-field small,
.question-points strong,
.question-points small {
  display: block;
}

.timing-grid small,
.default-points-field small,
.question-points small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.timing-grid input,
.default-points-field input {
  min-height: 38px;
  padding: 7px;
  text-align: center;
}

.timing-grid em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.default-points-field {
  grid-template-columns: 20px minmax(0, 1fr) 72px;
}

.question-points {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 13px;
  background: #f4f6ff;
  border: 1px solid #d9def4;
  border-radius: 14px;
}

.question-points > div:first-child {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.points-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.points-choice button {
  padding: 9px;
  color: #52608e;
  background: white;
  border: 1px solid #d6dced;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.points-choice button.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.custom-points-input {
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: center;
}

.answer-type-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  color: #17664e;
  background: #e8faf3;
  border-radius: 12px;
  font-size: 12px;
}

.mobile-editor-actions {
  display: none;
}

.launch-dialog {
  width: min(650px, calc(100% - 30px));
}

.dialog-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.launch-checks,
.validation-list {
  display: grid;
  gap: 9px;
}

.launch-check {
  padding: 12px;
  border: 1px solid;
  border-radius: 14px;
}

.launch-check.soft-warning {
  color: #7a4308;
  background: #fff8e8;
}

.validation-list {
  max-height: 240px;
  margin-top: 10px;
  overflow: auto;
}

.validation-list button {
  padding: 9px 11px;
  color: #793d07;
  text-align: left;
  background: #fff6de;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

.screen-launch-actions,
.live-navigation,
.ended-actions {
  display: flex;
  gap: 8px;
}

.host-screen-launcher.screen-connected {
  background: #dff9ee;
  border-color: #8bd9b9;
}

.host-screen-launcher.screen-connected > div > i {
  background: #19815f;
}

.lobby-readiness {
  padding: 12px;
  color: #72591f;
  background: #fff5d5;
  border-radius: 14px;
}

.lobby-readiness > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
}

.lobby-readiness strong,
.lobby-readiness small {
  display: block;
}

.lobby-readiness small {
  margin-top: 3px;
  color: inherit;
  opacity: .76;
  font-size: 11px;
}

.live-navigation > * {
  flex: 1 1 auto;
}

.ended-actions {
  flex-direction: column;
}

.stop-game-zone {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ead7dc;
}

.stop-game-zone > span {
  color: #9a6470;
  font-size: 11px;
  text-align: center;
}

.danger-text {
  color: #c82d4a;
}

.answer-row.disconnected {
  opacity: .58;
}

.answer-row.disconnected em {
  color: #8a5360;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  color: #a2253e;
  background: #fff0f3;
  border: 1px solid #efb8c3;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.text-btn {
  justify-self: center;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-weight: 700;
}

.selection-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: #42604f;
  font-size: 12px;
  font-weight: 750;
}

.late-join-notice {
  margin-bottom: 14px;
  color: #744b10;
  background: #fff4d8;
}

.winner.is-you {
  border: 2px solid #62cba5;
  background: #e5fbf2;
}

.winner.own-rank {
  margin-top: 12px;
}

.correct-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #14684e;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

@media (max-width: 980px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    position: static;
  }

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

@media (max-width: 680px) {
  .entry-screen {
    padding: 14px;
  }

  .entry-card {
    padding: 26px 18px;
    border-radius: 24px;
  }

  .entry-copy {
    margin: 30px 0 22px;
  }

  .entry-actions,
  .title-grid {
    grid-template-columns: 1fr;
  }

  .entry-choice {
    min-height: 78px;
  }

  .editor-main {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .mobile-editor-actions {
    position: fixed;
    z-index: 20;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(116px, .8fr) minmax(0, 1.2fr);
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid #d8def1;
    border-radius: 17px;
    box-shadow: 0 16px 38px rgba(34, 45, 96, .2);
    backdrop-filter: blur(14px);
  }

  .mobile-editor-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    gap: 6px;
    padding-inline: 10px;
    font-size: 14px;
    line-height: 1.15;
  }

  .mobile-editor-actions > button span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .topbar .top-actions button[data-action="save-quiz"] {
    display: none;
  }

  .round-summary {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    flex: 1 1 100%;
  }

  .round-summary em {
    grid-column: 2;
    justify-self: start;
  }

  .round-summary > .disclosure-caret {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .round-actions {
    margin-left: 44px;
  }

  .question-head {
    align-items: stretch;
  }

  .question-title {
    width: 100%;
    flex-wrap: nowrap;
  }

  .question-actions {
    display: grid;
    grid-template-columns: repeat(5, 38px);
    justify-content: end;
  }

  .bottom-item-toolbar,
  .points-choice {
    grid-template-columns: 1fr;
  }

  .toolbar-label {
    grid-column: 1;
  }

  .option-line {
    grid-template-columns: 28px minmax(0, 1fr) 38px;
  }

  .option-line input[placeholder="Ссылка на картинку"] {
    grid-column: 2 / -1;
  }

  .timing-grid .metric-field {
    grid-template-columns: 20px minmax(0, 1fr) 64px 28px;
  }

  .screen-launch-actions,
  .live-navigation {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .screen-launch-actions > *,
  .live-navigation > * {
    width: 100%;
  }

  .player-card-top {
    align-items: flex-start;
  }

}

@media (max-width: 420px) {
  .entry-brand {
    grid-template-columns: 54px 1fr;
  }

  .entry-brand img {
    width: 54px;
    height: 54px;
  }

  .entry-copy h1 {
    font-size: 34px;
  }

  .round-block,
  .question-block,
  .editor-main,
  .settings-panel {
    padding: 13px;
  }

  .question-actions {
    grid-template-columns: repeat(5, 36px);
    gap: 4px;
  }

  .question-actions .icon-btn,
  .question-actions .drag-handle {
    width: 36px;
    min-height: 36px;
  }

  .timing-grid .metric-field,
  .default-points-field {
    grid-template-columns: 20px minmax(0, 1fr) 60px;
  }

  .timing-grid em {
    display: none;
  }

  .custom-points-input {
    grid-template-columns: 1fr 90px;
  }
}

@media (max-width: 340px) {
  .mobile-editor-actions {
    grid-template-columns: minmax(108px, .82fr) minmax(0, 1.18fr);
    gap: 6px;
    padding: 7px;
  }

  .mobile-editor-actions > button {
    gap: 5px;
    padding-inline: 8px;
    font-size: 13px;
  }
}

/* Compact host console based on the approved desktop and mobile prototype. */
.host-session-shell {
  display: block;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.host-session-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  background: #f6f1e8;
}

.host-session-topbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  min-height: 62px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #e7dcc8;
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 8px 26px rgba(30, 36, 64, 0.05);
}

.host-session-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.host-session-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-session-mode {
  padding-left: 12px;
  color: var(--blue);
  border-left: 1px solid #e7dcc8;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.host-open-screen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  color: var(--blue);
  background: #eef2ff;
  border: 1px solid #ccd5ff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.host-open-screen.is-connected {
  box-shadow: inset 0 0 0 1px rgba(49, 85, 245, 0.1);
}

.host-open-screen-mobile {
  display: none;
}

.host-dashboard {
  display: grid;
  grid-template-columns: minmax(650px, 1fr) minmax(320px, 370px);
  gap: 12px;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.host-main-panel,
.host-side-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid #e7dcc8;
  border-radius: 22px;
  background: #fffdf9;
  box-shadow: 0 18px 45px rgba(30, 36, 64, 0.08);
}

.host-main-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.host-stage-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  color: white;
  background: #3559f5;
  border: 1px solid #d7def9;
  border-radius: 18px;
}

.host-stage-head,
.host-stage-simple-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.host-stage-head > div:first-child,
.host-stage-simple-head > div:first-child {
  min-width: 0;
}

.host-stage-head > div:first-child > span,
.host-stage-simple-head > div:first-child > span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.host-stage-card h2 {
  margin: 0;
  color: inherit;
  font-family: "Nunito Sans", "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(21px, 1.6vw, 24px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.host-stage-card p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  line-height: 1.35;
}

.host-answer-status {
  min-width: 104px;
  padding: 8px 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
}

.host-answer-status strong,
.host-answer-status span {
  display: block;
}

.host-answer-status strong {
  font-size: 25px;
  line-height: 1;
}

.host-answer-status span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
}

.host-stage-indicators {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.host-stage-timer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  width: 104px;
  min-width: 104px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
}

.host-stage-timer .host-stage-timer-label {
  align-self: end;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.host-stage-timer-value {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  align-items: baseline;
  justify-content: flex-start;
  gap: 3px;
}

.host-stage-timer-value strong {
  font-size: 22px;
  line-height: 0.9;
  text-align: right;
}

.host-stage-timer-value em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}

.host-stage-timer .timer-bar {
  grid-column: 1 / -1;
  width: 100%;
}

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

.host-stage-timer.paused .host-stage-timer-value {
  grid-column: 1;
  grid-row: 2;
  justify-content: flex-start;
}

.host-stage-timer.paused .host-stage-timer-value strong {
  font-size: 12px;
  line-height: 1.1;
  text-align: left;
}

.host-stage-progress {
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.host-stage-progress i {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: inherit;
  transition: width 180ms ease;
}

.host-stage-afterline {
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
}

.host-stage-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.host-stage-content {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.host-stage-content.has-media {
  grid-template-columns: minmax(180px, .72fr) minmax(260px, 1.28fr);
  align-items: stretch;
}

.host-stage-media-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(150px, 22vh, 220px);
  min-width: 0;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 13px;
}

.host-stage-section-media {
  height: clamp(160px, 28vh, 260px);
}

.host-stage-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 8px 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.2;
}

.host-stage-option img {
  width: 42px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
}

.host-stage-option.correct {
  color: #3b3310;
  background: var(--gold);
  border-color: var(--gold);
}

.host-stage-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border-radius: 9px;
}

.host-stage-simple-head > strong {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 48px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  font-size: 24px;
}

.host-stage-results .winners {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.host-stage-results .winner {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 48px;
  padding: 8px;
}

.host-stage-results .winner em {
  grid-column: 2;
}

.host-stage-card .timer-panel {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
}

.host-activity-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(360px, 1.18fr);
  gap: 10px;
  min-height: 0;
}

.host-activity-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  background: white;
  border: 1px solid #e7dcc8;
  border-radius: 16px;
}

.host-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.host-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.host-section-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.host-stat-list {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow: auto;
}

.host-stat-option {
  padding: 7px 9px;
  background: #fff8ec;
  border: 1px solid #e7dcc8;
  border-radius: 11px;
}

.host-stat-option > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
}

.host-stat-option b {
  color: var(--blue);
}

.host-stat-option.correct {
  background: #fff3c8;
  border-color: #f0e0aa;
}

.host-stat-bar {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  background: #ebe6da;
  border-radius: 999px;
}

.host-stat-bar i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.host-player-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(48px, auto);
  gap: 5px;
  min-height: 0;
  overflow: auto;
}

.host-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  background: #fff8ec;
  border: 1px solid #e7dcc8;
  border-radius: 11px;
}

.host-player-row > div {
  min-width: 0;
}

.host-player-row strong,
.host-player-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-player-row strong {
  color: var(--ink);
  font-size: 12px;
}

.host-player-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.host-player-row em {
  max-width: 126px;
  padding: 5px 7px;
  overflow: hidden;
  color: #4b5565;
  background: #f2f4f8;
  border: 1px solid #dfe3eb;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-player-row em.waiting {
  color: #8a93a8;
  background: transparent;
  border-style: dashed;
}

.host-empty-state {
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 92px;
  margin: 0;
  padding: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.host-side-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  overflow: hidden;
}

.host-side-sticky {
  display: grid;
  gap: 8px;
}

.host-focus-card {
  padding: 13px;
  border-radius: 18px;
}

.host-focus-card {
  background: #fff8ec;
  border: 1px solid #efe0b8;
}

.host-focus-card > span,
.host-focus-card > strong {
  display: block;
}

.host-focus-card > span {
  color: var(--muted);
  font-size: 11px;
}

.host-focus-card > strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
}

.host-desktop-actions {
  display: grid;
  gap: 8px;
}

.host-side-navigation {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 8px;
}

.host-side-navigation > * {
  min-width: 0;
}

.host-side-scroll {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.host-utility-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.host-side-panel .host-timeline {
  display: block;
  max-height: none;
  padding: 0;
  overflow: hidden;
  background: white;
  border: 1px solid #e7dcc8;
  border-radius: 14px;
}

.host-timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
}

.host-timeline-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.host-timeline-head strong {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.host-side-panel .host-timeline-list {
  gap: 4px;
  max-height: 180px;
  padding: 0 8px 8px;
}

.host-side-panel .host-timeline-tail {
  height: 0;
  pointer-events: none;
}

.host-side-panel .timeline-row {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
  padding: 5px 7px;
  border-width: 1px;
  border-radius: 9px;
}

.host-side-panel .timeline-row > span {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
}

.host-side-panel .timeline-row strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.host-side-panel .timeline-row em {
  overflow: hidden;
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-side-panel .timeline-row.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.host-stop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  color: #d74b67;
  background: white;
  border: 1px solid #e7dcc8;
  border-radius: 13px;
  font-weight: 800;
}

.host-mobile-actions {
  display: none;
}

@media (max-width: 1080px) {
  .host-dashboard {
    grid-template-columns: minmax(580px, 1fr) 320px;
  }

  .host-activity-grid {
    grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.1fr);
  }

  .host-player-row em {
    max-width: 96px;
  }
}

@media (max-width: 860px) {
  .host-session-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .host-session-workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

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

  .host-main-panel,
  .host-side-panel {
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .host-session-workspace {
    display: block;
    padding: 10px 10px 118px;
  }

  .host-session-topbar {
    position: static;
    top: auto;
    z-index: auto;
    min-height: 56px;
    margin: 0 0 10px;
    padding: 9px 10px;
    gap: 8px;
    border-radius: 16px;
    backdrop-filter: none;
  }

  .host-session-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  .host-session-title {
    font-size: 13px;
  }

  .host-session-mode {
    padding-left: 0;
    color: var(--muted);
    border-left: 0;
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .host-open-screen {
    min-height: 34px;
    padding: 0 9px;
    font-size: 11px;
  }

  .host-open-screen-desktop {
    display: none;
  }

  .host-open-screen-mobile {
    display: inline;
  }

  .host-dashboard {
    display: grid;
    gap: 12px;
  }

  .host-main-panel,
  .host-side-panel,
  .host-side-sticky,
  .host-activity-grid {
    display: contents;
  }

  .host-stage-card {
    order: 1;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
  }

  .host-answer-overview {
    order: 2;
  }

  .host-player-answers {
    order: 3;
  }

  .host-side-scroll {
    order: 4;
    overflow: visible;
  }

  .host-focus-card,
  .host-desktop-actions,
  .host-utility-actions {
    display: none;
  }

  .host-stage-card h2 {
    font-size: 21px;
    line-height: 1.16;
  }

  .host-answer-status {
    min-width: 82px;
    padding: 9px;
  }

  .host-stage-timer {
    width: 94px;
    min-width: 94px;
  }

  .host-answer-status strong {
    font-size: 22px;
  }

  .host-stage-progress {
    height: 8px;
  }

  .host-stage-afterline {
    font-size: 12px;
  }

  .host-stage-options {
    gap: 8px;
  }

  .host-stage-option {
    min-height: 58px;
    padding: 10px 11px;
  }

  .host-stage-content.has-media {
    grid-template-columns: minmax(0, 1fr);
  }

  .host-stage-media-frame,
  .host-stage-section-media {
    height: min(42dvh, 260px);
  }

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

  .host-activity-card {
    padding: 14px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(30, 36, 64, 0.08);
  }

  .host-section-head h3 {
    font-size: 15px;
  }

  .host-stat-list {
    gap: 7px;
    overflow: visible;
  }

  .host-stat-option {
    padding: 10px 11px;
    border-radius: 13px;
  }

  .host-stat-option > div:first-child {
    font-size: 13px;
  }

  .host-stat-bar {
    height: 7px;
    margin-top: 7px;
  }

  .host-player-list {
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 280px;
  }

  .host-player-row {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .host-player-row strong {
    font-size: 14px;
  }

  .host-player-row span {
    font-size: 11px;
  }

  .host-player-row em {
    max-width: 150px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .host-side-scroll .host-timeline {
    box-shadow: 0 12px 32px rgba(30, 36, 64, 0.08);
  }

  .host-side-panel .host-timeline-list {
    max-height: 220px;
  }

  .host-mobile-actions {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 35;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px;
    background: rgba(255, 253, 249, 0.97);
    border: 1px solid #e7dcc8;
    border-radius: 17px;
    box-shadow: 0 12px 32px rgba(30, 36, 64, 0.14);
    backdrop-filter: blur(12px);
  }

  .host-mobile-actions > button {
    min-width: 0;
    min-height: 52px;
    padding-inline: 12px;
    border-radius: 13px;
  }

  .host-mobile-actions-active {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .host-mobile-actions-active > button {
    min-height: 46px;
    padding: 0;
  }

  .host-mobile-actions-active .host-mobile-compact,
  .host-mobile-actions-active .host-mobile-back {
    flex: 0 0 44px;
  }

  .host-mobile-actions-active .host-mobile-compact {
    gap: 3px;
  }

  .host-mobile-actions-active .host-mobile-compact span {
    font-size: 10px;
    line-height: 1;
  }

  .host-mobile-actions-active .host-mobile-next {
    flex: 1 1 96px;
    min-height: 50px;
    margin-left: 1px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .host-mobile-actions > .primary-btn.full {
    grid-column: 1 / -1;
  }

  .host-mobile-actions-ended {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .host-mobile-actions-ended > .primary-btn.full {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .host-session-workspace {
    padding-inline: 8px;
  }

  .host-session-topbar {
    padding-inline: 8px;
  }

  .host-open-screen {
    gap: 5px;
    padding-inline: 8px;
  }

  .host-open-screen > i {
    display: none;
  }

  .host-stage-head {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 8px;
  }

  .host-stage-indicators {
    display: grid;
    gap: 5px;
  }

  .host-stage-card h2 {
    font-size: 20px;
  }

  .host-stage-timer,
  .host-answer-status {
    width: 88px;
    min-width: 74px;
    padding-inline: 6px;
  }

  .host-mobile-actions {
    right: 8px;
    left: 8px;
  }

  .host-mobile-actions > button {
    padding-inline: 9px;
    font-size: 13px;
  }

  .host-mobile-actions-active > button {
    padding-inline: 0;
  }

  .host-mobile-actions-active .host-mobile-next {
    padding-inline: 8px;
  }
}

/* Mobile pass: compact public flows without horizontal overflow or false whitespace. */
html,
body,
#app {
  min-height: 100%;
  min-height: 100dvh;
}

@media (max-width: 680px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  .auth-screen,
  .entry-screen,
  .player-screen,
  .game-screen {
    width: 100%;
    min-width: 0;
    min-height: 100svh;
    min-height: 100dvh;
    background-size: 150px;
  }

  .auth-screen {
    height: 100svh;
    height: 100dvh;
    padding: 8px;
    overflow: hidden;
    background-position: right -36px bottom -28px;
  }

  .auth-card {
    width: min(400px, 100%);
    max-height: calc(100dvh - 16px);
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-width: 2px;
    border-radius: 20px;
    box-shadow: 6px 6px 0 rgba(24, 33, 58, .28);
  }

  .auth-card > img {
    width: 68px;
    height: 68px;
    margin: -2px auto 0;
  }

  .auth-back {
    top: 8px;
    left: 8px;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .auth-kicker {
    font-size: 12px;
  }

  .auth-card h1 {
    margin: 7px 0 5px;
    font-size: 23px;
    line-height: 1.12;
  }

  .auth-card > p {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
  }

  .login-form {
    gap: 9px;
    margin-top: 12px;
  }

  .login-form label {
    gap: 4px;
    font-size: 11px;
  }

  .login-form input {
    min-height: 40px;
    padding: 8px 10px;
  }

  .login-form .primary-btn {
    min-height: 42px;
  }

  .player-screen {
    place-items: start center;
    align-content: start;
    padding: 8px;
    overflow-x: hidden;
    background-position: left -48px bottom -38px;
  }

  .player-card {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    padding: 14px;
    border-width: 2px;
    border-radius: 20px;
    box-shadow: 6px 6px 0 rgba(24, 33, 58, .26);
  }

  .player-card-top {
    align-items: center;
    min-width: 0;
    margin-bottom: 12px;
  }

  .player-brand {
    min-width: 0;
    margin: 0;
  }

  .player-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .player-brand .brand-mark img {
    width: 46px;
    height: 46px;
  }

  .player-brand strong {
    font-size: 16px;
  }

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

  .player-card-top .connection-badge {
    margin: 0;
  }

  .join-form,
  .player-question,
  .player-state {
    gap: 10px;
    min-width: 0;
  }

  .join-form h1,
  .player-question h1,
  .player-state h1 {
    margin: 0;
    font-size: clamp(22px, 7vw, 27px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .join-form > p,
  .player-question > p,
  .player-state > p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
  }

  .join-form label {
    gap: 4px;
  }

  .join-form input {
    min-height: 42px;
  }

  .player-options,
  .player-image-options {
    gap: 8px;
    min-width: 0;
  }

  .player-option {
    min-width: 0;
    padding: 11px 12px;
    border-radius: 14px;
  }

  .player-option span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .answer-sent-state {
    padding: 12px 0 4px;
  }

  .answer-sent-icon {
    width: 54px;
    height: 54px;
    font-size: 25px;
  }

  .late-join-notice {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    margin-bottom: 9px;
    padding: 10px;
  }

  .late-join-notice > i {
    width: 34px;
    height: 34px;
  }

  .selection-hint {
    margin: 0;
  }

  .game-screen {
    padding: 6px;
    overflow-x: hidden;
    background-position: left -50px bottom -42px;
  }

  .stage.public-stage {
    width: 100%;
    min-width: 0;
    min-height: calc(100svh - 12px);
    min-height: calc(100dvh - 12px);
    padding: 12px;
    border-radius: 18px;
    background-position: right -18px bottom -14px;
    background-size: 96px;
  }

  .stage-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .stage-top > div:first-child {
    min-width: 0;
    flex: none;
  }

  .stage-top p {
    margin: 0 0 3px;
    font-size: 11px;
    line-height: 1.2;
  }

  .stage-top h2 {
    margin: 0;
    font-size: clamp(21px, 7vw, 28px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .stage-status {
    align-items: flex-start;
  }

  .stage .phase-pill {
    padding: 6px 8px;
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
  }

  .waiting-hero,
  .slide-insert,
  .section-screen {
    min-width: 0;
    min-height: 0;
    align-content: center;
    justify-items: center;
    gap: 10px;
  }

  .waiting-hero > *,
  .slide-insert > *,
  .section-screen > * {
    margin-block: 0;
  }

  .public-qr-image,
  .qr-stage #joinQr {
    width: min(46vw, 180px, 26dvh);
    height: min(46vw, 180px, 26dvh);
    padding: 8px;
    border-width: 2px;
    border-radius: 14px;
    box-shadow: 5px 5px 0 var(--gold);
  }

  .waiting-hero p,
  .slide-insert p,
  .section-screen p {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.28;
  }

  .qr-stage strong {
    font-size: clamp(28px, 10vw, 40px);
  }

  .section-screen h3 {
    max-width: 100%;
    font-size: clamp(28px, 10vw, 42px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .question-stage-content {
    gap: 8px;
    min-width: 0;
  }

  .question-status-line {
    gap: 6px;
    margin-bottom: 0;
  }

  .stage .timer-panel {
    grid-template-columns: auto auto minmax(50px, 1fr);
    gap: 5px;
    padding: 6px 8px;
  }

  .question-meta-line {
    gap: 6px;
  }

  .question-meta-line span {
    padding: 6px 8px;
    font-size: 10px;
  }

  .stage .question-body {
    margin: 0;
    font-size: clamp(15px, 4.5vw, 19px);
    line-height: 1.28;
    overflow-wrap: anywhere;
  }

  .answer-options,
  .image-options {
    gap: 8px;
    margin-top: 2px;
  }

  .answer-tile {
    min-width: 0;
    min-height: 58px;
    padding: 10px 11px;
    border-radius: 14px;
  }

  .answer-tile span {
    min-width: 0;
    font-size: clamp(14px, 4.3vw, 17px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .answer-tile strong {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .image-options .answer-tile {
    grid-template-columns: 74px minmax(0, 1fr) auto;
  }

  .answer-tile img {
    height: 56px;
  }

  .winners {
    gap: 7px;
    width: 100%;
    margin: 4px auto 0;
  }

  .winner {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 14px;
  }

  .winner span {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .winner strong,
  .winner em {
    min-width: 0;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .winner em {
    grid-column: auto;
    white-space: nowrap;
  }

  .rank-1 {
    transform: none;
  }
}

@media (max-width: 420px) and (max-height: 700px) {
  .auth-card {
    padding: 12px 14px;
  }

  .auth-card > img {
    width: 56px;
    height: 56px;
  }

  .auth-card h1 {
    font-size: 21px;
  }

  .player-card {
    padding: 12px;
  }

  .player-card-top {
    margin-bottom: 9px;
  }

  .join-form,
  .player-question,
  .player-state {
    gap: 8px;
  }

  .public-qr-image,
  .qr-stage #joinQr {
    width: min(40vw, 145px, 23dvh);
    height: min(40vw, 145px, 23dvh);
  }

  .answer-tile {
    min-height: 50px;
    padding: 8px 10px;
  }
}

/* Consistent content rhythm and responsive density. */
.stage.public-stage {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  row-gap: clamp(22px, 4vh, 42px);
}

.public-stage .stage-top {
  display: block;
  margin: 0;
}

.public-stage .stage-top > div:first-child {
  width: 100%;
  height: auto;
  flex: none;
}

.public-stage > .waiting-hero,
.public-stage > .slide-insert,
.public-stage > .section-screen,
.public-stage > .question-stage-content,
.public-stage > .winners {
  width: 100%;
  min-height: 0;
  flex: none;
  align-self: start;
}

.public-stage > .waiting-hero,
.public-stage > .slide-insert,
.public-stage > .section-screen {
  align-content: start;
  justify-items: center;
  gap: clamp(14px, 2.5vh, 24px);
}

.slide-image,
.player-slide-image {
  display: block;
  width: auto;
  max-width: min(760px, 100%);
  max-height: min(48vh, 520px);
  margin-inline: auto;
  object-fit: contain;
  border-radius: 22px;
}

.round-body > .title-grid + .round-items {
  margin-top: 18px;
}

.bottom-item-toolbar .ghost-btn {
  min-width: 0;
  padding-inline: 9px;
  font-size: 12px;
}

.launch-dialog .dialog-actions {
  margin-top: 24px;
}

.question-number {
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border-radius: 10px;
  line-height: 1;
}

.image-source-editor {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.image-source-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.image-source-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.image-source-or,
.image-source-editor small {
  color: var(--muted);
  font-size: 11px;
}

.image-upload-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--blue);
  background: #eef1ff;
  border: 1px solid #cbd4ff;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

/* Keep both image-source choices on the same visual baseline. */
.image-upload-btn,
.image-source-controls > input[type="url"] {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  padding-block: 9px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.1;
}

.image-upload-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-source-preview {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #17664e;
  font-size: 11px;
  font-weight: 760;
}

.image-source-preview img {
  width: 52px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 9px;
  background: #eef1f8;
}

.image-source-editor.compact .image-source-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.image-source-editor.compact .image-source-panel > small {
  display: none;
}

.image-source-editor.compact .image-upload-btn {
  min-height: 40px;
  padding-inline: 10px;
}

.mobile-editor-actions {
  display: none !important;
}

@media (max-width: 680px) {
  .sidebar {
    position: relative;
  }

  .sidebar .brand {
    padding-right: 86px;
  }

  .sidebar-account {
    position: absolute;
    top: 14px;
    right: 14px;
    bottom: auto;
    left: auto;
    grid-column: auto;
    width: auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar-logout {
    min-height: 34px;
    margin: 0;
    padding: 7px 10px;
    color: white;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    font-size: 12px;
  }

  .dashboard-quiz,
  .quiz-row {
    min-height: 0;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 9px 10px;
    padding: 12px;
    border-left-width: 6px;
    border-radius: 18px;
  }

  .dashboard-quiz .quiz-art {
    grid-column: 1;
    grid-row: 1;
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .dashboard-quiz .quiz-art img {
    width: 54px;
    height: 54px;
  }

  .dashboard-quiz .quiz-row-main {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .dashboard-quiz .quiz-row-main strong {
    font-size: 16px;
    line-height: 1.1;
  }

  .dashboard-quiz .quiz-row-main span {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.28;
  }

  .dashboard-quiz .quiz-meta {
    grid-column: 2;
    gap: 6px;
  }

  .dashboard-quiz .quiz-meta span {
    padding: 5px 8px;
    font-size: 10px;
  }

  .dashboard-quiz .row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 38px;
    grid-column: 1 / -1;
    grid-row: auto;
    gap: 6px;
    width: 100%;
  }

  .dashboard-quiz .row-actions .ghost-btn,
  .dashboard-quiz .row-actions .primary-btn {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px;
    font-size: 11px;
  }

  .dashboard-quiz .row-actions .icon-btn {
    width: 38px;
    min-height: 38px;
  }

  .editor-main {
    padding-bottom: 18px;
  }

  .round-block {
    padding: 12px;
    border-radius: 18px;
  }

  .round-body > .title-grid + .round-items {
    margin-top: 14px;
  }

  .question-block {
    padding: 10px;
    border-left-width: 5px;
    border-radius: 16px;
  }

  .question-head {
    gap: 8px;
    margin-bottom: 0;
  }

  .question-title {
    gap: 8px;
  }

  .question-title strong {
    font-size: 14px;
    line-height: 1.15;
  }

  .question-title em {
    font-size: 10px;
  }

  .question-body-fields {
    gap: 9px;
    padding-top: 10px;
  }

  .question-body-fields > label {
    gap: 4px;
    font-size: 11px;
  }

  .question-body-fields input,
  .question-body-fields textarea {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .question-body-fields textarea {
    min-height: 70px;
  }

  .inline-validation {
    gap: 5px;
    padding: 9px 10px;
  }

  .options-editor {
    gap: 7px;
    margin-top: 4px;
  }

  .option-line {
    grid-template-columns: 22px minmax(0, 1fr) 34px;
    gap: 6px;
    align-items: start;
    padding: 7px;
    border-radius: 12px;
  }

  .option-line > input[type="radio"],
  .option-line > input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
    margin-top: 10px;
  }

  .option-line > input[data-bind="option-text"] {
    grid-column: 2;
    grid-row: 1;
  }

  .option-line > .icon-btn {
    grid-column: 3;
    grid-row: 1;
    width: 34px;
    min-height: 34px;
  }

  .image-source-editor.compact {
    grid-column: 2 / -1;
  }

  .image-source-controls,
  .image-source-editor.compact .image-source-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .image-source-or {
    display: none;
  }

  .image-upload-btn,
  .image-source-editor.compact .image-upload-btn {
    min-height: 40px;
    padding: 8px 10px;
  }

  .image-upload-btn span {
    display: none;
  }

  .image-source-preview img {
    width: 44px;
    height: 36px;
  }

  .bottom-item-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .bottom-item-toolbar .ghost-btn {
    min-height: 38px;
    padding: 7px 6px;
    font-size: 10px;
  }

  .stage.public-stage {
    grid-template-rows: auto auto;
    min-height: calc(100dvh - 12px);
    align-content: start;
    row-gap: 16px;
  }

  .public-stage > .waiting-hero,
  .public-stage > .slide-insert,
  .public-stage > .section-screen {
    align-content: start;
    gap: 10px;
  }

  .slide-image,
  .player-slide-image {
    max-height: 34dvh;
    border-radius: 14px;
  }
}

/* Responsive answer media and compact host/editor controls. */
.answer-tile.has-image {
  column-gap: clamp(18px, 2vw, 28px);
}

.image-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 20px);
  align-items: stretch;
}

.image-options .answer-tile {
  grid-template-columns: clamp(112px, 12vw, 168px) minmax(0, 1fr) auto;
  gap: clamp(12px, 1.4vw, 20px);
  min-width: 0;
  min-height: 148px;
  padding: clamp(12px, 1.4vw, 18px);
}

.answer-image-frame,
.player-option-media {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 14px;
}

.answer-image-frame img,
.player-option-media img,
.image-options .answer-tile img,
.player-image-options .player-option img {
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0;
}

.answer-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.answer-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.image-options .correct-label {
  white-space: normal;
}

.player-image-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.player-image-options .player-option,
.review-options.player-image-options .player-option {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: start;
  align-items: start;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 10px;
}

.player-image-options .player-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.player-image-options .player-option > span:not(.player-option-media) {
  min-width: 0;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.player-image-options.review-options .player-option > strong {
  justify-self: start;
  font-size: 12px;
}

@media (max-width: 680px) {
  .control-panel .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
    margin-bottom: 14px;
  }

  .control-panel .panel-head h2,
  .control-panel .panel-head p {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
  }

  .control-panel .panel-head h2 {
    font-size: clamp(22px, 7vw, 27px);
    line-height: 1.08;
  }

  .control-panel .panel-head p {
    font-size: 13px;
    line-height: 1.35;
  }

  .bottom-item-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 12px;
  }

  .bottom-item-toolbar .toolbar-label {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    font-size: 11px;
  }

  .bottom-item-toolbar .ghost-btn {
    justify-content: flex-start;
    gap: 7px;
    min-height: 42px;
    padding: 8px 9px;
    font-size: 11px;
    line-height: 1.18;
    text-align: left;
    white-space: normal;
  }

  .bottom-item-toolbar .ghost-btn span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .host-screen-launcher {
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
    padding: 13px;
    border-radius: 20px;
  }

  .host-screen-launcher > div:first-child {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    width: 100%;
    min-width: 0;
  }

  .host-screen-launcher > div:first-child > i {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 21px;
  }

  .host-screen-launcher > div:first-child > span {
    min-width: 0;
  }

  .host-screen-launcher strong {
    font-size: 14px;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .host-screen-launcher small {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .host-screen-launcher .screen-launch-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .host-screen-launcher .screen-launch-actions > * {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 9px;
    font-size: 11px;
    line-height: 1.18;
    text-align: center;
    white-space: normal;
  }

  .image-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .image-options .answer-tile {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(32px, auto);
    align-content: start;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 8px;
  }

  .image-options .answer-image-frame {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .image-options .answer-copy {
    grid-column: 1;
    grid-row: 2;
    align-content: center;
    gap: 4px;
  }

  .image-options .answer-copy span {
    font-size: clamp(12px, 3.7vw, 15px);
    line-height: 1.18;
  }

  .image-options .answer-tile > strong {
    grid-column: 2;
    grid-row: 2;
    width: 30px;
    height: 30px;
  }

  .image-options .correct-label {
    font-size: 9px;
    line-height: 1.15;
  }

  .player-image-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .player-image-options .player-option,
  .review-options.player-image-options .player-option {
    gap: 7px;
    padding: 8px;
    border-radius: 14px;
  }

  .player-image-options .player-option > span:not(.player-option-media) {
    font-size: 12px;
    line-height: 1.22;
  }

  .player-image-options.review-options .player-option > strong {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .host-screen-launcher .screen-launch-actions,
  .bottom-item-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .bottom-item-toolbar .toolbar-label {
    grid-column: 1;
  }
}

/* Keep the question type controls full-width regardless of older toolbar grids. */
.bottom-item-toolbar {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

.bottom-item-toolbar .toolbar-label,
.bottom-item-toolbar .question-type-choices {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.bottom-item-toolbar .question-type-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Stack optional image controls on phones so the URL field never overflows. */
@media (max-width: 680px) {
  .image-source-editor,
  .image-source-editor.compact,
  .image-source-panel,
  .image-source-controls,
  .image-source-editor.compact .image-source-controls {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .image-source-controls,
  .image-source-editor.compact .image-source-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
  }

  .image-upload-btn,
  .image-source-editor.compact .image-upload-btn,
  .image-source-controls > input[type="url"] {
    grid-column: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .image-upload-btn span,
  .image-source-editor.compact .image-upload-btn span {
    display: inline;
  }

  .image-source-controls .image-remove-btn {
    grid-column: 1;
    justify-self: start;
  }

  .image-source-editor summary span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .image-source-editor:not(.compact) summary {
    grid-template-columns: 22px minmax(0, 1fr) 18px;
    grid-template-rows: auto auto;
    grid-template-areas:
      "image title caret"
      "image note caret";
    column-gap: 9px;
    row-gap: 2px;
    min-height: 64px;
    padding: 9px 11px;
  }

  .image-source-editor:not(.compact) summary > .ph-image {
    grid-area: image;
    align-self: center;
  }

  .image-source-editor:not(.compact) summary > span {
    grid-area: title;
    align-self: end;
    font-size: 14px;
    line-height: 1.2;
    overflow-wrap: normal;
  }

  .image-source-editor:not(.compact) summary > small {
    grid-area: note;
    align-self: start;
    line-height: 1.2;
  }

  .image-source-editor:not(.compact) summary > .ph-caret-down {
    grid-area: caret;
    align-self: center;
  }

  .image-source-editor.compact summary {
    grid-template-columns: 18px minmax(0, 1fr) 16px;
    grid-template-rows: auto auto;
    grid-template-areas:
      "image title caret"
      "image status caret";
    column-gap: 7px;
    row-gap: 4px;
    min-height: 58px;
    padding: 7px 8px;
  }

  .image-source-editor.compact summary > .ph-image {
    grid-area: image;
    align-self: center;
  }

  .image-source-editor.compact summary > span {
    grid-area: title;
    align-self: end;
    line-height: 1.2;
  }

  .image-source-editor.compact summary > .image-source-status {
    grid-area: status;
    align-self: start;
    justify-self: start;
  }

  .image-source-editor.compact summary > .ph-caret-down {
    grid-area: caret;
    align-self: center;
  }
}

/* Final responsive release pass: keep editor controls aligned at every width. */
@media (min-width: 681px) {
  .question-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .question-title {
    width: 100%;
    min-width: 0;
  }

  .question-actions {
    display: grid;
    grid-template-columns: repeat(5, 38px);
    align-items: start;
    justify-content: end;
    width: auto;
    min-width: max-content;
    gap: 6px;
  }

  .question-actions .icon-btn,
  .question-actions .drag-handle {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .option-line {
    align-items: start;
  }

  .option-line > input[type="radio"],
  .option-line > input[type="checkbox"] {
    align-self: start;
    margin-top: 15px;
  }

  .option-line > .icon-btn {
    align-self: start;
    margin-top: 3px;
  }

  .image-source-controls {
    grid-template-columns: minmax(120px, .85fr) auto minmax(150px, 1.15fr) auto;
  }

  .image-source-controls .image-remove-btn {
    min-width: max-content;
    justify-self: end;
    white-space: nowrap;
  }

  .image-source-editor.compact .image-source-controls {
    grid-template-columns: minmax(105px, .9fr) minmax(135px, 1.1fr) auto;
    gap: 6px;
  }

  .image-source-editor.compact .image-source-or {
    display: none;
  }

  .image-source-editor.compact .image-upload-btn {
    min-width: 0;
    padding-inline: 8px;
    font-size: 11px;
  }

  .image-source-editor.compact .image-source-controls > input[type="url"] {
    width: 100%;
    min-width: 0;
  }

  .image-source-editor.compact .image-remove-btn {
    padding-inline: 7px;
    font-size: 12px;
  }
}

@media (min-width: 681px) and (max-width: 1120px) {
  .editor-grid,
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .image-source-controls .image-remove-btn {
    width: 100%;
    min-height: 38px;
    justify-self: stretch;
    color: var(--qz-color-danger);
    background: white;
    border: 1px solid #efb8c3;
    border-radius: 10px;
  }
}

/* Keep the host activity cards on one shared vertical rhythm. */
.answer-monitor,
.players-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
}

.answer-monitor .panel-head,
.players-panel .panel-head {
  margin: 0;
}

.answer-monitor .panel-head h2,
.players-panel .panel-head h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

@media (max-width: 680px) {
  .answer-monitor,
  .players-panel {
    gap: 12px;
    padding: 12px;
  }
}

/* Give launch choices a full-width reading order on phones. */
@media (max-width: 680px) {
  .launch-grid .quiz-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .launch-grid .quiz-row-main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .launch-grid .quiz-row-main strong {
    margin-bottom: 3px;
    font-size: 17px;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .launch-grid .quiz-row-main span {
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: normal;
  }

  .launch-grid .quiz-row > .primary-btn {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
  }
}

/* Quiz launch hub and the calm hand-off after a game ends. */
.host-launch-scene,
.host-finished-scene {
  display: grid;
  gap: 24px;
  width: min(100%, 1060px);
}

.host-quiz-picker {
  min-width: 0;
}

.host-quiz-picker .quiz-list {
  display: grid;
  gap: 14px;
}

.host-quiz-choice {
  grid-template-columns: 68px minmax(0, 1fr) auto;
}

.host-quiz-choice .quiz-art {
  width: 60px;
  height: 60px;
  border-radius: 19px;
}

.host-quiz-choice .quiz-art img {
  width: 66px;
  height: 66px;
}

.host-quiz-choice .quiz-row-main {
  min-width: 0;
}

.host-finished-card {
  display: grid;
  grid-template-columns: 132px minmax(250px, 1fr) minmax(330px, .9fr);
  grid-template-areas:
    "art copy stats"
    "art actions actions";
  align-items: center;
  gap: 20px 28px;
  min-width: 0;
  padding: 30px;
}

.host-finished-art {
  grid-area: art;
  width: 132px;
  height: 132px;
  object-fit: contain;
  transform: rotate(-7deg);
}

.host-finished-copy {
  grid-area: copy;
  min-width: 0;
}

.host-finished-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.host-finished-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.06;
}

.host-finished-copy p {
  max-width: 620px;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

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

.host-finished-stats > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  min-height: 88px;
  padding: 14px;
}

.host-finished-stats dt {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.host-finished-stats dd {
  min-width: 0;
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.host-finished-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.host-finished-actions .primary-btn,
.host-finished-actions .ghost-btn {
  min-width: 190px;
}

@media (max-width: 1100px) {
  .host-finished-card {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-areas:
      "art copy"
      "stats stats"
      "actions actions";
  }

  .host-finished-art {
    width: 112px;
    height: 112px;
  }
}

@media (max-width: 680px) {
  .host-launch-scene,
  .host-finished-scene {
    gap: 16px;
  }

  .host-finished-card {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
      "art copy"
      "stats stats"
      "actions actions";
    gap: 18px 14px;
    padding: 20px 16px;
  }

  .host-finished-art {
    width: 72px;
    height: 72px;
  }

  .host-finished-copy h2 {
    font-size: 26px;
  }

  .host-finished-copy p {
    font-size: 14px;
  }

  .host-finished-stats {
    gap: 7px;
  }

  .host-finished-stats > div {
    min-height: 82px;
    padding: 11px 8px;
  }

  .host-finished-stats dt {
    font-size: 10px;
  }

  .host-finished-stats dd {
    font-size: 18px;
  }

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

  .host-finished-actions .primary-btn,
  .host-finished-actions .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .host-quiz-choice {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .host-quiz-choice .quiz-art {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .host-quiz-choice .quiz-art img {
    width: 56px;
    height: 56px;
  }

  .host-quiz-choice > .primary-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Calm editor: reduce simultaneous information and keep color semantic. */
.editor-shell {
  grid-template-columns: minmax(0, 1fr);
}

.editor-shell > .sidebar {
  display: none;
}

.editor-shell .workspace {
  grid-column: 1;
  width: 100%;
  background: #fff9ed;
}

.editor-shell .mobile-editor-title,
.editor-shell .editor-back-label-mobile {
  display: none;
}

.editor-shell .editor-back-button {
  width: fit-content;
  min-height: 44px;
  margin: 0 0 16px;
  padding: 9px 14px;
  color: var(--blue);
  white-space: nowrap;
}

.editor-shell .topbar h1 {
  font-size: 24px;
  line-height: 1.2;
}

.calm-editor {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 32px;
}

.calm-editor-main {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.calm-quiz-meta {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.calm-quiz-meta label {
  color: var(--muted);
  font-size: 14px;
}

.calm-quiz-meta input,
.calm-quiz-meta textarea {
  color: var(--ink);
  background: rgba(255, 255, 255, .92);
  border: 1px solid #d9d2c5;
  border-radius: 14px;
}

.calm-quiz-meta textarea {
  min-height: 54px;
  line-height: 1.45;
}

.calm-editor textarea[data-autogrow] {
  box-sizing: border-box;
  width: 100%;
  min-height: 54px;
  overflow-y: hidden;
  line-height: 1.45;
  resize: none;
}

.calm-validation {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  margin: 20px 0 28px;
  padding: 12px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, .58);
  border: 1px solid #ddd6ca;
  border-radius: 14px;
}

.calm-validation.has-errors,
.calm-validation.ready {
  color: var(--muted);
  background: rgba(255, 255, 255, .58);
  border-color: #ddd6ca;
}

.calm-validation > i,
.calm-validation.ready > i {
  width: 18px;
  height: 18px;
  color: #e7ad24;
  background: transparent;
  border-radius: 0;
  font-size: 17px;
}

.calm-validation.ready > i {
  color: #19815f;
}

.calm-validation > i::before {
  color: currentColor;
}

.calm-validation strong {
  color: var(--ink-2);
  font-size: 14px;
}

.calm-validation p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.rounds-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 16px;
  padding-top: 24px;
  border-top: 1px solid #ddd6ca;
}

.rounds-section-head h2,
.rounds-section-head p {
  margin: 0;
}

.rounds-section-head h2 {
  font-size: 24px;
}

.rounds-section-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.rounds-section-head .secondary-btn {
  flex: 0 0 auto;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--blue);
  box-shadow: none;
}

.calm-editor .rounds-list {
  gap: 12px;
}

.calm-editor .round-block {
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #ded8ce;
  border-radius: 18px;
  box-shadow: none;
}

.calm-editor .round-block.has-errors,
.calm-editor .question-block.has-errors {
  border-color: #d9b34e;
}

.calm-editor .round-head {
  padding: 14px 16px;
}

.calm-editor .round-summary {
  grid-template-columns: 34px minmax(110px, auto) minmax(0, 1fr) 18px;
}

.calm-editor .round-summary > span,
.calm-editor .question-number {
  color: var(--ink-2);
  background: #f0f1f5;
  border-radius: 10px;
}

.calm-editor .round-body {
  margin: 0;
  padding: 18px;
  border-top: 1px solid #e3ddd3;
}

.calm-editor .question-block {
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e1ddd5;
  border-left-width: 1px;
  border-radius: 15px;
  box-shadow: none;
}

.calm-editor .question-block:hover {
  border-color: #cfd4df;
  box-shadow: none;
}

.calm-editor .question-head {
  min-height: 58px;
  margin: 0;
  padding: 9px 12px;
}

.calm-editor .question-body-fields[hidden] {
  display: none !important;
}

.calm-editor .question-block.collapsed .question-actions {
  display: none;
}

.calm-editor .question-body-fields {
  padding: 14px;
  border-top: 1px solid #ece8e0;
}

.calm-editor .round-settings {
  margin: 0 0 14px;
  background: #fbfaf7;
  border: 1px solid #e5e0d7;
  border-radius: 13px;
}

.calm-editor .round-settings > summary,
.calm-editor .bottom-item-toolbar > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.calm-editor .round-settings > summary::-webkit-details-marker,
.calm-editor .bottom-item-toolbar > summary::-webkit-details-marker {
  display: none;
}

.calm-editor .round-settings:not([open]) > .title-grid,
.calm-editor .bottom-item-toolbar:not([open]) > .question-type-choices {
  display: none !important;
}

.calm-editor .round-settings > summary span,
.calm-editor .round-settings > summary strong,
.calm-editor .round-settings > summary small {
  display: block;
}

.calm-editor .round-settings > summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.calm-editor .round-settings[open] > summary,
.calm-editor .bottom-item-toolbar[open] > summary {
  border-bottom: 1px solid #e5e0d7;
}

.calm-editor .round-settings[open] > summary > .disclosure-caret,
.calm-editor .bottom-item-toolbar[open] > summary > .disclosure-caret {
  transform: rotate(180deg);
}

.calm-editor .round-settings .title-grid {
  grid-template-columns: minmax(0, 1fr);
  padding: 14px;
}

.calm-editor .round-settings-fields > .image-source-editor {
  grid-column: 1 / -1;
}

.round-hero-image,
.player-round-image {
  display: block;
  width: min(100%, 760px);
  max-height: 360px;
  margin: 0 auto 8px;
  object-fit: contain;
  border-radius: 22px;
}

.round-hero-image {
  border: 2px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .12);
}

.player-round-image {
  max-height: 280px;
  border: 2px solid #cfd7ff;
  background: #eef1ff;
}

.mini-stage-image {
  display: block;
  width: 100%;
  max-height: 220px;
  margin: 4px 0 2px;
  border-radius: 18px;
  object-fit: contain;
  background: var(--qz-color-neutral-soft);
}

.calm-editor .drag-handle,
.calm-editor .icon-btn {
  color: var(--muted);
  background: #fff;
  border: 1px solid #ded8ce;
  box-shadow: none;
}

.calm-editor .icon-btn.danger {
  color: #c53f59;
  background: #fff;
  border-color: #ead6da;
}

.calm-editor .bottom-item-toolbar {
  display: block;
  overflow: hidden;
  margin-top: 14px !important;
  padding: 0;
  background: #fff;
  border: 1px solid #ddd6ca;
  border-radius: 13px;
}

.calm-editor .bottom-item-toolbar > summary {
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  color: var(--blue);
  font-weight: 760;
}

.calm-editor .bottom-item-toolbar .question-type-choices {
  padding: 12px;
}

.calm-editor .question-type-choice {
  background: #fff;
  border: 1px solid #d8dde9;
  border-radius: 14px;
  box-shadow: none;
}

.calm-editor .question-type-choice > i {
  color: var(--blue);
  background: #f0f3ff;
}

.calm-settings-panel {
  top: 28px;
  display: flex;
  min-height: 0;
  align-self: start;
  padding: 24px;
  flex-direction: column;
  gap: 0;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #d9d6d0;
  border-radius: 20px;
  box-shadow: none;
}

.calm-settings-panel .panel-head {
  margin-bottom: 22px;
}

.calm-settings-panel .panel-head h2 {
  font-size: 24px;
}

.calm-settings-panel .panel-head p {
  margin-top: 6px;
  color: var(--muted);
}

.calm-mode-switch {
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 1px solid #d9d6d0;
  border-radius: 12px;
}

.calm-mode-switch button {
  min-height: 50px;
  padding: 10px 12px;
  text-align: center;
  border-radius: 0;
}

.calm-mode-switch button + button {
  border-left: 1px solid #d9d6d0;
}

.calm-mode-switch button.active {
  color: var(--blue);
  background: #eef1ff;
  box-shadow: none;
}

.calm-mode-switch button small {
  display: none;
}

.calm-points-field {
  min-height: 74px;
  margin: 20px 0 0;
  column-gap: 12px;
  padding: 16px;
  background: #f7f8fd;
  border: 1px solid #dfe3ef;
  border-radius: 14px;
}

.calm-points-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  background: #fff;
  border: 1px solid #d9d6d0;
}

.advanced-settings {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e3ddd3;
  border-bottom: 1px solid #e3ddd3;
}

.advanced-settings-heading {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
}

.advanced-settings-heading strong,
.advanced-settings-heading small {
  display: block;
  min-width: 0;
}

.advanced-settings-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.advanced-settings-body {
  padding: 0 0 16px;
}

.manual-mode-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.calm-launch-button {
  margin-top: 20px;
  box-shadow: none;
}

.mobile-quiz-settings,
.calm-mobile-launch {
  display: none;
}

@media (min-width: 681px) and (max-width: 1120px) {
  .calm-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .calm-settings-panel {
    min-height: 0;
  }

  .calm-launch-button {
    margin-top: 24px;
  }
}

@media (max-width: 680px) {
  .editor-shell {
    display: block;
  }

  .editor-shell > .sidebar {
    display: none;
  }

  .editor-shell .workspace {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .editor-shell .topbar {
    position: sticky;
    z-index: 24;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 68px;
    width: calc(100% + 28px);
    max-width: none;
    margin: -14px -14px 24px;
    padding: 12px 14px;
    background: rgba(255, 249, 237, .96);
    border-bottom: 1px solid #ded8ce;
    backdrop-filter: blur(12px);
  }

  .editor-shell .topbar > div:first-child {
    display: contents;
  }

  .editor-shell .page-subtitle,
  .editor-shell .save-status {
    display: none;
  }

  .editor-shell .editor-back-button {
    display: flex;
    grid-column: 1;
    align-items: center;
    align-self: center;
    gap: 5px;
    min-height: 44px;
    min-width: 0;
    margin: 0;
    padding: 7px 10px;
  }

  .editor-shell .editor-back-label-wide {
    display: none;
  }

  .editor-shell .editor-back-label-mobile {
    display: inline;
  }

  .editor-shell .topbar h1 {
    display: flex;
    grid-column: 2;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    font-size: 24px;
    line-height: 1;
    white-space: nowrap;
  }

  .editor-shell .desktop-editor-title {
    display: none;
  }

  .editor-shell .mobile-editor-title {
    display: inline;
  }

  .editor-shell .top-actions {
    display: flex;
    grid-column: 3;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    min-height: 44px;
    width: auto;
    margin-left: auto;
    padding: 0;
  }

  .editor-shell .topbar .top-actions button[data-action="save-quiz"] {
    display: inline-flex;
    min-height: 44px;
    padding: 6px 4px;
    color: var(--blue);
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 15px;
    line-height: 1;
  }

  .editor-shell .topbar .top-actions button[data-action="save-quiz"] > i {
    display: none;
  }

  .calm-editor {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .calm-editor-main {
    padding: 0 0 18px;
  }

  .calm-quiz-meta {
    gap: 18px;
  }

  .calm-quiz-meta textarea {
    min-height: 54px;
  }

  .calm-editor textarea[data-autogrow] {
    min-height: 54px;
  }

  .calm-validation {
    margin: 18px 0;
    padding: 12px 14px;
  }

  .calm-validation p {
    display: none;
  }

  .calm-settings-panel {
    display: none;
  }

  .mobile-quiz-settings {
    display: block;
    margin: 0 0 28px;
    padding: 16px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid #d9d6d0;
    border-radius: 16px;
  }

  .mobile-settings-heading {
    display: block;
    margin-bottom: 18px;
    color: var(--ink);
  }

  .mobile-settings-heading strong,
  .mobile-settings-heading small {
    display: block;
    min-width: 0;
  }

  .mobile-settings-heading strong {
    font-size: 20px;
  }

  .mobile-settings-heading small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
  }

  .mobile-settings-body {
    padding: 0;
    border-top: 0;
  }

  .rounds-section-head {
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 14px;
    padding-top: 22px;
  }

  .rounds-section-head h2 {
    font-size: 22px;
    line-height: 1.2;
  }

  .rounds-section-head p {
    display: none;
  }

  .rounds-section-head .secondary-btn {
    width: auto;
    min-width: 96px;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .rounds-section-head .secondary-btn span {
    font-size: 0;
  }

  .rounds-section-head .secondary-btn span::after {
    content: "Раунд";
    font-size: 13px;
  }

  .calm-editor .round-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 13px;
  }

  .calm-editor .round-summary {
    grid-template-columns: 32px minmax(0, 1fr) 18px;
    gap: 8px;
  }

  .calm-editor .round-summary em {
    grid-column: 2;
  }

  .calm-editor .round-summary > .disclosure-caret {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .calm-editor .round-actions {
    margin: 0;
  }

  .calm-editor .round-actions .icon-btn {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .calm-editor .round-body {
    padding: 14px;
  }

  .round-hero-image,
  .player-round-image {
    max-height: 240px;
    border-radius: 16px;
  }

  .calm-editor .question-head {
    padding: 9px 10px;
  }

  .calm-editor .question-title {
    flex-wrap: nowrap;
  }

  .calm-editor .question-actions {
    grid-template-columns: repeat(5, 36px);
    gap: 4px;
  }

  .calm-editor .question-block.collapsed .question-actions {
    display: none;
  }

  .calm-editor .bottom-item-toolbar,
  .calm-editor .question-type-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calm-editor .question-type-choice {
    min-height: 92px;
  }

  .calm-mobile-launch {
    position: static;
    display: inline-flex;
    min-height: 54px;
    margin: 18px 0 0;
    box-shadow: none;
  }
}

@media (max-width: 390px) {
  .editor-shell .topbar h1 {
    font-size: 20px;
  }

  .editor-shell .topbar .top-actions button[data-action="save-quiz"] {
    font-size: 14px;
  }

  .rounds-section-head h2 {
    font-size: 20px;
  }

  .calm-editor .round-actions {
    justify-content: flex-end;
    gap: 5px;
  }

  .calm-editor .round-actions .icon-btn {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
  }
}

@media (max-width: 370px) {
  .editor-shell .topbar h1 {
    font-size: 18px;
  }

  .editor-shell .editor-back-button,
  .editor-shell .topbar .top-actions button[data-action="save-quiz"] {
    font-size: 13px;
  }
}

@media (max-width: 340px) {
  .editor-shell .topbar {
    grid-template-columns: minmax(96px, auto) minmax(0, 1fr) 40px;
  }

  .calm-mode-switch button {
    padding-inline: 4px;
  }

  .calm-mode-switch button strong {
    font-size: 12px;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .editor-shell .topbar .top-actions button[data-action="save-quiz"] {
    justify-content: center;
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .editor-shell .topbar .top-actions button[data-action="save-quiz"] span {
    display: none;
  }

  .editor-shell .editor-back-button {
    min-width: 96px;
    padding-inline: 7px;
  }

  .editor-shell .topbar .top-actions button[data-action="save-quiz"] > i {
    display: inline-block;
    font-size: 18px;
  }
}

/* Keep the public game canvas inside one TV or monitor viewport. */
.game-screen {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: clamp(10px, 1.5vw, 24px);
  overflow: hidden;
  background-image: none;
}

.stage.public-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(18px, 2.2vw, 34px);
  overflow: hidden;
  align-content: stretch;
  row-gap: clamp(12px, 2vh, 24px);
  background-position: right 22px bottom 18px;
  background-size: clamp(110px, 12vw, 180px);
}

.public-stage .stage-top {
  min-width: 0;
}

.public-stage .stage-top p {
  margin: 0 0 4px;
  font-size: clamp(13px, 1.25vw, 19px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.public-stage .stage-top h2 {
  max-width: min(100%, 1280px);
  margin: 0;
  font-size: clamp(28px, min(4.2vw, 6vh), 56px);
  line-height: 1.03;
  overflow-wrap: anywhere;
}

.public-stage.phase-section .stage-top h2 {
  font-size: clamp(20px, min(2.4vw, 4vh), 32px);
}

.public-stage > .section-screen,
.public-stage > .question-stage-content {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}

.section-screen {
  display: grid;
  place-items: center;
  gap: clamp(18px, 2.2vw, 34px);
  overflow: hidden;
}

.section-screen.has-media {
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  align-items: stretch;
  text-align: left;
}

.stage-media-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: clamp(16px, 1.8vw, 24px);
}

.round-hero-image,
.question-hero-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: inherit;
}

.section-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.5vh, 18px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.section-screen .section-copy h3 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(30px, min(4.4vw, 6.2vh), 64px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.section-screen .section-copy p {
  max-width: 100%;
  margin: 0;
  font-size: clamp(16px, min(2vw, 3vh), 26px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-screen:not(.has-media) .section-copy {
  align-items: center;
  max-width: min(100%, 1040px);
  text-align: center;
}

.question-stage-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.5vh, 16px);
  overflow: hidden;
}

.question-status-line {
  margin: 0;
}

.question-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 22px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.question-layout.answers-only {
  grid-template-rows: minmax(0, 1fr);
}

.question-layout.has-media {
  grid-template-columns: minmax(260px, .9fr) minmax(420px, 1.1fr);
  grid-template-rows: minmax(0, 1fr);
}

.question-prompt {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 14px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.question-layout.has-media .question-media-frame {
  flex: 1 1 auto;
}

.question-layout .question-body {
  max-width: 100%;
  margin: 0;
  flex: 0 0 auto;
  font-size: clamp(16px, min(2vw, 3vh), 28px);
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.question-layout .answer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  gap: clamp(8px, 1.2vw, 14px);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.question-layout .answer-tile {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: clamp(10px, 1.2vw, 18px);
  overflow: hidden;
}

.question-layout .answer-tile span {
  font-size: clamp(15px, min(1.7vw, 2.5vh), 24px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.stage-density-compact .section-copy h3 {
  font-size: clamp(26px, min(3.5vw, 5vh), 48px);
}

.stage-density-compact .question-layout .answer-tile span {
  font-size: clamp(15px, min(1.55vw, 2.3vh), 22px);
}

.stage-density-tight .section-copy h3 {
  font-size: clamp(22px, min(3vw, 4.2vh), 40px);
}

.stage-density-tight .question-layout .answer-tile span {
  font-size: clamp(14px, min(1.35vw, 2vh), 20px);
}

.stage-density-compact .section-copy p,
.stage-density-compact .question-layout .question-body,
.stage-density-tight .section-copy p,
.stage-density-tight .question-layout .question-body {
  font-size: clamp(14px, min(1.5vw, 2.2vh), 20px);
}

@media (max-width: 780px) {
  .game-screen {
    padding: 6px;
  }

  .stage.public-stage {
    min-height: 0;
    padding: 12px;
    row-gap: 10px;
    border-radius: 18px;
    background-size: 88px;
  }

  .section-screen.has-media,
  .question-layout.has-media {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-screen.has-media {
    grid-template-rows: minmax(0, 1fr) auto;
    text-align: center;
  }

  .section-screen.has-media .section-copy {
    align-items: center;
  }

  .question-layout.has-media {
    grid-template-rows: minmax(0, .8fr) minmax(0, 1.2fr);
  }

  .question-layout .answer-options {
    gap: 8px;
  }
}

@media (min-width: 781px) and (max-height: 720px) {
  .stage.public-stage {
    padding: 18px 22px;
    row-gap: 10px;
  }

  .public-stage .stage-top h2 {
    font-size: clamp(24px, min(3.6vw, 5.2vh), 42px);
  }

  .section-screen .section-copy h3 {
    font-size: clamp(26px, min(3.8vw, 5.4vh), 48px);
  }

  .question-stage-content,
  .question-layout {
    gap: 8px;
  }

  .question-layout .answer-tile {
    padding: 9px 12px;
  }
}

/* Keep option photos visibly rounded on phones, including square source images. */
@media (max-width: 680px) {
  .player-options.has-option-images .player-option-media {
    overflow: hidden;
    border-radius: 14px;
  }

  .player-options.has-option-images .player-option-media img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
  }
}

