:root {
  --ink: #18213a;
  --ink-2: #25304f;
  --surface: #fffdf7;
  --soft: #fff8e9;
  --line: #eadfca;
  --muted: #687086;
  --coral: #ff5d67;
  --gold: #ffd84d;
  --blue: #3155f5;
  --shadow: 0 14px 36px rgba(18, 24, 39, 0.10);
  font-family: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eef2f7;
}

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

button {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 109, 246, 0.35);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px;
  color: white;
  background: linear-gradient(180deg, #111827 0%, #172033 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand strong {
  display: block;
  font-size: 20px;
  font-weight: 720;
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: white;
  font-weight: 760;
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(47, 109, 246, 0.24);
}

.brand-home {
  padding: 0;
  border: 0;
}

.brand-home:hover img {
  transform: rotate(0deg) scale(1.06);
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.sidebar-note {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 24px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-note span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.sidebar-note strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: 2px;
}

.sidebar-trophy {
  position: absolute;
  left: 38px;
  bottom: 176px;
  width: 156px;
  height: 156px;
  object-fit: contain;
  transform: rotate(-5deg);
  pointer-events: none;
}

.workspace {
  min-width: 0;
  padding: 28px;
  background: var(--soft);
}

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

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.breadcrumb-link {
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  font: inherit;
}

.breadcrumb-link:hover {
  color: var(--coral);
  transform: none;
}

.breadcrumbs strong {
  color: var(--ink);
}

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

h1 {
  margin-bottom: 0;
  font-size: 36px;
  line-height: 1.02;
  font-weight: 680;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 680;
}

.top-actions,
.row-actions,
.item-toolbar,
.host-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.save-status,
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.save-status.saved {
  color: var(--blue);
  background: rgba(47, 109, 246, 0.10);
}

.save-status.unsaved {
  color: #9a6410;
  background: rgba(255, 216, 77, 0.18);
}

.connection-badge {
  color: var(--muted);
  background: rgba(104, 115, 133, 0.10);
}

.connection-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.connection-badge.live {
  color: var(--blue);
  background: rgba(47, 109, 246, 0.12);
}

.connection-badge.connecting i,
.connection-badge.reconnecting i {
  animation: connectionPulse 1.2s ease-in-out infinite;
}

.stage-status,
.player-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-status .connection-badge {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.10);
}

.player-card-top .connection-badge {
  margin-bottom: 34px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 10px;
  border: 0;
  font-weight: 680;
}

.primary-btn {
  padding: 0 18px;
  color: white;
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(47, 109, 246, 0.18);
}

.primary-btn.danger-btn {
  background: #d92348;
  box-shadow: 0 10px 22px rgba(217, 35, 72, 0.18);
}

.secondary-btn {
  padding: 0 18px;
  color: #14315f;
  background: #eaf1ff;
  border: 1px solid #cfdcff;
  box-shadow: none;
}

.ghost-btn {
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  backdrop-filter: none;
}

.ghost-btn.compact {
  min-height: 36px;
  font-size: 14px;
}

.icon-btn {
  width: 40px;
  min-height: 40px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.icon-btn.accent {
  color: white;
  background: var(--blue);
}

.icon-btn.danger {
  color: #d92348;
}

.full {
  width: 100%;
}

.dashboard-grid,
.launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.dashboard-scene {
  position: relative;
  min-height: calc(100vh - 190px);
  padding-bottom: 112px;
  overflow: hidden;
}

.dashboard-ribbon {
  position: absolute;
  left: 2%;
  bottom: -8px;
  width: min(86%, 980px);
  height: 150px;
  object-fit: contain;
  object-position: left bottom;
  pointer-events: none;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(18, 24, 39, 0.06);
  backdrop-filter: none;
  transition: transform 200ms ease, box-shadow 220ms ease, border-color 180ms ease;
}

.panel-head p,
.quiz-row-main span,
.empty,
.stage-top p,
.question-body {
  color: var(--muted);
}

.quiz-list {
  display: grid;
  gap: 12px;
}

.quiz-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.quiz-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(23, 22, 43, 0.08);
}

.quiz-row.selected {
  border-color: rgba(83, 117, 255, 0.55);
  box-shadow: inset 4px 0 0 var(--blue);
}

.quiz-row-main strong,
.quiz-row-main span {
  display: block;
}

.quiz-row-main strong {
  margin-bottom: 5px;
  font-size: 17px;
  font-weight: 680;
}

.quiz-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quiz-meta span,
.phase-pill,
.round-index {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: #eef1ff;
  font-size: 12px;
  font-weight: 680;
}

.festive-panel {
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
  border-color: #d7e2f7;
}

.festive-panel p {
  color: var(--muted);
}

.quick-generator {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.quick-generator label {
  color: var(--ink-2);
}

.quick-generator input,
.quick-generator select {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.quick-generator-row {
  display: grid;
  grid-template-columns: 0.75fr 1fr;
  gap: 10px;
}

.spark {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent 44%, white 44% 56%, transparent 56%),
    linear-gradient(0deg, transparent 44%, white 44% 56%, transparent 56%),
    var(--blue);
  box-shadow: 0 12px 24px rgba(47, 109, 246, 0.18);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.title-grid {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  outline: 0;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(83, 117, 255, 0.12);
}

.item-toolbar {
  margin: 18px 0;
}

.bottom-add-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed rgba(80, 104, 255, 0.35);
  border-radius: 12px;
  background: rgba(80, 104, 255, 0.06);
}

.bottom-add-panel strong {
  display: block;
  margin-bottom: 10px;
  font-weight: 680;
}

.bottom-toolbar {
  margin: 0;
}

.items-list {
  display: grid;
  gap: 14px;
}

.question-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.question-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.question-head div,
.question-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  font-weight: 700;
}

.options-editor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.option-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.option-line input[type="radio"],
.option-line input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.settings-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 12px;
}

.metric-field {
  grid-template-columns: 20px minmax(0, 1fr) 92px;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
}

.question-points {
  grid-template-columns: 20px minmax(0, 1fr) 120px;
  align-items: center;
  margin: 12px 0 4px;
  color: var(--ink);
  font-size: 14px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle-line input {
  width: 18px;
  min-height: 18px;
}

.host-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.host-control-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(360px, 1.15fr) 330px;
  gap: 18px;
  align-items: start;
}

.control-panel,
.answer-monitor {
  display: grid;
  gap: 14px;
}

.host-controls.vertical {
  align-items: stretch;
  flex-direction: column;
}

.host-controls.vertical > span {
  color: var(--muted);
}

.host-controls.vertical button span {
  color: inherit;
}

.screen-link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--blue);
  background: rgba(80, 104, 255, 0.08);
  font-weight: 680;
  text-decoration: none;
}

.mini-stage {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, rgba(23, 22, 43, 0.94), rgba(47, 39, 84, 0.90));
}

.mini-stage span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.mini-stage strong {
  font-size: 22px;
  font-weight: 660;
}

