:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --panel-soft: #edf7f5;
  --panel-tint: #f7fafb;
  --ink: #121926;
  --muted: #647084;
  --line: #d5dde8;
  --line-strong: #becada;
  --brand: #0d8a7d;
  --brand-dark: #075e57;
  --brand-ink: #063d3a;
  --accent: #bf7a14;
  --accent-soft: #fff4df;
  --info: #2f6fed;
  --rose: #be3b52;
  --danger: #b42318;
  --ok: #28734d;
  --shadow: 0 14px 42px rgba(18, 25, 38, 0.1);
  --shadow-soft: 0 8px 24px rgba(18, 25, 38, 0.07);
  --shadow-lift: 0 20px 52px rgba(18, 25, 38, 0.14);
  --focus-ring: 0 0 0 4px rgba(13, 138, 125, 0.16);
  --motion-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  position: relative;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(13, 138, 125, 0.12), transparent 32%),
    linear-gradient(225deg, rgba(191, 122, 20, 0.1), transparent 34%),
    linear-gradient(180deg, #f9fbfc 0%, #eef4f6 100%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      120deg,
      rgba(13, 138, 125, 0.045) 0 1px,
      transparent 1px 28px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(18, 25, 38, 0.025) 0 1px,
      transparent 1px 44px
    ),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  background-size: 100% 100%, 100% 100%, 220% 100%;
  animation: ambient-scan 16s ease-in-out infinite;
  opacity: 0.72;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0 16%, rgba(13, 138, 125, 0.045) 24%, transparent 34%),
    linear-gradient(255deg, transparent 0 52%, rgba(47, 111, 237, 0.04) 62%, transparent 74%);
  background-size: 170% 100%, 150% 100%;
  mix-blend-mode: multiply;
  animation: ambient-drift 24s var(--motion-soft) infinite;
  opacity: 0.75;
}

@keyframes ambient-scan {
  0%,
  100% {
    background-position: 0 0, 0 0, -120% 0;
  }
  50% {
    background-position: 18px 24px, 0 18px, 120% 0;
  }
}

@keyframes ambient-drift {
  0%,
  100% {
    background-position: -60% 0, 120% 0;
  }
  50% {
    background-position: 120% 0, -30% 0;
  }
}

a {
  color: var(--brand-dark);
}

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

button {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

button:not(.swatch)::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 42%, rgba(255, 255, 255, 0.46) 48%, transparent 56%);
  transform: translateX(-130%);
}

button:hover {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(18, 25, 38, 0.11);
  transform: translateY(-1px);
}

button:not(.swatch):hover::after {
  animation: control-sheen 0.72s var(--motion-soft);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

button:active {
  transform: translateY(0) scale(0.99);
}

button.primary {
  background: linear-gradient(180deg, #109689, var(--brand-dark));
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(13, 138, 125, 0.22);
}

button.primary:hover {
  background: linear-gradient(180deg, #0d8a7d, #064f49);
}

@keyframes control-sheen {
  to {
    transform: translateX(130%);
  }
}

.button-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
}

.button-link:hover {
  border-color: var(--brand);
}

.sound-toggle {
  border-color: #b9d8d5;
  background: linear-gradient(180deg, #ffffff, #eef6f5);
  color: var(--brand-dark);
  font-weight: 750;
}

.sound-toggle.is-muted {
  border-color: #e2e8f0;
  background: #f6f7f9;
  color: var(--muted);
}

button.danger {
  color: var(--danger);
  border-color: #f3b6b0;
}

button.ghost {
  background: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  color: var(--ink);
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(18, 25, 38, 0.03);
}

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

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 14px;
  font-weight: 650;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(18, 25, 38, 0.08), transparent 38%),
    linear-gradient(220deg, rgba(13, 138, 125, 0.12), transparent 42%);
}

.auth-box {
  position: relative;
  overflow: hidden;
  width: min(460px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 252, 0.96)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(18, 25, 38, 0.16);
  padding: 28px;
}

.auth-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--info));
}

.auth-box h1,
.auth-box p {
  margin-top: 0;
}

.topbar {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(18, 25, 38, 0.98) 0%, rgba(7, 94, 87, 0.96) 58%, rgba(33, 75, 105, 0.96) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 34px rgba(18, 25, 38, 0.18);
  color: #fff;
  padding: 16px min(30px, 5vw);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 24px);
  background-size: 180% 100%, 100% 100%;
  animation: topbar-glide 18s var(--motion-soft) infinite;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

@keyframes topbar-glide {
  0%,
  100% {
    background-position: -90% 0, 0 0;
  }
  50% {
    background-position: 120% 0, 18px 0;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #dff4f1);
  color: var(--brand-ink);
  box-shadow: inset 0 -1px 0 rgba(18, 25, 38, 0.08), 0 10px 22px rgba(18, 25, 38, 0.2);
  font-weight: 900;
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 10px;
  filter: drop-shadow(0 10px 20px rgba(18, 25, 38, 0.22));
  transform: translateZ(0);
}

.topbar .brand-logo {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.auth-box .brand-logo,
.mobile-game .brand-logo {
  width: 44px;
  height: 44px;
}

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

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

.topbar .nav button {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: none;
}

.topbar .nav button:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
}

.nav button.active {
  border-color: rgba(255, 255, 255, 0.55);
  background: #ffffff;
  color: var(--brand-ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.topbar .sound-toggle {
  border-color: rgba(213, 227, 224, 0.48);
  background: rgba(237, 247, 245, 0.16);
  color: #fff;
}

.topbar .sound-toggle.is-muted {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(18, 25, 38, 0.2);
  color: #d8e3ea;
}

.topbar button.danger {
  border-color: rgba(255, 179, 171, 0.55);
  background: rgba(180, 35, 24, 0.12);
  color: #ffe7e4;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px min(30px, 5vw) 54px;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 min(30px, 5vw) 28px;
}

.site-footer-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 7px;
  border: 1px solid rgba(13, 138, 125, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(237, 247, 245, 0.48)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    0 16px 38px rgba(18, 25, 38, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: footer-badge-in 0.72s var(--motion-spring) both;
}

.site-footer-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent, rgba(13, 138, 125, 0.08), transparent);
  background-size: 220% 100%;
  pointer-events: none;
  animation: footer-sheen 9s var(--motion-soft) infinite;
}

.site-footer-inner > * {
  position: relative;
  z-index: 1;
}

.auth-shell .site-footer {
  align-self: end;
  padding-bottom: 0;
}

@keyframes footer-badge-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes footer-sheen {
  0%,
  100% {
    background-position: -120% 0;
  }
  50% {
    background-position: 120% 0;
  }
}

.stack {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.dashboard-grid > .panel:first-child {
  min-height: 0;
}

.panel,
.card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 255, 0.94)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: panel-enter 0.54s var(--motion-spring) both;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.panel::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.94), transparent);
  opacity: 0.9;
}

.panel > *,
.card > * {
  position: relative;
  z-index: 1;
}

.panel:hover,
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

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

.panel {
  padding: 20px;
}

.card {
  padding: 16px;
}

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

.section-head h1,
.section-head h2,
.section-head h3 {
  margin: 0;
  color: #101828;
  letter-spacing: 0;
}

.workspace-head {
  position: relative;
  overflow: hidden;
  align-items: center;
  border: 1px solid rgba(13, 138, 125, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.94), rgba(237, 247, 245, 0.9) 52%, rgba(255, 244, 223, 0.86)),
    linear-gradient(90deg, rgba(13, 138, 125, 0.11), transparent);
  box-shadow: var(--shadow-soft);
  margin-bottom: 0;
  padding: 18px;
}

.workspace-head::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--info));
}

