*,
*::before,
*::after {
  box-sizing: border-box
}

* {
  margin: 0
}

:root {
  --bg: #09090b;
  --panel: #111114;
  --panel-2: #17171b;
  --panel-3: #1e1e23;
  --line: #222228;
  --line-2: #2d2d35;
  --text: #ececef;
  --muted: #8b8b96;
  --dim: #5b5b66;
  --ok: #22c07a;
  --bad: #f0525a;
  --warn: #f0a83a;
  --heart: #f43f5e;
  --self: #f0a83a;
  --radius: 14px;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 55%, transparent);
  color-scheme: dark;
}

html {
  -webkit-text-size-adjust: 100%
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-feature-settings: "cv11", "ss01"
}

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

button {
  font: inherit;
  color: inherit
}

code,
.mono {
  font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em
}

code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px
}

h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.2
}

h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em
}

h3 {
  font-size: 14.5px;
  font-weight: 600
}

::selection {
  background: var(--accent-soft)
}

[hidden] {
  display: none !important
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: .18em;
  font-weight: 800;
  letter-spacing: -.05em;
  font-size: 20px;
  line-height: 1
}

.logo i {
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
  font-size: .72em;
  letter-spacing: 0
}

.logo-xl {
  font-size: 64px
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px)
}

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

.brand-sub {
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none
}

.nav-links a {
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s, background .15s
}

.nav-links a:hover {
  color: var(--text)
}

.nav-links a.on {
  color: var(--text);
  background: var(--panel-2)
}

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

.nav-name {
  font-weight: 500;
  font-size: 13.5px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-2);
  flex: none;
  object-fit: cover
}

.avatar-lg {
  width: 64px;
  height: 64px
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 96px
}

.wrap.wide {
  max-width: 1560px;
  padding-top: 20px
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
  flex-wrap: wrap
}

.page-head p {
  color: var(--muted);
  margin-top: 6px;
  max-width: 640px
}

.back {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px
}

.back:hover {
  color: var(--text)
}

.section-title {
  margin: 12px 0 -4px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.narrow {
  max-width: 760px
}

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

.row.center {
  justify-content: center
}

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

.row.wrap {
  flex-wrap: wrap
}

.gap {
  gap: 12px
}

.gap-sm {
  gap: 8px
}

.grow {
  flex: 1;
  min-width: 0
}

.spacer {
  flex: 1
}

.inline {
  display: inline-flex
}

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

.small {
  font-size: 12.5px
}

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text)
}

.empty p+p {
  margin-top: 4px
}

.empty .btn {
  margin-top: 16px
}

.link {
  color: var(--accent)
}

.link:hover {
  text-decoration: underline
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 550;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, filter .15s, transform .05s;
  white-space: nowrap;
  user-select: none;
  text-decoration: none
}

.btn:hover {
  background: var(--panel-3);
  border-color: #3a3a44
}

.btn:active {
  transform: translateY(1px)
}

.btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  transform: none
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff
}

.btn-primary:hover {
  background: var(--accent);
  border-color: transparent;
  filter: brightness(1.12)
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted)
}

.btn-ghost:hover {
  background: var(--panel-2);
  border-color: transparent;
  color: var(--text)
}

.btn-ok {
  background: var(--ok);
  border-color: transparent;
  color: #03140b
}

.btn-ok:hover {
  background: var(--ok);
  border-color: transparent;
  filter: brightness(1.1)
}

.btn-bad {
  background: var(--bad);
  border-color: transparent;
  color: #fff
}

.btn-bad:hover {
  background: var(--bad);
  border-color: transparent;
  filter: brightness(1.1)
}

.btn-self {
  background: transparent;
  border-color: color-mix(in srgb, var(--self) 60%, transparent);
  color: var(--self)
}

.btn-self:hover {
  background: color-mix(in srgb, var(--self) 12%, transparent);
  border-color: var(--self)
}

.btn-discord {
  background: #5865f2;
  border-color: transparent;
  color: #fff
}

.btn-discord:hover {
  background: #5865f2;
  border-color: transparent;
  filter: brightness(1.1)
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: 8px
}

.btn-lg {
  height: 52px;
  padding: 0 22px;
  font-size: 16px;
  border-radius: 12px
}

.btn-block {
  width: 100%
}

.danger {
  color: var(--bad)
}

.btn-ghost.danger:hover {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent)
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  font: 600 11px/1 Inter, system-ui, sans-serif;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  color: inherit;
  opacity: .75
}