.timer-panel {
  display: inline-grid;
  grid-template-columns: auto auto minmax(72px, 120px);
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(80, 104, 255, 0.14);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.timer-panel.manual {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  border-radius: 12px;
  color: var(--ink);
  background: rgba(80, 104, 255, 0.08);
}

.timer-panel.mode-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(80, 104, 255, 0.20);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
}

.mode-panel span {
  color: var(--muted);
  opacity: 1;
  font-size: 12px;
  line-height: 1.1;
  text-transform: uppercase;
}

.mode-panel strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  text-align: left;
}

.mode-panel em {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-style: normal;
}

.stage .timer-panel,
.player-state .timer-panel,
.player-question .timer-panel {
  color: white;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
}

.player-state .timer-panel,
.player-question .timer-panel {
  color: var(--ink);
  border-color: var(--line);
  background: var(--soft);
}

.timer-panel strong {
  display: block;
  min-width: 2ch;
  font-size: 18px;
  font-weight: 760;
  line-height: 1;
  text-align: right;
}

.timer-panel span {
  display: block;
  color: inherit;
  opacity: 0.68;
  font-size: 12px;
  font-weight: 700;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  background: #f3f6fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
}

.drag-handle:hover {
  color: var(--blue);
  background: #eaf1ff;
  transform: none;
}

.timer-panel.mode-panel span {
  color: var(--muted);
  opacity: 1;
  line-height: 1.1;
  text-transform: uppercase;
}

.timer-panel.mode-panel strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  text-align: left;
}

.timer-panel.paused {
  border-color: rgba(255, 216, 77, 0.42);
  background: rgba(255, 216, 77, 0.14);
}

.timer-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(128, 129, 151, 0.18);
}

.timer-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  transition: width 250ms linear;
}

.answer-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  background: var(--soft);
}

.answer-summary strong {
  font-size: 28px;
  font-weight: 680;
}

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

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

.answer-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}

.answer-row.correct {
  border-color: rgba(255, 216, 77, 0.42);
  background: rgba(255, 216, 77, 0.14);
}

.answer-row.wrong {
  border-color: rgba(255, 86, 111, 0.34);
  background: rgba(255, 86, 111, 0.08);
}

.answer-row.answered {
  border-color: rgba(80, 104, 255, 0.32);
  background: rgba(80, 104, 255, 0.07);
}

.stage {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 132px);
  padding: 30px;
  color: white;
  border-radius: 14px;
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 200, 87, 0.28), transparent 28%),
    radial-gradient(circle at 12% 80%, rgba(47, 109, 246, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(23, 22, 43, 0.94), rgba(24, 33, 58, 0.90));
  box-shadow: var(--shadow);
}

.stage-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

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

.stage-top h2 {
  max-width: 980px;
  font-size: 44px;
  font-weight: 660;
  line-height: 1.05;
}

.stage-top p {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 680;
}

.stage .phase-pill {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  height: max-content;
}

.waiting-hero,
.section-screen {
  display: grid;
  place-items: center;
  flex: 1;
  text-align: center;
}

.waiting-hero svg {
  width: 86px;
  height: 86px;
  color: var(--gold);
}

.waiting-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 28px;
  line-height: 1.25;
}

.section-screen {
  gap: 14px;
}

.section-screen span,
.question-meta-line span {
  color: var(--gold);
  font-weight: 680;
}

.section-screen h3 {
  margin: 0;
  max-width: 900px;
  font-size: 56px;
  line-height: 1;
  font-weight: 660;
}

.section-screen p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 24px;
}

.question-meta-line {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.question-meta-line span {
  padding: 8px 11px;
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.question-stage-content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.question-status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stage .question-body {
  max-width: 980px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.25;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.answer-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 96px;
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.answer-tile.correct {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.answer-tile img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
}

.answer-tile span {
  font-size: 22px;
  font-weight: 650;
}

.answer-tile strong {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink);
  background: white;
}

.host-controls {
  margin-top: auto;
  padding-top: 22px;
}

.host-controls > span {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 680;
}

.host-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.qr-panel {
  text-align: center;
}

.qr-image {
  display: none;
  width: 232px;
  height: 232px;
  margin: 12px auto;
  padding: 12px;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(18, 24, 39, 0.08);
}

.qr-image:not([hidden]) {
  display: block;
}

.qr-image[hidden],
#joinQr[hidden],
#hostQr[hidden] {
  display: none !important;
}

#joinQr,
#hostQr {
  width: 220px;
  height: 220px;
  margin: 10px auto;
  display: block;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--line);
}

.host-remote-panel p {
  color: var(--muted);
  font-size: 14px;
}

.host-remote-panel .ghost-btn {
  margin-top: 12px;
}

.qr-panel strong {
  display: block;
  font-size: 32px;
  font-weight: 680;
  letter-spacing: 4px;
}

.qr-panel a {
  display: block;
  margin-top: 8px;
  padding: 9px 10px;
  color: var(--blue);
  border: 1px solid #dbe5f5;
  border-radius: 8px;
  background: #f8faff;
  word-break: break-all;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
}

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

.players-list div {
  display: flex;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--soft);
  font-weight: 680;
}

.winners {
  display: grid;
  gap: 12px;
  width: min(720px, 100%);
  margin: 20px auto 0;
}

.winner {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
  color: var(--ink);
  background: white;
}

.winner span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold);
  font-weight: 760;
}

.rank-1 {
  transform: scale(1.03);
  box-shadow: 0 18px 40px rgba(255, 200, 87, 0.24);
}

.player-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 200, 87, 0.28), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(80, 104, 255, 0.24), transparent 28%),
    linear-gradient(150deg, var(--ink), var(--ink-2));
}

.player-card {
  width: 100%;
  max-width: min(520px, calc(100vw - 36px));
  min-height: 560px;
  padding: 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.player-brand {
  color: var(--ink);
}

.player-brand span {
  color: var(--muted);
}

.join-form,
.player-question,
.player-state {
  display: grid;
  gap: 16px;
}

.join-form h1,
.player-question h1,
.player-state h1 {
  font-size: 30px;
  font-weight: 660;
}

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

.player-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.player-option.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(83, 117, 255, 0.12);
}

.answer-sent-state {
  place-items: center;
  padding: 30px 0 10px;
  text-align: center;
}

.answer-sent-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  color: white;
  background: var(--gold);
  box-shadow: 0 16px 32px rgba(255, 216, 77, 0.22);
  font-size: 32px;
  font-weight: 800;
}

.player-option.correct {
  border-color: rgba(255, 216, 77, 0.55);
  background: rgba(255, 216, 77, 0.14);
}

.player-option strong {
  color: var(--ink);
  font-weight: 680;
}

.review-options .player-option {
  grid-template-columns: minmax(0, 1fr) auto;
}

.game-screen {
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 200, 87, 0.22), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(47, 109, 246, 0.18), transparent 26%),
    linear-gradient(140deg, #161528, var(--ink-2));
}

.public-stage {
  min-height: calc(100vh - 48px);
}

.player-option input {
  width: 18px;
  min-height: 18px;
}