.workspace-head::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, 0.42) 46%, transparent 58%),
    repeating-linear-gradient(90deg, rgba(13, 138, 125, 0.04) 0 1px, transparent 1px 34px);
  background-size: 210% 100%, 100% 100%;
  animation: hero-polish 13s var(--motion-soft) infinite;
  opacity: 0.8;
}

.workspace-head > * {
  position: relative;
  z-index: 2;
}

.workspace-head h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.workspace-head .muted {
  margin: 4px 0 0;
}

@keyframes hero-polish {
  0%,
  100% {
    background-position: -110% 0, 0 0;
  }
  50% {
    background-position: 130% 0, 24px 0;
  }
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.between {
  justify-content: space-between;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(13, 138, 125, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 251, 0.96)),
    linear-gradient(135deg, rgba(13, 138, 125, 0.11), rgba(191, 122, 20, 0.08));
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  animation: stat-rise 0.58s var(--motion-spring) both;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.stat-value {
  display: block;
  margin-top: 4px;
  color: #101828;
  font-size: 30px;
  line-height: 1;
}

.stat-card:nth-child(2) {
  animation-delay: 60ms;
}

.stat-card:nth-child(3) {
  animation-delay: 120ms;
}

.stat-card:nth-child(4) {
  animation-delay: 180ms;
}

@keyframes stat-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hidden {
  display: none !important;
}

.notice {
  border: 1px solid #f0d59c;
  border-radius: 8px;
  background: #fff8e7;
  color: #704b12;
  padding: 12px;
}

.notice,
.success,
.error {
  animation: notice-pop 0.34s ease-out both;
}

@keyframes notice-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.error {
  border: 1px solid #f3b6b0;
  border-radius: 8px;
  background: #fff4f2;
  color: var(--danger);
  padding: 12px;
}

.compact-error {
  padding: 8px 10px;
  font-size: 13px;
}

.success {
  border: 1px solid #b7dfc5;
  border-radius: 8px;
  background: #effaf3;
  color: var(--ok);
  padding: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(100, 112, 132, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 5px 10px;
  color: #42526a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill {
  border-color: rgba(13, 138, 125, 0.28);
  background: #edf7f5;
  color: var(--brand-ink);
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(237, 247, 245, 0.78), rgba(255, 244, 223, 0.44)),
    #fff;
  padding: 22px;
}

.tool-panel {
  padding: 14px;
}

.owner-pill {
  background: #f8fafc;
}

.category-chip,
.category-dot {
  border-color: rgba(100, 112, 132, 0.24);
}

.category-chip.tone-teal,
.category-dot.tone-teal {
  background: #edf7f5;
  color: var(--brand-ink);
}

.category-chip.tone-gold,
.category-dot.tone-gold {
  background: #fff4df;
  color: #704b12;
}

.category-chip.tone-blue,
.category-dot.tone-blue {
  background: #eef4ff;
  color: #1d4ed8;
}

.category-chip.tone-rose,
.category-dot.tone-rose {
  background: #fff1f3;
  color: #a1253a;
}

.category-chip.tone-slate,
.category-dot.tone-slate {
  background: #f1f5f9;
  color: #475569;
}

.category-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: -1px;
}

.category-row strong {
  display: inline-flex;
  align-items: center;
}

.action-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
  font-weight: 750;
}

.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch-grid .swatch {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
}

.swatch-grid .swatch.active {
  box-shadow: var(--focus-ring);
  transform: translateY(-1px);
}

.swatch.tone-teal {
  background: linear-gradient(145deg, #edf7f5, var(--brand));
}

.swatch.tone-gold {
  background: linear-gradient(145deg, #fff4df, var(--accent));
}

.swatch.tone-blue {
  background: linear-gradient(145deg, #eef4ff, var(--info));
}

.swatch.tone-rose {
  background: linear-gradient(145deg, #fff1f3, var(--rose));
}

.swatch.tone-slate {
  background: linear-gradient(145deg, #f1f5f9, #64748b);
}

.quiz-row,
.player-row,
.leader-row,
.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.quiz-row:hover,
.player-row:hover,
.answer-row:hover {
  transform: translateX(2px);
}

.quiz-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(213, 221, 232, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    linear-gradient(90deg, rgba(13, 138, 125, 0.09), transparent 38%);
  box-shadow: 0 7px 18px rgba(18, 25, 38, 0.055);
  padding: 14px;
  animation: card-rise 0.54s var(--motion-spring) both;
}

.quiz-row:hover {
  box-shadow: 0 14px 34px rgba(18, 25, 38, 0.11);
  transform: translateY(-2px);
}

.quiz-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.quiz-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.quiz-info strong {
  color: #101828;
  font-size: 17px;
  overflow-wrap: anywhere;
}

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

.quiz-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 8px;
  width: 100%;
}

.quiz-actions button {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.quiz-row:first-child,
.player-row:first-child,
.leader-row:first-child,
.answer-row:first-child {
  border-top: 0;
}

.quiz-row:first-child {
  border-top: 1px solid rgba(213, 221, 232, 0.92);
}

.quiz-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--line-strong);
  transition: width 0.22s ease;
}

.quiz-row:hover::before {
  width: 7px;
}

.quiz-row.status-published::before {
  background: linear-gradient(180deg, var(--brand), var(--ok));
}

.quiz-row.status-draft::before {
  background: linear-gradient(180deg, var(--accent), #e7a53b);
}

.quiz-row.status-archived::before {
  background: linear-gradient(180deg, #94a3b8, #64748b);
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.leader-row > *,
.answer-row > *,
.player-row > * {
  min-width: 0;
}

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

#liveBox {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  border: 1px solid rgba(13, 138, 125, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(237, 247, 245, 0.92), rgba(255, 244, 223, 0.42)),
    #fff;
  padding: 16px;
}

#liveBox::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

#liveBox > * {
  position: relative;
  z-index: 1;
}

.settings-panel {
  max-width: 760px;
}

.question-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 251, 0.98)),
    #fbfcfe;
  box-shadow: 0 7px 18px rgba(18, 25, 38, 0.055);
}

.answers {
  display: grid;
  gap: 8px;
}

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

.answer-edit.matching-edit {
  grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) auto;
}

.answer-edit input[type="checkbox"],
.answer-edit input[type="radio"] {
  width: auto;
  justify-self: center;
}

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

.stage {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  display: grid;
  align-content: center;
  gap: 18px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(237, 247, 245, 0.88) 58%, rgba(255, 244, 223, 0.7)),
    #fff;
}

.stage::before,
.mobile-game::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(15, 118, 110, 0.08) 44%, transparent 52%),
    repeating-linear-gradient(0deg, rgba(15, 118, 110, 0.035) 0 1px, transparent 1px 18px);
  background-size: 220% 100%, 100% 100%;
  animation: stage-sheen 9s ease-in-out infinite;
  opacity: 0.85;
}

.stage::after,
.mobile-game::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 30%, rgba(18, 25, 38, 0.04)),
    repeating-linear-gradient(90deg, rgba(18, 25, 38, 0.035) 0 1px, transparent 1px 72px);
  opacity: 0.48;
  transform: translateZ(0);
  animation: stage-depth 18s var(--motion-soft) infinite;
}

.stage > *,
.mobile-game > * {
  position: relative;
  z-index: 2;
}

.stage[data-status="question-active"],
.mobile-game[data-status="question-active"] {
  border-color: rgba(13, 138, 125, 0.42);
  box-shadow: 0 18px 48px rgba(13, 138, 125, 0.12);
}

.stage[data-status="show-answer"],
.mobile-game[data-status="show-answer"] {
  border-color: rgba(191, 122, 20, 0.42);
  box-shadow: 0 18px 48px rgba(191, 122, 20, 0.12);
}

.stage[data-status="show-leaderboard"],
.mobile-game[data-status="show-leaderboard"] {
  border-color: rgba(40, 115, 77, 0.42);
  box-shadow: 0 18px 48px rgba(40, 115, 77, 0.12);
}

