:root {
  --ink: #17122b;
  --ink-soft: #39324f;
  --paper: #fffaf2;
  --white: #ffffff;
  --coral: #ff5d6c;
  --coral-dark: #dc3f52;
  --lavender: #a98bff;
  --lavender-dark: #7652de;
  --lime: #b9ed74;
  --lime-dark: #75a43d;
  --blue: #5bb8ff;
  --blue-dark: #277abb;
  --yellow: #ffd45b;
  --red: #f44d66;
  --green: #55c98d;
  --muted: #716b80;
  --line: rgba(23, 18, 43, 0.12);
  --shadow: 0 18px 50px rgba(23, 18, 43, 0.14);
  --shadow-small: 0 8px 20px rgba(23, 18, 43, 0.1);
  --radius: 24px;
  font-family:
    Inter, ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 15%, rgba(169, 139, 255, 0.2), transparent 25rem),
    radial-gradient(circle at 90% 80%, rgba(255, 93, 108, 0.13), transparent 28rem),
    var(--paper);
}

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

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 4px solid rgba(91, 184, 255, 0.45);
  outline-offset: 2px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.15'/%3E%3C/svg%3E");
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 34px;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  color: var(--white);
  background: var(--coral);
  box-shadow: 0 6px 0 var(--coral-dark);
  font-size: 18px;
  transform: rotate(-3deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 5px;
  border-width: 7px 7px 0 0;
  border-style: solid;
  border-color: var(--coral-dark) transparent transparent transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 11px 20px;
  background: var(--white);
  box-shadow: 0 5px 0 var(--ink);
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-primary {
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 5px 0 rgba(23, 18, 43, 0.32);
}

.btn-primary:hover {
  box-shadow: 0 7px 0 rgba(23, 18, 43, 0.32);
}

.btn-coral {
  border-color: var(--coral-dark);
  color: var(--white);
  background: var(--coral);
  box-shadow: 0 5px 0 var(--coral-dark);
}

.btn-coral:hover {
  box-shadow: 0 7px 0 var(--coral-dark);
}

.btn-large {
  min-height: 58px;
  padding: 15px 26px;
  border-radius: 17px;
  font-size: 17px;
}

.btn-wide {
  width: 100%;
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn-quiet:hover,
.btn-quiet:active {
  box-shadow: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: 0 5px 0 rgba(23, 18, 43, 0.22);
}

.hero {
  display: grid;
  min-height: calc(100vh - 88px);
  align-items: center;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(48px, 8vw, 108px);
  padding: 48px 0 96px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  border: 1px solid rgba(118, 82, 222, 0.22);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--lavender-dark);
  background: rgba(169, 139, 255, 0.13);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 93, 108, 0.12);
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(58px, 8.2vw, 108px);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.84;
}

.hero h1 span {
  position: relative;
  display: inline-block;
  color: var(--coral);
  transform: rotate(-2deg);
}

.hero h1 span::after {
  content: "";
  position: absolute;
  right: 0.03em;
  bottom: -0.06em;
  left: 0.06em;
  height: 0.09em;
  border-radius: 999px;
  background: var(--yellow);
  transform: rotate(-1deg);
}

.hero-copy {
  max-width: 560px;
  margin: 30px 0 34px;
  color: var(--ink-soft);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 38px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 7px;
}

.check {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 12px;
  font-weight: 950;
}

.join-card {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 28px;
  padding: clamp(28px, 5vw, 48px);
  background: var(--white);
  box-shadow:
    12px 12px 0 var(--ink),
    var(--shadow);
  transform: rotate(1deg);
}

.join-card::before,
.join-card::after {
  content: "";
  position: absolute;
  z-index: -1;
}

.join-card::before {
  width: 82px;
  height: 82px;
  top: -42px;
  right: -34px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.join-card::after {
  width: 58px;
  height: 58px;
  bottom: -32px;
  left: -28px;
  border: 2px solid var(--ink);
  background: var(--blue);
  transform: rotate(18deg);
}

.join-card h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.045em;
}

.join-card p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.5;
}