.player-option img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  padding: 13px 16px;
  color: white;
  border-radius: 8px;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 680;
  animation: toastIn 180ms ease-out;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 18, 30, 0.58);
  backdrop-filter: blur(5px);
  animation: fadeIn 140ms ease-out;
}

.confirm-dialog {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 28px 80px rgba(12, 18, 30, 0.28);
  animation: dialogIn 180ms ease-out;
}

.confirm-dialog h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.confirm-dialog p {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@keyframes connectionPulse {
  50% { opacity: 0.28; transform: scale(0.75); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
}

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

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

/* Readiness pass: clearer actions, accounts and a compact host preview */
.brand-mark img {
  width: 62px;
  height: 62px;
  transform: rotate(-2deg);
}

.sidebar-account {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 28px;
  display: grid;
  gap: 3px;
  padding: 16px;
  color: var(--ink);
  background: #fffdf7;
  border-radius: 22px;
  box-shadow: 0 16px 30px rgba(24, 33, 58, .16);
}

.sidebar-account > span {
  font-weight: 800;
}

.sidebar-account > strong {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  margin-top: 8px;
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  font-weight: 800;
}

.sidebar-logout:hover {
  transform: none;
  color: var(--coral);
}

.dashboard-scene {
  min-height: 0;
  padding-bottom: 0;
}

.getting-started {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  padding: 14px;
  background: #eef1ff;
  border: 2px solid #cfd7ff;
  border-radius: 24px;
}

.getting-started > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  padding: 12px;
  background: #fffdf7;
  border-radius: 17px;
}

.getting-started > div > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-weight: 900;
}

.getting-started strong {
  font-size: 14px;
  line-height: 1.2;
}

.getting-started p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.quizzes-panel {
  max-width: 1050px;
}

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

.dashboard-quiz .row-actions {
  max-width: 350px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 42px 24px;
  text-align: center;
  background: #fffdf7;
  border: 2px dashed #cfd7ff;
  border-radius: 26px;
}

.empty-state img {
  width: 94px;
  height: 94px;
  object-fit: contain;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state p {
  color: var(--muted);
}

.host-screen-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 16px 18px;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid #e4bb1c;
  border-radius: 24px;
  box-shadow: 0 14px 28px rgba(255, 216, 77, .18);
}

.host-screen-launcher > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.host-screen-launcher > div > i {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: white;
  background: var(--blue);
  border-radius: 15px;
  font-size: 24px;
}

.host-screen-launcher strong,
.host-screen-launcher small {
  display: block;
}

.host-screen-launcher strong {
  font-family: "Unbounded Variable", sans-serif;
  font-size: 16px;
}

.host-screen-launcher small {
  margin-top: 3px;
  color: #5b5127;
}

.host-screen-launcher .primary-btn {
  text-decoration: none;
  white-space: nowrap;
}

.host-control-grid {
  grid-template-columns: minmax(330px, .78fr) minmax(440px, 1.22fr);
  gap: 20px;
  align-items: start;
}

.screen-preview-panel {
  overflow: hidden;
}

.compact-head {
  align-items: flex-start;
}

.compact-head .phase-pill {
  flex: 0 0 auto;
}

.mini-stage {
  min-height: 340px;
  padding: 26px;
  border-radius: 24px;
  background-position: right -22px bottom -28px;
  background-size: 160px;
}

.mini-stage strong,
.mini-stage span,
.mini-stage p {
  position: relative;
  z-index: 1;
}

.mini-lobby {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 26px;
  align-items: center;
}

.mini-lobby .qr-image,
.mini-lobby canvas {
  width: 100%;
  max-width: 210px;
  aspect-ratio: 1;
  padding: 10px;
  background: white;
}

.mini-lobby > div {
  display: grid;
  gap: 10px;
}

.mini-lobby strong,
.mini-question > strong,
.mini-message strong,
.mini-results > strong {
  font-family: "Unbounded Variable", sans-serif;
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.12;
}

.mini-lobby span,
.mini-question > span,
.mini-message span {
  color: rgba(255, 255, 255, .82);
  font-weight: 800;
}

.mini-question {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-question p {
  margin: 0;
  color: rgba(255, 255, 255, .84);
}

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

.mini-options span {
  min-height: 54px;
  padding: 12px;
  color: white;
  background: rgba(255, 255, 255, .14);
  border: 2px solid rgba(255, 255, 255, .24);
  border-radius: 14px;
}

.mini-options span.correct {
  color: var(--ink);
  background: var(--gold);
}

.mini-message {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.mini-message > i {
  font-size: 52px;
}

.mini-results .winners {
  margin-top: 20px;
}

.mini-results .winner {
  padding: 10px 12px;
}

.danger-text {
  color: #c62e3d;
  border-color: #ffb5bc;
  background: #fff3f4;
}

.stopped-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.stopped-screen img {
  width: min(180px, 28vh);
  height: min(180px, 28vh);
  object-fit: contain;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: var(--blue);
  background-image: url('/art/party-popper.png');
  background-repeat: no-repeat;
  background-position: right -50px bottom -40px;
  background-size: 300px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 34px;
  background: var(--soft);
  border: 3px solid var(--ink);
  border-radius: 32px;
  box-shadow: 14px 14px 0 rgba(24, 33, 58, .3);
}

.auth-card > img {
  display: block;
  width: 118px;
  height: 118px;
  margin: -18px auto 4px;
  object-fit: contain;
}

.auth-kicker {
  display: block;
  color: var(--coral);
  text-align: center;
  font-family: "Unbounded Variable", sans-serif;
  font-weight: 850;
}

.auth-card h1 {
  margin: 12px 0;
  font-size: 32px;
  text-align: center;
}

.auth-card > p {
  color: var(--muted);
  text-align: center;
}

.login-form,
.admin-user-form,
.password-reset-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(290px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

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

.user-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: #fff8e9;
  border: 2px solid var(--line);
  border-radius: 18px;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: white;
  background: var(--coral);
  border-radius: 15px;
  font-family: "Unbounded Variable", sans-serif;
  font-weight: 900;
}

.user-row strong,
.user-row span {
  display: block;
}

.user-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

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

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

@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;
  }
}

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

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

  .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 {
    grid-column: 1 / -1;
  }

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

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

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

.loader,
.error-screen {
  color: white;
  text-align: center;
}