.stage[data-status="finished"],
.mobile-game[data-status="finished"] {
  border-color: rgba(191, 122, 20, 0.44);
  box-shadow: 0 20px 56px rgba(191, 122, 20, 0.15);
}

@keyframes stage-sheen {
  0%,
  100% {
    background-position: -140% 0, 0 0;
  }
  50% {
    background-position: 140% 0, 0 12px;
  }
}

@keyframes stage-depth {
  0%,
  100% {
    background-position: 0 0, 0 0;
  }
  50% {
    background-position: 0 0, 36px 0;
  }
}

.game-code {
  font-size: clamp(42px, 8vw, 86px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.question-title {
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
  margin: 0;
  animation: question-in 0.44s ease-out both;
}

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

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

.answer-tile {
  --answer-accent: var(--brand);
  --answer-border: rgba(13, 138, 125, 0.36);
  --answer-soft: rgba(237, 247, 245, 0.92);
  --answer-strong: rgba(13, 138, 125, 0.14);
  --answer-ink: #063d3a;
  --answer-shadow: rgba(13, 138, 125, 0.13);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 8px 12px;
  min-height: 86px;
  border-radius: 8px;
  border: 2px solid var(--answer-border);
  border-left-width: 8px;
  border-left-color: var(--answer-accent);
  background:
    linear-gradient(135deg, var(--answer-strong), rgba(255, 255, 255, 0.96) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), var(--answer-soft)),
    #fff;
  padding: 16px;
  text-align: left;
  font-weight: 750;
  color: #101828;
  box-shadow:
    0 10px 24px rgba(18, 25, 38, 0.07),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: answer-enter 0.48s var(--motion-spring) both;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

.answer-tone-1 {
  --answer-accent: #0d8a7d;
  --answer-border: rgba(13, 138, 125, 0.42);
  --answer-soft: rgba(237, 247, 245, 0.96);
  --answer-strong: rgba(13, 138, 125, 0.16);
  --answer-ink: #063d3a;
  --answer-shadow: rgba(13, 138, 125, 0.15);
}

.answer-tone-2 {
  --answer-accent: #bf7a14;
  --answer-border: rgba(191, 122, 20, 0.44);
  --answer-soft: rgba(255, 244, 223, 0.98);
  --answer-strong: rgba(191, 122, 20, 0.17);
  --answer-ink: #5a3608;
  --answer-shadow: rgba(191, 122, 20, 0.15);
}

.answer-tone-3 {
  --answer-accent: #2f6fed;
  --answer-border: rgba(47, 111, 237, 0.38);
  --answer-soft: rgba(238, 244, 255, 0.98);
  --answer-strong: rgba(47, 111, 237, 0.15);
  --answer-ink: #123b8f;
  --answer-shadow: rgba(47, 111, 237, 0.13);
}

.answer-tone-4 {
  --answer-accent: #be3b52;
  --answer-border: rgba(190, 59, 82, 0.38);
  --answer-soft: rgba(255, 241, 243, 0.98);
  --answer-strong: rgba(190, 59, 82, 0.15);
  --answer-ink: #792034;
  --answer-shadow: rgba(190, 59, 82, 0.13);
}

.answer-tone-5 {
  --answer-accent: #6d47b8;
  --answer-border: rgba(109, 71, 184, 0.36);
  --answer-soft: rgba(246, 241, 255, 0.98);
  --answer-strong: rgba(109, 71, 184, 0.14);
  --answer-ink: #3f2673;
  --answer-shadow: rgba(109, 71, 184, 0.12);
}

.answer-tone-6 {
  --answer-accent: #28734d;
  --answer-border: rgba(40, 115, 77, 0.38);
  --answer-soft: rgba(239, 250, 243, 0.98);
  --answer-strong: rgba(40, 115, 77, 0.15);
  --answer-ink: #17442d;
  --answer-shadow: rgba(40, 115, 77, 0.13);
}

.answer-tone-7 {
  --answer-accent: #c2410c;
  --answer-border: rgba(194, 65, 12, 0.36);
  --answer-soft: rgba(255, 244, 237, 0.98);
  --answer-strong: rgba(194, 65, 12, 0.14);
  --answer-ink: #742507;
  --answer-shadow: rgba(194, 65, 12, 0.12);
}

.answer-tone-8 {
  --answer-accent: #475467;
  --answer-border: rgba(71, 84, 103, 0.34);
  --answer-soft: rgba(241, 245, 249, 0.98);
  --answer-strong: rgba(71, 84, 103, 0.13);
  --answer-ink: #263244;
  --answer-shadow: rgba(71, 84, 103, 0.12);
}

.answer-code {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  background: var(--answer-accent);
  color: #fff;
  box-shadow:
    0 10px 20px var(--answer-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.answer-copy {
  min-width: 0;
  color: #101828;
  overflow-wrap: anywhere;
}

.answer-note {
  grid-column: 2;
  margin-top: -2px;
  color: #475467;
  font-size: 14px;
}

.answer-grid .answer-tile:nth-child(2) {
  animation-delay: 55ms;
}

.answer-grid .answer-tile:nth-child(3) {
  animation-delay: 110ms;
}

.answer-grid .answer-tile:nth-child(4) {
  animation-delay: 165ms;
}

.answer-grid .answer-tile:nth-child(5) {
  animation-delay: 220ms;
}

.answer-grid .answer-tile:nth-child(6) {
  animation-delay: 275ms;
}

.answer-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 45%, rgba(255, 255, 255, 0.72) 50%, transparent 56%);
  transform: translateX(-120%);
}

.answer-tile:hover {
  box-shadow:
    0 16px 34px rgba(18, 25, 38, 0.11),
    0 0 0 3px var(--answer-strong);
  transform: translateY(-2px);
}

.answer-tile:hover::after {
  animation: tile-sheen 0.7s ease-out;
}

@keyframes answer-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tile-sheen {
  to {
    transform: translateX(120%);
  }
}

.answer-tile.selected {
  border-color: var(--answer-accent);
  border-left-color: var(--answer-accent);
  background:
    linear-gradient(135deg, var(--answer-strong), rgba(255, 255, 255, 0.9) 54%),
    linear-gradient(180deg, var(--answer-soft), rgba(255, 255, 255, 0.96));
  box-shadow:
    0 16px 34px var(--answer-shadow),
    0 0 0 4px var(--answer-strong);
  animation: selected-pop 0.22s ease-out both;
}

.answer-tile.correct {
  --answer-accent: var(--ok);
  --answer-border: #9bd3ae;
  --answer-soft: #effaf3;
  --answer-strong: rgba(40, 115, 77, 0.17);
  --answer-shadow: rgba(40, 115, 77, 0.16);
  border-color: var(--ok);
  border-left-color: var(--ok);
  background:
    linear-gradient(180deg, #effaf3, #ffffff),
    #effaf3;
  animation: correct-pop 0.48s ease-out both;
}

.answer-tile.wrong {
  --answer-accent: var(--danger);
  --answer-border: #e7ada7;
  --answer-soft: #fff4f2;
  --answer-strong: rgba(180, 35, 24, 0.14);
  --answer-shadow: rgba(180, 35, 24, 0.12);
  border-color: #e7ada7;
  border-left-color: var(--danger);
  background:
    linear-gradient(180deg, #fff4f2, #ffffff),
    #fff4f2;
  animation: wrong-shake 0.42s ease-out both;
}

@keyframes selected-pop {
  50% {
    transform: scale(1.015);
  }
}

@keyframes correct-pop {
  0% {
    transform: scale(0.98);
  }
  45% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wrong-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc),
    #fff;
  padding: 12px;
  box-shadow: 0 7px 16px rgba(18, 25, 38, 0.055);
  animation: metric-rise 0.36s ease-out both;
}

.metric strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

@keyframes metric-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.time-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 251, 0.95)),
    #fbfcfe;
  padding: 10px;
}