.join-form {
  display: grid;
  gap: 14px;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
  font-weight: 650;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.field:hover,
.field:focus {
  border-color: var(--ink);
}

.code-field {
  min-height: 70px;
  border: 2px solid var(--ink);
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 950;
  letter-spacing: 0.18em;
  text-align: center;
}

.form-error {
  margin: 0;
  border-radius: 12px;
  padding: 11px 13px;
  color: #91283a;
  background: rgba(244, 77, 102, 0.12);
  font-size: 14px;
  font-weight: 750;
}

.legal-note {
  margin-top: 18px !important;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.screen {
  min-height: 100vh;
}

.screen-dark {
  color: var(--white);
  background:
    radial-gradient(circle at 20% 20%, rgba(169, 139, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 80% 90%, rgba(255, 93, 108, 0.13), transparent 30rem),
    var(--ink);
}

.screen-dark .brand {
  color: var(--white);
}

.screen-dark .btn-quiet {
  color: var(--white);
}

.screen-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 8px 11px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(85, 201, 141, 0.16);
}

.builder {
  padding-bottom: 120px;
}

.builder-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 40px 0 34px;
}

.builder-head h1 {
  margin: 6px 0 0;
  font-size: clamp(38px, 6vw, 64px);
  letter-spacing: -0.06em;
  line-height: 1;
}

.builder-sub {
  margin: 0;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.builder-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
}

.quiz-title-card,
.question-card,
.builder-side {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(18px);
}

.quiz-title-card {
  margin-bottom: 20px;
  padding: 24px;
}

.quiz-title {
  border: 0;
  padding: 5px 0;
  background: transparent;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.question-list {
  display: grid;
  gap: 20px;
}

.question-card {
  overflow: hidden;
}

.question-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.question-number {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 900;
}

.number-chip {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: var(--white);
  background: var(--ink);
  font-size: 13px;
}

.timer-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-weight: 800;
}

.question-card-body {
  padding: 22px;
}

.prompt-field {
  min-height: 52px;
  margin-bottom: 16px;
  font-size: 19px;
  font-weight: 800;
}

.answer-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-editor {
  display: grid;
  align-items: center;
  grid-template-columns: 38px 1fr 38px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 13px;
  background: rgba(23, 18, 43, 0.045);
}

.answer-editor.correct {
  border-color: var(--green);
  background: rgba(85, 201, 141, 0.09);
}

.shape {
  display: inline-grid;
  place-items: center;
  font-size: 19px;
}

.answer-editor .field {
  border: 0;
  border-radius: 0;
  padding-inline: 4px;
  background: transparent;
  box-shadow: none;
}

.answer-editor input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

.remove-question {
  border: 0;
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.remove-question:hover {
  color: var(--red);
}

.add-question {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px dashed rgba(23, 18, 43, 0.25);
  border-radius: 20px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.4);
  font-weight: 850;
  cursor: pointer;
}

.add-question:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--white);
}

.builder-side {
  position: sticky;
  top: 24px;
  padding: 24px;
}