@media (max-width: 980px) {
  .app-shell {
    align-content: start;
  }

  .app-shell,
  .editor-grid,
  .host-grid,
  .host-control-grid,
  .dashboard-grid,
  .launch-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px;
  }

  .sidebar-note {
    position: static;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .stage-top {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-panel {
    position: static;
  }

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

  .quick-generator-row {
    grid-template-columns: 1fr;
  }

  .answer-options,
  .title-grid {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 640px;
    padding: 22px;
  }

  .stage-top h2 {
    font-size: 32px;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 28px;
  }

  .sidebar {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
  }

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

  .brand {
    margin-bottom: 12px;
  }

  .nav-item {
    margin-bottom: 0;
  }

  .sidebar-note {
    padding: 12px;
  }

  .sidebar-note strong {
    font-size: 22px;
  }

  .toast {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: 12px;
    text-align: center;
  }

  .workspace {
    padding: 14px;
  }

  .panel,
  .player-card {
    padding: 16px;
  }

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

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

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

  .metric-field input,
  .question-points input {
    grid-column: 1 / -1;
  }

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

  .winner {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .winner em {
    grid-column: 2;
  }
}

/* Layout refresh: calmer typography, compact controls and clear quiz hierarchy */
body {
  font-size: 15px;
  line-height: 1.45;
}

button,
.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  line-height: 1.15;
  white-space: normal;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 14px;
}

.icon-btn {
  width: 38px;
  min-height: 38px;
  flex: 0 0 auto;
  font-size: 16px;
}

.panel {
  padding: 20px;
  border-radius: 10px;
}

.topbar {
  flex-wrap: wrap;
}

.item-toolbar.compact-toolbar {
  margin: 14px 0;
  gap: 8px;
}

.rounds-list {
  display: grid;
  gap: 16px;
}

.round-block {
  padding: 16px;
  border: 1px solid rgba(80, 104, 255, 0.18);
  border-radius: 10px;
  background: #f8faff;
}

.round-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.round-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.round-head span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-weight: 760;
}

.round-head strong {
  font-size: 18px;
}

.round-head em {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: 12px;
  font-style: normal;
  font-weight: 680;
}

.round-items {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 24px;
  border-radius: 10px;
  transition: background 160ms ease, outline-color 160ms ease;
}

.round-items.drop-active {
  outline: 1px dashed rgba(47, 109, 246, 0.34);
  outline-offset: 5px;
  background: rgba(47, 109, 246, 0.04);
}

.round-items.drop-empty {
  min-height: 78px;
}

.round-items.drop-empty::after {
  content: "Отпустите, чтобы добавить сюда";
  display: grid;
  place-items: center;
  min-height: 64px;
  color: var(--blue);
  border: 2px dashed rgba(47, 109, 246, 0.34);
  border-radius: 10px;
  background: rgba(47, 109, 246, 0.06);
  font-weight: 680;
}

.question-block {
  position: relative;
  cursor: grab;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.question-block.dragging {
  opacity: 0.55;
  outline: 2px dashed var(--blue);
  cursor: grabbing;
}

.question-block.drop-before::before,
.question-block.drop-after::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.14);
}

.question-block.drop-before::before {
  top: -10px;
}

.question-block.drop-after::after {
  bottom: -10px;
}

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

.question-actions .icon-btn {
  width: 34px;
  min-height: 34px;
}

.host-control-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr) minmax(260px, 0.65fr);
}

.host-current-card {
  display: grid;
  gap: 7px;
  padding: 16px;
  border-radius: 10px;
  background: #f8faff;
  border: 1px solid rgba(80, 104, 255, 0.18);
}

.host-current-card span,
.host-current-card p,
.host-timeline em,
.answer-row small {
  color: var(--muted);
}

.host-current-card strong {
  font-size: 22px;
  line-height: 1.15;
}

.host-current-card p {
  margin: 0;
}

.host-timeline {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.host-timeline h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

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

.timeline-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--soft);
  font-weight: 700;
}

.timeline-row strong,
.timeline-row em,
.answer-row small {
  display: block;
}

.timeline-row em {
  margin-top: 2px;
  font-size: 12px;
  font-style: normal;
}

.timeline-row.active {
  border-color: rgba(80, 104, 255, 0.55);
  box-shadow: inset 4px 0 0 var(--blue);
}

.timeline-row.done {
  opacity: 0.68;
}

.answer-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 680;
}

.answer-row small {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
}

.players-panel h2 {
  margin-bottom: 12px;
}

.qr-stage {
  gap: 18px;
}

.qr-stage > div {
  display: grid;
  place-items: center;
}

.public-qr-image,
.qr-stage #joinQr {
  width: min(34vh, 300px);
  height: min(34vh, 300px);
  padding: 14px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.qr-stage strong {
  color: var(--gold);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0.08em;
}

.stage-top h2 {
  font-size: clamp(32px, 4.2vw, 56px);
}

.answer-tile span {
  font-size: clamp(18px, 2vw, 26px);
}

.player-card {
  min-height: auto;
}

.join-form h1,
.player-question h1,
.player-state h1 {
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.1;
}

@media (max-width: 760px) {
  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }

  .round-head,
  .question-head,
  .answer-row {
    grid-template-columns: 1fr;
  }

  .question-head {
    align-items: flex-start;
    gap: 10px;
  }

  .question-actions,
  .top-actions,
  .row-actions {
    width: 100%;
  }
}

.host-controls.vertical > span {
  color: var(--muted);
}

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

@media (max-width: 620px) {
  .host-control-grid,
  .control-panel,
  .answer-monitor,
  .host-side {
    min-width: 0;
  }

  .host-control-grid {
    gap: 10px;
  }

  .control-panel,
  .answer-monitor {
    gap: 10px;
    padding: 12px;
  }

  .control-panel .panel-head,
  .screen-link,
  .host-timeline,
  .host-side,
  .answer-stats-panel,
  .answer-stats-list {
    display: none;
  }

  .host-current-card {
    padding: 12px;
  }

  .host-current-card span {
    font-size: 11px;
    text-transform: uppercase;
  }

  .host-current-card strong {
    font-size: 20px;
  }

  .host-current-card p {
    font-size: 13px;
  }

  .host-controls {
    gap: 8px;
    margin-top: 0;
    padding-top: 0;
  }

  .host-controls.vertical > span {
    display: none;
  }

  .answer-monitor h2 {
    margin-bottom: 0;
    font-size: 18px;
  }

  .answer-summary {
    padding: 10px 12px;
  }

  .answer-summary strong {
    font-size: 24px;
  }

  .answer-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 10px;
  }

  .answer-monitor .answer-row strong {
    display: none;
  }

  .timer-panel:not(.mode-panel) {
    width: 100%;
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .game-screen {
    padding: 12px;
  }

  .public-stage {
    min-height: calc(100vh - 24px);
  }

  .stage-top {
    gap: 10px;
    margin-bottom: 14px;
  }

  .stage-top h2 {
    font-size: 28px;
  }

  .question-status-line {
    gap: 8px;
  }

  .question-meta-line span {
    font-size: 12px;
  }

  .stage .question-body {
    font-size: 20px;
  }
}

/* Confetti Studio — bespoke visual system */
:root {
  --ink: #18213a;
  --ink-2: #25304f;
  --surface: #fffdf7;
  --soft: #fff8e9;
  --line: #eadfca;
  --muted: #687086;
  --coral: #ff5d67;
  --gold: #ffd84d;
  --blue: #3155f5;
  --shadow: 0 16px 38px rgba(49, 85, 245, 0.11);
  font-family: "Nunito Sans Variable", "Nunito Sans", ui-sans-serif, system-ui, sans-serif;
}

body {
  color: var(--ink);
  background: var(--soft);
  font-size: 16px;
}

