:root {
  --bg: #050505;
  --bg-elevated: #0a0e14;
  --card: #0c1118;
  --accent: #00a2ff;
  --accent-strong: #33b6ff;
  --accent-dim: rgba(0, 162, 255, 0.16);
  --accent-glow: rgba(0, 162, 255, 0.35);
  --text: #f5f7fb;
  --text-muted: #8b93a7;
  --border: rgba(0, 162, 255, 0.22);
  --danger: #ff5a4d;
  --locked: #3a4150;
  --radius: 14px;
  --header-h: 64px;
  --font: "Inter", system-ui, sans-serif;
  --display: "Black Ops One", "Inter", sans-serif;
  --numbers: "Rajdhani", "Inter", sans-serif;
}

[x-cloak] {
  display: none !important;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

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

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

button,
input,
select {
  font: inherit;
}

body.app-body {
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  padding-bottom: 32px;
}

.page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.page-center {
  min-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top) - 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.page-center .profile-card,
.page-center .confirm-card {
  width: min(420px, 100%);
}

.brand-mark {
  display: block;
  width: 82px;
  height: 27px;
  object-fit: contain;
  object-position: center;
}

.brand-one {
  color: var(--accent);
}

.brand-xl {
  font-size: 2.6rem;
  text-align: center;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  background: rgba(5, 5, 5, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  justify-self: center;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
}

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
}

.burger::before {
  top: -6px;
}

.burger::after {
  top: 6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-chip-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  margin-bottom: 4px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(300px, 86vw);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  z-index: 40;
  padding: calc(16px + env(safe-area-inset-top)) 18px 24px;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  pointer-events: none;
}

.drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-nav {
  display: grid;
  gap: 8px;
  margin: 28px 0;
}

.drawer-nav a {
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--accent-dim);
  font-weight: 700;
}

.page-head h1,
.detail-summary h1,
.detail-members h2,
.confirm-card h1,
.profile-card h1 {
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}

.page-head p,
.muted {
  color: var(--text-muted);
}

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

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.stat strong {
  display: block;
  font-family: var(--numbers);
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1;
}

.stat span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.create-btn {
  margin-bottom: 16px;
}

.squad-list {
  display: grid;
  gap: 16px;
}

.squad-card,
.confirm-card,
.profile-card,
.detail-summary,
.detail-members {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 24px rgba(0, 162, 255, 0.08);
  padding: 16px;
}

.squad-card {
  animation: rise 0.35s ease both;
}

.squad-card-link {
  display: block;
}

.squad-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
}

.squad-card-title h2 {
  margin: 0;
  font-size: 1rem;
}

.squad-card-title p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.squad-count {
  margin: 0;
  font-family: var(--numbers);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: right;
  white-space: nowrap;
}

.squad-count span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 500;
}

.squad-count.xl {
  font-size: 1.5rem;
  text-align: center;
  margin: 8px 0 16px;
}

.member-row {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 16px 0;
  margin: 0;
  overflow-x: auto;
}

.member-slot {
  min-width: 64px;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.member-name {
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-leader {
  background: var(--accent);
  color: #041018;
  font-size: 0.62rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 6px;
}

.card-status {
  text-align: center;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  margin: 8px 0 0;
}

.hint-banner {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #041018;
}

.btn-glow {
  box-shadow: 0 0 22px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

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

.btn-locked,
.btn:disabled {
  background: #1a1f28;
  color: #7b8494;
  border-color: #2a3140;
  box-shadow: none;
}

.avatar {
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
}

.avatar-md {
  width: 48px;
  height: 48px;
  font-size: 0.82rem;
}

.avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 1.4rem;
  margin: 0 auto 12px;
}

.avatar-fallback {
  background: hsl(var(--hue) 70% 38%);
  color: white;
  font-weight: 800;
}

.avatar-empty {
  border: 1px dashed var(--accent);
  color: var(--accent);
  background: transparent;
}

.squad-icon {
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #12324d, #071018);
  color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  font-family: var(--display);
  font-weight: 400;
}

.squad-icon-md {
  width: 48px;
  height: 48px;
  font-size: 0.95rem;
}

.squad-icon-xl {
  width: 120px;
  height: 120px;
  font-size: 2.2rem;
  margin: 16px auto;
}

.squad-icon svg {
  width: 62%;
  height: 62%;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 14px;
}

.detail-layout {
  display: grid;
  gap: 16px;
}

.detail-summary {
  text-align: center;
}

.status-label {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.status-open {
  color: var(--accent-strong);
}

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.member-row-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  background: #0a1018;
  border-radius: 12px;
  padding: 10px;
}

.member-meta strong {
  display: block;
}

.role-note {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5d6678;
}

.online-dot.is-online {
  background: #2bff88;
  box-shadow: 0 0 8px rgba(43, 255, 136, 0.7);
}

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

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

.field-icon,
.field-eye {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 0;
}

.field-icon {
  left: 12px;
}

.field-eye {
  right: 12px;
}

.field-input,
.field-file {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #070b10;
  color: var(--text);
  padding: 12px 14px;
}

.field-wrap .field-input {
  padding-left: 42px;
  padding-right: 42px;
}

.form-error {
  color: var(--danger);
  font-size: 0.86rem;
  margin-bottom: 10px;
}

.field .form-error {
  display: block;
  margin: 6px 0 0;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 18px;
  color: var(--text-muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
}

.modal {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 0 32px var(--accent-glow);
}

.toasts {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 16px;
  right: 16px;
  z-index: 60;
  display: grid;
  gap: 8px;
}

.toast {
  background: #0d1b28;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 0 18px var(--accent-glow);
  animation: rise 0.25s ease;
}

.toast-error,
.toast-warning {
  border-color: #ff8a3d;
}

.profile-card {
  text-align: center;
}

.profile-meta {
  display: grid;
  gap: 12px;
  text-align: center;
  margin: 20px 0;
}

.profile-meta dt {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.profile-meta dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.profile-meta a {
  color: var(--accent);
}

.status-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

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

.login-hero {
  position: relative;
  padding: 20px 16px 32px;
  background: var(--bg);
  overflow: hidden;
}

.login-hero-art {
  display: grid;
  place-items: center;
}

.login-logo {
  width: min(420px, 88vw);
  height: auto;
  mix-blend-mode: screen;
}

.login-hero-fade {
  position: absolute;
  inset: auto 0 0;
  height: 56px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.login-card {
  margin-top: 8px;
  padding: 8px 20px 32px;
}

.login-kicker,
.login-title {
  text-align: center;
  margin: 0;
}

.login-kicker {
  color: var(--text-muted);
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  margin-top: 8px;
}

.login-title {
  margin: 18px 0 20px;
  letter-spacing: 0.18em;
}

.login-hero-compact {
  padding: 8px 16px 12px;
}

.login-hero-compact .login-logo {
  width: min(260px, 62vw);
}

.login-foot {
  margin: 18px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-foot a {
  color: var(--accent);
  font-weight: 700;
}

.empty-copy {
  color: var(--text-muted);
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 768px) {
  .page {
    padding-top: 24px;
  }

  .detail-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }

  .modal {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 20%;
    width: 400px;
    transform: translateX(-50%);
  }

  .user-chip-name {
    display: inline;
  }
}

@media (max-width: 379px) {
  .user-chip-name {
    display: none;
  }

  .squad-card-title h2 {
    font-size: 0.9rem;
  }
}

.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-telegram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.login-telegram-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.telegram-box {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.telegram-box h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.telegram-code {
  margin: 8px 0;
  font-family: var(--numbers);
  font-size: 1.6rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 700;
}