.builder-side h3 {
  margin: 0 0 18px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.summary-list {
  display: grid;
  gap: 13px;
  margin: 0 0 24px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

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

.divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.center-stage {
  display: grid;
  min-height: calc(100vh - 82px);
  align-items: center;
  justify-items: center;
  padding: 36px 0 76px;
  text-align: center;
}

.name-card {
  width: min(480px, 100%);
  border: 2px solid var(--ink);
  border-radius: 28px;
  padding: clamp(28px, 7vw, 48px);
  background: var(--white);
  box-shadow: 10px 10px 0 var(--ink);
}

.name-card .mini-code {
  display: inline-block;
  margin-bottom: 18px;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--lavender-dark);
  background: rgba(169, 139, 255, 0.13);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.name-card h1 {
  margin: 0 0 10px;
  font-size: clamp(36px, 7vw, 52px);
  letter-spacing: -0.055em;
}

.name-card > p {
  margin: 0 0 28px;
  color: var(--muted);
}

.name-form {
  display: grid;
  gap: 13px;
}

.name-field {
  min-height: 62px;
  border-color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  text-align: center;
}

.game-stage {
  display: flex;
  min-height: calc(100vh - 82px);
  flex-direction: column;
  padding: 24px 0 50px;
}

.lobby-layout {
  display: grid;
  flex: 1;
  align-items: center;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 48px;
}

.lobby-callout {
  text-align: center;
}

.lobby-kicker,
.game-kicker {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.room-code {
  display: inline-block;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 16px 28px 19px;
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
  font-size: clamp(48px, 6.5vw, 78px);
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.lobby-callout h1 {
  margin: 27px 0 10px;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.05em;
}

.lobby-callout > p {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.64);
}

.roster-panel {
  min-height: 440px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.07);
}

.roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.roster-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.player-count {
  display: inline-grid;
  min-width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 11px;
  color: var(--ink);
  background: var(--lime);
  font-weight: 950;
}

.player-grid {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.player-avatar {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lavender);
  font-size: 11px;
  font-weight: 950;
}

.player-chip:nth-child(4n + 2) .player-avatar {
  background: var(--coral);
}

.player-chip:nth-child(4n + 3) .player-avatar {
  background: var(--lime);
}

.player-chip:nth-child(4n + 4) .player-avatar {
  background: var(--blue);
}

.empty-roster {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: rgba(255, 255, 255, 0.48);
  text-align: center;
}

.empty-roster-orbit {
  display: block;
  width: 62px;
  height: 62px;
  margin: 0 auto 15px;
  border: 3px dashed rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  animation: spin 8s linear infinite;
}

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

.waiting-player {
  width: min(620px, 100%);
  text-align: center;
}

.waiting-orb {
  position: relative;
  display: grid;
  width: 130px;
  height: 130px;
  margin: 0 auto 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 0 0 16px rgba(185, 237, 116, 0.1);
  font-size: 42px;
  font-weight: 950;
  animation: breathe 1.8s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 28px rgba(185, 237, 116, 0.04);
  }
}

.waiting-player h1 {
  margin: 0 0 12px;
  font-size: clamp(42px, 8vw, 72px);
  letter-spacing: -0.06em;
}

.waiting-player p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 18px;
}

.waiting-name {
  color: var(--yellow);
}

.question-head {
  display: grid;
  align-items: start;
  grid-template-columns: 90px 1fr 90px;
  gap: 26px;
  margin: 12px 0 28px;
}

.timer {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.06);
  font-size: 26px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.question-title-wrap {
  text-align: center;
}

.question-progress {
  margin: 0 0 12px;
  color: var(--lavender);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question-prompt {
  max-width: 950px;
  margin: 0 auto;
  font-size: clamp(30px, 4.8vw, 58px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.06;
}

.answer-count {
  display: grid;
  justify-items: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.answer-count strong {
  color: var(--white);
  font-size: 28px;
  letter-spacing: 0;
}

.answer-grid {
  display: grid;
  flex: 1;
  align-content: stretch;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.answer-tile {
  position: relative;
  display: grid;
  min-height: 160px;
  align-items: center;
  grid-template-columns: 60px 1fr;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  padding: 24px 30px;
  color: var(--white);
  background: var(--coral);
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.2);
  font-size: clamp(18px, 2.7vw, 30px);
  font-weight: 900;
  text-align: left;
}

button.answer-tile {
  cursor: pointer;
  transition:
    transform 140ms ease,
    filter 140ms ease;
}

button.answer-tile:hover {
  z-index: 2;
  filter: brightness(1.07);
  transform: scale(1.015);
}

button.answer-tile:active {
  transform: scale(0.98);
}

.answer-tile:nth-child(2) {
  background: var(--blue-dark);
}

.answer-tile:nth-child(3) {
  background: var(--yellow);
  color: var(--ink);
}

.answer-tile:nth-child(4) {
  background: var(--lavender-dark);
}

.answer-tile .shape {
  font-size: 34px;
}

.answer-tile.correct-answer {
  outline: 5px solid var(--green);
  outline-offset: -5px;
  filter: brightness(1.08);
}

.answer-tile.wrong-answer {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.answer-locked {
  display: grid;
  flex: 1;
  place-items: center;
  text-align: center;
}

.lock-icon {
  display: grid;
  width: 110px;
  height: 110px;
  margin: 0 auto 28px;
  place-items: center;
  border-radius: 30px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.25);
  font-size: 42px;
  transform: rotate(-4deg);
}

.answer-locked h1 {
  margin: 0 0 11px;
  font-size: clamp(42px, 8vw, 72px);
  letter-spacing: -0.06em;
}

.answer-locked p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 18px;
}

.results-layout {
  display: grid;
  flex: 1;
  align-items: center;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 42px;
  padding: 24px 0;
}

.answer-reveal h1,
.leaderboard-panel h2 {
  margin: 0;
  letter-spacing: -0.045em;
}

.answer-reveal h1 {
  max-width: 720px;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.08;
}

.result-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.result-answer {
  position: relative;
  min-height: 110px;
  border-radius: 17px;
  padding: 18px 18px 42px;
  color: var(--white);
  background: var(--coral);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18);
  font-size: 17px;
  font-weight: 850;
}

.result-answer:nth-child(2) {
  background: var(--blue-dark);
}

.result-answer:nth-child(3) {
  color: var(--ink);
  background: var(--yellow);
}

.result-answer:nth-child(4) {
  background: var(--lavender-dark);
}

.result-answer.not-correct {
  opacity: 0.38;
}

.result-answer.correct-answer::after {
  content: "✓";
  position: absolute;
  top: 13px;
  right: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 15px;
}

.result-answer-count {
  position: absolute;
  right: 18px;
  bottom: 13px;
  left: 18px;
  font-size: 12px;
  font-weight: 950;
  opacity: 0.8;
}

.leaderboard-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.07);
}

