:root {
  --bg: #070c16;
  --bg-soft: #0e1a30;
  --surface: rgba(10, 22, 41, 0.72);
  --surface-strong: rgba(9, 20, 36, 0.9);
  --line: rgba(163, 226, 255, 0.18);
  --text: #e4f4ff;
  --muted: #9ab8d6;
  --accent: #74dbff;
  --accent-2: #00b7ff;
  --danger: #ff6d88;
  --shadow: 0 28px 80px rgba(1, 10, 22, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Satoshi", "Space Grotesk", "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(0, 183, 255, 0.36), transparent 34%),
    radial-gradient(circle at 82% 82%, rgba(63, 150, 255, 0.24), transparent 36%),
    linear-gradient(150deg, #050b14 0%, #0a1530 48%, #071326 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 100%);
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.glow {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(76px);
  opacity: 0.42;
}

.glow-1 {
  background: linear-gradient(130deg, #00d2ff, #2d6cff);
  top: -6rem;
  left: -7rem;
}

.glow-2 {
  background: linear-gradient(130deg, #3d89ff, #4b66ff);
  bottom: -7rem;
  right: -9rem;
}

.card {
  width: 100%;
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(14, 28, 51, 0.92), rgba(8, 18, 34, 0.72));
  backdrop-filter: blur(16px);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.login-card {
  max-width: 480px;
  padding: 2.05rem;
  animation: rise 0.6s ease;
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(16, 31, 56, 0.96), rgba(8, 18, 34, 0.82)),
    radial-gradient(circle at 75% -20%, rgba(76, 182, 255, 0.2), transparent 48%);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 20% 0%, rgba(49, 182, 255, 0.13), transparent 42%);
}

.login-hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.5rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(159, 208, 236, 0.38);
  box-shadow: 0 8px 24px rgba(0, 140, 255, 0.25);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 0.25rem;
  font-size: clamp(1.9rem, 3.6vw, 2.35rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  color: var(--accent-2);
  font-weight: 700;
}

.sub {
  color: var(--muted);
  line-height: 1.35;
}

.login-badge {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(130, 199, 242, 0.35);
  background: rgba(83, 171, 255, 0.1);
  color: #9dd8ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.24rem 0.58rem;
}

.stack {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.9rem;
  position: relative;
  z-index: 1;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(131, 200, 242, 0.15);
  background: rgba(6, 14, 26, 0.42);
}

.login-row {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 0.75rem;
}

.remember-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.remember-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2daeff;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input {
  width: 100%;
  border: 1px solid rgba(118, 188, 232, 0.22);
  border-radius: 13px;
  background: rgba(4, 11, 23, 0.72);
  color: var(--text);
  padding: 0.75rem 0.9rem;
  font: inherit;
}

input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(0, 183, 255, 0.2);
}

.btn {
  border: 1px solid rgba(159, 208, 236, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 13px;
  padding: 0.62rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(159, 208, 236, 0.46);
}

.btn-primary {
  background: linear-gradient(135deg, #0ec6ff, #44a7ff);
  color: #05132a;
  border-color: transparent;
  width: 100%;
  padding-block: 0.72rem;
}

.btn-danger {
  background: rgba(255, 109, 136, 0.2);
  color: #ffd4dc;
  border-color: rgba(255, 109, 136, 0.4);
}

.error-text {
  min-height: 1.2em;
  color: #ff9cab;
  margin-top: 0.75rem;
  position: relative;
  z-index: 1;
}

.login-note {
  margin-top: -0.1rem;
  color: #85a8c7;
  font-size: 0.8rem;
}

.login-footnotes {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.note-chip {
  font-size: 0.76rem;
  color: #9fc3df;
  border: 1px solid rgba(129, 193, 234, 0.2);
  border-radius: 999px;
  padding: 0.26rem 0.52rem;
  background: rgba(11, 29, 51, 0.55);
}

.hidden {
  display: none !important;
}

.dashboard {
  display: grid;
  gap: 1rem;
  width: min(1520px, calc(100vw - 2rem));
  animation: rise 0.55s ease;
  position: relative;
}

.main-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
}

.top-menu {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.2rem 0;
}

.menu-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.4rem;
  color: var(--muted);
  font-weight: 700;
}

.menu-logo {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(159, 208, 236, 0.34);
}

.menu-item {
  text-align: center;
  border: 1px solid rgba(159, 208, 236, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.menu-item.active {
  border-color: rgba(0, 183, 255, 0.5);
  background: rgba(0, 183, 255, 0.16);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(150deg, rgba(14, 29, 50, 0.96), rgba(11, 22, 39, 0.86));
}

.toolbar h2 {
  margin-top: 0.35rem;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.session-subtitle {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.6rem;
}

.layout-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.view-stack {
  display: grid;
  gap: 1rem;
}

.view-page {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1rem;
}

.panel-players .table-wrap {
  max-height: 470px;
}

.ops-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.65fr) minmax(350px, 1fr);
  align-items: stretch;
}

.panel-map {
  display: grid;
  gap: 0.8rem;
  min-height: 620px;
}

.map-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.map-open-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  width: fit-content;
}

.map-open-link:hover {
  text-decoration: underline;
}

.map-frame-wrap {
  border: 1px solid rgba(124, 194, 238, 0.2);
  border-radius: 14px;
  background: rgba(2, 8, 18, 0.72);
  min-height: 520px;
  overflow: hidden;
  position: relative;
}

.map-frame {
  width: 100%;
  height: 520px;
  border: 0;
  display: block;
}

.panel-console,
.panel-chat {
  display: flex;
  flex-direction: column;
  height: 560px;
  min-height: 560px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.6rem;
}

.count-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(117, 201, 246, 0.35);
  color: var(--accent);
  background: rgba(84, 172, 255, 0.09);
  font-weight: 700;
}

.table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(155, 206, 238, 0.11);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

th,
td {
  padding: 0.48rem;
  border-bottom: 1px solid rgba(155, 206, 238, 0.11);
  text-align: left;
  font-size: 0.89rem;
}

th {
  color: var(--muted);
  letter-spacing: 0.01em;
}

.chat-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  gap: 0.55rem;
}

.chat-item {
  border: 1px solid rgba(126, 190, 226, 0.18);
  background: rgba(4, 11, 23, 0.68);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  line-height: 1.35;
}

.chat-name {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
}

.chat-name.team {
  color: #5ee28f;
}

.chat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.chat-time {
  color: #7fa3c4;
  font-size: 0.76rem;
}

.chat-text {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.command-form {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr auto;
}

.command-output {
  margin-top: 0.8rem;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(124, 194, 238, 0.2);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(2, 8, 18, 0.78);
  color: #bee4ff;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.85rem;
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed rgba(146, 203, 238, 0.24);
  border-radius: 10px;
  padding: 0.85rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 940px) {
  .login-row {
    grid-template-columns: 1fr;
  }

  .top-menu {
    flex-wrap: wrap;
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }

  .panel-console,
  .panel-chat {
    height: 470px;
    min-height: 470px;
  }

  .panel-map {
    min-height: 520px;
  }

  .map-frame-wrap,
  .map-frame {
    min-height: 420px;
    height: 420px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .btn {
    flex: 1;
  }

  .command-form {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 980px;
  }
}