h1,
h2,
h3,
.brand strong,
.quiz-row-main strong,
.winner strong {
  font-family: "Unbounded Variable", "Unbounded", "Arial Rounded MT Bold", sans-serif;
  letter-spacing: -0.035em;
}

.ph,
.ph-bold,
.ph-fill {
  flex: 0 0 auto;
  font-size: 1.25em;
  line-height: 1;
}

button,
.quiz-row,
.player-option,
.answer-tile {
  transition-timing-function: cubic-bezier(.2, .8, .2, 1);
}

button:hover {
  transform: translateY(-2px) scale(1.01);
}

button:active {
  transform: translateY(1px) scale(.985);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.app-shell {
  grid-template-columns: 272px minmax(0, 1fr);
  background: var(--soft);
}

.sidebar {
  z-index: 2;
  padding: 30px 24px 26px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 0 42px 42px 0;
  box-shadow: 16px 0 40px rgba(49, 85, 245, .12);
  overflow: hidden;
}

.brand {
  gap: 10px;
  margin-bottom: 46px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  padding: 0;
  overflow: visible;
  color: white;
  background: transparent;
  box-shadow: none;
}

.brand-mark img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  transform: rotate(-6deg);
}

.brand strong {
  font-size: 19px;
  font-weight: 760;
}

.brand span {
  max-width: 150px;
  margin-top: 6px;
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  line-height: 1.2;
}

.nav-item {
  min-height: 56px;
  gap: 13px;
  margin-bottom: 10px;
  padding: 14px 18px;
  color: rgba(255, 255, 255, .9);
  border: 2px solid transparent;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 780;
}

.nav-item.active,
.nav-item:hover {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 10px 22px rgba(24, 33, 58, .16);
}

.nav-item:hover {
  transform: translateX(3px);
}

.sidebar-note {
  left: 24px;
  right: 24px;
  bottom: 28px;
  min-height: 114px;
  padding: 18px 16px;
  color: var(--ink);
  background: #fffdf7;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 16px 30px rgba(24, 33, 58, .16);
}

.sidebar-note img {
  position: absolute;
  right: -7px;
  top: -44px;
  width: 94px;
  height: 94px;
  object-fit: contain;
  transform: rotate(8deg);
  pointer-events: none;
}

.sidebar-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sidebar-note strong {
  max-width: 116px;
  margin-top: 7px;
  color: var(--ink);
  font-family: "Unbounded Variable", sans-serif;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.03em;
}

.workspace {
  padding: 40px 44px 52px;
  background: var(--soft);
}

.topbar {
  align-items: flex-start;
  margin-bottom: 34px;
}

h1 {
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 790;
  line-height: 1.02;
}

h2 {
  font-size: 21px;
  font-weight: 740;
}

.page-subtitle {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 620;
}

.breadcrumbs {
  margin-bottom: 12px;
}

.breadcrumbs span {
  color: var(--coral);
}

.breadcrumb-link {
  color: var(--blue);
}

.top-actions {
  padding-top: 5px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 780;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  padding: 11px 18px;
  font-size: 15px;
}

.primary-btn {
  color: white;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(49, 85, 245, .2);
}

.primary-btn:hover {
  box-shadow: 0 16px 30px rgba(49, 85, 245, .28);
}

.primary-btn.danger-btn {
  background: var(--coral);
  box-shadow: 0 12px 24px rgba(255, 93, 103, .22);
}

.secondary-btn {
  color: var(--blue);
  background: #eef1ff;
  border: 2px solid #cfd7ff;
}

.ghost-btn {
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid #d8d0c1;
}

.ghost-btn:hover {
  color: var(--blue);
  background: #eef1ff;
  border-color: #aebcff;
}

.icon-btn {
  width: 46px;
  min-height: 46px;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid #ddd3c0;
}

.icon-btn.accent {
  color: white;
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: 0 10px 20px rgba(255, 93, 103, .22);
}

.icon-btn.danger {
  color: #d63a49;
}

.icon-btn.danger:hover {
  color: white;
  background: var(--coral);
  border-color: var(--coral);
}

.save-status,
.connection-badge,
.phase-pill,
.round-index,
.quiz-meta span {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 780;
}

.save-status.saved,
.connection-badge.live {
  color: var(--blue);
  background: #eef1ff;
}

.save-status.unsaved,
.connection-badge.connecting,
.connection-badge.reconnecting {
  color: #725500;
  background: #fff0a9;
}

.dashboard-grid,
.launch-grid {
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 28px;
  align-items: stretch;
}

.panel {
  padding: 24px;
  background: #fffdf7;
  border: 2px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.dashboard-grid > .panel.wide {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dashboard-grid > .panel.wide > .panel-head {
  margin: 0 0 16px;
}

.dashboard-grid > .panel.wide > .panel-head p {
  max-width: 650px;
}

.quiz-list {
  gap: 16px;
}

.quiz-row {
  gap: 15px;
  padding: 18px;
  border: 2px solid #eadfca;
  border-radius: 26px;
  background: #fffdf7;
  box-shadow: 0 12px 28px rgba(255, 93, 103, .07);
}

.dashboard-quiz {
  grid-template-columns: 84px minmax(150px, 1fr) auto;
  min-height: 142px;
  border-left: 9px solid var(--coral);
}

.dashboard-quiz .quiz-art {
  grid-row: 1 / 3;
}

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

.dashboard-quiz .quiz-meta {
  grid-column: 2;
  align-self: start;
}

.dashboard-quiz .row-actions {
  grid-column: 3;
  grid-row: 1 / 3;
}

.quiz-art {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  background: #fff0a9;
  border-radius: 24px;
}

.quiz-art img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  transform: rotate(-7deg);
}

.quiz-row:hover {
  transform: translateY(-3px);
  border-color: #ffc0b7;
  box-shadow: 0 20px 36px rgba(255, 93, 103, .12);
}

.quiz-row.selected {
  border-color: var(--coral);
  box-shadow: inset 0 0 0 1px var(--coral), 0 18px 34px rgba(255, 93, 103, .1);
}

.quiz-row-main strong {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.25;
}

.quiz-meta span {
  min-height: 30px;
  color: #483c04;
  background: #fff0a9;
}

.festive-panel {
  overflow: hidden;
  padding: 28px;
  color: var(--ink);
  background: var(--gold);
  border-color: #efc62b;
  border-radius: 36px;
  box-shadow: 0 20px 42px rgba(255, 216, 77, .2);
}

.festive-panel h2 {
  max-width: 260px;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.05;
}

.festive-panel p {
  max-width: 255px;
  color: #4d4b55;
}

.generator-mascot {
  display: block;
  width: 118px;
  height: 118px;
  margin: -12px -4px -4px auto;
  object-fit: contain;
  transform: rotate(5deg);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}

.festive-panel:hover .generator-mascot {
  transform: rotate(-3deg) translateY(-3px);
}

.quick-generator {
  gap: 14px;
}

.quick-generator label {
  color: var(--ink);
  font-weight: 780;
}

input,
select,
textarea {
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid #ddd3c0;
  border-radius: 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(49, 85, 245, .12);
}

.festive-panel input,
.festive-panel select {
  border-color: #d6ad16;
  background: #fffdf7;
}

.festive-panel .primary-btn {
  min-height: 56px;
  border-radius: 18px;
}

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

.editor-main {
  background: #fffdf7;
}

.settings-panel {
  top: 28px;
  background: #eef1ff;
  border-color: #cfd7ff;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  padding: 5px;
  background: #dbe5f5;
  border-radius: 18px;
}

.mode-switch button {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 78px;
  padding: 10px 11px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}

.mode-switch button strong,
.mode-switch button small {
  display: block;
  min-width: 0;
}

.mode-switch button strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.mode-switch button small {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.25;
}

.mode-switch button.active {
  color: var(--ink);
  background: #fffdf7;
  box-shadow: 0 8px 18px rgba(24, 33, 58, .12);
}

.mode-switch button:hover {
  transform: none;
}

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

.password-input-row input {
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .04em;
}

.password-input-row .ghost-btn {
  min-height: 48px;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.round-block {
  padding: 20px;
  border: 2px solid #efd77b;
  border-radius: 24px;
  background: #fff7cf;
}

.round-head span,
.question-number {
  color: white;
  background: var(--coral);
  border-radius: 12px;
}

.question-block {
  padding: 18px;
  border: 2px solid #eadfca;
  border-left: 7px solid var(--blue);
  border-radius: 20px;
  background: #fffdf7;
}

.question-block:hover {
  border-color: #bac5ff;
  box-shadow: 0 14px 28px rgba(49, 85, 245, .09);
}

.drag-handle {
  color: var(--blue);
  background: #eef1ff;
  border: 2px solid #cfd7ff;
  border-radius: 12px;
}

.option-line {
  grid-template-columns: 28px minmax(0, 1fr) 46px;
  padding: 8px;
  background: #fffaf0;
  border-radius: 14px;
}

.question-type-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.bottom-item-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.question-type-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  background: #fffdf7;
  border: 2px solid #cfd7ff;
  border-radius: 16px;
  overflow: hidden;
}

.question-type-choice > span {
  min-width: 0;
}

.question-type-choice > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--blue);
  background: #eef1ff;
  border-radius: 11px;
}

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