.btn-primary kbd,
.btn-ok kbd,
.btn-bad kbd {
  background: rgba(0, 0, 0, .18);
  border-color: rgba(0, 0, 0, .12)
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0
}

.field>label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500
}

.help {
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.45
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s
}

.input::placeholder {
  color: var(--dim)
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft)
}

textarea.input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5
}

select.input {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b96' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer
}

.input-sm {
  height: 32px;
  font-size: 13px;
  border-radius: 8px;
  padding: 0 10px
}

select.input-sm {
  padding-right: 30px;
  background-position: right 10px center
}

input[type=file].input {
  padding: 7px 10px;
  height: auto
}

.color-input {
  width: 44px;
  padding: 4px;
  cursor: pointer;
  flex: none
}

.color-input.input-sm {
  width: 34px;
  padding: 3px
}

input[type=checkbox],
input[type=radio] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  line-height: 1.4
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none
}

.switch-row small,
.radio small {
  display: block;
  color: var(--dim);
  font-size: 12.5px;
  margin-top: 2px
}

.switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: var(--line-2);
  transition: background .2s;
  margin-top: 1px
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s cubic-bezier(.3, .7, .4, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3)
}

.switch-row input:checked+.switch {
  background: var(--accent)
}

.switch-row input:checked+.switch::after {
  transform: translateX(16px)
}

.switch-row input:focus-visible+.switch {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

.switch-row.compact {
  align-items: center;
  font-size: 13px;
  color: var(--muted)
}

.switch-row.align-end {
  align-self: flex-end;
  padding-bottom: 10px
}

.radio {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, background .15s
}

.radio:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft)
}

.radio input {
  margin-top: 3px
}

.check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted)
}

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

.chip-check {
  cursor: pointer
}

.chip-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none
}

.chip-check span {
  display: inline-flex;
  height: 30px;
  align-items: center;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 13px;
  transition: .15s
}

.chip-check input:checked+span {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--text)
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line)
}

.badge-accent {
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 60%, #fff);
  border-color: transparent
}

.badge-warn {
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  color: var(--warn);
  border-color: transparent
}

.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap
}

.cat-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c)
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid;
  font-weight: 500
}

.flash-ok {
  background: color-mix(in srgb, var(--ok) 9%, transparent);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: #8fe7bd
}

.flash-err {
  background: color-mix(in srgb, var(--bad) 9%, transparent);
  border-color: color-mix(in srgb, var(--bad) 30%, transparent);
  color: #ffadb1
}

.table-card {
  padding: 0;
  overflow-x: auto
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px
}

.table th {
  text-align: left;
  font-weight: 500;
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle
}

.table tr:last-child td {
  border-bottom: 0
}

.table tbody tr:hover td {
  background: rgba(255, 255, 255, .015)
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums
}

.table .actions {
  text-align: right;
  white-space: nowrap
}

.table .actions form {
  display: inline-flex;
  gap: 4px
}

.table tr.is-off td {
  color: var(--dim)
}

.table tr.is-pending td {
  background: color-mix(in srgb, var(--warn) 5%, transparent)
}

.q-cell {
  max-width: 520px
}

.q-cell a:hover {
  color: var(--accent)
}

.questions-table td:nth-child(3) {
  max-width: 240px
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 12px
}

.filters select {
  width: auto;
  min-width: 170px
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  flex-wrap: wrap
}

.bulk-bar select {
  width: auto
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px
}

.add-cat {
  margin-bottom: 16px;
  padding: 12px
}

.seed-card {
  margin-bottom: 16px
}

.seed-card p {
  margin-top: 4px;
  max-width: 640px
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start
}

.rules {
  border: 1px solid var(--line);
  padding: 20px 20px 22px
}

.rules legend {
  padding: 0 8px;
  margin-left: -8px;
  font-weight: 600;
  font-size: 14px
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px
}

.span-2 {
  grid-column: span 2
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 14px 0;
  background: linear-gradient(transparent, var(--bg) 35%);
  z-index: 5
}

.danger-zone {
  margin-top: 40px
}

.danger-inline {
  margin-top: 12px
}

.auth {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center
}

.auth-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px
}

.auth-card h1 {
  font-size: 20px
}

.auth-sub {
  color: var(--muted);
  margin: -4px 0 18px
}

.auth-foot {
  color: var(--dim);
  font-size: 12.5px;
  margin-top: 8px
}

.dev-login {
  display: flex;
  gap: 8px;
  width: 100%
}

.stats-inline {
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap
}