.leaderboard-panel h2 {
  margin-bottom: 20px;
  font-size: 28px;
}

.leaderboard {
  display: grid;
  gap: 9px;
}

.leader-row {
  display: grid;
  align-items: center;
  grid-template-columns: 35px 1fr auto;
  gap: 10px;
  border-radius: 13px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
}

.leader-row:first-child {
  color: var(--ink);
  background: var(--yellow);
}

.leader-rank {
  font-weight: 950;
}

.leader-name {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.leaderboard-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.personal-result {
  display: grid;
  min-height: calc(100vh - 82px);
  align-items: center;
  justify-items: center;
  padding: 36px 0 70px;
  text-align: center;
}

.result-icon {
  display: grid;
  width: 118px;
  height: 118px;
  margin: 0 auto 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--green);
  box-shadow: 0 0 0 18px rgba(85, 201, 141, 0.1);
  font-size: 48px;
  font-weight: 950;
}

.result-icon.incorrect {
  background: var(--coral);
  box-shadow: 0 0 0 18px rgba(255, 93, 108, 0.1);
}

.personal-result h1 {
  margin: 0;
  font-size: clamp(54px, 11vw, 94px);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.result-points {
  margin: 17px 0 32px;
  color: var(--yellow);
  font-size: 22px;
  font-weight: 900;
}

.personal-stats {
  display: grid;
  width: min(540px, 100%);
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px 12px;
  background: rgba(255, 255, 255, 0.07);
}

.stat-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--white);
  font-size: 26px;
}

.stat-card span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.correct-note {
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.62);
}

.correct-note strong {
  color: var(--white);
}

.final-stage {
  display: grid;
  min-height: calc(100vh - 82px);
  align-items: center;
  justify-items: center;
  padding: 20px 0 60px;
  text-align: center;
}

.final-stage h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 76px);
  letter-spacing: -0.065em;
}

.final-stage > div > p {
  margin: 8px 0 40px;
  color: rgba(255, 255, 255, 0.6);
}

.podium {
  display: flex;
  min-height: 330px;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 34px;
}

.podium-place {
  display: flex;
  width: min(190px, 28vw);
  flex-direction: column;
  align-items: center;
}

.podium-avatar {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 10px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--ink);
  background: var(--lavender);
  font-size: 23px;
  font-weight: 950;
}

.podium-name {
  width: 100%;
  overflow: hidden;
  margin-bottom: 5px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 800;
}

.podium-block {
  display: grid;
  width: 100%;
  place-items: start center;
  border-radius: 18px 18px 0 0;
  padding-top: 20px;
  color: var(--ink);
  background: var(--blue);
  font-size: 36px;
  font-weight: 950;
}

.place-1 {
  order: 2;
}

.place-1 .podium-avatar {
  width: 76px;
  height: 76px;
  background: var(--yellow);
  font-size: 28px;
}

.place-1 .podium-block {
  height: 180px;
  background: var(--yellow);
}

.place-2 {
  order: 1;
}

.place-2 .podium-block {
  height: 130px;
  background: #dfe6ef;
}

.place-3 {
  order: 3;
}

.place-3 .podium-avatar {
  background: var(--coral);
}