.question-type-choice strong {
  font-size: 14px;
  line-height: 1.25;
}

.question-type-choice small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.question-type-choice:hover {
  color: var(--blue);
  background: #eef1ff;
  border-color: var(--blue);
}

.option-content {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.option-content > input {
  width: 100%;
}

.image-source-editor {
  overflow: hidden;
  margin: 4px 0 12px;
  background: #f8faff;
  border: 2px solid #dbe5f5;
  border-radius: 16px;
}

.image-source-editor summary {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto 18px;
  gap: 9px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--blue);
  cursor: pointer;
  list-style: none;
}

.image-source-editor summary::-webkit-details-marker {
  display: none;
}

.image-source-editor summary span {
  color: var(--ink);
  font-weight: 800;
}

.image-source-editor summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.image-source-editor summary .ph-caret-down {
  transition: transform 160ms ease;
}

.image-source-editor[open] summary .ph-caret-down {
  transform: rotate(180deg);
}

.image-source-editor.has-image summary small {
  color: var(--blue);
}

.image-source-editor.compact {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.image-source-editor.compact summary {
  grid-template-columns: 18px minmax(0, 1fr) auto 16px;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 12px;
}

.image-source-panel {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.image-source-panel > small {
  color: var(--muted);
  font-size: 11px;
}

.image-source-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.image-source-controls > input {
  flex: 1 1 220px;
  min-width: 160px;
}

.image-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 7px;
  padding: 9px 12px;
  color: var(--blue);
  background: #eef1ff;
  border: 2px solid #cfd7ff;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

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

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

.image-source-preview {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--blue);
  font-size: 12px;
}

.image-source-preview img {
  width: 84px;
  height: 58px;
  object-fit: cover;
  border: 2px solid #cfd7ff;
  border-radius: 10px;
}

.image-remove-btn {
  min-height: 42px;
  padding: 8px 10px;
  color: var(--coral);
}

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

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

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

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

.answer-image-frame img {
  display: block;
  width: 120px;
  height: 82px;
  object-fit: cover;
  border-radius: 12px;
}

.player-option.has-image {
  grid-template-columns: 22px 88px minmax(0, 1fr);
}

.player-option-media,
.player-option-media img {
  display: block;
  width: 88px;
  height: 62px;
}

.player-option-media img {
  object-fit: cover;
  border-radius: 10px;
}

.review-options .player-option.has-image {
  grid-template-columns: 88px minmax(0, 1fr) auto;
}

.metric-field,
.question-points,
.toggle-line {
  color: var(--ink);
}

.bottom-add-panel {
  border: 2px dashed #aebcff;
  border-radius: 20px;
  background: #eef1ff;
}

.host-control-grid {
  grid-template-columns: minmax(300px, .82fr) minmax(380px, 1.18fr);
  gap: 14px;
}

.host-screen-launcher {
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  box-shadow: none;
}

.host-screen-launcher > div > i {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 19px;
}

.host-screen-launcher small {
  max-width: 560px;
  font-size: 11px;
  line-height: 1.25;
}

.screen-launch-actions {
  gap: 8px;
}

.screen-launch-actions .primary-btn,
.screen-launch-actions .ghost-btn {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 13px;
}

.control-panel,
.screen-preview-panel,
.answer-monitor,
.players-panel {
  padding: 18px;
}

.control-panel,
.answer-monitor {
  gap: 10px;
}

.answer-monitor,
.players-panel {
  align-self: start;
  min-height: 0;
}

.answer-monitor {
  align-content: start;
}

.control-panel .panel-head,
.screen-preview-panel .panel-head,
.answer-monitor .panel-head,
.players-panel .panel-head {
  margin-bottom: 0;
}

.players-panel .panel-head {
  margin-bottom: 12px;
}

.host-current-card {
  gap: 4px;
  padding: 12px 14px;
  border-left-width: 5px;
  border-radius: 14px;
}

.host-current-card strong {
  font-size: 18px;
}

.host-current-card p {
  font-size: 12px;
}

.host-controls {
  gap: 8px;
  margin-top: 0;
  padding-top: 0;
}

.host-controls.vertical > span {
  font-size: 11px;
  line-height: 1.3;
}

.stop-game-zone {
  padding-top: 4px;
}

.host-timeline,
.answer-stats-panel {
  max-height: none;
  padding: 0;
  overflow: hidden;
  background: #f8faff;
  border: 2px solid #dbe5f5;
  border-radius: 14px;
}

.host-timeline summary,
.answer-stats-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 800;
}

.host-timeline summary::-webkit-details-marker,
.answer-stats-panel summary::-webkit-details-marker {
  display: none;
}

.host-timeline summary > span,
.answer-stats-panel summary {
  flex: 1;
}

.host-timeline summary > strong {
  color: var(--blue);
}