.time-controls .muted {
  grid-column: 1 / -1;
}

.time-controls button {
  width: 100%;
}

#controls > button,
#controls > .button-link {
  width: 100%;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.leaderboard-list.is-empty {
  border: 1px dashed rgba(100, 112, 132, 0.28);
  border-radius: 8px;
  padding: 18px;
  place-items: center;
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin: 6px 0 14px;
}

.podium-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 7px;
  justify-items: center;
  overflow: hidden;
  border: 1px solid rgba(213, 221, 232, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)),
    linear-gradient(150deg, rgba(13, 138, 125, 0.09), rgba(191, 122, 20, 0.08));
  box-shadow:
    0 16px 34px rgba(18, 25, 38, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 13px 10px 14px;
  text-align: center;
  animation: podium-rise 0.66s var(--motion-spring) both;
}

.podium-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--info));
}

.podium-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.podium-card > * {
  position: relative;
  z-index: 1;
}

.podium-rank-1 {
  min-height: 168px;
  transform-origin: center bottom;
  background:
    linear-gradient(180deg, rgba(255, 252, 242, 0.98), rgba(255, 255, 255, 0.94)),
    linear-gradient(150deg, rgba(191, 122, 20, 0.2), rgba(13, 138, 125, 0.09));
}

.podium-rank-2,
.podium-rank-3 {
  min-height: 145px;
}

.podium-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(191, 122, 20, 0.24);
  border-radius: 999px;
  background: rgba(255, 244, 223, 0.8);
  color: #8a540e;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 850;
}

.podium-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(13, 138, 125, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(145deg, #ffffff, #edf7f5),
    #fff;
  box-shadow: 0 10px 22px rgba(18, 25, 38, 0.11);
  font-size: 26px;
}

.podium-card strong {
  max-width: 100%;
  color: #101828;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.podium-score {
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.victory-ceremony {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 18px;
  border: 1px solid rgba(191, 122, 20, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 252, 242, 0.98), rgba(255, 255, 255, 0.96) 46%, rgba(237, 247, 245, 0.9)),
    repeating-linear-gradient(90deg, rgba(191, 122, 20, 0.06) 0 1px, transparent 1px 38px);
  box-shadow: 0 18px 46px rgba(18, 25, 38, 0.11);
  padding: clamp(16px, 2.4vw, 28px);
  animation: ceremony-enter 0.78s var(--motion-spring) both;
}

.victory-ceremony::before {
  content: "";
  position: absolute;
  inset: -24px 0 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(191, 122, 20, 0.58) 8% 9%, transparent 9% 100%),
    linear-gradient(90deg, transparent 0 28%, rgba(13, 138, 125, 0.5) 28% 29%, transparent 29% 100%),
    linear-gradient(90deg, transparent 0 52%, rgba(47, 111, 237, 0.42) 52% 53%, transparent 53% 100%),
    linear-gradient(90deg, transparent 0 74%, rgba(190, 59, 82, 0.42) 74% 75%, transparent 75% 100%);
  background-size: 140px 120px, 190px 130px, 170px 110px, 210px 150px;
  animation: ceremony-confetti 4.2s linear infinite;
  opacity: 0.44;
}

.victory-rays {
  position: absolute;
  inset: -42% -12% 18%;
  z-index: -1;
  pointer-events: none;
  background: conic-gradient(
    from 0deg at 50% 60%,
    rgba(191, 122, 20, 0.14) 0 10deg,
    transparent 10deg 24deg,
    rgba(13, 138, 125, 0.12) 24deg 34deg,
    transparent 34deg 52deg
  );
  filter: blur(0.2px);
  opacity: 0.72;
  animation: ceremony-rays 10s linear infinite;
}

.victory-header {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.victory-header h1 {
  margin: 0;
  color: #101828;
  letter-spacing: 0;
}

.victory-header .muted {
  max-width: 720px;
  margin: 0;
  color: #475467;
  font-weight: 650;
}

.award-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 330px;
}

.award-podium.ceremony-count-1,
.award-podium.ceremony-count-2 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 280px));
  justify-content: center;
}

.award-card {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: end;
  justify-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid rgba(213, 221, 232, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.93)),
    linear-gradient(150deg, rgba(13, 138, 125, 0.08), rgba(47, 111, 237, 0.05));
  box-shadow:
    0 18px 40px rgba(18, 25, 38, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  padding: 42px 14px 0;
  text-align: center;
  transform-origin: center bottom;
  animation: award-rise 0.82s var(--motion-spring) both;
}

.award-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--info));
}

.award-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, 0.48) 46%, transparent 58%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px 24px);
  background-size: 220% 100%, 100% 100%;
  animation: award-sheen 3.8s var(--motion-soft) infinite;
}

.award-card > * {
  position: relative;
  z-index: 1;
}

.award-rank-1 {
  order: 2;
  min-height: 312px;
  border-color: rgba(191, 122, 20, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 249, 234, 0.99), rgba(255, 255, 255, 0.94)),
    linear-gradient(150deg, rgba(191, 122, 20, 0.26), rgba(13, 138, 125, 0.07));
}

.award-rank-2 {
  order: 1;
  min-height: 266px;
}

.award-rank-3 {
  order: 3;
  min-height: 244px;
}

