:root {
  --bg: #090f24;
  --bg-2: #0f1630;
  --surface: #171f3d;
  --surface-2: #1b2345;
  --line: #303a63;
  --text: #d9e0ff;
  --muted: #9ba6cc;
  --accent: #8c7dff;
  --accent-2: #6b5af8;
  --ok: #34d399;
  --danger: #fb7185;
}

body[data-theme="light"] {
  --bg: #eceff8;
  --bg-2: #dfe5f4;
  --surface: #f7f9ff;
  --surface-2: #ffffff;
  --line: #d4dbef;
  --text: #182037;
  --muted: #5a6788;
  --accent: #6b5af8;
  --accent-2: #5b48ee;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #1b2750 0%, transparent 35%),
    radial-gradient(circle at 90% 0%, #192345 0%, transparent 38%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
}

body.is-booting,
body.modal-open {
  overflow: hidden;
}

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

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p,
small,
code,
pre {
  margin: 0;
}

code,
pre {
  font-family: "IBM Plex Mono", monospace;
}

[hidden] {
  display: none !important;
}

.container {
  width: min(860px, calc(100% - 26px));
  margin: 28px auto 42px;
  display: grid;
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 38px rgba(3, 5, 12, 0.4);
}

.top {
  display: grid;
  gap: 12px;
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.brand-line h1 {
  color: #8a7cff;
  font-size: 1.36rem;
  letter-spacing: 0.02em;
}

.brand-line p {
  font-size: 0.86rem;
  color: var(--muted);
}

.top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-link {
  color: #aeb8de;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.mini-link:hover {
  border-bottom-color: #aeb8de;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: #c8d4f8;
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
}

.status[data-state="error"] i {
  background: var(--danger);
}

.top-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.search-box {
  display: grid;
  gap: 5px;
}

.search-box span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: #121a35;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}

body[data-theme="light"] .search-box input {
  background: #f0f3fc;
}

.search-box input:focus {
  border-color: var(--accent);
}

.about {
  display: grid;
  gap: 11px;
}

.about h2,
.stats h2,
.docs h2,
.license h2 {
  font-size: 0.94rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.hero-image {
  border-radius: 8px;
  border: 1px solid var(--line);
  max-height: 240px;
  width: 100%;
  object-fit: cover;
}

.about p,
.license p {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.45;
}

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

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: #d9e0ff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 9px;
  background: #131b37;
  font-size: 0.82rem;
  font-weight: 600;
}

.action-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.action-btn:hover {
  border-color: var(--accent);
}

.action-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #ffffff;
}

.stats {
  display: grid;
  gap: 10px;
}

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

.metric {
  text-align: center;
}

.metric small {
  color: var(--muted);
  font-size: 0.74rem;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: #8b7dff;
  font-size: 1.2rem;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.77rem;
  color: var(--muted);
}

.meta-strip strong {
  color: var(--text);
}

.empty-filter {
  font-size: 0.86rem;
  color: var(--muted);
}

.docs {
  display: grid;
  gap: 10px;
}

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

.endpoint-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: #131a35;
  display: grid;
  gap: 7px;
  cursor: pointer;
}

body[data-theme="light"] .endpoint-card {
  background: #eff3fc;
}

.endpoint-card h3 {
  font-size: 0.96rem;
}

.endpoint-card p,
.endpoint-card code {
  color: var(--muted);
  font-size: 0.76rem;
}

.endpoint-card:hover {
  border-color: var(--accent);
}

.endpoint-card[data-endpoint-name="ytmp4"] {
  border-color: rgba(121, 143, 255, 0.45);
  background:
    linear-gradient(180deg, rgba(129, 98, 255, 0.08) 0%, rgba(19, 26, 53, 1) 72%);
}

body[data-theme="light"] .endpoint-card[data-endpoint-name="ytmp4"] {
  background:
    linear-gradient(180deg, rgba(129, 98, 255, 0.08) 0%, rgba(239, 243, 252, 1) 72%);
}

.endpoint-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.method-pill {
  font-size: 0.66rem;
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--muted);
}

.endpoint-arrow {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  width: 26px;
  height: 24px;
  border-radius: 7px;
  cursor: pointer;
}

.endpoint-arrow:hover {
  border-color: var(--accent);
}

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