.stats-inline b {
  color: var(--text);
  font-weight: 600
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start
}

.game-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  transition: border-color .15s, background .15s
}

.game-row:hover {
  border-color: var(--line-2);
  background: var(--panel-2)
}

.game-row-main {
  flex: 1;
  min-width: 0
}

.game-row-title {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.game-row-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  flex-wrap: wrap
}

.game-row-meta b {
  color: var(--text)
}

.game-row.is-finished .game-row-title {
  color: var(--muted)
}

.finished summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 0;
  list-style: none
}

.finished summary::-webkit-details-marker {
  display: none
}

.finished summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  transition: transform .2s
}

.finished[open] summary::before {
  transform: rotate(90deg)
}

.finished .stack {
  margin-top: 8px
}

.empty-state {
  text-align: center;
  padding: 100px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted)
}

.empty-code {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -.05em;
  color: var(--line-2);
  line-height: 1
}

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
  align-items: center
}

.toast {
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  animation: toastIn .25s cubic-bezier(.2, .8, .3, 1)
}

.toast.err {
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
  color: #ffb3b7
}

.toast.hide {
  opacity: 0;
  transform: translateY(6px);
  transition: .25s
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px)
  }
}

.dropdown {
  position: relative
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 300px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  flex-direction: column;
  gap: 10px
}

.dropdown.open .dropdown-menu {
  display: flex
}

.dropdown-list {
  padding: 6px;
  gap: 0;
  max-height: 360px;
  overflow: auto;
  min-width: 240px
}

.dropdown-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px
}

.dropdown-list button:hover {
  background: var(--panel-3)
}

.dropdown-list button:disabled {
  opacity: .35;
  cursor: not-allowed
}

.dropdown-list button .cnt {
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums
}

.dropdown-list .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none
}

.popover {
  position: fixed;
  z-index: 50;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  min-width: 200px;
  display: flex;
  flex-direction: column
}

.popover button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px
}

.popover button:hover {
  background: var(--panel-3)
}

.popover hr {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 4px 2px
}

.popover .danger {
  color: var(--bad)
}

.host-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.host-title {
  font-size: 18px;
  font-weight: 650;
  margin-right: 6px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.host-top-right {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap
}

.seg {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
  gap: 2px
}

.seg button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--muted);
  border-radius: 8px;
  font-weight: 550;
  font-size: 13.5px;
  cursor: pointer;
  transition: .15s
}

.seg button:hover {
  color: var(--text)
}

.seg button.on {
  background: var(--accent);
  color: #fff
}

.final-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  font-size: 13.5px
}

.final-counter b {
  color: var(--text);
  font-size: 15px
}

#btn-sound.off {
  color: var(--dim);
  text-decoration: line-through
}

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-weight: 500;
  flex-wrap: wrap
}

.banner .spacer {
  min-width: 8px
}

.banner.win {
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent)
}

.host {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start
}

.host-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0
}

.host-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px
}

.stage {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px
}

.eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 650
}

.eyebrow span {
  letter-spacing: .04em;
  text-transform: none;
  font-weight: 500;
  margin-left: 6px
}

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

.cat-name {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-top: 4px;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 12px
}

.cat-name .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none
}

.cat-name.spinning {
  color: var(--muted)
}

.cat-name.landed {
  animation: land .55s cubic-bezier(.2, .9, .3, 1.3)
}

@keyframes land {
  0% {
    transform: scale(.94);
    opacity: .4
  }

  60% {
    transform: scale(1.04)
  }

  100% {
    transform: none;
    opacity: 1
  }
}

.stage-q {
  min-height: 120px
}

.q-text {
  font-size: 25px;
  line-height: 1.38;
  font-weight: 550;
  letter-spacing: -.015em;
  margin-top: 8px;
  text-wrap: pretty
}

.q-text.empty {
  color: var(--dim);
  font-weight: 450;
  font-size: 18px
}

.q-text.fresh {
  animation: fadeUp .35s ease-out
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px)
  }
}

.answer {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  cursor: pointer;
  flex-wrap: wrap
}

.answer-val {
  font-size: 18px;
  font-weight: 650;
  color: color-mix(in srgb, var(--ok) 70%, #fff);
  transition: filter .2s
}

.answer.hidden .answer-val {
  filter: blur(9px);
  user-select: none
}

.answer-hint {
  font-size: 12px;
  color: var(--dim);
  margin-left: auto
}

.answer:not(.hidden) .answer-hint {
  display: none
}

.note {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 2px solid var(--line-2)
}

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

.timer-row {
  display: flex;
  align-items: center;
  gap: 14px
}

.timer {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden
}

.timer i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  border-radius: 99px
}