.award-medal {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(191, 122, 20, 0.28);
  border-radius: 999px;
  background: linear-gradient(145deg, #fff9ea, #f1bd55);
  color: #563407;
  box-shadow: 0 9px 18px rgba(18, 25, 38, 0.1);
  font-size: 15px;
  font-weight: 950;
}

.award-avatar {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid rgba(13, 138, 125, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(145deg, #ffffff, #edf7f5),
    #fff;
  box-shadow:
    0 18px 32px rgba(18, 25, 38, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 38px;
}

.award-rank-1 .award-avatar {
  width: 88px;
  height: 88px;
  border-color: rgba(191, 122, 20, 0.28);
  background:
    linear-gradient(145deg, #fffdf7, #ffe4a9),
    #fff;
  font-size: 44px;
}

.award-card strong {
  max-width: 100%;
  color: #101828;
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.award-rank-1 strong {
  font-size: 21px;
}

.award-score {
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 950;
  line-height: 1.05;
}

.award-rank-1 .award-score {
  color: #7a4a0c;
  font-size: 28px;
}

.award-step {
  display: grid;
  width: calc(100% + 28px);
  min-height: 62px;
  place-items: center;
  align-self: end;
  margin: 8px -14px 0;
  border-top: 1px solid rgba(18, 25, 38, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(13, 138, 125, 0.12)),
    linear-gradient(90deg, rgba(13, 138, 125, 0.16), rgba(191, 122, 20, 0.18));
  color: #0f3f3b;
}

.award-rank-1 .award-step {
  min-height: 88px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(191, 122, 20, 0.2)),
    linear-gradient(90deg, rgba(191, 122, 20, 0.28), rgba(13, 138, 125, 0.14));
  color: #5b3708;
}

.award-rank-2 .award-step {
  min-height: 72px;
}

.award-step span {
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.award-step small {
  margin-top: -8px;
  color: currentColor;
  font-weight: 850;
  opacity: 0.74;
}

.award-card.is-you {
  border-color: rgba(13, 138, 125, 0.52);
  box-shadow:
    0 22px 48px rgba(13, 138, 125, 0.16),
    inset 0 0 0 1px rgba(13, 138, 125, 0.12);
}

.award-empty {
  display: grid;
  gap: 4px;
  justify-items: center;
  border: 1px dashed rgba(100, 112, 132, 0.3);
  border-radius: 8px;
  padding: 22px;
  text-align: center;
}

.final-ranking {
  display: grid;
  gap: 12px;
  animation: final-ranking-in 0.68s var(--motion-spring) 1.35s both;
}

.final-rank-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.final-rank-head h2,
.final-rank-head p {
  margin: 0;
  letter-spacing: 0;
}

@keyframes ceremony-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ceremony-confetti {
  from {
    background-position: 0 -120px, 0 -130px, 0 -110px, 0 -150px;
  }
  to {
    background-position: 0 120px, 0 130px, 0 110px, 0 150px;
  }
}

@keyframes ceremony-rays {
  to {
    transform: rotate(1turn);
  }
}

@keyframes award-rise {
  0% {
    opacity: 0;
    transform: translateY(34px) scale(0.94);
  }
  60% {
    opacity: 1;
    transform: translateY(-6px) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes award-sheen {
  0%,
  100% {
    background-position: -130% 0, 0 0;
  }
  50% {
    background-position: 130% 0, 0 8px;
  }
}

@keyframes final-ranking-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.leader-row,
.player-row {
  border: 1px solid rgba(213, 221, 232, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.78)),
    rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.leader-row:first-child,
.player-row:first-child {
  border-top: 1px solid rgba(213, 221, 232, 0.78);
}

.leader-row:hover,
.player-row:hover {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(18, 25, 38, 0.07);
}

.leader-row {
  position: relative;
  overflow: hidden;
}

.leaderboard-list .leader-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  border-color: rgba(213, 221, 232, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    linear-gradient(90deg, rgba(13, 138, 125, 0.08), transparent 46%);
  box-shadow: 0 9px 20px rgba(18, 25, 38, 0.065);
  padding: 12px 13px 12px 12px;
}

.leaderboard-list .leader-row:hover {
  box-shadow: 0 16px 34px rgba(18, 25, 38, 0.12);
  transform: translateY(-2px);
}

.leader-row.rank-1 {
  border-color: rgba(191, 122, 20, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 252, 242, 0.98), rgba(255, 255, 255, 0.94)),
    linear-gradient(90deg, rgba(191, 122, 20, 0.15), transparent 48%);
}

.leader-row.rank-2 {
  border-color: rgba(47, 111, 237, 0.24);
}

.leader-row.rank-3 {
  border-color: rgba(13, 138, 125, 0.24);
}

.leader-row.is-you,
.podium-card.is-you {
  border-color: rgba(13, 138, 125, 0.46);
  box-shadow:
    0 18px 38px rgba(13, 138, 125, 0.14),
    inset 0 0 0 1px rgba(13, 138, 125, 0.12);
}

.rank-medal {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(13, 138, 125, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(145deg, #ffffff, #edf7f5),
    #fff;
  color: var(--brand-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 8px 18px rgba(18, 25, 38, 0.08);
  font-size: 15px;
  font-weight: 900;
}

.rank-1 .rank-medal {
  border-color: rgba(191, 122, 20, 0.38);
  background: linear-gradient(145deg, #fff9ea, #f2bc52);
  color: #563407;
}

.rank-2 .rank-medal {
  background: linear-gradient(145deg, #f8fafc, #cbd5e1);
  color: #334155;
}

.rank-3 .rank-medal {
  background: linear-gradient(145deg, #fff4df, #d1923b);
  color: #5d3910;
}

.leader-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.leader-main strong {
  overflow-wrap: anywhere;
}

.leader-subline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.leader-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: 0.7;
}

.leaderboard-item {
  animation: leaderboard-rise 0.62s ease-out both;
}

.award-card.delay-0 {
  animation-delay: 120ms;
}

.award-card.delay-1 {
  animation-delay: 260ms;
}

.award-card.delay-2 {
  animation-delay: 400ms;
}

.podium-card.delay-0 {
  animation-delay: 30ms;
}

.podium-card.delay-1 {
  animation-delay: 110ms;
}

.podium-card.delay-2 {
  animation-delay: 190ms;
}

.leaderboard-item.delay-0 {
  animation-delay: 0ms;
}

.leaderboard-item.delay-1 {
  animation-delay: 90ms;
}

.leaderboard-item.delay-2 {
  animation-delay: 180ms;
}

.leaderboard-item.delay-3 {
  animation-delay: 270ms;
}

.leaderboard-item.delay-4 {
  animation-delay: 360ms;
}

.leaderboard-item.delay-5 {
  animation-delay: 450ms;
}

.leaderboard-item.delay-6 {
  animation-delay: 540ms;
}

.leaderboard-item.delay-7 {
  animation-delay: 630ms;
}

.leaderboard-item.delay-8 {
  animation-delay: 720ms;
}

.leaderboard-item.delay-9 {
  animation-delay: 810ms;
}

.rank-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.rank-change,
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.rank-change {
  border: 1px solid var(--line);
  color: #475467;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.rank-change.points,
.rank-change.up,
.rank-change.new {
  border-color: #b7dfc7;
  background: #effaf3;
  color: var(--ok);
}

.rank-change.down {
  border-color: #f3b6b0;
  background: #fff4f2;
  color: var(--danger);
}

.rank-change.same {
  background: #f6f7f9;
}

.score-badge {
  min-width: 86px;
  background:
    linear-gradient(180deg, #edf7f5, #ffffff),
    #fff;
  border: 1px solid rgba(13, 138, 125, 0.2);
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 900;
  animation: score-pulse 1.4s ease-in-out infinite;
}

.score-badge span {
  margin-right: 3px;
  font-size: 18px;
  line-height: 1;
}

@keyframes score-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(15, 118, 110, 0);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.08);
  }
}

@keyframes leaderboard-rise {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  55% {
    opacity: 1;
    transform: translateY(-3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes podium-rise {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  62% {
    opacity: 1;
    transform: translateY(-4px) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.celebration {
  position: relative;
  overflow: hidden;
}

.celebration::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 20%, #f4c542 0 5px, transparent 6px),
    radial-gradient(circle at 28% 12%, #0f766e 0 4px, transparent 5px),
    radial-gradient(circle at 72% 18%, #d92d20 0 5px, transparent 6px),
    radial-gradient(circle at 88% 28%, #2563eb 0 4px, transparent 5px),
    radial-gradient(circle at 50% 10%, #9333ea 0 4px, transparent 5px);
  animation: confetti 1.8s ease-out infinite;
}

@keyframes confetti {
  0% {
    opacity: 0;
    transform: translateY(-16px);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(90px);
  }
}

progress.timer {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  border: 0;
  background: #e2e8f0;
  appearance: none;
  box-shadow: inset 0 0 0 1px rgba(24, 33, 47, 0.05);
  transition: filter 0.18s ease, transform 0.18s ease;
}

progress.timer::-webkit-progress-bar {
  border-radius: 999px;
  background: #e2e8f0;
}

progress.timer::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s linear;
}

progress.timer::-moz-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

body[data-timer-urgency="medium"] progress.timer::-webkit-progress-value {
  background: #d97706;
}

body[data-timer-urgency="medium"] progress.timer::-moz-progress-bar {
  background: #d97706;
}

body[data-timer-urgency="high"] progress.timer::-webkit-progress-value {
  background: #c2410c;
}

body[data-timer-urgency="high"] progress.timer::-moz-progress-bar {
  background: #c2410c;
}

body[data-timer-urgency="critical"] progress.timer {
  animation: timer-alert 0.28s ease-in-out infinite alternate;
}

body[data-timer-urgency="critical"] progress.timer::-webkit-progress-value {
  background: var(--danger);
}

body[data-timer-urgency="critical"] progress.timer::-moz-progress-bar {
  background: var(--danger);
}

body[data-timer-urgency="critical"] .question-title,
body[data-timer-urgency="critical"] .mobile-game h1 {
  animation: question-in 0.44s ease-out both, urgency-breathe 0.5s ease-in-out infinite alternate;
}

@keyframes timer-alert {
  to {
    filter: saturate(1.35);
    transform: scaleY(1.18);
  }
}

@keyframes urgency-breathe {
  to {
    transform: translateY(0) scale(1.012);
  }
}

.qr {
  width: 180px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 25, 38, 0.12);
  padding: 8px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.avatar-grid button {
  min-height: 48px;
  padding: 4px;
  font-size: 24px;
}

.avatar-grid button.active {
  border-color: var(--brand);
  background: var(--panel-soft);
}

.mobile-game {
  position: relative;
  overflow: hidden;
  width: min(640px, 100%);
  margin: 0 auto;
  min-height: min(760px, calc(100vh - 56px));
  align-content: start;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(237, 247, 245, 0.86) 62%, rgba(255, 244, 223, 0.56)),
    #fff;
}

:root {
  --bg: #edf2f5;
  --panel: #ffffff;
  --panel-soft: #e7f5f2;
  --panel-tint: #f7fafc;
  --ink: #101722;
  --muted: #5b6878;
  --line: rgba(169, 184, 199, 0.54);
  --line-strong: rgba(120, 139, 158, 0.62);
  --brand: #07897f;
  --brand-dark: #045d57;
  --brand-ink: #052f2e;
  --accent: #c48518;
  --accent-soft: #fff1d2;
  --info: #2e67d1;
  --rose: #b83251;
  --shadow: 0 20px 58px rgba(16, 23, 34, 0.13);
  --shadow-soft: 0 12px 34px rgba(16, 23, 34, 0.09);
  --shadow-lift: 0 28px 76px rgba(16, 23, 34, 0.18);
  --focus-ring: 0 0 0 4px rgba(7, 137, 127, 0.18);
}

body {
  background:
    linear-gradient(180deg, #f8fbfc 0%, #edf3f6 46%, #e4edf1 100%),
    var(--bg);
}

body::before {
  background:
    repeating-linear-gradient(118deg, rgba(4, 93, 87, 0.052) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(16, 23, 34, 0.028) 0 1px, transparent 1px 52px),
    linear-gradient(92deg, transparent 0 20%, rgba(255, 255, 255, 0.72) 47%, transparent 74%);
  background-size: 100% 100%, 100% 100%, 230% 100%;
  opacity: 0.76;
  animation: ambient-scan 22s ease-in-out infinite;
}

body::after {
  background:
    linear-gradient(115deg, transparent 0 14%, rgba(196, 133, 24, 0.062) 26%, transparent 40%),
    linear-gradient(245deg, transparent 0 48%, rgba(46, 103, 209, 0.055) 61%, transparent 76%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 44%);
  background-size: 180% 100%, 160% 100%, 100% 100%;
  opacity: 0.9;
}

button,
.button-link {
  min-height: 44px;
  border-color: rgba(133, 151, 170, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 249, 0.96)),
    #fff;
  box-shadow:
    0 8px 18px rgba(16, 23, 34, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

button:hover,
.button-link:hover {
  border-color: rgba(7, 137, 127, 0.62);
  box-shadow:
    0 16px 34px rgba(16, 23, 34, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

button.primary {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, #12a092 0%, #07897f 44%, #045d57 100%),
    var(--brand);
  box-shadow:
    0 16px 34px rgba(7, 137, 127, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

button.primary:hover {
  background:
    linear-gradient(135deg, #14aa9d 0%, #07897f 42%, #034c48 100%),
    var(--brand-dark);
}

input,
textarea,
select {
  min-height: 44px;
  border-color: rgba(133, 151, 170, 0.52);
  background:
    linear-gradient(180deg, #ffffff, #f8fbfd),
    #fff;
  box-shadow:
    inset 0 1px 2px rgba(16, 23, 34, 0.055),
    0 1px 0 rgba(255, 255, 255, 0.72);
}

.auth-shell {
  background:
    linear-gradient(135deg, rgba(4, 93, 87, 0.13), transparent 38%),
    linear-gradient(225deg, rgba(196, 133, 24, 0.12), transparent 40%),
    linear-gradient(180deg, #f9fbfc, #e9f0f4);
}

.auth-box {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 252, 0.9)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    0 34px 86px rgba(16, 23, 34, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar {
  background:
    linear-gradient(135deg, rgba(8, 18, 28, 0.98) 0%, rgba(4, 72, 68, 0.98) 50%, rgba(20, 54, 82, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 18px 46px rgba(8, 18, 28, 0.26),
    inset 0 -1px 0 rgba(196, 133, 24, 0.34);
  padding-top: 18px;
  padding-bottom: 18px;
}

.topbar::before {
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 28px),
    linear-gradient(90deg, transparent 0 12%, rgba(196, 133, 24, 0.16) 44%, transparent 72%);
  background-size: 210% 100%, 100% 100%, 180% 100%;
}

.brand {
  font-weight: 900;
}

.brand-logo {
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.86);
  padding: 3px;
  box-shadow:
    0 14px 30px rgba(16, 23, 34, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.topbar .brand-logo {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.topbar .nav button {
  border-color: rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.topbar .nav button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.08);
}

.nav button.active {
  background:
    linear-gradient(180deg, #ffffff, #edf7f5),
    #fff;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.container {
  padding-top: 34px;
}

.panel,
.card {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 253, 0.9)),
    rgba(255, 255, 255, 0.76);
  box-shadow:
    0 18px 48px rgba(16, 23, 34, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.panel::after,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.42) 49%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(4, 93, 87, 0.025) 0 1px, transparent 1px 42px);
  background-size: 220% 100%, 100% 100%;
  opacity: 0.62;
}

.panel:hover,
.card:hover {
  border-color: rgba(255, 255, 255, 0.92);
}

.workspace-head {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(9, 25, 38, 0.98), rgba(4, 93, 87, 0.94) 54%, rgba(32, 78, 108, 0.94)),
    #101722;
  box-shadow:
    0 24px 66px rgba(16, 23, 34, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  padding: 22px;
}

.workspace-head h1,
.workspace-head h2,
.workspace-head h3 {
  color: #ffffff;
}

.workspace-head .muted {
  color: rgba(229, 244, 243, 0.8);
}

.workspace-head::before {
  height: 5px;
  background: linear-gradient(90deg, #11a195, #c48518, #2e67d1, #b83251);
}

.workspace-head::after {
  background:
    linear-gradient(110deg, transparent 0 36%, rgba(255, 255, 255, 0.16) 46%, transparent 58%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 42px);
  opacity: 0.9;
}

.stat-card {
  border-color: rgba(255, 255, 255, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.9)),
    linear-gradient(135deg, rgba(7, 137, 127, 0.13), rgba(196, 133, 24, 0.1));
  box-shadow:
    0 14px 34px rgba(16, 23, 34, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.stat-card::before {
  width: 5px;
}

.stat-value {
  color: #091928;
  font-weight: 950;
}

.pill,
.status-pill,
.category-chip,
.category-dot {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.quiz-row {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 253, 0.9)),
    linear-gradient(90deg, rgba(7, 137, 127, 0.11), transparent 42%);
  box-shadow:
    0 12px 30px rgba(16, 23, 34, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.quiz-row:hover {
  box-shadow:
    0 24px 56px rgba(16, 23, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.quiz-info strong {
  color: #091928;
  font-weight: 900;
}

.question-box,
#liveBox,
.metric,
.time-controls {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 253, 0.9)),
    rgba(255, 255, 255, 0.74);
  box-shadow:
    0 12px 30px rgba(16, 23, 34, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.host-layout {
  gap: 22px;
}

.host-layout aside .panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 249, 251, 0.9)),
    rgba(255, 255, 255, 0.76);
}

.stage,
.mobile-game {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(145deg, rgba(8, 18, 28, 0.98), rgba(4, 64, 61, 0.95) 52%, rgba(32, 67, 96, 0.94)),
    #091928;
  box-shadow:
    0 28px 78px rgba(8, 18, 28, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.stage::before,
.mobile-game::before {
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.12) 47%, transparent 58%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.048) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(196, 133, 24, 0.045) 0 1px, transparent 1px 70px);
  opacity: 0.62;
}

.stage::after,
.mobile-game::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent 34%, rgba(0, 0, 0, 0.18)),
    linear-gradient(90deg, rgba(7, 137, 127, 0.16), transparent 28%, rgba(46, 103, 209, 0.1) 74%, transparent);
  opacity: 0.9;
}

.stage .muted,
.mobile-game .muted {
  color: rgba(226, 241, 240, 0.78);
}

.stage label,
.stage strong,
.mobile-game label,
.mobile-game strong {
  color: rgba(244, 250, 251, 0.96);
}

.stage .brand,
.mobile-game .brand {
  color: #fff;
}

.stage .pill,
.mobile-game .pill {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(244, 250, 251, 0.94);
}

.game-code,
.question-title,
.mobile-game h1 {
  color: #ffffff;
  text-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.answer-tile {
  border-width: 1px;
  border-left-width: 9px;
  background:
    linear-gradient(135deg, var(--answer-strong), rgba(255, 255, 255, 0.98) 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--answer-soft)),
    #fff;
  box-shadow:
    0 16px 36px rgba(8, 18, 28, 0.13),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.answer-code {
  box-shadow:
    0 12px 24px var(--answer-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.answer-tile:hover {
  box-shadow:
    0 24px 52px rgba(8, 18, 28, 0.18),
    0 0 0 3px var(--answer-strong);
}

.analysis-grid .metric {
  color: #101722;
}

.stage .metric .muted,
.mobile-game .metric .muted {
  color: var(--muted);
}

.leaderboard-list .leader-row,
.player-row,
.leader-row {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.9)),
    rgba(255, 255, 255, 0.74);
  box-shadow:
    0 12px 28px rgba(16, 23, 34, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.leaderboard-list .leader-row:hover {
  box-shadow:
    0 22px 50px rgba(16, 23, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.podium-card,
.award-card,
.victory-ceremony {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow:
    0 24px 62px rgba(16, 23, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.victory-ceremony {
  background:
    linear-gradient(135deg, rgba(255, 252, 242, 0.96), rgba(255, 255, 255, 0.94) 48%, rgba(231, 245, 242, 0.88)),
    repeating-linear-gradient(90deg, rgba(196, 133, 24, 0.07) 0 1px, transparent 1px 42px);
}

progress.timer {
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 8px 20px rgba(8, 18, 28, 0.12);
}

progress.timer::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.2);
}

progress.timer::-webkit-progress-value {
  background: linear-gradient(90deg, #12a092, #c48518);
}

progress.timer::-moz-progress-bar {
  background: linear-gradient(90deg, #12a092, #c48518);
}

.topbar .brand-logo {
  animation: premium-logo-breathe 9.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.topbar .brand span {
  animation: premium-brand-glow 9.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

button.primary,
.button-link:hover {
  animation: premium-control-glow 7.8s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.panel::after,
.card::after {
  animation: premium-surface-sheen 18s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.stat-card::after,
.quiz-row::after,
.question-box::after,
#liveBox::after,
.time-controls::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(255, 255, 255, 0.34) 50%, transparent 62%);
  background-size: 260% 100%;
  opacity: 0;
  animation: premium-card-sweep 13.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.stat-card > *,
.quiz-row > *,
.question-box > *,
#liveBox > *,
.time-controls > * {
  position: relative;
  z-index: 1;
}

.quiz-row:nth-child(2n)::after,
.stat-card:nth-child(2n)::after {
  animation-delay: 2.2s;
}

.quiz-row:nth-child(3n)::after,
.stat-card:nth-child(3n)::after {
  animation-delay: 3.8s;
}

.workspace-head {
  animation: premium-head-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.workspace-head h1 {
  animation: premium-title-focus 9.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.stat-card {
  animation: stat-rise 0.72s var(--motion-spring) both, premium-card-float 10.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.quiz-row {
  animation: card-rise 0.68s var(--motion-spring) both, premium-card-float 11.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.stage[data-status="question-active"],
.mobile-game[data-status="question-active"] {
  animation: premium-stage-breathe 8.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.stage[data-status="show-answer"],
.mobile-game[data-status="show-answer"] {
  animation: premium-reveal-glow 7.2s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.stage[data-status="show-leaderboard"],
.mobile-game[data-status="show-leaderboard"],
.stage[data-status="finished"],
.mobile-game[data-status="finished"] {
  animation: premium-victory-aura 9.2s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.stage[data-status="question-active"] .question-title,
.mobile-game[data-status="question-active"] h1 {
  animation: question-in 0.5s ease-out both, premium-question-glow 8.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

body[data-timer-urgency="critical"] .stage[data-status="question-active"] .question-title,
body[data-timer-urgency="critical"] .mobile-game[data-status="question-active"] h1 {
  animation:
    question-in 0.44s ease-out both,
    urgency-breathe 0.5s ease-in-out infinite alternate,
    premium-question-glow 2.2s ease-in-out infinite;
}

.stage[data-status="question-active"] .answer-tile,
.mobile-game[data-status="question-active"] .answer-tile {
  animation:
    answer-enter 0.48s var(--motion-spring) both,
    premium-answer-float 9.6s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.answer-tile::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.36) 48%, transparent 58%);
  transform: translateX(-125%);
  opacity: 0.28;
  animation: premium-answer-scan 11.2s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.answer-tile:nth-child(2)::before {
  animation-delay: 1.2s;
}

.answer-tile:nth-child(3)::before {
  animation-delay: 2.4s;
}

.answer-tile:nth-child(4)::before {
  animation-delay: 3.6s;
}

.answer-code {
  animation: premium-code-pop 7.8s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.answer-tile:nth-child(2) .answer-code {
  animation-delay: 0.8s;
}

.answer-tile:nth-child(3) .answer-code {
  animation-delay: 1.6s;
}

.answer-tile:nth-child(4) .answer-code {
  animation-delay: 2.4s;
}

progress.timer::-webkit-progress-value {
  background:
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0.22) 0 8px, transparent 8px 18px),
    linear-gradient(90deg, #12a092, #c48518);
  background-size: 56px 100%, 100% 100%;
  animation: premium-timer-flow 2.1s linear infinite;
}

progress.timer::-moz-progress-bar {
  background:
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0.22) 0 8px, transparent 8px 18px),
    linear-gradient(90deg, #12a092, #c48518);
  background-size: 56px 100%, 100% 100%;
}

.leaderboard-list .leader-row,
.player-row {
  animation: leaderboard-rise 0.68s ease-out both, premium-row-breathe 10.5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.leader-row > *,
.player-row > * {
  position: relative;
  z-index: 1;
}

.leader-row::after,
.player-row::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(255, 255, 255, 0.3) 50%, transparent 62%);
  background-size: 260% 100%;
  opacity: 0;
  animation: premium-card-sweep 14s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.leaderboard-list .leader-row:nth-child(2n)::after,
.player-row:nth-child(2n)::after {
  animation-delay: 2.4s;
}

.rank-medal,
.score-badge,
.podium-avatar,
.award-avatar,
.award-medal {
  animation: premium-medal-shine 8.2s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.podium-card,
.award-card {
  animation:
    podium-rise 0.8s var(--motion-spring) both,
    premium-podium-float 10.8s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.award-card {
  animation:
    award-rise 0.92s var(--motion-spring) both,
    premium-podium-float 10.8s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.victory-ceremony {
  animation:
    ceremony-enter 0.9s var(--motion-spring) both,
    premium-victory-aura 9.8s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

.site-footer-inner {
  animation:
    footer-badge-in 0.82s var(--motion-spring) both,
    premium-footer-float 12s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

@keyframes premium-logo-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
  }
  50% {
    transform: translateY(-0.5px) scale(1.014);
    filter: drop-shadow(0 13px 24px rgba(18, 195, 181, 0.18));
  }
}

@keyframes premium-brand-glow {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.18);
  }
}

@keyframes premium-control-glow {
  0%,
  100% {
    box-shadow:
      0 16px 34px rgba(7, 137, 127, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }
  50% {
    box-shadow:
      0 19px 46px rgba(7, 137, 127, 0.28),
      0 0 0 3px rgba(7, 137, 127, 0.055),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
}

@keyframes premium-surface-sheen {
  0%,
  100% {
    background-position: -160% 0, 0 0;
  }
  50% {
    background-position: 160% 0, 18px 0;
  }
}

@keyframes premium-card-sweep {
  0%,
  44%,
  100% {
    opacity: 0;
    background-position: -155% 0;
  }
  58% {
    opacity: 0.34;
  }
  78% {
    opacity: 0;
    background-position: 155% 0;
  }
}

@keyframes premium-head-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes premium-title-focus {
  0%,
  100% {
    text-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }
  50% {
    text-shadow:
      0 12px 30px rgba(0, 0, 0, 0.18),
      0 0 24px rgba(255, 255, 255, 0.16);
  }
}

@keyframes premium-card-float {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.012) saturate(1.015);
  }
}

@keyframes premium-stage-breathe {
  0%,
  100% {
    box-shadow:
      0 28px 78px rgba(8, 18, 28, 0.26),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  50% {
    box-shadow:
      0 32px 88px rgba(7, 137, 127, 0.18),
      0 0 0 1px rgba(255, 255, 255, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }
}

@keyframes premium-reveal-glow {
  0%,
  100% {
    box-shadow:
      0 28px 78px rgba(8, 18, 28, 0.26),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  50% {
    box-shadow:
      0 32px 88px rgba(196, 133, 24, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }
}

@keyframes premium-victory-aura {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.035) brightness(1.01);
  }
}

@keyframes premium-question-glow {
  0%,
  100% {
    text-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
  }
  50% {
    text-shadow:
      0 14px 34px rgba(0, 0, 0, 0.26),
      0 0 22px rgba(255, 255, 255, 0.16);
  }
}

@keyframes premium-answer-float {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.018) saturate(1.018);
  }
}

@keyframes premium-answer-scan {
  0%,
  50%,
  100% {
    transform: translateX(-125%);
    opacity: 0;
  }
  62% {
    opacity: 0.28;
  }
  80% {
    transform: translateX(125%);
    opacity: 0;
  }
}

@keyframes premium-code-pop {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1);
  }
  56% {
    transform: scale(1.032);
  }
  68% {
    transform: scale(1);
  }
}

@keyframes premium-timer-flow {
  to {
    background-position: 56px 0, 0 0;
  }
}

@keyframes premium-row-breathe {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.012) saturate(1.012);
  }
}

@keyframes premium-medal-shine {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.045);
  }
}

@keyframes premium-podium-float {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.018) saturate(1.02);
  }
}

@keyframes premium-footer-float {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.018);
  }
}

@media (max-width: 880px) {
  .container {
    padding: 18px 14px 36px;
  }

  .site-footer {
    padding: 0 14px 24px;
  }

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .host-layout aside {
    order: -1;
  }

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

  .answer-tile {
    min-height: 74px;
  }

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

  .award-podium {
    gap: 8px;
    min-height: 290px;
  }

  .award-card {
    padding-right: 10px;
    padding-left: 10px;
  }

  .award-rank-1 {
    min-height: 286px;
  }

  .award-rank-2 {
    min-height: 244px;
  }

  .award-rank-3 {
    min-height: 226px;
  }

  .podium-card {
    min-height: 136px;
    padding: 12px 8px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .topbar .brand {
    width: 100%;
    min-width: 0;
  }

  .topbar .nav {
    width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 1px 5px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .topbar .nav::-webkit-scrollbar {
    display: none;
  }

  .topbar .nav button,
  .topbar .nav a {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head button {
    width: 100%;
  }

  .quiz-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-link {
    width: 100%;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .topbar {
    padding: 10px 10px 9px;
  }

  .topbar .brand {
    gap: 9px;
    font-size: 21px;
    line-height: 1;
  }

  .topbar .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .auth-shell {
    padding: 16px 14px;
  }

  .site-footer-inner {
    width: 100%;
    min-height: 50px;
  }

  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav button,
  .nav a {
    width: 100%;
    min-width: 0;
  }

  .topbar .nav button,
  .topbar .nav a {
    min-height: 36px;
    padding: 7px 7px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
  }

  .topbar .nav a button {
    width: 100%;
  }

  .topbar .nav #logoutBtn {
    grid-column: span 2;
  }

  .panel {
    padding: 14px;
  }

  .workspace-head {
    padding: 15px;
  }

  .workspace-head h1 {
    font-size: 28px;
  }

  .stat-strip {
    gap: 8px;
  }

  .stat-card {
    padding: 12px 12px 12px 14px;
  }

  .stat-value {
    font-size: 24px;
  }

  .dashboard-grid,
  .form-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .quiz-title-line {
    display: grid;
  }

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

  .answer-edit,
  .answer-edit.matching-edit {
    grid-template-columns: 1fr;
  }

  .answer-edit input[type="checkbox"],
  .answer-edit input[type="radio"] {
    justify-self: start;
  }

  .game-code {
    font-size: 42px;
  }

  .question-title {
    font-size: 28px;
  }

  .answer-tile {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px 10px;
    min-height: 66px;
    padding: 12px;
  }

  .answer-code {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .answer-note {
    grid-column: 2;
    font-size: 13px;
  }

  .leader-row,
  .player-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .leaderboard-podium {
    grid-template-columns: 1fr;
  }

  .victory-ceremony {
    gap: 14px;
    padding: 14px;
  }

  .award-podium,
  .award-podium.ceremony-count-1,
  .award-podium.ceremony-count-2 {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .award-rank-1 {
    order: 1;
  }

  .award-rank-2 {
    order: 2;
  }

  .award-rank-3 {
    order: 3;
  }

  .award-rank-1,
  .award-rank-2,
  .award-rank-3 {
    min-height: 0;
  }

  .award-card {
    padding-top: 40px;
  }

  .award-avatar,
  .award-rank-1 .award-avatar {
    width: 58px;
    height: 58px;
    font-size: 31px;
  }

  .award-rank-1 .award-score,
  .award-score {
    font-size: 22px;
  }

  .award-step,
  .award-rank-1 .award-step,
  .award-rank-2 .award-step {
    min-height: 50px;
  }

  .award-step span {
    font-size: 26px;
  }

  .final-rank-head {
    align-items: stretch;
    flex-direction: column;
  }

  .podium-rank-1,
  .podium-rank-2,
  .podium-rank-3 {
    min-height: 0;
  }

  .podium-card {
    justify-items: start;
    text-align: left;
  }

  .podium-avatar {
    width: 42px;
    height: 42px;
    font-size: 23px;
  }

  .leaderboard-list .leader-row {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
  }

  .leader-row > strong,
  .score-badge {
    justify-self: start;
  }

  .leaderboard-list .score-badge {
    grid-column: 2;
  }

  .time-controls {
    grid-template-columns: 1fr;
  }
}

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

  body::before,
  body::after,
  .topbar::before,
  .workspace-head::after,
  .stage::before,
  .stage::after,
  .mobile-game::before,
  .mobile-game::after,
  .celebration::before,
  .victory-ceremony::before,
  .victory-rays,
  .award-card::after {
    display: none;
  }
}
