body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #07080b;
}

#app {
  min-height: 100vh;
}

.demo-root {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 18px;
  padding: 12px;
}

.demo-root.demo-clean {
  gap: 0;
  padding: 0;
}

.demo-clean .stage {
  width: 100%;
}

.demo-clean .segment:has([data-action^="demo-"]),
.demo-clean .public-shell + div {
  display: none;
}

.demo-bar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  width: min(100%, 860px);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 8px;
  background: rgba(16, 17, 22, 0.84);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}

.demo-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.demo-button,
.icon-button,
.segment-button,
.ghost-button,
.primary-button {
  border: 0;
  cursor: pointer;
  transition:
    transform var(--motion-state) ease,
    background var(--motion-state) ease,
    color var(--motion-state) ease,
    opacity var(--motion-state) ease;
}

.demo-button {
  flex: 0 0 auto;
  min-height: 44px;
  border-radius: var(--radius-pill);
  padding: 0 14px;
  background: rgba(244, 242, 236, 0.1);
  color: rgba(244, 242, 236, 0.74);
  font-weight: 850;
}

.demo-button.active,
.segment-button.active {
  background: var(--cloud);
  color: var(--ink);
}

.public-tour-bar {
  width: min(100%, 1120px);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.public-tour-heading {
  display: grid;
  min-width: 154px;
  gap: 2px;
}

.public-tour-heading span {
  color: rgba(244, 242, 236, 0.58);
  font-size: 12px;
  font-weight: 760;
}

.public-tour-heading strong {
  color: var(--cloud);
  font-size: 15px;
  line-height: 1.15;
}

.public-tour-steps {
  min-width: 0;
}

.public-tour-next {
  background: var(--signal);
  color: var(--ink);
}

.public-tour-root .public-tour-bar {
  position: static;
}

@media (max-width: 760px) {
  .public-tour-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-tour-heading {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
}

.demo-button:hover,
.icon-button:hover,
.segment-button:hover,
.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
}

.stage {
  display: grid;
  width: min(100%, 1100px);
  justify-items: center;
}

.phone-shell {
  position: relative;
  width: 100%;
  max-width: var(--phone-max);
  min-height: 100dvh;
  overflow: hidden;
  border: 1px solid rgba(244, 242, 236, 0.12);
  background: var(--ink);
  box-shadow: var(--shadow-live);
}

.phone-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(16, 17, 22, 0.1), rgba(16, 17, 22, 0.42) 38%, rgba(16, 17, 22, 0.98) 70%),
    var(--hero-image);
  background-position: center top;
  background-size: cover;
  filter: saturate(0.96) contrast(1.04);
  transition: background-image var(--motion-panel) ease, opacity var(--motion-panel) ease;
}

.phone-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(244, 242, 236, 0.02), rgba(16, 17, 22, 0.18));
}

.phone-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  padding: var(--page-pad) var(--page-pad) calc(112px + env(safe-area-inset-bottom));
}

.topbar,
.panel-title,
.metric-row,
.list-row,
.host-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.glass-chip,
.round-chip,
.metric-chip,
.icon-button {
  min-height: 48px;
  border: 1px solid rgba(244, 242, 236, 0.16);
  background: rgba(16, 17, 22, 0.7);
  color: var(--cloud);
  backdrop-filter: blur(18px);
}

.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 900;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: var(--radius-pill);
  background: var(--signal);
  box-shadow: 0 0 24px rgba(201, 255, 71, 0.68);
}

.icon-button {
  display: grid;
  width: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: var(--radius-pill);
  font-size: 18px;
  font-weight: 950;
}

.round-chip {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 950;
  transform: rotate(-3deg);
}

.hero-block {
  margin-top: 118px;
  border: 1px solid rgba(244, 242, 236, 0.12);
  border-radius: var(--radius-xl);
  padding: 16px;
  background: rgba(16, 17, 22, 0.58);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 62px rgba(0, 0, 0, 0.22);
}

.hero-block.compact {
  margin-top: 48px;
}

