:root {
  color-scheme: dark;
}

.screen-page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: #f5f2e8;
  background:
    radial-gradient(70% 100% at 92% 0%, rgba(216, 255, 95, 0.05), transparent 60%),
    radial-gradient(60% 80% at 0% 100%, rgba(255, 111, 78, 0.045), transparent 65%),
    #070910;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(110px);
}

.orb-a {
  top: -22vw;
  right: -9vw;
  width: 54vw;
  height: 54vw;
  background: rgba(198, 244, 68, 0.12);
}

.orb-b {
  left: -18vw;
  bottom: -30vw;
  width: 49vw;
  height: 49vw;
  background: rgba(255, 111, 78, 0.09);
}

.grid-veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 82px 82px;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 40%, #000 10%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 75% at 50% 40%, #000 10%, transparent 80%);
}

/* Top bar */
.topbar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 56px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--ink);
  background: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-copy strong {
  font-size: 11px;
  letter-spacing: 0.19em;
}

.brand-copy small {
  font-size: 9px;
  letter-spacing: 0.26em;
  color: #777f8e;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: #a5acb9;
  background: rgba(255, 255, 255, 0.028);
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  animation: live-pulse 2.4s ease-out infinite;
}

.live-pill.is-offline i {
  background: var(--coral);
  animation: none;
}

.live-pill.is-offline {
  color: #d89c8e;
}

.top-link,
.top-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #a5acb9;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.top-link:hover {
  color: var(--lime);
}

.top-btn {
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.022);
}

.top-btn:hover {
  color: var(--lime);
  border-color: rgba(216, 255, 95, 0.35);
}

/* Stage */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 56px 14px;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(36px, 5vw, 80px);
}

.intro {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 18px;
}

.q-big-num {
  font-family: var(--font-display);
  font-size: clamp(56px, 6vw, 92px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--lime);
}

.q-meta-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.q-tag {
  width: fit-content;
  padding: 5px 11px;
  border-radius: 999px;
  color: #cdd68a;
  background: rgba(216, 255, 95, 0.1);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.q-position {
  color: #71798a;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.question-wrap {
  min-height: 120px;
}

.question-text {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 50px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.03em;
  color: #f8f5eb;
}

.question-wrap.swap,
.qr-shell.swap {
  animation: swap-in 0.38s var(--ease-out) both;
}

.q-live-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #9ca3b1;
  font-size: 13px;
}

.qls-item b {
  color: var(--lime);
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.qls-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.14);
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-btn {
  height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #d7dbe2;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  font-weight: 650;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav-btn:hover:not(:disabled) {
  border-color: rgba(216, 255, 95, 0.45);
  color: var(--lime);
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-next {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.nav-next:hover:not(:disabled) {
  color: var(--ink);
  background: #e4ff7a;
}

.nav-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-dot {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #8b93a3;
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.nav-dot:hover {
  border-color: rgba(216, 255, 95, 0.5);
  color: #f5f2e8;
}

.nav-dot.is-current {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.nav-dot.is-answered:not(.is-current)::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lime);
}

/* Global stats */
.global-stats {
  display: flex;
  align-items: flex-start;
  gap: clamp(24px, 3vw, 46px);
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.g-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 64px;
}

.g-stat strong {
  color: #f8f5eb;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.g-stat strong small {
  font-size: 15px;
}

.g-stat:first-child strong {
  color: var(--lime);
}

.g-stat span {
  color: #71798a;
  font-size: 9.5px;
  letter-spacing: 0.13em;
}

/* Scan panel */
.scan-panel {
  position: relative;
  width: 100%;
  max-width: 430px;
  justify-self: end;
  padding: 24px 28px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(13, 16, 23, 0.82);
  box-shadow: 0 32px 85px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.scan-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a4abb8;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.2em;
}

.scan-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lime);
}

.scan-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.qr-shell {
  position: relative;
  width: fit-content;
  margin: 26px auto 24px;
  padding: 15px;
}

.qr-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--lime);
  border-style: solid;
  opacity: 0.9;
}

.qr-corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; border-top-left-radius: 6px; }
.qr-corner-tr { top: 0; right: 0; border-width: 2px 2px 0 0; border-top-right-radius: 6px; }
.qr-corner-bl { bottom: 31px; left: 0; border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }
.qr-corner-br { bottom: 31px; right: 0; border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }

