:root {
  --black: #07090d;
  --black-soft: #0a0e16;
  --panel: #090d16;
  --navy: #0d1730;
  --navy-soft: #101c38;
  --line: #1a2740;
  --line-bright: #293b5c;
  --green: #38ff9c;
  --green-soft: #21c877;
  --blue: #4c8dff;
  --blue-soft: #8bb8ff;
  --red: #ff5f7e;
  --text: #eef3fa;
  --muted: #8491a6;
  --muted-dark: #536078;
  --font-sans: "Inter", "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
}

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

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--black);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--black);
  background: var(--green);
}

:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 50;
  padding: 9px 12px;
  color: var(--black);
  background: var(--green);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ------------------------------------------------------------------ */
/* Background                                                          */
/* ------------------------------------------------------------------ */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 9, 13, 0.62), rgba(7, 9, 13, 0.94)),
    radial-gradient(ellipse 60% 72% at 50% 46%, var(--navy) 0%, var(--black) 72%);
}

.scene-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 36% 42% at 50% 48%, rgba(29, 52, 104, 0.6), transparent 72%),
    radial-gradient(circle at 85% 2%, rgba(56, 255, 156, 0.055), transparent 26%);
}

.scene-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(92, 126, 190, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 126, 190, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.72;
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 48%, #000 12%, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 68% at 50% 48%, #000 12%, transparent 78%);
}

.scene-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.017) 0,
    rgba(255, 255, 255, 0.017) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.55;
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.screen {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  align-content: safe center;
  justify-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: 32px 16px;
}

.auth-panel {
  position: relative;
  width: min(430px, 100%);
  padding: 24px 30px 0;
  background:
    linear-gradient(180deg, rgba(11, 16, 27, 0.97), rgba(7, 10, 17, 0.985)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow:
    0 36px 100px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(56, 255, 156, 0.015),
    0 0 90px -58px rgba(56, 255, 156, 0.65);
  animation: panel-in 420ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

.auth-panel::before {
  position: absolute;
  top: -1px;
  right: 22%;
  left: 22%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.75;
}

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

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid #131d2f;
}

.wordmark {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.wordmark span {
  margin-left: 4px;
  color: var(--green);
  font-weight: 500;
  opacity: 0.85;
}

.network-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  line-height: 1;
  white-space: nowrap;
}

.online-dot {
  width: 4px;
  height: 4px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(56, 255, 156, 0.75);
  animation: status-pulse 2.8s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.slash {
  color: #2d3a51;
}

/* ------------------------------------------------------------------ */
/* Heading                                                             */
/* ------------------------------------------------------------------ */

.identity-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 28px;
  margin-top: 14px;
  padding: 3px 8px;
  color: var(--green);
  background: rgba(56, 255, 156, 0.055);
  border-left: 2px solid var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.identity-strip.is-error {
  color: #ff91a5;
  background: rgba(255, 95, 126, 0.07);
  border-left-color: var(--red);
}

.identity-logout {
  flex: 0 0 auto;
  height: 21px;
  padding: 0 7px;
  color: #7f8fa8;
  background: transparent;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.identity-logout:hover {
  color: #ffb9c5;
  border-color: rgba(255, 95, 126, 0.45);
}

.identity-logout:disabled {
  cursor: wait;
  opacity: 0.55;
}

.heading {
  padding: 25px 0 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-soft);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.17em;
  line-height: 1.5;
}

.heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Tabs                                                                */
/* ------------------------------------------------------------------ */

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 23px;
  border-bottom: 1px solid var(--line);
}

.auth-panel.has-result .heading,
.auth-panel.has-result .auth-tabs {
  display: none;
}

.auth-panel.has-result .register-result {
  padding-top: 22px;
}

.auth-tab {
  position: relative;
  padding: 10px 0 11px;
  color: var(--muted-dark);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: color 160ms ease;
}

.auth-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--green);
  box-shadow: 0 0 10px rgba(56, 255, 156, 0.42);
  opacity: 0;
  transform: scaleX(0.45);
  transition:
    opacity 160ms ease,
    transform 200ms ease;
}

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