.timer.low i {
  background: var(--bad)
}

.timer-num {
  width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 18px
}

.timer-num.low {
  color: var(--bad)
}

.judge {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  flex-wrap: wrap
}

.judge-who {
  flex: 1;
  min-width: 180px
}

.judge-name {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.02em;
  margin-top: 2px
}

.judge-name.none {
  color: var(--dim);
  font-weight: 500;
  font-size: 16px
}

.judge-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.judge-btns .btn {
  min-width: 130px
}

.players {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px
}

.pc {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, opacity .2s, box-shadow .2s;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0
}

.pc:hover {
  border-color: var(--line-2);
  background: var(--panel-2)
}

.pc.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  box-shadow: 0 0 0 1px var(--accent), 0 12px 34px -14px var(--accent)
}

.pc.out {
  opacity: .36
}

.pc.out .pc-name {
  text-decoration: line-through;
  text-decoration-color: var(--dim)
}

.pc.flash-ok {
  animation: flashOk .9s ease-out
}

.pc.flash-bad {
  animation: flashBad .9s ease-out
}

@keyframes flashOk {
  0% {
    box-shadow: 0 0 0 2px var(--ok), 0 0 40px -6px var(--ok)
  }

  100% {
    box-shadow: 0 0 0 0 transparent
  }
}

@keyframes flashBad {
  0% {
    box-shadow: 0 0 0 2px var(--bad), 0 0 40px -6px var(--bad)
  }

  20% {
    transform: translateX(-3px)
  }

  40% {
    transform: translateX(3px)
  }

  60% {
    transform: translateX(-2px)
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
    transform: none
  }
}

.pc-head {
  display: flex;
  align-items: center;
  gap: 8px
}

.pc-seat {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--panel-3);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  flex: none
}

.pc.active .pc-seat {
  background: var(--accent);
  color: #fff
}

.pc-pts {
  margin-left: auto;
  font-weight: 750;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em
}

.pc-pts small {
  font-size: 11px;
  color: var(--dim);
  font-weight: 600;
  margin-left: 2px
}

.pc-name {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.01em
}

.hearts {
  display: flex;
  gap: 3px;
  flex-wrap: wrap
}

.heart {
  width: 18px;
  height: 18px;
  fill: transparent;
  stroke: var(--line-2);
  stroke-width: 1.8;
  transition: fill .25s, stroke .25s
}

.heart.full {
  fill: var(--heart);
  stroke: var(--heart)
}

.heart.lost {
  animation: heartLost .6s
}

@keyframes heartLost {
  0% {
    transform: scale(1.4);
    fill: var(--heart)
  }

  100% {
    transform: none
  }
}

.pc-sub {
  font-size: 11.5px;
  color: var(--dim);
  font-weight: 500;
  min-height: 16px
}

.pc-tools {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s
}

.pc:hover .pc-tools,
.pc.active .pc-tools {
  opacity: 1
}

.pc-tools button {
  flex: 1;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0
}

.pc-tools button:hover {
  color: var(--text);
  border-color: #3a3a44
}

.add-player {
  color: var(--dim)
}

.kbd-help {
  font-size: 12px;
  color: var(--dim);
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap
}

.kbd-help kbd {
  min-width: 18px;
  height: 18px;
  font-size: 10.5px
}

.side-stats {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline
}

.stat-row span {
  color: var(--muted);
  font-size: 13px
}

.stat-row b {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em
}

.standings {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px
}

.standings div {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px
}

.standings div b {
  font-variant-numeric: tabular-nums
}

.standings div.lead {
  color: var(--warn);
  font-weight: 600
}

.log-card {
  padding: 16px 0 6px
}

.log-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 18px 10px
}

.log-head span {
  font-size: 12px
}

.log {
  list-style: none;
  padding: 0;
  max-height: 440px;
  overflow: auto
}

.log li {
  display: flex;
  gap: 10px;
  padding: 7px 18px;
  font-size: 13px;
  line-height: 1.4;
  border-top: 1px solid var(--line)
}

.log time {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  flex: none;
  padding-top: 1px
}

.log .t-correct {
  color: #7fe0b2
}

.log .t-wrong {
  color: #ff9ea3
}

.log .t-out {
  color: var(--bad);
  font-weight: 600
}

