@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  /* --- CORES PRINCIPAIS --- */
  --bg-body: #09090b;
  --bg-sidebar: #0c0c0e;
  --bg-card: #121215;
  --bg-hover: #1a1a1e;
  --bg-input: #18181b;
  --bg-code: #050507;

  --border-base: #27272a;
  --border-highlight: #3f3f46;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  /* --- CORES DE DESTAQUE --- */
  --accent-primary: #7c3aed;
  --accent-secondary: #8b5cf6;
  --accent-light: #c4b5fd;
  --accent-glow: rgba(124, 58, 237, 0.15);
  --accent-gold: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.2);

  /* --- STATUS --- */
  --status-success: #10b981;
  --status-danger: #ef4444;
  --status-warning: #f59e0b;
  --status-info: #3b82f6;

  --status-get: #3b82f6;
  --status-post: #10b981;
  --status-put: #f59e0b;
  --status-delete: #ef4444;

  --rank-theme: #7f7f7f;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body,
button,
input,
select,
textarea {
  font-family: "Inter", sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-base);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-highlight);
}

/* --- TOAST --- */
#push-toast {
  width: 100%;
  height: 0;
  overflow: hidden;
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  transition: height 0.4s var(--ease-out);
  flex-shrink: 0;
  position: relative;
  z-index: 9999;
  border-bottom: 1px solid var(--border-base);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
#push-toast.visible {
  height: 50px;
}
#push-toast.success {
  background: var(--status-success);
  color: white;
}
#push-toast.error {
  background: var(--status-danger);
  color: white;
}
#push-toast.info {
  background: var(--status-info);
  color: white;
}

.toast-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0 24px;
}
.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
#push-toast.visible .toast-content {
  opacity: 1;
  transform: translateY(0);
}
.toast-progress-bar {
  height: 3px;
  width: 0%;
  background: rgba(255, 255, 255, 0.4);
  position: absolute;
  bottom: 0;
  left: 0;
}
.toast-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s;
}
#push-toast.visible .toast-close-btn {
  opacity: 1;
}

/* --- LAYOUT --- */
.app-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100%;
  position: relative;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-base);
  display: flex;
  flex-direction: column;
  transition: width 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  padding: 20px 12px;
  flex-shrink: 0;
  z-index: 100;
}
.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
  padding: 20px 8px;
}

.brand {
  height: 40px;
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  padding-left: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.brand img {
  height: 28px;
  width: auto;
  transition: opacity 0.3s;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-light);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: var(--accent-primary);
  border-radius: 0 4px 4px 0;
}
.nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-text {
  margin-left: 12px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s;
  font-size: 0.9rem;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0;
}
.sidebar.collapsed .nav-text {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
  position: relative;
  overflow: hidden;
  width: 100%;
}
.header-bar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-base);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  z-index: 40;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-base);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
  background: var(--bg-hover);
}
.icon-btn:active {
  transform: scale(0.96);
}

.content-area,
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  scroll-behavior: smooth;
}

h1 {
  font-size: 1.8rem;
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 600px;
  line-height: 1.6;
}

/* --- DROPDOWNS --- */
.dropdown-wrapper {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  pointer-events: none;
  transition: all 0.2s var(--ease-out);
  z-index: 100;
  transform-origin: top right;
}
.dropdown-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.user-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-base);
  margin-bottom: 4px;
}
.user-action,
.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.user-action {
  justify-content: flex-start;
  gap: 10px;
}
.user-action:hover,
.lang-item:hover,
.lang-item.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.user-action.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--status-danger);
}
.lang-check {
  opacity: 0;
  color: var(--accent-primary);
}
.lang-item.active .lang-check {
  opacity: 1;
}
.avatar-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 12px;
}
.avatar-btn img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--border-base);
  transition: all 0.2s;
}
.avatar-btn:hover img {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* --- DASHBOARD STATS --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.card-premium {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-smooth), border-color 0.3s,
    box-shadow 0.3s;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}