.kicker {
  color: rgba(244, 242, 236, 0.72);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.hero-title {
  max-width: 390px;
  margin: 8px 0 0;
  color: var(--cloud);
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-title.small {
  font-size: 34px;
}

.hero-text {
  margin: 10px 0 0;
  color: rgba(244, 242, 236, 0.72);
  font-size: 14px;
  line-height: 1.42;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-xs);
  margin-top: 14px;
}

.metric-chip {
  min-width: 0;
  border-radius: var(--radius-card);
  padding: 10px 8px;
  text-align: center;
}

.metric-chip strong {
  display: block;
  color: var(--cloud);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
}

.metric-chip span {
  display: block;
  margin-top: 5px;
  color: var(--fog);
  font-size: 11px;
  line-height: 1.1;
}

.rail {
  display: flex;
  gap: var(--gap-sm);
  margin: 9px calc(var(--page-pad) * -1) 0;
  overflow-x: auto;
  padding: 5px var(--page-pad) 8px;
  scrollbar-width: none;
}

.rail-card {
  flex: 0 0 calc(100% - 34px);
  min-height: 116px;
  border: 1px solid rgba(244, 242, 236, 0.12);
  border-radius: var(--radius-choice);
  padding: 14px;
  background: rgba(244, 242, 236, 0.1);
  color: var(--cloud);
}

.rail-card.small {
  flex-basis: 146px;
}

.rail-card.medium {
  flex-basis: 232px;
}

.rail-card.selected,
.choice-card.selected {
  background: var(--cloud);
  color: var(--ink);
  transform: translateY(-3px) scale(1.012);
  box-shadow: 0 22px 44px rgba(244, 242, 236, 0.16);
}

.rail-card.selected span,
.choice-card.selected span,
.rail-card.selected p,
.choice-card.selected p {
  color: rgba(16, 17, 22, 0.58);
}

.mark {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: var(--radius-pill);
  background: rgba(244, 242, 236, 0.14);
  color: var(--cloud);
  font-size: 23px;
  font-weight: 600;
}

.selected .mark {
  background: transparent;
  color: var(--ink);
  font-size: 27px;
  transform: rotate(-4deg);
}

.surface {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  background: rgba(16, 17, 22, 0.82);
  backdrop-filter: blur(24px);
}

.surface.solid {
  background: var(--scrim-solid);
}

.surface.cloud {
  background: var(--cloud);
  color: var(--ink);
}

.panel-title strong,
.rail-card strong,
.choice-card strong,
.list-row strong,
.host-line strong {
  display: block;
  font-weight: 950;
}

.muted,
.rail-card span,
.choice-card span,
.list-row span,
.host-line span {
  color: var(--fog);
  font-size: 12px;
  line-height: 1.35;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-sm);
  margin-top: 14px;
}

.choice-grid.many {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.question-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 14px 0 0;
  overflow: hidden;
  border: 1px solid rgba(244, 242, 236, 0.16);
  border-radius: var(--radius-choice);
  background: rgba(8, 9, 12, 0.88);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.question-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.question-media.compact {
  border-radius: var(--radius-card);
}

.public-question-media {
  width: min(100%, 337.778px);
  max-height: none;
}

.choice-card {
  min-height: 136px;
  border: 1px solid rgba(244, 242, 236, 0.12);
  border-radius: var(--radius-choice);
  padding: 14px;
  background: rgba(16, 17, 22, 0.78);
  color: var(--cloud);
  text-align: left;
  box-shadow: none;
}

.choice-card.readonly {
  cursor: default;
}

.choice-card:not(.selected):hover {
  transform: translateY(-2px);
}

.choice-card[disabled],
.primary-button[disabled] {
  cursor: not-allowed;
  opacity: 0.54;
}

.text-answer {
  width: 100%;
  min-height: 112px;
  margin-top: 14px;
  border: 1px solid rgba(244, 242, 236, 0.14);
  border-radius: var(--radius-choice);
  padding: 16px;
  resize: vertical;
  background: rgba(244, 242, 236, 0.92);
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  outline: none;
}

.text-answer:focus {
  box-shadow: 0 0 0 3px rgba(201, 255, 71, 0.32);
}

.sticky-action {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  width: min(calc(100vw - 32px), 398px);
  min-height: 76px;
  grid-template-columns: minmax(92px, 0.42fr) 1fr;
  gap: 8px;
  padding: 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(244, 242, 236, 0.16);
  border-radius: var(--radius-pill);
  background: rgba(16, 17, 22, 0.84);
  backdrop-filter: blur(24px);
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.44);
}

