* {
  box-sizing: border-box;
}

/* Dark theme (default) */
:root {
  --bg: #0a0d12;
  --panel: #12161c;
  --line: rgba(255, 255, 255, 0.07);
  --text: #e9eaec;
  --text-dim: #838a94;
  --accent: #3fa0f5;
  --accent-dim: rgba(63, 160, 245, 0.12);
  --ember: #ff7a45;
  --ice: #5fd0ff;
  --input-bg: #1a1f28;
  --input-border: rgba(255,255,255,0.1);
  --bg-body-gradient-a: rgba(63, 160, 245, 0.08);
  --bg-body-gradient-b: rgba(95, 208, 255, 0.05);
  color-scheme: dark;
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
  --text: #111318;
  --text-dim: #6b7280;
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.10);
  --ember: #ea580c;
  --ice: #0ea5e9;
  --input-bg: #f8f9fb;
  --input-border: rgba(0,0,0,0.12);
  --bg-body-gradient-a: rgba(37, 99, 235, 0.05);
  --bg-body-gradient-b: rgba(14, 165, 233, 0.04);
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Lexend", "Segoe UI", Arial, sans-serif;
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, var(--bg-body-gradient-a), transparent),
    radial-gradient(ellipse 700px 400px at 100% 0%, var(--bg-body-gradient-b), transparent);
  background-attachment: fixed;
}

/* ---------- header ---------- */

header {
  background: rgba(20, 23, 26, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

header h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.site-logo {
  flex-shrink: 0;
}

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

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #5865f2;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.discord-btn:hover {
  background: #4752c4;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

#nav-tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.custom-select {
  position: relative;
  display: inline-flex;
}

.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.custom-select-trigger:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--accent);
  color: var(--text);
}

.custom-select-arrow {
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  opacity: 0.6;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(-135deg);
}

.custom-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: #14171c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.custom-select.open .custom-select-menu {
  display: block;
  animation: rowIn 0.15s ease both;
}

.custom-select-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.custom-select-menu-checkbox {
  max-height: 260px;
  overflow-y: auto;
}

.custom-select-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.12s ease, color 0.12s ease;
}

.custom-select-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.custom-select-checkbox-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.custom-select-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.custom-select-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

#search-input {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  min-width: 170px;
}

#search-input:focus {
  outline: none;
  border-color: var(--accent);
}

#search-input::placeholder {
  color: #5c6066;
}

/* ---------- main / leaderboard ---------- */

main {
  padding: 32px 32px 80px;
  max-width: 880px;
  margin: 0 auto;
}

#view-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.title-icon {
  width: 22px;
  height: 22px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: "Lexend", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.back-btn:hover {
  opacity: 0.8;
}

/* Scoreboard-style rows: a colored left bar communicates rank instead of
   tinting the whole row like a generic card list. */

#leaderboard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 480px;
}

table.with-tiers {
  min-width: 640px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th:nth-child(1) { width: 8%; }
th:nth-child(2) { width: 52%; }
th:nth-child(3) { width: 20%; text-align: left; }
th:nth-child(4) { width: 20%; text-align: left; }

table.with-tiers th:nth-child(1) { width: 6%; }
table.with-tiers th:nth-child(2) { width: 30%; }
table.with-tiers th:nth-child(3) { width: 12%; }
table.with-tiers th:nth-child(4) { width: 12%; }
table.with-tiers th:nth-child(5) { width: 40%; }

.mini-tier-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-tier-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mini-tier-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #1c2128;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mini-tier-icon {
  width: 16px;
  height: 16px;
}

.mini-tier-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
}

thead tr {
  border-bottom: 1px solid var(--line);
}

th {
  text-align: left;
  padding: 18px 16px 18px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5c6066;
}

th:first-child { padding-left: 18px; width: 50px; }

td {
  padding: 13px 16px;
  font-size: 0.92rem;
}

td:nth-child(3), td:nth-child(4) {
  text-align: left;
}

td:first-child {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: #5c6066;
  padding-left: 18px;
}

tbody tr {
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease, border-left-color 0.12s ease;
  animation: rowIn 0.25s ease both;
}

tbody tr:nth-child(1) { animation-delay: 0.02s; }
tbody tr:nth-child(2) { animation-delay: 0.05s; }
tbody tr:nth-child(3) { animation-delay: 0.08s; }
tbody tr:nth-child(4) { animation-delay: 0.11s; }
tbody tr:nth-child(5) { animation-delay: 0.14s; }

@keyframes rowIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

tr.rank-1 {
  border-left-color: var(--accent);
}