.auth-tab.is-active {
  color: var(--text);
}

.auth-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* ------------------------------------------------------------------ */
/* Form                                                                */
/* ------------------------------------------------------------------ */

.auth-form {
  padding-top: 19px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

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

.field-label {
  min-width: 0;
  color: #b3bfd0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.field-label-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.info-button {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  color: var(--blue-soft);
  background: rgba(76, 141, 255, 0.12);
  border: 1px solid var(--blue);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  place-items: center;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.info-button::before {
  position: absolute;
  inset: -7px;
  content: "";
}

.info-button:hover {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(76, 141, 255, 0.38);
}

.field input {
  display: block;
  width: 100%;
  height: 43px;
  padding: 0 12px;
  color: var(--text);
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  font-size: 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.field input::placeholder {
  color: #4a566c;
}

.field input:hover {
  border-color: var(--line-bright);
}

.field input:focus {
  background: #09101c;
  border-color: rgba(56, 255, 156, 0.65);
  box-shadow: 0 0 0 1px rgba(56, 255, 156, 0.13);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 43px;
}

.peek {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 35px;
  height: 35px;
  padding: 0;
  color: #5d6b83;
  background: transparent;
  border: 0;
  border-radius: 2px;
  place-items: center;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.peek:hover {
  color: var(--green);
  background: rgba(56, 255, 156, 0.05);
}

.peek svg {
  width: 17px;
  height: 17px;
}

.peek .icon-eye-off {
  display: none;
}

.peek[aria-pressed="true"] .icon-eye {
  display: none;
}

.peek[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 17px;
}

.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #080d17;
  border: 1px solid #2b3b56;
  border-radius: 2px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.check input:checked + .check-box {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(56, 255, 156, 0.24);
}

.check input:checked + .check-box::after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 3px;
  height: 7px;
  content: "";
  border: solid #04110a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check input:focus-visible + .check-box {
  outline: 1px solid var(--green);
  outline-offset: 3px;
}

.text-button {
  padding: 0 0 2px;
  color: #8b98ad;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted #33425c;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.text-button:hover {
  color: var(--green);
  border-color: rgba(56, 255, 156, 0.5);
}

.field-note {
  margin: -2px 0 13px;
  color: #536078;
  font-size: 9.5px;
  line-height: 1.6;
}

.form-error {
  margin: 0 0 12px;
  padding: 8px 10px;
  color: #ff91a5;
  background: rgba(255, 95, 126, 0.065);
  border: 1px solid rgba(255, 95, 126, 0.22);
  border-radius: 3px;
  font-size: 10.5px;
  line-height: 1.6;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 45px;
  margin-top: 1px;
  padding: 0 15px 0 17px;
  color: #04110a;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.primary-button:hover {
  background: #5dffb2;
  box-shadow: 0 0 28px rgba(56, 255, 156, 0.2);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.button-mark {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.primary-button.is-loading .button-mark {
  animation: mark-move 850ms ease-in-out infinite;
}

.step-back {
  display: block;
  width: 100%;
  margin-top: 11px;
  padding: 5px 0;
  color: #67758b;
  background: transparent;
  border: 0;
  font-size: 10px;
  letter-spacing: 0.03em;
  text-align: center;
  transition: color 160ms ease;
}

.step-back:hover {
  color: var(--green);
}

.register-result {
  padding: 7px 0 3px;
}

.register-result .secondary-button {
  margin-top: 18px;
}

.leader-dashboard {
  padding: 0;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 14px;
  color: var(--text);
  text-align: left;
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.feature-card:hover {
  background: rgba(56, 255, 156, 0.035);
  border-color: rgba(56, 255, 156, 0.42);
}

.feature-card + .feature-card {
  margin-top: 8px;
}

.feature-index {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.feature-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.feature-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.feature-copy small {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.feature-arrow {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 15px;
}

.leader-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.members-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.members-back {
  padding: 0;
  color: #9caec4;
  background: transparent;
  border: 0;
  font-size: 10px;
  letter-spacing: 0.04em;
  transition: color 160ms ease;
}

.members-back:hover {
  color: var(--green);
}

.members-view-note {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.ranking-panel {
  margin-top: 0;
}

.ranking-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  min-height: 150px;
  color: var(--muted-dark);
  border: 1px dashed var(--line-bright);
  border-radius: 3px;
}

.ranking-empty span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.ranking-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.ranking-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
}

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

.ranking-table th {
  padding: 9px 8px;
  color: var(--muted-dark);
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.ranking-table td {
  padding: 9px 8px;
  color: #c6d2e3;
  border-bottom: 1px solid #131d2f;
}

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

.ranking-table td:first-child,
.ranking-table td:last-child {
  font-family: var(--font-mono);
}

.ranking-table tr.is-me td {
  color: var(--green);
}

.ranking-detail {
  padding: 2px 0;
  color: #8da2bb;
  background: transparent;
  border: 0;
  font-size: 8.5px;
  text-decoration: underline;
  text-decoration-color: rgba(141, 162, 187, 0.35);
  text-underline-offset: 3px;
}

.ranking-detail:hover {
  color: var(--green);
}

.score-detail-panel {
  width: min(320px, 100%);
}

.score-detail-title {
  margin: 8px 0 2px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
}

.score-detail-identity {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 9px;
}

.score-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-bottom: 14px;
}

.score-detail-grid > div {
  padding: 10px 7px;
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 3px;
  text-align: center;
}

.score-detail-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-dark);
  font-size: 7.5px;
}

.score-detail-grid strong {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
}

.score-detail-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.score-detail-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.score-detail-section-head h4 {
  margin: 0;
  color: #b7c5d7;
  font-size: 9px;
  font-weight: 500;
}

.score-detail-section-head span {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.score-detail-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 96px;
  overflow-y: auto;
}

.score-detail-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  color: #aebdd0;
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.score-detail-item strong {
  color: var(--green);
  font-size: 8px;
  font-weight: 600;
}

.score-detail-empty {
  color: var(--muted-dark);
  font-size: 8.5px;
}

.score-detail-close {
  width: 100%;
  height: 37px;
  color: #aab8ca;
  background: transparent;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.score-detail-close:hover {
  color: var(--green);
  border-color: rgba(56, 255, 156, 0.45);
}

.ranking-edit {
  width: 100%;
  height: 38px;
  margin-top: 12px;
  color: var(--green);
  background: rgba(56, 255, 156, 0.04);
  border: 1px solid rgba(56, 255, 156, 0.35);
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.ranking-edit:hover {
  background: rgba(56, 255, 156, 0.09);
  border-color: rgba(56, 255, 156, 0.65);
}

.application-link {
  width: 100%;
  margin-top: 14px;
  padding: 4px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: rgba(143, 158, 178, 0.3);
  text-underline-offset: 4px;
}

.application-link:hover {
  color: var(--green);
}

.application-status-text {
  margin: 0;
  padding: 16px;
  color: var(--green);
  background: rgba(56, 255, 156, 0.045);
  border: 1px solid rgba(56, 255, 156, 0.2);
  border-radius: 3px;
  font-size: 15px;
  line-height: 1.7;
}

.application-panel {
  width: min(390px, 100%);
}

.application-title {
  margin: 8px 0 14px;
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
}

.application-field {
  display: block;
  margin-bottom: 10px;
}

.application-field > span {
  display: block;
  margin-bottom: 5px;
  color: #98a8bd;
  font-size: 9px;
}

.application-field input {
  display: block;
  width: 100%;
  height: 37px;
  padding: 0 9px;
  color: var(--text);
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  font-size: 11px;
}

.application-field input:focus {
  border-color: rgba(56, 255, 156, 0.65);
}

.application-requirements {
  margin: 10px 0 14px;
  padding: 10px 11px;
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.application-requirements p {
  margin: 0;
  color: #aab8ca;
  font-size: 9px;
  line-height: 1.7;
}

.application-requirements p + p {
  margin-top: 4px;
}

.application-requirements ol {
  margin: 4px 0 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.8;
}

.application-note {
  color: var(--muted-dark) !important;
  font-size: 8px !important;
}

.application-input-row {
  display: flex;
  gap: 6px;
}

.application-input-row input {
  flex: 1;
  min-width: 0;
}

.application-types-button {
  flex: 0 0 auto;
  padding: 0 8px;
  color: var(--green);
  background: transparent;
  border: 1px solid rgba(56, 255, 156, 0.28);
  border-radius: 3px;
  font-size: 8px;
}

.application-types-button:hover {
  background: rgba(56, 255, 156, 0.08);
}

.modal-types {
  z-index: 70;
}

.types-panel {
  width: min(360px, 100%);
}

.types-title {
  margin: 8px 0 12px;
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
}

.types-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 52vh;
  overflow-y: auto;
}

.types-item {
  padding: 5px 7px;
  color: #a9b7c9;
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.score-panel {
  margin-top: 0;
}

.score-intro {
  margin-bottom: 14px;
}

.score-intro h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.score-intro p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.75;
}

.score-filters {
  display: flex;
  gap: 7px;
  margin-bottom: 4px;
}

.score-filter {
  height: 30px;
  padding: 0 11px;
  color: #8b9bb0;
  background: transparent;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  font-size: 8.5px;
}

.score-filter.is-active {
  color: #04110a;
  background: var(--green);
  border-color: var(--green);
}

.score-tier {
  margin-top: 17px;
}

.score-tier-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  color: #b9c6d8;
  font-family: var(--font-mono);
  font-size: 9px;
}

.score-tier-head::before,
.score-tier-head::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.petal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.petal-button {
  position: relative;
  min-height: 29px;
  padding: 5px 8px;
  color: #07130c;
  background: #28e98b;
  border: 1px solid #28e98b;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  line-height: 1.25;
  transition:
    background 120ms ease,
    transform 120ms ease;
}

.petal-button:hover {
  background: #58ffad;
}

.petal-button:active {
  transform: translateY(1px);
}

.petal-button.has-count {
  color: #eafff3;
  background: #0d3322;
  border-color: rgba(56, 255, 156, 0.65);
}

.petal-button.is-nonstackable {
  color: #06130b;
  background: #1a9b60;
  border-color: #1a9b60;
}

.petal-button.is-nonstackable:hover {
  background: #24bd76;
}

.petal-button.is-nonstackable.has-count {
  color: #d9ffea;
  background: #0a2418;
  border-color: rgba(56, 255, 156, 0.35);
}

.petal-count {
  display: inline-block;
  min-width: 15px;
  margin-left: 4px;
  padding: 1px 3px;
  color: var(--green);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  font-size: 7px;
  text-align: center;
}

.petal-button.has-count .petal-count {
  color: #04110a;
  background: var(--green);
}

.ultra-section {
  margin-top: 19px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.ultra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ultra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.ultra-label {
  min-width: 0;
  color: #c3cfdf;
  font-family: var(--font-mono);
  font-size: 8px;
}

.ultra-label small {
  display: block;
  margin-top: 2px;
  color: var(--muted-dark);
  font-size: 7px;
}

.ultra-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ultra-step {
  width: 20px;
  height: 20px;
  color: var(--green);
  background: transparent;
  border: 1px solid rgba(56, 255, 156, 0.28);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1;
}

.ultra-step:hover {
  background: rgba(56, 255, 156, 0.1);
}

.ultra-count {
  min-width: 18px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: center;
}

.score-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line-bright);
}

.score-total span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.score-total strong {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
}

.score-save {
  width: 100%;
  height: 39px;
  margin-top: 12px;
  color: #04110a;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.score-save:hover {
  background: #5dffb2;
}

.leader-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.leader-head h3 {
  margin: 0;
  color: #c6d2e3;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.leader-head span {
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 8px;
}

.leader-table-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.leader-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.leader-table th,
.leader-table td {
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #131d2f;
  font-size: 8.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

.leader-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #6f7e95;
  background: #070b12;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.leader-table th:nth-child(1) {
  width: 27%;
}

.leader-table th:nth-child(2) {
  width: 45%;
}

.leader-table th:nth-child(3) {
  width: 28%;
}

.leader-table td {
  color: #b3bfd0;
}

.leader-table td:nth-child(2),
.leader-table td:nth-child(3) {
  color: #8ea0b9;
  font-family: var(--font-mono);
  font-size: 8px;
}

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

.leader-empty {
  padding: 12px 8px;
  color: var(--muted-dark);
  font-size: 9px;
}

.leader-tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.leader-tool {
  flex: 1;
  height: 34px;
  color: #b6c4d6;
  background: transparent;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.leader-tool:hover {
  color: var(--green);
  border-color: rgba(56, 255, 156, 0.45);
  background: rgba(56, 255, 156, 0.035);
}

.leader-tool.is-danger {
  color: #ff91a5;
  border-color: rgba(255, 95, 126, 0.32);
}

.leader-tool.is-danger:hover {
  color: #ffd3db;
  background: rgba(255, 95, 126, 0.08);
  border-color: rgba(255, 95, 126, 0.6);
}

.leader-add-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.leader-add-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.leader-add-head h4 {
  margin: 0;
  color: #c6d2e3;
  font-size: 10.5px;
  font-weight: 600;
}

.leader-add-head span {
  color: var(--muted-dark);
  font-size: 8px;
}

.leader-field {
  display: block;
  margin-bottom: 9px;
}

.leader-field > span {
  display: block;
  margin-bottom: 5px;
  color: #8d9bb0;
  font-size: 9px;
}

.leader-field input {
  display: block;
  width: 100%;
  height: 37px;
  padding: 0 10px;
  color: var(--text);
  background: #080d17;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
  font-size: 11px;
}

.leader-field input:focus {
  border-color: rgba(56, 255, 156, 0.65);
  box-shadow: 0 0 0 1px rgba(56, 255, 156, 0.1);
}

.leader-field input::placeholder {
  color: #4a566c;
}

.leader-add-submit {
  width: 100%;
  height: 36px;
  color: #04110a;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.leader-add-submit:hover {
  background: #5dffb2;
}

.remove-panel {
  width: min(380px, 100%);
}

.remove-title {
  margin: 8px 0 4px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
}

.remove-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.remove-list {
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.remove-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid #131d2f;
  font-size: 10px;
  cursor: pointer;
}

.remove-item:last-child {
  border-bottom: 0;
}

.remove-item input {
  accent-color: var(--red);
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.remove-item code {
  color: #718097;
  font-family: var(--font-mono);
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-item .self-note {
  margin-left: auto;
  color: #58667d;
  font-size: 8px;
}

.remove-item.is-self {
  cursor: not-allowed;
  opacity: 0.5;
}

.remove-warning {
  margin: 12px 0 0;
  padding: 8px 10px;
  color: #ffb9c5;
  background: rgba(255, 95, 126, 0.075);
  border-left: 2px solid var(--red);
  font-size: 10px;
  line-height: 1.6;
}

.remove-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.remove-cancel,
.remove-confirm {
  flex: 1;
  height: 37px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.remove-cancel {
  color: #a4b1c4;
  background: transparent;
  border: 1px solid var(--line-bright);
}

.remove-confirm {
  color: #fff;
  background: #c9445f;
  border: 1px solid #c9445f;
}

.remove-confirm:hover {
  background: #e0526f;
}

@keyframes mark-move {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(4px);
  }
}

/* ------------------------------------------------------------------ */
/* Member view                                                         */
/* ------------------------------------------------------------------ */

.member-view {
  padding: 18px 0 4px;
}

.member-session {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.member-handle {
  overflow: hidden;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-session-note {
  flex: 0 0 auto;
  color: var(--muted-dark);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.member-view .leader-dashboard {
  margin-top: 14px;
}

.member-view .secondary-button {
  margin-top: 16px;
}

.secondary-button {
  width: 100%;
  height: 41px;
  margin-top: 17px;
  color: #b6c2d4;
  background: transparent;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.secondary-button:hover {
  color: var(--green);
  background: rgba(56, 255, 156, 0.04);
  border-color: rgba(56, 255, 156, 0.45);
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 24px -30px 0;
  padding: 12px 30px 13px;
  color: #526078;
  border-top: 1px solid #131d2f;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.foot-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.foot-status i {
  width: 4px;
  height: 4px;
  background: var(--green);
  border-radius: 50%;
  opacity: 0.8;
}

.page-foot {
  margin: 17px 0 0;
  color: #3f4b60;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-align: center;
}

.page-foot span {
  margin: 0 4px;
  color: #24344c;
}

.not-found-panel .heading {
  padding-bottom: 4px;
}

.not-found-panel .primary-button {
  margin-top: 24px;
}

/* ------------------------------------------------------------------ */
/* Account ID help                                                     */
/* ------------------------------------------------------------------ */

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.84);
  backdrop-filter: blur(5px);
}

.modal-panel {
  position: relative;
  width: min(340px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100svh - 40px);
  padding: 22px 20px 18px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(11, 16, 27, 0.99), rgba(7, 10, 17, 0.995)),
    var(--panel);
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  box-shadow:
    0 32px 90px -35px #000,
    0 0 60px -42px rgba(76, 141, 255, 0.55);
  animation: modal-in 220ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  color: #6e7d95;
  background: transparent;
  border: 0;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
  place-items: center;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.modal-text {
  margin: 0 18px 16px;
  color: #d5dfed;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  line-height: 1.75;
  text-align: center;
}

.modal-image {
  display: flex;
  justify-content: center;
  padding: 5px;
  background: #05080f;
  border: 1px solid #22324f;
  border-radius: 2px;
}

.modal-image img {
  display: block;
  width: 100%;
  max-width: 273px;
  height: auto;
  border-radius: 1px;
}

.modal-button {
  width: 100%;
  height: 40px;
  margin-top: 15px;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.modal-button:hover {
  background: #6aa2ff;
  box-shadow: 0 0 24px rgba(76, 141, 255, 0.2);
}

/* ------------------------------------------------------------------ */
/* Feedback                                                            */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  color: #c7d2e2;
  background: #0a111d;
  border: 1px solid var(--line-bright);
  border-left: 2px solid var(--green);
  border-radius: 3px;
  box-shadow: 0 18px 40px -20px #000;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-left-color: var(--red);
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 45;
  padding: 11px 14px;
  color: #ffdbe2;
  background: #2a1018;
  border: 1px solid rgba(255, 95, 126, 0.3);
  border-radius: 3px;
  font-size: 11px;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
  .screen {
    padding: 16px 12px;
  }

  .auth-panel {
    padding: 20px 20px 0;
  }

  .heading {
    padding-top: 21px;
  }

  .heading h1 {
    font-size: 24px;
  }

  .network-state {
    font-size: 7px;
    letter-spacing: 0.06em;
  }

  .field input {
    font-size: 16px;
  }

  .panel-foot {
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 20px;
    padding-left: 20px;
    font-size: 7px;
  }

  .modal {
    padding: 12px;
  }

  .modal-panel {
    padding: 20px 14px 16px;
  }

  .modal-image img {
    max-width: 100%;
  }

  .member-meta {
    grid-template-columns: 1fr;
  }

  .member-meta > div + div {
    padding-left: 0;
    border-top: 1px solid #141f32;
    border-left: 0;
  }
}

@media (max-height: 640px) and (min-width: 481px) {
  .screen {
    align-content: start;
    padding-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