.host-timeline summary > i,
.answer-stats-panel summary > i {
  transition: transform 160ms ease;
}

.host-timeline[open] summary > i,
.answer-stats-panel[open] summary > i {
  transform: rotate(180deg);
}

.host-timeline-list,
.answer-stats-panel .answer-list,
.answer-stats-panel > .empty {
  display: grid;
  gap: 7px;
  max-height: 280px;
  margin: 0;
  padding: 0 10px 10px;
  overflow: auto;
}

.timeline-row {
  padding: 8px 9px;
  border-radius: 12px;
}

.answer-monitor {
  grid-column: 2;
}

.players-panel {
  grid-column: 1;
  grid-row: 2;
}

.answer-summary {
  padding: 9px 11px;
  border-radius: 14px;
}

.answer-summary strong {
  font-size: 23px;
}

.answer-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 9px 10px;
  border-radius: 12px;
}

.players-list {
  gap: 6px;
}

.players-list div {
  padding: 8px 10px;
  border-radius: 12px;
}

.host-current-card,
.answer-summary,
.timeline-row,
.players-list div {
  background: #fff8e9;
  border: 2px solid #eadfca;
  border-radius: 18px;
}

.host-current-card {
  border-left: 7px solid var(--coral);
}

.timeline-row.active {
  border-color: var(--blue);
  box-shadow: inset 6px 0 0 var(--blue);
}

.screen-link {
  color: var(--blue);
  background: #eef1ff;
  border-radius: 16px;
}

.timer-panel,
.timer-panel.mode-panel {
  border: 2px solid #cfd7ff;
  background: #eef1ff;
  border-radius: 16px;
}

.timer-bar i {
  background: var(--coral);
}

.answer-row {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffdf7;
}

.answer-row.correct {
  border-color: var(--gold);
  background: #fff0a9;
}

.answer-row.wrong {
  border-color: #ff9ca4;
  background: #fff0f1;
}

.answer-row.answered {
  border-color: #aebcff;
  background: #eef1ff;
}

.mini-stage,
.stage {
  color: white;
  background-color: var(--blue);
  background-image: url('/art/party-popper.png');
  background-repeat: no-repeat;
  background-position: right 24px bottom 18px;
  background-size: 180px;
  border: 0;
  border-radius: 30px;
  box-shadow: 0 22px 46px rgba(49, 85, 245, .24);
}

.stage {
  padding: 34px;
}

.stage-top h2 {
  font-weight: 790;
}

.stage-top p,
.stage .question-body,
.section-screen p,
.waiting-hero p {
  color: rgba(255, 255, 255, .86);
}

.stage .phase-pill,
.question-meta-line span {
  color: var(--ink);
  background: var(--gold);
}

.answer-tile {
  min-height: 104px;
  background: rgba(255, 255, 255, .14);
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 22px;
}

.answer-tile:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, .2);
}

.answer-tile.correct {
  color: var(--ink);
  background: var(--gold);
  border-color: #fff0a9;
}

.qr-image,
#joinQr,
#hostQr,
.public-qr-image,
.qr-stage #joinQr {
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--gold);
}

.winner {
  border: 2px solid #eadfca;
  border-radius: 22px;
  background: #fffdf7;
}

.winner span {
  background: var(--gold);
}

.rank-1 {
  border-color: var(--gold);
  box-shadow: 8px 8px 0 rgba(255, 216, 77, .46);
}

.player-screen,
.game-screen {
  background-color: var(--blue);
  background-image: url('/art/party-popper.png');
  background-repeat: no-repeat;
  background-position: left -70px bottom -60px;
  background-size: 330px;
}

.player-card {
  max-width: min(540px, calc(100vw - 36px));
  padding: 28px;
  background: var(--soft);
  border: 3px solid var(--ink);
  border-radius: 30px;
  box-shadow: 12px 12px 0 rgba(24, 33, 58, .32);
}

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

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

.player-brand span {
  color: var(--muted);
}

.player-option {
  padding: 15px;
  background: #fffdf7;
  border: 2px solid #ddd3c0;
  border-radius: 18px;
  cursor: pointer;
}

.player-option:hover {
  transform: translateY(-2px);
  border-color: #aebcff;
}

.player-option.selected {
  border-color: var(--blue);
  background: #eef1ff;
  box-shadow: 0 0 0 4px rgba(49, 85, 245, .12);
}

.answer-sent-icon {
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--gold);
}

.toast {
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 7px 7px 0 rgba(24, 33, 58, .2);
}

.dialog-backdrop {
  background: rgba(24, 33, 58, .56);
}

.confirm-dialog {
  background: var(--soft);
  border: 3px solid var(--ink);
  border-radius: 26px;
  box-shadow: 12px 12px 0 rgba(24, 33, 58, .25);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

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

  .workspace {
    padding: 34px 28px 44px;
  }

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

  .dashboard-quiz .quiz-art {
    grid-row: 1 / 2;
  }

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

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

@media (max-width: 980px) {
  .app-shell,
  .editor-grid,
  .host-grid,
  .host-control-grid,
  .dashboard-grid,
  .launch-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    padding: 16px 18px;
    border-radius: 0 0 28px 28px;
  }

  .sidebar .brand {
    margin: 0;
  }

  .sidebar .nav-item {
    width: auto;
    min-width: 140px;
    margin: 0;
  }

  .sidebar-note {
    display: none;
  }

  .sidebar-trophy {
    display: none;
  }

  .generator-mascot {
    float: right;
  }

  .dashboard-scene {
    min-height: 0;
    padding-bottom: 70px;
  }

  .dashboard-ribbon {
    width: 100%;
    height: 96px;
  }

  .settings-panel {
    position: static;
  }

  .answer-monitor,
  .players-panel {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 24px 14px 36px;
  }

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

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

  .sidebar .nav-item {
    min-width: 0;
    height: 46px;
  }

  .question-type-choice {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: start;
    min-height: 104px;
    padding: 11px;
  }

  .password-input-row {
    grid-template-columns: 1fr;
  }

  .image-source-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .image-source-controls > input,
  .image-upload-btn {
    width: 100%;
  }

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

  .answer-image-frame img {
    width: 88px;
    height: 68px;
  }

  h1 {
    font-size: 34px;
  }

  .page-subtitle {
    font-size: 15px;
  }

  .panel,
  .festive-panel,
  .player-card {
    padding: 18px;
    border-radius: 24px;
  }

  .dashboard-quiz,
  .quiz-row {
    grid-template-columns: 58px minmax(0, 1fr);
    border-radius: 22px;
  }

  .quiz-art {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

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

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

  .row-actions .ghost-btn {
    flex: 1 1 130px;
  }

  .generator-mascot {
    width: 92px;
    height: 92px;
  }

  .top-actions,
  .question-actions {
    width: 100%;
  }

  .stage,
  .public-stage {
    padding: 18px;
    border-radius: 22px;
    background-size: 120px;
  }

  .answer-options,
  .title-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .generator-mascot,
  .quiz-art img,
  .sidebar-note img,
  .brand-mark img {
    transform: none !important;
  }
}

/* Payments, balances, preview mode and operations console */
.sidebar-balance {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 6px;
  margin: -4px -4px 9px;
  padding: 10px 11px;
  color: white;
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 14px;
}

.sidebar-balance span,
.sidebar-balance strong {
  margin: 0;
  color: inherit;
}

.sidebar-balance span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-balance strong {
  font-size: 14px;
  white-space: nowrap;
}

.sidebar-legal,
.entry-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.sidebar-legal {
  margin-top: 8px;
}

.sidebar-legal a,
.entry-legal a,
.billing-legal a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
}