.sticky-action.wide-lead {
  grid-template-columns: minmax(116px, 0.48fr) 1fr;
}

.sticky-meta {
  display: grid;
  min-height: 60px;
  place-items: center;
  border-radius: var(--radius-pill);
  background: rgba(244, 242, 236, 0.12);
  color: var(--cloud);
  font-weight: 950;
  text-align: center;
}

.primary-button {
  min-height: 60px;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  background: var(--pulse);
  color: white;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 18px 48px rgba(112, 92, 255, 0.38);
}

.primary-button.cloud {
  background: var(--cloud);
  color: var(--ink);
  box-shadow: none;
}

.primary-button.signal {
  background: var(--signal);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(201, 255, 71, 0.22);
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  border-radius: var(--radius-pill);
  padding: 6px;
  background: rgba(244, 242, 236, 0.1);
  backdrop-filter: blur(18px);
}

.segment.two {
  grid-template-columns: repeat(2, 1fr);
}

.segment-button {
  min-height: 48px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fog);
  font-size: 13px;
  font-weight: 950;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.list-row,
.host-line {
  min-height: 58px;
  border-radius: var(--radius-card);
  padding: 12px 14px;
  background: rgba(244, 242, 236, 0.09);
}

.list-row.gold {
  background: var(--gold);
  color: var(--ink);
}

.list-row.signal {
  background: var(--signal);
  color: var(--ink);
}

.score-number {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 0.86;
  font-weight: 950;
}

.host-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.host-line {
  background: rgba(8, 9, 12, 0.82);
}

.host-line b {
  color: var(--signal);
  font-size: 13px;
}

.rating-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.star-button {
  display: grid;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(244, 242, 236, 0.12);
  color: var(--fog);
  font-size: 22px;
  cursor: pointer;
}

.star-button.active {
  background: var(--gold);
  color: var(--ink);
}

.public-shell {
  position: relative;
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(244, 242, 236, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(16, 17, 22, 0.92), rgba(16, 17, 22, 0.42) 50%, rgba(16, 17, 22, 0.86)),
    var(--public-image, url("../assets/generated/quiz-public-room-v1-web.jpg"));
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-live);
}

.public-content {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 0.98fr 1.02fr;
  gap: 28px;
  padding: 42px;
}

.public-panel {
  align-self: end;
  border: 1px solid rgba(244, 242, 236, 0.14);
  border-radius: 32px;
  padding: 28px;
  background: rgba(16, 17, 22, 0.82);
  backdrop-filter: blur(20px);
}

.public-title {
  margin: 0;
  color: var(--cloud);
  font-size: 48px;
  line-height: 0.96;
  letter-spacing: 0;
}

.public-panel:has(.public-question-media) .public-title {
  font-size: 48px;
}

.hero-title[tabindex="-1"]:focus,
.public-title[tabindex="-1"]:focus {
  outline: none;
}

.qr-box {
  display: grid;
  width: min(24vw, 220px);
  gap: 10px;
  border-radius: 26px;
  padding: 12px;
  background: var(--cloud);
  color: var(--ink);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28);
}

.qr-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: contain;
  image-rendering: crisp-edges;
}

.qr-caption {
  display: grid;
  gap: 2px;
}

.qr-caption strong {
  font-size: 17px;
  font-weight: 950;
  line-height: 1.1;
}

.qr-caption span {
  color: rgba(16, 17, 22, 0.58);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.2;
}

.overview-grid {
  display: grid;
  width: min(100%, 1180px);
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 14px;
  align-items: start;
}

.overview-phone {
  width: 250px;
  height: 541px;
  overflow: hidden;
  border: 1px solid rgba(244, 242, 236, 0.12);
  border-radius: 28px;
  background: var(--ink);
  justify-self: center;
  transform-origin: top center;
}

