:root {
  color-scheme: light;
  --ink: var(--kq-ink);
  --paper: var(--kq-blue);
  --white: var(--kq-white);
  --blue: var(--kq-blue);
  --blue-deep: var(--kq-blue-deep);
  --pink: var(--kq-pink);
  --aqua: var(--kq-aqua);
  --yellow: var(--kq-yellow);
  --green: var(--kq-green);
  --red: var(--kq-red);
  --line: rgba(255, 255, 255, 0.26);
  --muted: rgba(255, 255, 255, 0.72);
  --shadow: 0 22px 52px rgba(20, 14, 92, 0.22);
  --font-display: var(--kq-font-display);
  --font-ui: var(--kq-font-ui);
  --font-data: var(--kq-font-data);
}

* {
  box-sizing: border-box;
}

[hidden],
.sr-only {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: #fff;
  font-family: var(--font-ui);
  letter-spacing: 0;
  touch-action: manipulation;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: min(48vw, 620px);
  height: min(32vh, 320px);
  right: -10vw;
  top: 76px;
  border-radius: 110px 0 0 220px;
  background: var(--pink);
}

body::after {
  width: min(44vw, 560px);
  height: min(38vh, 360px);
  right: -12vw;
  bottom: 0;
  border-radius: 250px 0 0 88px;
  background: var(--aqua);
}

a,
button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

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

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100vw - 24px));
  margin: 0 auto;
}