.card-premium:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Rank Card */
.card-rank {
  background: linear-gradient(145deg, var(--bg-card) 0%, #141419 100%);
}
.card-rank.themed {
  border-color: rgba(255, 255, 255, 0.05);
}
.card-rank.themed:hover {
  border-color: var(--rank-theme);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
    inset 0 0 20px color-mix(in srgb, var(--rank-theme) 10%, transparent);
}
.rank-watermark {
  position: absolute;
  right: -50px;
  bottom: -40px;
  height: 160%;
  width: auto;
  opacity: 0.08;
  transform: rotate(-10deg);
  pointer-events: none;
  filter: grayscale(0.5);
  transition: transform 0.4s var(--ease-smooth);
}
.card-premium:hover .rank-watermark {
  transform: rotate(0deg) scale(1.05);
  opacity: 0.15;
  filter: grayscale(0);
}
.cp-content {
  padding: 24px;
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.cp-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}
.card-rank.themed .cp-icon {
  background: color-mix(in srgb, var(--rank-theme) 10%, transparent);
  color: var(--rank-theme);
  border-color: color-mix(in srgb, var(--rank-theme) 20%, transparent);
}
.cp-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rank-details {
  display: flex;
  align-items: center;
  gap: 20px;
}
.rank-img-main {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.5));
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.rank-text-box {
  display: flex;
  flex-direction: column;
}
.rank-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.rank-rr {
  font-size: 0.9rem;
  color: var(--rank-theme);
  font-weight: 700;
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Mission Summary Card */
.card-missions:hover {
  border-color: var(--status-success);
}
.mission-watermark {
  position: absolute;
  right: -20px;
  bottom: -20px;
  font-size: 140px;
  color: var(--status-success);
  opacity: 0.03;
  transform: rotate(15deg);
  pointer-events: none;
  transition: transform 0.4s var(--ease-smooth);
}
.card-premium:hover .mission-watermark {
  transform: rotate(0deg) scale(1.05);
  opacity: 0.1;
}
.cp-icon.mission {
  background: rgba(16, 185, 129, 0.1);
  color: var(--status-success);
  border-color: rgba(16, 185, 129, 0.2);
}
.mission-flex {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 10px;
}
.circle-wrap {
  width: 70px;
  height: 70px;
  position: relative;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
}
.circle-svg {
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
}
.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 6;
}
.circle-val {
  fill: none;
  stroke: var(--status-success);
  stroke-width: 6;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1s ease;
  stroke-linecap: round;
}
.circle-text {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
}
.mission-text-box .val-big {
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
}
.mission-text-box .val-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Match Card */
.card-match {
  padding: 0;
  background-color: var(--bg-card);
}
.match-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  transition: transform 0.5s ease;
  filter: saturate(0.5) brightness(0.6);
}
.card-premium:hover .match-bg {
  transform: scale(1.05);
  opacity: 0.4;
}
.match-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #09090b 0%,
    rgba(9, 9, 11, 0.95) 45%,
    rgba(9, 9, 11, 0.2) 100%
  );
  z-index: 1;
}
.match-content {
  position: relative;
  z-index: 3;
  height: 100%;
  width: 100%;
  padding: 24px;
  display: flex;
  align-items: center;
}
.match-info-wrapper {
  width: 65%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.match-result {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.victory {
  color: var(--status-success);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}
.defeat {
  color: var(--status-danger);
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}
.match-score {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.match-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.match-stat-item {
  display: flex;
  flex-direction: column;
}
.ms-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 2px;
  letter-spacing: 0.05em;
}
.ms-val {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  font-family: "JetBrains Mono", monospace;
}
.agent-contained {
  position: absolute;
  right: -20px;
  bottom: -20px;
  height: 135%;
  width: auto;
  z-index: 2;
  object-fit: contain;
  opacity: 0.9;
  mask-image: linear-gradient(to top left, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top left, black 60%, transparent 100%);
  pointer-events: none;
  transition: transform 0.4s var(--ease-smooth);
}
.card-premium:hover .agent-contained {
  transform: scale(1.05) translateX(-5px);
}

/* --- INVENTORY GRID (MISSIONS) --- */
#missions-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.mission-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  transition: all 0.2s;
  min-height: 220px;
  opacity: 0; /* Init for animation */
}
.mission-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: var(--bg-hover);
}

/* TARGET MISSION STYLE */
.mission-card.target {
  border-color: var(--accent-gold);
  box-shadow: 0 0 20px var(--accent-gold-glow);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), var(--bg-card));
}
.mission-card.target::after {
  content: "ALVO";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.mc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.mc-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-base);
  color: var(--text-muted);
}
.mission-card.target .mc-icon-box {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.1);
}

.btn-target {
  background: transparent;
  border: 1px solid var(--border-base);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-target:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}
.mission-card.target .btn-target {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}
.btn-target:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--border-base);
  color: var(--text-muted);
}
.btn-target:disabled:hover {
  border-color: var(--border-base);
  color: var(--text-muted);
}

.mc-body {
  flex: 1;
}
.mc-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}
.mc-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.mc-footer {
  margin-top: auto;
}
.mc-reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-primary);
  border: 1px solid var(--border-base);
  margin-bottom: 12px;
}
.mission-card.target .mc-reward-badge {
  background: rgba(251, 191, 36, 0.1);
  color: var(--accent-gold);
  border-color: rgba(251, 191, 36, 0.3);
}