.entry-legal {
  justify-content: center;
  margin-top: 22px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 22px;
  padding: 5px;
  background: #ede4d3;
  border: 2px solid var(--ink);
  border-radius: 16px;
}

.auth-mode-tabs button {
  padding: 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-weight: 850;
}

.auth-mode-tabs button.active {
  color: white;
  background: var(--blue);
  box-shadow: 0 5px 0 var(--ink);
}

.terms-choice {
  display: grid !important;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.terms-choice input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin-top: 2px;
}

.terms-choice a {
  color: var(--blue);
  font-weight: 800;
}

.legal-screen {
  min-height: 100vh;
  padding: 40px 20px;
  background: #eef2f7;
}

.legal-card {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 28px;
  box-shadow: 12px 12px 0 rgba(24, 33, 58, .14);
}

.legal-card .auth-back {
  position: static;
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--blue);
}

.legal-card .auth-kicker {
  text-align: left;
}

.legal-card h1 {
  max-width: 720px;
  margin: 12px 0 6px;
  font-size: clamp(28px, 5vw, 48px);
}

.legal-updated {
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 13px;
}

.legal-body {
  color: var(--ink-2);
  white-space: pre-wrap;
  line-height: 1.72;
}

.billing-page,
.admin-content {
  display: grid;
  gap: 22px;
}

.balance-hero {
  display: grid;
  grid-template-columns: minmax(210px, .6fr) minmax(280px, 1.4fr);
  gap: 20px 34px;
  align-items: center;
  padding: 28px 32px;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--ink);
  border-radius: 28px;
  box-shadow: 9px 9px 0 rgba(24, 33, 58, .16);
}

.balance-hero > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 10px;
}

.balance-hero > div span {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.balance-hero > div strong {
  font-family: "Unbounded Variable", sans-serif;
  font-size: clamp(48px, 8vw, 82px);
  line-height: 1;
}

.balance-hero > div em {
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
}

.balance-hero p {
  margin: 0;
  font-weight: 700;
  line-height: 1.55;
}

.balance-hero small {
  grid-column: 1 / -1;
  margin-top: -12px;
  font-weight: 800;
}

.provider-notice {
  margin: 18px 0;
  padding: 13px 15px;
  background: #fff0cf;
  border: 2px solid #d6a22d;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 750;
}

.provider-notice.test {
  color: #173c8f;
  background: #e8efff;
  border-color: #7fa0ff;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 24px 16px 18px;
  text-align: center;
  background: var(--soft);
  border: 2px solid var(--ink);
  border-radius: 22px;
}

.package-card.featured {
  background: #eef1ff;
  box-shadow: 6px 6px 0 var(--blue);
}

.package-card > strong {
  font-family: "Unbounded Variable", sans-serif;
  font-size: 48px;
  line-height: 1;
}

.package-card > span:not(.package-badge) {
  margin: 4px 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.package-card h3 {
  margin: 0;
  font-size: 24px;
}

.package-card small {
  margin: 5px 0 18px;
  color: var(--muted);
}

.package-card .primary-btn {
  margin-top: auto;
}

.package-badge {
  position: absolute;
  top: -12px;
  padding: 5px 10px;
  color: white;
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: white;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  background: var(--soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.data-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef1f7;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.status-paid { color: #17623a; background: #e2f7ea; }
.status-refunded,
.status-partially_refunded { color: #72400a; background: #fff0cf; }

.billing-legal {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 22px;
  padding-bottom: 6px;
}

.admin-tabs button {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--muted);
  background: white;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-weight: 850;
}

.admin-tabs button.active {
  color: white;
  background: var(--blue);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

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

.metric-grid article {
  min-width: 0;
  padding: 20px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 18px;
}

.metric-grid span {
  display: block;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  font-family: "Unbounded Variable", sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  overflow-wrap: anywhere;
}

.admin-user-ledger {
  display: grid;
  gap: 12px;
}

.admin-user-credit {
  display: grid;
  grid-template-columns: 46px minmax(140px, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 14px;
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 18px;
}

.admin-user-identity strong,
.admin-user-identity span {
  display: block;
}

.admin-user-identity span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.admin-user-credit dl {
  display: flex;
  gap: 12px;
  margin: 0;
}

.admin-user-credit dl div {
  min-width: 60px;
  text-align: center;
}

.admin-user-credit dt {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.admin-user-credit dd {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 900;
}

.admin-user-credit form {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: 105px minmax(160px, 1fr) auto;
  gap: 8px;
}

.admin-user-credit .current-account-label,
.admin-user-credit > .text-btn {
  grid-column: 2 / -1;
  justify-self: start;
}

.admin-payment-table {
  min-width: 1050px;
}

.refund-form {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.refund-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.refund-form button {
  justify-content: center;
}

.refund-list {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
}

.refund-list p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.document-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.document-editor {
  display: grid;
  gap: 14px;
}

.document-editor textarea {
  min-height: 560px;
  resize: vertical;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.document-editor > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.preview-check,
.preview-player-banner,
.screen-preview-banner {
  color: #173c8f;
  background: #e8efff;
  border-color: #7fa0ff !important;
}

.preview-host-card .primary-btn,
.preview-stage .primary-btn {
  width: max-content;
  margin-top: 8px;
}

.preview-player-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 2px solid;
  border-radius: 14px;
}

.preview-player-banner strong,
.preview-player-banner small {
  display: block;
}

.preview-player-banner small {
  margin-top: 2px;
}

.screen-preview-banner {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border: 2px solid #7fa0ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.preview-stage {
  display: grid;
  place-items: center;
  gap: 10px;
  max-width: 620px;
  margin: auto;
  text-align: center;
}

.preview-stage > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: white;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 18px;
}

.preview-stage h3,
.preview-stage p {
  margin: 0;
}

.editor-launch-actions {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

@media (max-width: 1120px) {
  .package-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .sidebar-balance {
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 7px 9px;
  }

  .sidebar-balance span {
    display: inline !important;
  }

  .sidebar-legal {
    display: none;
  }

  .admin-user-credit {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .admin-user-credit dl,
  .admin-user-credit form,
  .admin-user-credit .current-account-label,
  .admin-user-credit > .text-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .balance-hero,
  .package-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .balance-hero {
    padding: 22px;
  }

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

  .screen-preview-banner {
    top: 6px;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .document-editor > div {
    align-items: stretch;
    flex-direction: column;
  }
}
