:root {
  --bg: #07070b;
  --bg2: #101018;
  --line: #2a2a36;
  --text: #ececf1;
  --muted: #8b8b9a;
  --accent: #ff4d2e;
  --accent-dim: #c43a24;
  --ok: #3dd68c;
  --danger: #ff5c5c;
  --font-display: "Bebas Neue", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page--admin {
  background: radial-gradient(120% 80% at 50% 0%, #15151f 0%, var(--bg) 55%);
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg2), var(--bg));
}

.topbar--admin {
  border-bottom-color: #333348;
}

.topbar__mark {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  letter-spacing: 0.18em;
  color: var(--text);
}

.topbar__tag {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
}

.shell {
  flex: 1;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.shell--narrow {
  max-width: 26rem;
}

.panel {
  display: none;
  padding: 0.25rem 0 1.5rem;
}

.panel--active {
  display: block;
}

.panel__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3rem);
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0.35rem;
  line-height: 1;
}

.panel__lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.panel__muted {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field__input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.35rem;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}

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

.btn {
  display: block;
  width: 100%;
  padding: 1rem 1.1rem;
  border: none;
  border-radius: 0.35rem;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
}

.btn--primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  color: #0a0a0a;
}

.btn--ghost {
  margin-top: 0.65rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn--danger {
  margin-top: 0.65rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid #5a2a2a;
}

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

.btn-stack .btn {
  margin-top: 0.65rem;
}

.btn-stack .btn:first-child {
  margin-top: 0;
}

.msg {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.msg--err {
  color: var(--danger);
}

.pill-row {
  margin-bottom: 1rem;
}

.pill {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
}

.pill--on {
  border-color: #2f6a4a;
  color: var(--ok);
  background: rgba(61, 214, 140, 0.08);
}

.pill--off {
  opacity: 0.85;
}

.subhead {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.subhead--accent {
  color: var(--accent);
}

.subhead--dim {
  margin-top: 2rem;
  color: var(--muted);
}

.namelist {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  overflow: hidden;
}

.namelist li {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.namelist li:last-child {
  border-bottom: none;
}

.quizbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.quizbar__timer {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.qfig {
  margin: 0 0 1rem;
  border-radius: 0.4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.qfig__img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.qtext {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  line-height: 1.35;
  font-weight: 600;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1rem;
  border-radius: 0.35rem;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  min-height: 3.25rem;
}

.choice__key {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.2rem;
  background: #1a1a24;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.choice:disabled {
  opacity: 0.55;
  cursor: default;
}

.choice--picked {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.rank {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-bottom: none;
  font-weight: 600;
}

.rank li:first-child {
  border-radius: 0.35rem 0.35rem 0 0;
}

.rank li:last-child {
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 0.35rem 0.35rem;
}

.rank--top li {
  background: linear-gradient(90deg, rgba(255, 77, 46, 0.12), transparent);
}

.rank--bottom li {
  background: #0c0c12;
  color: var(--muted);
}

.rank__score {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.rank--bottom .rank__score {
  color: #6a6a78;
}

.meta {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
}

.meta dt {
  margin: 0;
  color: var(--muted);
}

.meta dd {
  margin: 0;
  font-weight: 600;
}