.mc-progress-wrap {
  width: 100%;
}
.mc-track {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.mc-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
}
.mission-card.target .mc-fill {
  background: var(--accent-gold);
}
.mc-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- PAGINATION (New Styles) --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding-bottom: 20px;
  align-items: center;
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-number {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.page-number:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.page-number.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* --- MODAL --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 400px;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-elastic);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.modal-backdrop.open .modal-box {
  transform: scale(1);
}
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, filter 0.2s;
}
.btn:active {
  transform: scale(0.96);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-base);
}
.btn-ghost:hover {
  border-color: var(--accent-secondary);
  color: var(--text-primary);
}
.btn-danger {
  background: var(--status-danger);
  color: white;
  margin-left: 12px;
}
.btn-danger:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-primary:hover {
  background: var(--accent-secondary);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

/* --- DOCS --- */
.docs-intro {
  margin-bottom: 40px;
  max-width: 640px;
}
.docs-intro code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-primary);
  font-size: 0.85em;
  border: 1px solid var(--border-base);
}
.docs-controls {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.search-wrapper {
  position: relative;
  width: 100%;
}
.search-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--border-highlight);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.tag-scroll-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  mask-image: linear-gradient(to right, black 95%, transparent 100%);
}
.tag-btn {
  background: transparent;
  border: 1px solid var(--border-base);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tag-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}
.tag-btn.active {
  background: var(--text-primary);
  color: var(--bg-body);
  border-color: var(--text-primary);
}
.tag-count {
  font-size: 0.7rem;
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}
.tag-btn.active .tag-count {
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
}
#dynamic-docs {
  display: flex;
  flex-direction: column;
}
.api-card {
  background: transparent;
  border-bottom: 1px solid var(--border-base);
  overflow: hidden;
  transition: background 0.2s;
}
.api-card:first-child {
  border-top: 1px solid var(--border-base);
}
.api-card:hover {
  background: var(--bg-card);
}
.api-card.open {
  background: var(--bg-card);
  margin: 16px 0;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.api-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 16px;
}
.route-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.method-badge {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 0.75rem;
  min-width: 50px;
  text-align: left;
  text-transform: uppercase;
}
.m-get {
  color: var(--status-get);
}
.m-post {
  color: var(--status-post);
}
.m-put {
  color: var(--status-put);
}
.m-delete {
  color: var(--status-delete);
}
.route-path {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.route-path span {
  color: var(--text-muted);
}
.route-desc-preview {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: none;
}
.api-toggle-icon {
  transition: transform 0.3s;
  color: var(--text-muted);
}
.api-card.open .api-toggle-icon {
  transform: rotate(180deg);
  color: var(--text-primary);
}
.api-body {
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
}
.api-card.open .api-body {
  height: auto;
  opacity: 1;
}
.api-body-inner {
  padding: 0 24px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.detail-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px 0;
}
.detail-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.params-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-base);
}
.params-table td {
  padding: 12px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-base);
}
.params-table tr:last-child td {
  border-bottom: none;
}
.param-key {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-primary);
}
.param-req {
  color: var(--status-delete);
  margin-left: 4px;
}
.param-loc {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-hover);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.code-block-wrapper {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
}
.code-block {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.code-block .key {
  color: var(--text-primary);
}
.code-block .string {
  color: var(--status-post);
}
.code-block .number {
  color: var(--status-put);
}
.code-block .boolean {
  color: var(--status-delete);
}
.code-block .null {
  color: var(--text-muted);
}
.copy-btn-abs {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-base);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn-abs:hover {
  background: var(--border-base);
  color: var(--text-primary);
}
.copy-btn-abs.success {
  color: var(--status-post);
  border-color: var(--status-post);
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
.skeleton {
  background: var(--bg-hover);
  border-radius: 8px;
  animation: pulse 2s infinite;
}

@media (min-width: 768px) {
  .route-desc-preview {
    display: block;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--border-highlight);
    background: var(--bg-sidebar);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 90;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .main {
    overflow-y: auto;
  }
  .header-bar {
    padding: 0 20px;
  }
  .content-area,
  .content-scroll {
    padding: 20px 20px 40px 20px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #missions-container {
    grid-template-columns: 1fr;
  }
  .agent-contained {
    height: 100%;
    right: -50px;
    opacity: 0.4;
  }
  .match-info-wrapper {
    width: 100%;
    z-index: 5;
  }
  .match-details-grid {
    grid-template-columns: 1fr 1fr;
  }
  .api-header {
    padding: 16px;
  }
  .api-body-inner {
    padding: 0 16px 24px 16px;
  }
}

/* ==================
   LOGIN PAGE STYLES
   ================== */
body.login-body {
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  position: relative;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  animation: float 10s infinite ease-in-out;
  opacity: 0.3;
}
.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    var(--accent-primary) 0%,
    transparent 70%
  );
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}
.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    var(--accent-secondary) 0%,
    transparent 70%
  );
  bottom: -20%;
  right: -10%;
  animation-delay: -5s;
}
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(30px, 50px);
  }
}

.login-card-container {
  width: 100%;
  max-width: 420px;
  padding: 3rem;
  background: var(--bg-card); /* Fallback */
  background: rgba(18, 18, 21, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.05em;
}
.login-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.discord-svg {
  fill: currentColor;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