.qr-paper {
  position: relative;
  width: clamp(230px, 23vw, 330px);
  aspect-ratio: 1;
  padding: 10px;
  overflow: hidden;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.qr-paper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.qr-loading span {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(13, 15, 20, 0.12);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.qr-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.qr-shell-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #818998;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.qr-shell-meta span:first-child {
  color: var(--lime);
}

.scan-panel h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.scan-hint {
  margin-top: 7px;
  color: #9198a7;
  font-size: 11.5px;
  line-height: 1.7;
}

.url-box {
  margin-top: 17px;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
}

.url-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #bbc1cb;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-box button {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--lime);
  background: rgba(216, 255, 95, 0.1);
  font-size: 10px;
  font-weight: 650;
  transition: background 0.2s ease, color 0.2s ease;
}

.url-box button:hover {
  background: rgba(216, 255, 95, 0.18);
}

.url-box button.is-copied {
  color: var(--ink);
  background: var(--lime);
}

/* Feed */
.feed {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 56px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.feed-title {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aeb4c1;
  font-size: 9.5px;
  letter-spacing: 0.12em;
}

.feed-title i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lime);
}

.feed-list {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
  padding: 8px 0;
}

.feed-empty {
  color: #5f6776;
  font-size: 10.5px;
}

.feed-item {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  color: #c3c8d1;
  animation: row-in 0.4s var(--ease-out) both;
}

.feed-item .feed-q {
  color: #8b93a3;
}

.feed-item .feed-mark {
  font-weight: 800;
}

.feed-item.is-correct .feed-mark {
  color: var(--lime);
}

.feed-item.is-wrong .feed-mark {
  color: #ff967f;
}

/* Footer */
.screen-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 56px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #545c6b;
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.footer-mid {
  color: #687181;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(216, 255, 95, 0.35); }
  60% { box-shadow: 0 0 0 7px rgba(216, 255, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(216, 255, 95, 0); }
}

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

@keyframes row-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes swap-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1180px) {
  .topbar,
  .feed,
  .screen-footer {
    padding-left: 38px;
    padding-right: 38px;
  }
  .stage {
    padding-left: 38px;
    padding-right: 38px;
    gap: 38px;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr);
  }
  .scan-panel { padding-left: 23px; padding-right: 23px; }
  .qr-paper { width: clamp(210px, 24vw, 290px); }
}

@media (max-width: 980px) {
  .screen-page { overflow-y: auto; }
  .stage {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 34px;
    padding-top: 20px;
    padding-bottom: 24px;
  }
  .scan-panel {
    justify-self: center;
    max-width: 440px;
    order: -1;
  }
  .qr-paper { width: min(100%, 300px); }
  .question-wrap { min-height: 0; }
}

@media (max-width: 620px) {
  .topbar { padding: 16px 20px 8px; }
  .brand-copy small { display: none; }
  .top-link { display: none; }
  .top-btn span { display: none; }
  .top-btn { width: 30px; padding: 0; justify-content: center; border-radius: 50%; }
  .stage { padding: 12px 20px 20px; }
  .intro { gap: 18px; }
  .q-big-num { font-size: 54px; }
  .question-text { font-size: clamp(24px, 7vw, 34px); }
  .nav { gap: 10px; }
  .nav-btn { height: 42px; padding: 0 15px; font-size: 12px; }
  .nav-dots { order: 3; width: 100%; }
  .global-stats { gap: 22px; }
  .g-stat strong { font-size: 26px; }
  .scan-panel { padding: 20px 20px 18px; border-radius: 22px; }
  .qr-shell { margin-top: 22px; margin-bottom: 20px; }
  .qr-paper { width: min(100%, 280px); }
  .feed,
  .screen-footer { padding-left: 20px; padding-right: 20px; }
  .feed { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-mid { display: none; }
  .screen-footer { font-size: 7.5px; }
}

@media (min-width: 981px) and (max-height: 800px) {
  .topbar { padding-top: 16px; }
  .stage { padding-top: 4px; padding-bottom: 8px; }
  .intro { gap: 16px; }
  .q-big-num { font-size: clamp(48px, 5vw, 72px); }
  .question-text { font-size: clamp(26px, 3vw, 42px); }
  .question-wrap { min-height: 90px; }
  .scan-panel { padding-top: 20px; padding-bottom: 18px; }
  .qr-shell { margin-top: 20px; margin-bottom: 18px; padding: 12px; }
  .qr-paper { width: clamp(200px, 21vw, 280px); }
  .scan-panel h2 { font-size: 19px; }
  .screen-footer { padding-bottom: 14px; }
}