tr.rank-1 td:first-child {
  color: var(--accent);
}

tr.rank-2 { border-left-color: #b8bcc2; }
tr.rank-2 td:first-child { color: #b8bcc2; }

tr.rank-3 { border-left-color: #d08a52; }
tr.rank-3 td:first-child { color: #d08a52; }

/* Tier / score values read as data, so they're monospace like the rank. */
td:last-child {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--accent);
}

.player-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--text);
  font-family: "Lexend", sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.player-link:hover {
  color: var(--accent);
}

.player-head {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: block;
  image-rendering: pixelated;
}

/* ---------- player profile ---------- */

.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  animation: rowIn 0.3s ease both;
}

.profile-head {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  display: block;
  image-rendering: pixelated;
  border: 1px solid var(--line);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.profile-meta {
  display: flex;
  gap: 8px;
}

.profile-score {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid rgba(63, 160, 245, 0.3);
  border-radius: 6px;
  padding: 3px 12px;
}

.profile-details {
  display: flex;
  gap: 40px;
  padding: 24px 28px;
  animation: rowIn 0.35s ease both;
}

.profile-detail-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-detail-col-grow {
  flex: 1;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5c6066;
}

.profile-region-badge {
  background: var(--accent-dim);
  border: 1px solid rgba(63, 160, 245, 0.3);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
  padding: 7px 12px;
  text-align: center;
  min-width: 40px;
}

.profile-tier-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.profile-tier-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.profile-tier-icon-box {
  width: 44px;
  height: 44px;
  background: #1c2128;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-tier-icon-box .gamemode-icon {
  width: 26px;
  height: 26px;
}

.profile-tier-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.empty-state {
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0;
  font-size: 0.9rem;
}

.widget-empty-state {
  padding: 16px 8px;
  font-size: 0.8rem;
}

/* ---------- mobile ---------- */

@media (max-width: 680px) {
  header {
    padding: 14px 16px;
  }

  .header-top {
    margin-bottom: 10px;
  }

  header h1 {
    font-size: 1.15rem;
  }

  .discord-btn span {
    display: none;
  }

  .discord-btn {
    padding: 8px;
  }

  nav {
    gap: 8px;
  }

  #nav-tabs {
    gap: 6px;
  }

  .tab-btn,
  .custom-select-trigger {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  #search-input {
    flex: 1 1 100%;
    order: 10;
    min-width: 0;
  }

  main {
    padding: 20px 14px 50px;
  }

  #view-title {
    font-size: 0.95rem;
  }

  td, th {
    padding: 10px 12px;
  }

  th:first-child, td:first-child {
    padding-left: 14px;
  }

  .player-link span {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-card {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding-bottom: 18px;
  }

  .profile-info {
    align-items: center;
  }

  .profile-details {
    flex-direction: column;
    gap: 20px;
    padding: 16px;
  }

  .profile-tier-icons {
    justify-content: center;
  }

  .custom-select-menu {
    max-width: calc(100vw - 32px);
  }
}

/* ---------- page tabs (Home / Leaderboard / Testers) ---------- */

.page-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.page-tab {
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 4px;
  font-family: "Lexend", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.page-tab:hover {
  color: var(--text);
}

.page-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- test rows (Home tab: live + recent tests) ---------- */

.test-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.test-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  padding: 12px 16px;
  flex-wrap: wrap;
}

.test-row-testee {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  color: var(--text);
}

.test-row-head {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  image-rendering: pixelated;
}

.test-row-gamemode {
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-row-gm-icon {
  width: 20px;
  height: 20px;
}

.test-row-divider {
  color: var(--text-dim);
  opacity: 0.5;
}

.test-row-testers {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

.test-row-tester {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.test-row-tester-head {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  image-rendering: pixelated;
}

/* ---------- live now widget (fixed, bottom-left) ---------- */

.side-panel-tab {
  display: none;
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 0 8px 8px 0;
  padding: 14px 8px;
  font-family: "Lexend", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  writing-mode: vertical-rl;
  cursor: pointer;
  z-index: 199;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.side-panel-tab:hover {
  background: #6bb8f7;
}

.side-panel-tab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-10px);
}

.side-panel {
  position: fixed;
  bottom: 16px;
  left: 16px;
  top: auto;
  height: auto;
  width: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  background: none;
  border-right: none;
  box-shadow: none;
  z-index: 200;
  overflow: visible;
  max-height: calc(100vh - 32px);
  transform: none;
}

.side-panel-close {
  display: none;
}

.live-now-widget {
  width: 100%;
  flex-shrink: 0;
  max-height: 45vh;
  display: none;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-now-widget.visible {
  display: flex;
}

/* Chunky "beveled block" header, like a Minecraft UI panel. */
.live-now-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, #3a3f47 0%, #23262b 100%);
  border-bottom: 3px solid #14161a;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12);
}

.live-now-title {
  font-family: "Lexend", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-now-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 6px #ff4d4d;
}

.live-now-count {
  background: var(--accent);
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.live-now-rows {
  background: rgba(18, 22, 28, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.live-now-rows::-webkit-scrollbar {
  width: 6px;
}

.live-now-rows::-webkit-scrollbar-track {
  background: transparent;
}

.live-now-rows::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

.live-now-rows::-webkit-scrollbar-thumb:hover {
  background: #6bb8f7;
}

.live-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.live-row-head {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.live-row-info {
  min-width: 0;
}

.live-row-name {
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-row-gamemode {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.live-row-tier {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.recent-tests-title {
  color: #ffffff;
}

.recent-tests-title::before {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.recent-tests-badge {
  background: var(--ice);
  color: #0a0d12;
}

@media (max-width: 680px) {
  .side-panel-tab {
    display: block;
  }

  .side-panel-close {
    display: block;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .side-panel-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  .side-panel {
    top: 0;
    left: 0;
    bottom: auto;
    height: 100vh;
    width: 100%;
    padding: 56px 16px 16px;
    background: rgba(10, 13, 18, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    max-height: none;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .side-panel.open {
    transform: translateX(0);
  }

  .live-now-widget {
    max-height: 40vh;
  }

  .live-now-header {
    padding: 10px 12px;
  }

  .live-now-title {
    font-size: 0.8rem;
  }

  .live-now-count {
    font-size: 0.68rem;
    padding: 2px 8px;
  }

  .live-now-rows {
    padding: 6px;
    gap: 4px;
  }

  .live-row {
    padding: 6px 8px;
    gap: 8px;
  }

  .live-row-head {
    width: 26px;
    height: 26px;
  }

  .live-row-name {
    font-size: 0.78rem;
  }

  .live-row-gamemode {
    font-size: 0.62rem;
  }

  .home-overview {
    padding: 16px;
    gap: 18px;
  }

  .home-section h3 {
    font-size: 0.95rem;
  }

  .home-section p,
  .home-steps,
  .home-rules {
    font-size: 0.85rem;
  }

  .page-tabs {
    gap: 4px;
  }

  .page-tab {
    font-size: 0.85rem;
  }
}

/* ---------- home overview ---------- */

.home-overview {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

.home-section h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.home-section p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 0.92rem;
}

.home-section p strong {
  color: var(--text);
}

.home-steps,
.home-rules {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 0.92rem;
}

.home-steps li strong,
.home-rules li strong {
  color: var(--text);
}

.home-steps code {
  background: rgba(63, 160, 245, 0.12);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

/* ---------- testers tab search ---------- */

.testers-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  font-family: "Lexend", sans-serif;
  font-size: 0.9rem;
}

.testers-search:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.testers-search::placeholder {
  color: #5c6066;
}

/* ---------- auth widget ---------- */

.header-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

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

.auth-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.auth-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06111c;
  font-weight: 700;
}

.auth-btn-primary:hover {
  background: #5bb0f8;
}

.auth-btn-small {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: 8px;
}

.auth-username-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 14px 6px 8px;
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-username-head {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: block;
  flex-shrink: 0;
}

/* ---------- testing tab ---------- */

.testing-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.testing-profile-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.testing-profile-bar strong {
  color: var(--text);
}

.testing-subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.testing-subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: "Lexend", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.testing-subtab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.testing-gamemode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.testing-gm-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 34px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 10px;
  padding: 7px 16px;
  font-family: "Lexend", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.testing-gm-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-dim);
}

.testing-region-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.testing-region-btn {
  box-sizing: border-box;
  min-height: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 5px 12px;
  font-family: "Lexend", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
}

.testing-region-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-dim);
}

.testing-gm-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

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

.queue-closed-banner {
  background: rgba(255, 122, 69, 0.12);
  border: 1px solid rgba(255, 122, 69, 0.3);
  color: var(--ember);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.queue-columns {
  display: flex;
  gap: 24px;
}

.queue-column {
  flex: 1;
}

.queue-column-narrow {
  flex: 0 0 220px;
}

.queue-column-header {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.queue-row-rank {
  width: 20px;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.queue-row-head {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.queue-row-name {
  flex-grow: 1;
  font-weight: 500;
}

.queue-row-region {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

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

.queue-tester-chip {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.queue-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.result-row-head {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.result-row-info {
  flex-grow: 1;
}

.result-row-name {
  font-weight: 600;
}

.result-row-gamemode {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.result-tier-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
}

@media (max-width: 680px) {
  .queue-columns {
    flex-direction: column;
  }
  .queue-column-narrow {
    flex: initial;
  }
  .result-row {
    flex-wrap: wrap;
  }
}

/* ---------- tests subtab ---------- */

.tests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-ticket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.test-ticket-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-radius: 6px;
  padding: 3px 8px;
}

.test-ticket-discord {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-left: auto;
}

.test-ticket-pending {
  color: #f59e0b;
}

.open-ticket-btn {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5865f2;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.open-ticket-btn:hover {
  background: rgba(88, 101, 242, 0.22);
  border-color: rgba(88, 101, 242, 0.55);
}

/* ---- test ticket chat panel ---- */
.test-chat-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.test-chat-messages {
  flex: 1;
  max-height: 280px;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.test-chat-msg {
  font-size: 0.84rem;
  line-height: 1.4;
}

.test-chat-msg-label {
  font-weight: 700;
  margin-right: 6px;
  color: var(--accent);
}

.test-chat-msg-label.discord-label {
  color: #5865f2;
}

.test-chat-msg-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: 4px;
}

.test-chat-empty {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: center;
  padding: 16px 0;
}

.test-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.test-chat-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.87rem;
  padding: 7px 12px;
  font-family: inherit;
  outline: none;
}
.test-chat-input:focus {
  border-color: var(--accent);
}

.test-chat-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.test-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.test-ticket-row-open .open-ticket-btn {
  background: rgba(88, 101, 242, 0.22);
  border-color: rgba(88, 101, 242, 0.55);
}

/* ---- end test ticket chat panel ---- */

.high-test-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #d97706, #b45309);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- support tab ---------- */

.support-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.support-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.support-heading {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.support-section-heading {
  margin: 20px 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.support-section-heading:first-child {
  margin-top: 0;
}

.support-section-heading-history {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.support-message-edited {
  font-weight: 400;
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.75em;
}

.support-ticket-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  color: var(--text);
  font-family: "Lexend", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.support-ticket-row:hover {
  border-color: var(--accent);
}

.support-ticket-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.support-ticket-status-open {
  background: rgba(63, 160, 245, 0.15);
  color: var(--accent);
}

.support-ticket-status-closed {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.support-ticket-subject {
  flex-grow: 1;
  font-weight: 600;
}

.support-ticket-category,
.support-ticket-player {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.support-form,
.support-reply-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.support-reply-form {
  flex-direction: row;
  max-width: none;
  margin-top: 14px;
}

.support-form-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-top: 6px;
}

.support-form-input,
.support-form-select,
.support-form-textarea {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "Lexend", sans-serif;
  font-size: 0.9rem;
}

.support-reply-form .support-form-input {
  flex-grow: 1;
}

.support-form-textarea {
  resize: vertical;
}

.verify-page {
  max-width: 480px;
  margin: 40px auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.verify-heading {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.verify-intro {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0 0 20px;
}

.verify-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.verify-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.verify-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "Lexend", sans-serif;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
}

.verify-error {
  color: #ff6b6b;
  font-size: 0.82rem;
  margin: 0;
  min-height: 1em;
}

.support-thread-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.support-thread-header .auth-btn {
  margin-left: auto;
}

.support-thread-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.support-message {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}

.support-message-discord {
  border-left: 3px solid var(--ice);
}

.support-message-website {
  border-left: 3px solid var(--accent);
}

.support-message-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.support-message-source {
  font-weight: 400;
  color: var(--ice);
}

.support-message-content {
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* ---------- settings page ---------- */

.settings-page {
  max-width: 540px;
  margin: 0 auto;
  padding: 24px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 4px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.settings-input {
  background: var(--input-bg, var(--bg));
  border: 1px solid var(--input-border, var(--line));
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.15s;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-input option {
  background: var(--panel);
  color: var(--text);
}

.settings-save-btn {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.settings-save-btn:hover {
  opacity: 0.85;
}

.settings-save-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.settings-feedback {
  font-size: 0.82rem;
  min-height: 1.1em;
}

.settings-feedback.success { color: #4ade80; }
.settings-feedback.error   { color: #f87171; }

/* Theme toggle pills */
.theme-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-pill {
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.theme-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