.site-header {
  height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.wordmark {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark strong,
h1,
h2 {
  font-family: var(--font-display);
}

.wordmark strong,
.wordmark small {
  display: block;
}

.wordmark strong {
  color: #fff;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 950;
  line-height: 0.92;
}

.wordmark small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.app-tabs,
.admin-tabs {
  min-width: 0;
  justify-self: end;
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.app-tabs a {
  min-height: 34px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 900;
}

.app-tabs a[aria-current="page"] {
  background: var(--blue);
  color: #fff;
}

main {
  height: calc(100dvh - 116px);
  min-height: 550px;
  overflow: hidden;
  position: relative;
}

body[data-auth-gate="true"] main {
  width: min(980px, calc(100vw - 24px));
  height: 100dvh;
  min-height: 0;
  display: grid;
  align-items: center;
  padding: 12px 0;
}

.app-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.auth-gate {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  align-items: center;
  gap: clamp(18px, 4vw, 44px);
}

.auth-copy,
.auth-card {
  min-height: 0;
}

.auth-copy {
  display: grid;
  align-content: center;
  gap: 14px;
}

.auth-copy .kq-mark {
  width: 50px;
  height: 50px;
  font-size: 18px;
}

.auth-card {
  padding: clamp(18px, 4vw, 28px);
  display: grid;
  gap: 12px;
  border-radius: 28px;
  background: rgba(47, 41, 144, 0.62);
  box-shadow: inset 0 0 0 1px var(--line);
}

.auth-card .signup-form {
  max-width: none;
  grid-template-columns: 1fr;
}

.auth-card .access-switch {
  width: 100%;
}

.auth-card .access-switch button {
  flex: 1;
}

.google-auth-block {
  display: grid;
  gap: 8px;
}

.google-slot {
  min-height: 44px;
}

.google-cta {
  min-height: 48px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: #fff;
  color: #1f1f1f;
  font-weight: 900;
}

.google-cta span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-consent {
  display: grid;
  gap: 8px;
}

.auth-consent label {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
}

.auth-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--yellow);
}

.field-status {
  min-height: 18px;
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
}

.field-status[data-state="available"] {
  color: var(--yellow);
}

.field-status[data-state="unavailable"],
.field-status[data-state="invalid"] {
  color: #fff;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  grid-template-areas:
    "copy board"
    "copy chat";
  align-items: stretch;
  gap: 14px;
}

body[data-signed-up="true"] .hero-grid {
  grid-template-areas: "copy chat";
  grid-template-rows: 1fr;
}

.hero-copy,
.broadcast-board,
.pregame-panel,
.section-grid,
.site-footer {
  position: relative;
  z-index: 1;
}

.hero-copy {
  grid-area: copy;
  min-height: 0;
  padding: clamp(22px, 4vw, 44px);
  display: grid;
  align-content: center;
  gap: 14px;
  overflow: hidden;
  border-radius: 30px;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.eyebrow {
  margin: 0;
  color: var(--yellow);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  color: #fff;
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 950;
  line-height: 0.88;
}

h2 {
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 950;
  line-height: 0.96;
}

.event-line {
  margin: 6px 0 0;
  color: #fff;
  font-family: var(--font-data);
  font-size: clamp(14px, 1.9vw, 20px);
  font-weight: 850;
}

.test-note {
  max-width: 600px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.28;
}

.signup-form {
  max-width: 680px;
  margin-top: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto;
  gap: 9px;
  align-items: end;
}

.access-switch {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.access-switch button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 950;
}

.access-switch button[aria-current="page"] {
  background: #fff;
  color: var(--blue-deep);
}

.signup-form label {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.signup-form input,
.chat-form input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 760;
}

.primary-cta,
.secondary-cta,
.chat-form button {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--blue-deep);
  font-weight: 950;
}

.secondary-cta {
  width: 100%;
  background: #fff;
}

.inline-status {
  min-height: 18px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
}

.broadcast-board,
.pregame-panel {
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(47, 41, 144, 0.56);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.broadcast-board {
  grid-area: board;
  display: grid;
  align-content: center;
  gap: 12px;
}

.topline,
.board-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  font-weight: 900;
}

.board-label {
  color: var(--yellow);
  font-size: 18px;
  font-weight: 900;
}

.countdown-display {
  color: #fff;
  font-family: var(--font-data);
  font-size: clamp(44px, 5.8vw, 76px);
  font-weight: 900;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.board-meta {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.broadcast-board .inline-status,
.pregame-panel .inline-status {
  color: rgba(255, 255, 255, 0.72);
}

.pregame-panel {
  grid-area: chat;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  align-content: stretch;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.chat-head strong {
  color: var(--yellow);
  font-family: var(--font-data);
  font-size: 12px;
}

.chat-countdown {
  margin: 10px 0 12px;
  padding: 12px;
  display: grid;
  gap: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.chat-countdown span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-countdown strong {
  color: #fff;
  font-family: var(--font-data);
  font-size: clamp(32px, 8vw, 54px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chat-list {
  min-height: 0;
  max-height: none;
  display: grid;
  align-content: end;
  gap: 7px;
  overflow: hidden;
}

.chat-message {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 740;
  line-height: 1.2;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.chat-message strong {
  color: #fff;
  font-weight: 900;
}

.chat-message[data-kind="system"] strong {
  color: var(--yellow);
}

.chat-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-form input {
  min-width: 0;
  box-shadow: inset 0 0 0 1px var(--line);
}

.chat-form button {
  background: var(--aqua);
}

.chat-actions {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.live-link {
  width: 100%;
}

.section-grid {
  padding: clamp(18px, 4vw, 42px);
  border-radius: 30px;
  background: rgba(47, 41, 144, 0.62);
  box-shadow: inset 0 0 0 1px var(--line);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 28px;
}

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

.steps li {
  min-height: 74px;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  background: #f7f6ff;
}

.flow-steps li {
  background: rgba(255, 255, 255, 0.12);
}

.flow-steps b {
  color: #fff;
}

.steps strong {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--blue-deep);
  font-family: var(--font-data);
  font-size: 14px;
}

.steps span,
.fairness-copy {
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.34;
  font-weight: 720;
}

.rules-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rules-strip span {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.history-panel,
.profile-panel {
  padding: clamp(18px, 4vw, 42px);
  border-radius: 30px;
  background: rgba(47, 41, 144, 0.62);
  box-shadow: inset 0 0 0 1px var(--line);
}

.history-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.58fr) minmax(0, 1fr);
  gap: 18px;
}

.history-list {
  min-height: 0;
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.history-card {
  min-height: 0;
  padding: 13px;
  display: grid;
  gap: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.history-main {
  display: grid;
  gap: 3px;
}

.history-main span,
.history-main small,
.history-meta span,
.history-card p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.history-main strong {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 0.98;
}

.history-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.history-meta div {
  min-width: 0;
  padding: 9px;
  display: grid;
  gap: 3px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.history-meta strong,
.winner-list {
  color: #fff;
  font-weight: 950;
}

.history-meta strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.winner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}

.winner-list span {
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--blue-deep);
}

.history-card p {
  margin: 0;
}

.profile-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.profile-copy p {
  max-width: 420px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 760;
  line-height: 1.32;
}

.profile-summary {
  min-height: 0;
  padding: 15px;
  display: grid;
  gap: 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
}

.profile-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-headline span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-weight: 950;
}

.profile-headline button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--blue-deep);
  font-weight: 950;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-stats div {
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
}

.profile-stats span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-stats strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #fff;
  font-family: var(--font-data);
  font-size: clamp(18px, 3vw, 32px);
}

.fairness-copy p {
  margin: 0 0 12px;
}

.site-footer {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 780;
}

.footer-links {
  display: inline-flex;
  gap: 10px;
}

@media (max-width: 820px) {
  .site-header,
  main,
  .site-footer {
    width: calc(100vw - 18px);
  }

  .site-header {
    height: 64px;
    grid-template-columns: 1fr;
    gap: 6px;
    align-content: center;
  }

  .wordmark {
    justify-self: start;
  }

  .wordmark .kq-mark {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .wordmark strong {
    font-size: 21px;
  }

  .wordmark small {
    display: none;
  }

  .app-tabs {
    width: 100%;
    justify-self: stretch;
    overflow: hidden;
  }

  .app-tabs a {
    flex: 1;
    min-height: 31px;
    padding: 0 6px;
    font-size: 12px;
  }

  main {
    height: calc(100dvh - 106px);
    min-height: 0;
  }

  body[data-auth-gate="true"] main {
    width: calc(100vw - 18px);
    height: 100dvh;
    padding: 9px 0;
  }

  .auth-gate {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    align-items: stretch;
    gap: 7px;
  }

  .auth-copy {
    padding: 4px 15px 0;
    align-content: end;
    gap: 5px;
  }

  .auth-copy .kq-mark {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .auth-card {
    padding: 13px;
    border-radius: 22px;
    gap: 8px;
  }

  .auth-card .google-cta,
  .google-slot {
    min-height: 42px;
  }

  .auth-card .auth-separator {
    font-size: 10px;
  }

  .auth-card .auth-consent {
    gap: 6px;
  }

  .auth-card .auth-consent label {
    font-size: 11px;
  }

  .auth-card .field-status {
    min-height: 14px;
    font-size: 9px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "board";
    gap: 9px;
  }

  .hero-copy {
    min-height: 0;
    padding: 15px;
    border-radius: 22px;
    gap: 8px;
  }

  h1 {
    font-size: clamp(36px, 10vw, 50px);
  }

  h2 {
    font-size: clamp(29px, 8vw, 40px);
  }

  .event-line,
  .test-note {
    font-size: 13px;
  }

  .signup-form {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .signup-form input,
  .primary-cta,
  .secondary-cta {
    min-height: 42px;
  }

  .broadcast-board {
    min-height: 0;
    padding: 13px;
    border-radius: 22px;
    gap: 8px;
  }

  .board-label {
    font-size: 15px;
  }

  .countdown-display {
    font-size: clamp(38px, 13vw, 54px);
  }

  .pregame-panel {
    grid-area: board;
    padding: 13px;
    border-radius: 22px;
  }

  body[data-signed-up="true"] .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    grid-template-areas: "chat";
  }

  body[data-signed-up="true"] .hero-copy {
    display: none;
  }

  body[data-signed-up="true"] .pregame-panel {
    grid-area: chat;
  }

  .chat-countdown {
    margin: 7px 0 9px;
    padding: 10px;
  }

  .chat-countdown strong {
    font-size: clamp(30px, 9vw, 42px);
  }

  .chat-list {
    min-height: 0;
    max-height: none;
  }

  .chat-form {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 7px;
  }

  .chat-form input,
  .chat-form button {
    min-height: 42px;
  }

  .section-grid,
  .history-panel,
  .profile-panel {
    padding: 16px;
    border-radius: 22px;
  }

  .section-grid,
  .history-panel,
  .profile-panel {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 13px;
  }

  .steps {
    gap: 8px;
  }

  .steps li {
    min-height: 55px;
    padding: 10px;
  }

  .steps span,
  .fairness-copy {
    font-size: 15px;
  }

  .rules-strip {
    gap: 6px;
  }

  .rules-strip span {
    min-height: 28px;
    font-size: 10px;
  }

  .history-list {
    gap: 8px;
  }

  .history-card {
    padding: 10px;
    gap: 7px;
    border-radius: 17px;
  }

  .history-main strong {
    font-size: 21px;
  }

  .history-meta {
    gap: 5px;
  }

  .history-meta div {
    padding: 7px;
  }

  .winner-list {
    font-size: 11px;
  }

  .profile-copy p {
    display: none;
  }

  .profile-summary {
    padding: 12px;
    border-radius: 18px;
  }

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

  .site-footer {
    height: 42px;
    font-size: 12px;
  }
}

@media (max-height: 740px) and (max-width: 820px) {
  .hero-copy {
    padding: 12px;
  }

  h1 {
    font-size: 34px;
  }

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

  .signup-form input,
  .primary-cta,
  .secondary-cta {
    min-height: 40px;
  }

  .countdown-display {
    font-size: 38px;
  }
}

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