.log .t-round,
.log .t-finish {
  color: var(--warn);
  font-weight: 600
}

.log .t-category {
  color: color-mix(in srgb, var(--accent) 55%, #fff)
}

.log .t-question,
.log .t-info,
.log .t-life,
.log .t-points {
  color: var(--muted)
}

.screen-body {
  background: #050507;
  overflow: hidden
}

.screen-body.transparent {
  background: transparent
}

.screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 4vh 4vw;
  gap: 3vh
}

.screen-head {
  display: flex;
  align-items: center;
  gap: 20px
}

.screen-head .logo {
  font-size: clamp(22px, 2.4vw, 40px)
}

.screen-round {
  font-size: clamp(14px, 1.4vw, 24px);
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .14em
}

.screen-final {
  margin-left: auto;
  font-size: clamp(14px, 1.4vw, 24px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted)
}

.screen-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.6vh;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  text-align: center
}

.screen-cat {
  font-size: clamp(16px, 1.7vw, 30px);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .14em;
  min-height: 1.3em
}

.screen-cat.spinning {
  color: var(--muted)
}

.screen-cat.landed {
  animation: land .55s cubic-bezier(.2, .9, .3, 1.3)
}

.screen-q {
  font-size: clamp(24px, 3.4vw, 64px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.02em;
  text-wrap: balance;
  min-height: 1.3em
}

.screen-q.fresh {
  animation: fadeUp .4s ease-out
}

.screen-answer {
  font-size: clamp(20px, 2.4vw, 44px);
  font-weight: 700;
  color: var(--ok);
  min-height: 1.3em
}

.screen-answer.fresh {
  animation: fadeUp .4s ease-out
}

.screen-timer {
  max-width: 760px;
  width: 100%;
  margin: 1vh auto 0;
  height: 8px;
  flex: none
}

.screen-players {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 1vw
}

.sp {
  background: rgba(20, 20, 24, .86);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4vh 1vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vh;
  transition: .25s;
  min-width: 0
}

.sp.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 16px 40px -16px var(--accent);
  transform: translateY(-4px)
}

.sp.out {
  opacity: .28
}

.sp.flash-ok {
  animation: flashOk .9s ease-out
}

.sp.flash-bad {
  animation: flashBad .9s ease-out
}

.sp-seat {
  font-size: clamp(10px, .8vw, 14px);
  color: var(--dim);
  font-weight: 700
}

.sp-name {
  font-size: clamp(12px, 1.1vw, 20px);
  font-weight: 650;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.sp .heart {
  width: clamp(12px, 1.2vw, 22px);
  height: clamp(12px, 1.2vw, 22px)
}

.sp .hearts {
  justify-content: center
}

.sp-pts {
  font-size: clamp(16px, 1.6vw, 30px);
  font-weight: 800;
  font-variant-numeric: tabular-nums
}

.screen-winner {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 7, .86);
  backdrop-filter: blur(8px);
  text-align: center;
  animation: fadeUp .5s
}

.screen-winner .eyebrow {
  font-size: clamp(14px, 1.4vw, 22px);
  color: var(--warn)
}

.screen-winner .w-name {
  font-size: clamp(40px, 7vw, 120px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  margin: 1vh 0
}

.screen-winner .w-pts {
  font-size: clamp(18px, 2vw, 34px);
  color: var(--muted);
  font-weight: 600
}

@media (max-width:1280px) {
  .players {
    grid-template-columns: repeat(4, minmax(0, 1fr))
  }
}

@media (max-width:1080px) {
  .host {
    grid-template-columns: 1fr
  }

  .host-side {
    position: static
  }

  .home-grid,
  .import-grid {
    grid-template-columns: 1fr
  }
}

@media (max-width:720px) {
  .wrap {
    padding: 24px 16px 80px
  }

  .nav {
    gap: 14px;
    padding: 0 16px
  }

  .brand-sub,
  .nav-name {
    display: none
  }

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

  .rules-grid {
    grid-template-columns: 1fr
  }

  .span-2 {
    grid-column: auto
  }

  .stage {
    padding: 18px
  }

  .q-text {
    font-size: 20px
  }

  .cat-name {
    font-size: 24px
  }

  .judge-btns {
    width: 100%
  }

  .judge-btns .btn {
    flex: 1;
    min-width: 0
  }

  .kbd-help {
    display: none
  }

  .host-top-right {
    margin-left: 0
  }

  .pc-tools {
    opacity: 1
  }
}

@media (hover:none) {
  .pc-tools {
    opacity: 1
  }
}