.footer {
  text-align: center;
  color: #7482b4;
  font-size: 0.75rem;
  padding: 8px;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(7, 10, 20, 0.88);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-box {
  min-width: min(86vw, 280px);
  padding: 20px;
  display: grid;
  gap: 8px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111932;
}

.loader-box strong {
  color: #8bffbf;
  letter-spacing: 0.08em;
}

.loader-box span {
  color: var(--muted);
  font-size: 0.86rem;
}

.loader-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6d5cff 0%, #8bffbf 100%);
  animation: pulse 1.2s ease-in-out infinite;
}

.button-primary,
.button-secondary {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: transparent;
  color: #fff;
}

.button-secondary {
  background: #141c38;
  color: var(--text);
}

body[data-theme="light"] .button-secondary {
  background: #f0f3fc;
}

.button-dark {
  background: transparent;
}

.compact {
  padding: 8px 10px;
  font-size: 0.82rem;
}

.theme-toggle-copy {
  display: grid;
  justify-items: start;
  text-align: left;
}

.theme-toggle-copy small {
  font-size: 0.64rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-toggle-visual {
  width: 44px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
}

.theme-toggle-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 180ms ease;
}

body[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(22px);
}

.tester-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 10px;
}

.tester-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 8, 18, 0.72);
}

.tester-sheet {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #111932;
  padding: 14px;
  display: grid;
  gap: 10px;
}

body[data-theme="light"] .tester-sheet {
  background: #ffffff;
}

.tester-sheet-head,
.panel-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tester-description {
  color: var(--muted);
  font-size: 0.86rem;
}

.route-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.route-chip span,
.route-chip code {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 0.75rem;
}

.tester-form,
.tester-fields,
.tester-data {
  display: grid;
  gap: 9px;
}

.tester-field {
  display: grid;
  gap: 5px;
}

.field-block {
  display: grid;
  gap: 6px;
}

.field-block > span {
  font-size: 0.79rem;
  color: var(--muted);
}

.tester-field input,
.tester-field select,
.field-block input,
.field-block select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #111a35;
  color: var(--text);
}

body[data-theme="light"] .tester-field input,
body[data-theme="light"] .tester-field select,
body[data-theme="light"] .field-block input,
body[data-theme="light"] .field-block select {
  background: #f0f3fc;
}

.field-block select[name="quality"] {
  border-color: rgba(122, 146, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(122, 146, 255, 0.2);
}

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

.tester-data pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #101832;
  color: #cfd8fb;
  font-size: 0.76rem;
}

body[data-theme="light"] .tester-data pre {
  background: #f0f3fc;
  color: #1e2741;
}