.place-3 .podium-block {
  height: 92px;
  background: #d99668;
}

.player-final-card {
  width: min(560px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.07);
}

.player-final-rank {
  display: grid;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 0 0 16px rgba(255, 212, 91, 0.1);
  font-size: 50px;
  font-weight: 950;
}

.player-final-card h1 {
  font-size: clamp(46px, 10vw, 72px);
}

.loading {
  display: grid;
  min-height: calc(100vh - 82px);
  place-items: center;
  text-align: center;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.loading-dots span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--coral);
  animation: bounce 900ms ease-in-out infinite alternate;
}

.loading-dots span:nth-child(2) {
  background: var(--yellow);
  animation-delay: 150ms;
}

.loading-dots span:nth-child(3) {
  background: var(--blue);
  animation-delay: 300ms;
}

@keyframes bounce {
  to {
    transform: translateY(-12px);
  }
}

.toast {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 44px));
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 13px 16px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 6px 6px 0 var(--ink);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti span {
  position: absolute;
  top: -20px;
  width: 11px;
  height: 20px;
  border-radius: 3px;
  background: var(--coral);
  animation: fall 5s linear infinite;
}

.confetti span:nth-child(4n + 2) {
  background: var(--yellow);
}

.confetti span:nth-child(4n + 3) {
  background: var(--blue);
}

.confetti span:nth-child(4n + 4) {
  background: var(--lime);
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 56px;
  }

  .hero-copy {
    max-width: 650px;
  }

  .join-card {
    width: min(620px, 100%);
    justify-self: center;
  }

  .builder-layout {
    grid-template-columns: 1fr;
  }

  .builder-side {
    position: static;
  }

  .lobby-layout,
  .results-layout {
    grid-template-columns: 1fr;
  }

  .lobby-layout {
    padding-top: 30px;
  }

  .roster-panel {
    min-height: 320px;
  }

  .empty-roster {
    min-height: 180px;
  }

  .results-layout {
    align-items: start;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .site-nav {
    min-height: 72px;
  }

  .nav-actions .btn:first-child {
    display: none;
  }

  .hero {
    padding: 32px 0 76px;
    gap: 70px;
  }

  .hero h1 {
    font-size: clamp(55px, 18vw, 78px);
  }

  .hero-copy {
    margin-top: 24px;
    font-size: 18px;
  }

  .join-card {
    border-radius: 23px;
    box-shadow: 8px 8px 0 var(--ink);
    transform: none;
  }

  .builder-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .builder-head .btn {
    width: 100%;
  }

  .answer-editor-grid,
  .answer-grid,
  .result-answers {
    grid-template-columns: 1fr;
  }

  .question-card-head {
    align-items: flex-start;
  }

  .answer-editor {
    grid-template-columns: 34px 1fr 34px;
  }

  .screen-header .header-meta .status-pill {
    display: none;
  }

  .game-stage {
    padding-top: 8px;
  }

  .lobby-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .room-code {
    padding: 14px 18px 17px;
    font-size: clamp(45px, 15vw, 66px);
  }

  .roster-panel {
    padding: 21px;
  }

  .question-head {
    grid-template-columns: 58px 1fr 58px;
    gap: 10px;
    margin-bottom: 20px;
  }

  .timer {
    width: 54px;
    height: 54px;
    border-width: 3px;
    font-size: 19px;
  }

  .question-progress {
    font-size: 11px;
  }

  .question-prompt {
    font-size: clamp(25px, 7.5vw, 38px);
  }

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

  .answer-count span {
    display: none;
  }

  .answer-grid {
    gap: 10px;
  }

  .answer-tile {
    min-height: 106px;
    grid-template-columns: 40px 1fr;
    border-radius: 16px;
    padding: 18px;
    font-size: 19px;
  }

  .answer-tile .shape {
    font-size: 25px;
  }

  .results-layout {
    gap: 25px;
  }

  .result-answer {
    min-height: 88px;
  }

  .personal-stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .stat-card strong {
    margin: 0;
  }

  .podium {
    min-height: 290px;
  }

  .podium-avatar {
    width: 48px;
    height: 48px;
  }

  .place-1 .podium-avatar {
    width: 58px;
    height: 58px;
  }

  .podium-name {
    font-size: 12px;
  }

  .podium-score {
    font-size: 10px;
  }
}

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