.overview-phone .phone-shell {
  min-height: 844px;
  transform: scale(0.64);
  transform-origin: top left;
  width: 390px;
  max-width: 390px;
}

.overview-phone .phone-content {
  min-height: 844px;
}

.overview-phone .sticky-action {
  position: absolute;
  bottom: 16px;
  width: calc(100% - 32px);
}

.overview-public {
  grid-column: span 2;
  width: 514px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  justify-self: center;
}

.overview-public .public-shell {
  width: 1120px;
  max-width: none;
  transform: scale(0.459);
  transform-origin: top left;
}

@media (min-width: 640px) {
  .phone-shell {
    min-height: 844px;
    border-radius: 42px;
  }

  .phone-content {
    min-height: 844px;
  }
}

@media (max-width: 374px) {
  .phone-content {
    padding-right: var(--page-pad-sm);
    padding-left: var(--page-pad-sm);
  }

  .hero-title {
    font-size: 34px;
  }

  .choice-card {
    min-height: 126px;
    padding: 12px;
  }

  .sticky-action {
    grid-template-columns: minmax(92px, 0.42fr) 1fr;
  }
}

@media (min-width: 414px) {
  .phone-content {
    padding-right: var(--page-pad-lg);
    padding-left: var(--page-pad-lg);
  }

  .hero-title {
    font-size: 40px;
  }

  .sticky-action {
    grid-template-columns: minmax(104px, 0.42fr) 1fr;
  }
}

@media (max-width: 880px) {
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-public {
    grid-column: span 2;
  }

  .public-title {
    font-size: 42px;
  }
}

.demo-clean .demo-only {
  display: none;
}

.toast-message {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  z-index: 60;
  width: min(calc(100vw - 32px), 398px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 13px 18px;
  background: rgba(16, 17, 22, 0.94);
  color: var(--cloud);
  font-weight: 850;
  text-align: center;
  box-shadow: var(--shadow-live);
}

.secondary-button,
.text-button {
  min-height: 48px;
  border: 1px solid rgba(244, 242, 236, 0.16);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform var(--motion-ui) ease,
    background var(--motion-ui) ease;
}

.secondary-button {
  width: 100%;
  margin-top: 12px;
  background: rgba(244, 242, 236, 0.12);
  color: var(--cloud);
}

.surface.cloud .secondary-button {
  border-color: rgba(16, 17, 22, 0.14);
  background: rgba(16, 17, 22, 0.08);
  color: var(--ink);
}

.text-button {
  background: transparent;
  color: var(--fog);
}

.secondary-button:hover,
.text-button:hover {
  transform: translateY(-2px);
}

[data-testid="timer-toggle"],
[data-testid="timer-toggle"]:hover {
  transform: none;
  transition: none;
}

.secondary-button[disabled],
.text-button[disabled] {
  cursor: not-allowed;
  opacity: 0.46;
}

.sticky-status {
  display: grid;
  min-height: 60px;
  place-items: center;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  background: var(--cloud);
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  text-align: center;
}

.sticky-status.signal {
  background: var(--signal);
}

.rail-card.disabled {
  opacity: 0.48;
}

.choice-grid.one-column {
  grid-template-columns: 1fr;
}

.lock-note {
  margin-top: 12px;
  border-radius: var(--radius-pill);
  padding: 12px 14px;
  background: rgba(16, 17, 22, 0.08);
  font-size: 13px;
  font-weight: 850;
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-line span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(201, 255, 71, 0.45);
  animation: loading-pulse 1.2s ease infinite;
}

@keyframes loading-pulse {
  70% {
    box-shadow: 0 0 0 12px rgba(201, 255, 71, 0);
  }
}

.error-surface {
  border-color: rgba(255, 107, 97, 0.52);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }

  .demo-button:hover,
  .icon-button:hover,
  .segment-button:hover,
  .ghost-button:hover,
  .primary-button:hover,
  .secondary-button:hover,
  .text-button:hover,
  .rail-card.selected,
  .choice-card.selected {
    transform: none;
  }
}