.link-button.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 760px) {
  .top-actions {
    grid-template-columns: 1fr;
  }

  .cta-row,
  .endpoint-grid,
  .stats-grid,
  .meta-strip {
    grid-template-columns: 1fr;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.docs-page .container {
  width: min(700px, calc(100% - 22px));
  margin: 20px auto 30px;
  gap: 11px;
}

.docs-page .card {
  border-radius: 11px;
  padding: 11px;
}

.docs-page .brand-line h1 {
  font-size: 1.15rem;
  background: linear-gradient(90deg, #8d7fff 0%, #67d0ff 45%, #7dffb6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.docs-page .brand-line p,
.docs-page .search-box input,
.docs-page .endpoint-card p,
.docs-page .endpoint-card code {
  font-size: 0.74rem;
}

.docs-page .top-actions {
  gap: 8px;
}

.docs-page .stats-grid,
.docs-page .cta-row,
.docs-page .endpoint-grid {
  gap: 7px;
}

.docs-page .endpoint-card {
  padding: 9px;
  border-radius: 8px;
}

.docs-page .endpoint-card h3 {
  font-size: 0.84rem;
}

.docs-page .meta-strip {
  font-size: 0.72rem;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-group {
  border-radius: 10px;
}

.category-toggle {
  width: 100%;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(119, 108, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.category-title {
  font-size: 0.86rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(90deg, #d0cbff 0%, #8dc5ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.category-title::before {
  content: "";
  width: 12px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, #8d7fff 0%, #67d0ff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.category-toggle small {
  color: var(--muted);
  font-size: 0.72rem;
}

.category-group:nth-child(2) .category-toggle {
  background: linear-gradient(180deg, rgba(92, 196, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.category-group:nth-child(3) .category-toggle {
  background: linear-gradient(180deg, rgba(115, 255, 199, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.category-group:nth-child(4) .category-toggle {
  background: linear-gradient(180deg, rgba(255, 203, 122, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.category-toggle::after {
  content: "▾";
  margin-left: 8px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.category-toggle.is-open::after {
  transform: rotate(180deg);
}

.category-content {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .docs-page .container {
    width: min(700px, calc(100% - 14px));
    margin: 12px auto 20px;
  }

  .docs-page .top-actions {
    grid-template-columns: 1fr;
  }
}

body.auth-locked {
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 12%, rgba(83, 166, 255, 0.24) 0, rgba(83, 166, 255, 0) 33%),
    radial-gradient(circle at 85% 85%, rgba(159, 119, 255, 0.22) 0, rgba(159, 119, 255, 0) 32%),
    rgba(4, 8, 21, 0.78);
  backdrop-filter: blur(10px);
}

.auth-gate-card {
  position: relative;
  overflow: hidden;
  width: min(660px, 100%);
  display: grid;
  gap: 14px;
  border-radius: 22px;
  border: 1px solid rgba(137, 176, 255, 0.45);
  background:
    linear-gradient(155deg, rgba(16, 25, 50, 0.97) 0%, rgba(12, 19, 39, 0.98) 58%, rgba(9, 14, 30, 0.98) 100%);
  box-shadow: 0 24px 65px rgba(2, 5, 14, 0.65);
  padding: 18px;
  animation: gateFloatIn 260ms ease;
}

.auth-gate-card::before,
.auth-gate-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.auth-gate-card::before {
  width: 260px;
  height: 260px;
  right: -110px;
  top: -115px;
  background: radial-gradient(circle, rgba(97, 149, 255, 0.32) 0, rgba(97, 149, 255, 0) 68%);
}

.auth-gate-card::after {
  width: 220px;
  height: 220px;
  left: -95px;
  bottom: -95px;
  background: radial-gradient(circle, rgba(174, 121, 255, 0.26) 0, rgba(174, 121, 255, 0) 70%);
}

.auth-gate-head {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.auth-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.67rem;
  color: #a5dfff;
  font-weight: 700;
}

.auth-gate-head h2 {
  font-size: clamp(1.32rem, 2.7vw, 1.9rem);
  line-height: 1.02;
  color: #f6f9ff;
}

.auth-gate-head p {
  color: #b7c6e6;
  font-size: 0.87rem;
  max-width: 48ch;
}

.auth-gate-head small {
  color: #9fcfff;
  font-weight: 600;
}

.auth-hints {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-hints span {
  border: 1px solid rgba(161, 208, 255, 0.34);
  background: rgba(28, 45, 88, 0.55);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.71rem;
  color: #dbf1ff;
  font-weight: 600;
}

.auth-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-tabs [data-auth-view] {
  border: 1px solid rgba(136, 166, 235, 0.32);
  border-radius: 11px;
  background: rgba(18, 28, 54, 0.63);
  color: #c5d0e8;
  font-weight: 600;
  min-height: 42px;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 140ms ease;
}

.auth-tabs [data-auth-view]:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 198, 255, 0.5);
}

.auth-tabs [data-auth-view].is-active {
  border-color: rgba(159, 129, 255, 0.86);
  color: #fff;
  background: linear-gradient(180deg, rgba(145, 122, 255, 0.48) 0%, rgba(98, 80, 228, 0.29) 100%);
  box-shadow:
    0 0 0 1px rgba(224, 216, 255, 0.16) inset,
    0 8px 20px rgba(74, 59, 175, 0.32);
}

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

.auth-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 11px;
  border: 1px solid rgba(132, 157, 214, 0.24);
  background: linear-gradient(180deg, rgba(11, 18, 38, 0.72) 0%, rgba(10, 17, 35, 0.57) 100%);
  border-radius: 14px;
  padding: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form label span {
  font-size: 0.7rem;
  color: #9eb1d3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.auth-form input,
.auth-form textarea {
  width: 100%;
  border: 1px solid rgba(136, 157, 207, 0.36);
  background: rgba(11, 18, 37, 0.84);
  color: #f1f5ff;
  border-radius: 11px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

body[data-theme="light"] .auth-form input,
body[data-theme="light"] .auth-form textarea {
  background: #eff3ff;
  border-color: #c7d0e8;
  color: #182037;
}

.auth-form textarea {
  min-height: 74px;
  resize: vertical;
}

.auth-form input:focus,
.auth-form textarea:focus {
  border-color: #9e88ff;
  box-shadow: 0 0 0 3px rgba(151, 129, 255, 0.22);
  transform: translateY(-1px);
}

.auth-form .button-primary {
  margin-top: 2px;
  min-height: 42px;
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.auth-feedback {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: #b3c0dd;
  border-left: 2px solid rgba(157, 183, 243, 0.42);
  padding-left: 8px;
}

.auth-feedback.is-success {
  color: #76e5b7;
  border-left-color: rgba(76, 207, 153, 0.74);
}

.auth-feedback.is-error {
  color: #ff92a2;
  border-left-color: rgba(250, 113, 137, 0.84);
}

.account {
  display: grid;
  gap: 11px;
}

.auth-locked-note,
#account-guest {
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
}

#profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.profile-copy {
  display: grid;
  gap: 2px;
}

.profile-copy span,
.profile-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

#profile-username {
  color: #9bc9ff;
  font-weight: 600;
}

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

.profile-stats article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.profile-stats small {
  color: var(--muted);
  font-size: 0.72rem;
}

.profile-stats strong {
  font-size: 0.86rem;
}

.profile-form {
  margin-top: 10px;
}

.recovery-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.recovery-panel h3 {
  font-size: 0.85rem;
}

#recovery-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.recovery-key-card {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.recovery-key-card code {
  font-size: 0.78rem;
}

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

.leaderboard-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.leaderboard-list {
  display: grid;
  gap: 7px;
}

.leaderboard-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
}

.leaderboard-rank {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
}

.leaderboard-avatar {
  width: 28px;
  height: 28px;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.leaderboard-copy {
  display: grid;
  gap: 2px;
}

.leaderboard-copy strong {
  font-size: 0.82rem;
}

.leaderboard-copy span {
  font-size: 0.74rem;
  color: var(--muted);
}

.leaderboard-copy code {
  font-size: 0.72rem;
  color: #b8ddff;
  word-break: break-all;
}

.admin-quota-input,
.admin-apikey-input,
.admin-password-input {
  width: 100%;
  border: 1px solid var(--line);
  background: #121a35;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 9px;
  outline: none;
}

.admin-create-form {
  border-color: rgba(125, 170, 255, 0.42);
  background:
    linear-gradient(160deg, rgba(15, 26, 52, 0.9) 0%, rgba(13, 22, 45, 0.85) 100%),
    radial-gradient(circle at 100% 0%, rgba(124, 174, 255, 0.18), rgba(124, 174, 255, 0));
}

.admin-create-form .recovery-key-card {
  border-color: rgba(132, 182, 255, 0.44);
  background: rgba(20, 34, 70, 0.55);
}

.admin-create-form .recovery-key-card code {
  color: #d7ebff;
  letter-spacing: 0.06em;
}

body[data-theme="light"] .admin-quota-input,
body[data-theme="light"] .admin-apikey-input,
body[data-theme="light"] .admin-password-input {
  background: #f0f3fc;
}

body[data-theme="light"] .admin-create-form {
  border-color: #b6c6e6;
  background: linear-gradient(160deg, #f7fbff 0%, #edf3ff 100%);
}

.leaderboard-item.route-item {
  grid-template-columns: auto 1fr auto;
}

.leaderboard-metric {
  color: var(--muted);
  font-size: 0.74rem;
}

.leaderboard-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .auth-tabs {
    grid-template-columns: 1fr;
  }

  .profile-head {
    grid-template-columns: auto 1fr;
  }

  .profile-actions {
    grid-column: 1 / -1;
    justify-items: stretch;
  }

  #admin-panel-link,
  #logout-button {
    width: 100%;
  }

  .profile-stats,
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-gate {
    padding: 10px;
    align-items: flex-start;
    overflow-y: auto;
  }
}
