@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --theme-main: #5b2d8e;
  --theme-light: #7c3aed;
  --theme-soft: #a78bfa;
  --theme-glow: rgba(167, 139, 250, 0.2);
  --theme-glow-strong: rgba(139, 92, 246, 0.4);
  --theme-border: rgba(91, 45, 142, 0.15);
  --theme-border-soft: rgba(139, 92, 246, 0.24);
  --theme-accent: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  --theme-accent-soft: linear-gradient(135deg, rgba(167, 139, 250, 0.55), rgba(139, 92, 246, 0.25));
  --theme-badge: rgba(139, 92, 246, 0.08);
  --theme-badge-shadow: rgba(139, 92, 246, 0.15);
  --theme-label: rgba(167, 139, 250, 0.74);
  --theme-swatch: #8b5cf6;
  --bg-primary: #06070b;
  --panel-bg: rgba(10, 10, 14, 0.82);
  --panel-bg-strong: rgba(8, 9, 12, 0.92);
  --panel-border: rgba(139, 92, 246, 0.15);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-soft-border: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-divider: rgba(255, 255, 255, 0.06);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.58);
  --text-muted: rgba(255, 255, 255, 0.28);
  --text-dim: rgba(255, 255, 255, 0.42);
  --danger-soft: rgba(248, 113, 113, 0.14);
  --danger-border: rgba(248, 113, 113, 0.28);
  --danger-text: #fca5a5;
  --success-soft: rgba(74, 222, 128, 0.14);
  --success-border: rgba(74, 222, 128, 0.28);
  --shadow-panel:
    0 0 80px 0 rgba(139, 92, 246, 0.15),
    0 30px 60px 0 rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

[data-theme="blue"] {
  --theme-main: #1e40af;
  --theme-light: #3b82f6;
  --theme-soft: #60a5fa;
  --theme-glow: rgba(96, 165, 250, 0.2);
  --theme-glow-strong: rgba(59, 130, 246, 0.4);
  --theme-border: rgba(30, 64, 175, 0.15);
  --theme-border-soft: rgba(59, 130, 246, 0.24);
  --theme-accent: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  --theme-accent-soft: linear-gradient(135deg, rgba(96, 165, 250, 0.55), rgba(59, 130, 246, 0.25));
  --theme-badge: rgba(59, 130, 246, 0.08);
  --theme-badge-shadow: rgba(59, 130, 246, 0.15);
  --theme-label: rgba(96, 165, 250, 0.72);
  --theme-swatch: #3b82f6;
}

[data-theme="pink"] {
  --theme-main: #be185d;
  --theme-light: #ec4899;
  --theme-soft: #f472b6;
  --theme-glow: rgba(244, 114, 182, 0.2);
  --theme-glow-strong: rgba(236, 72, 153, 0.38);
  --theme-border: rgba(190, 24, 93, 0.15);
  --theme-border-soft: rgba(244, 114, 182, 0.24);
  --theme-accent: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  --theme-accent-soft: linear-gradient(135deg, rgba(244, 114, 182, 0.55), rgba(236, 72, 153, 0.24));
  --theme-badge: rgba(244, 114, 182, 0.08);
  --theme-badge-shadow: rgba(244, 114, 182, 0.15);
  --theme-label: rgba(244, 114, 182, 0.72);
  --theme-swatch: #ec4899;
}

[data-theme="cyan"] {
  --theme-main: #0e7490;
  --theme-light: #06b6d4;
  --theme-soft: #22d3ee;
  --theme-glow: rgba(34, 211, 238, 0.2);
  --theme-glow-strong: rgba(6, 182, 212, 0.38);
  --theme-border: rgba(14, 116, 144, 0.15);
  --theme-border-soft: rgba(34, 211, 238, 0.24);
  --theme-accent: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
  --theme-accent-soft: linear-gradient(135deg, rgba(34, 211, 238, 0.55), rgba(6, 182, 212, 0.24));
  --theme-badge: rgba(34, 211, 238, 0.08);
  --theme-badge-shadow: rgba(34, 211, 238, 0.15);
  --theme-label: rgba(34, 211, 238, 0.72);
  --theme-swatch: #06b6d4;
}

[data-theme="orange"] {
  --theme-main: #c2410c;
  --theme-light: #f97316;
  --theme-soft: #fb923c;
  --theme-glow: rgba(251, 146, 60, 0.22);
  --theme-glow-strong: rgba(249, 115, 22, 0.38);
  --theme-border: rgba(194, 65, 12, 0.15);
  --theme-border-soft: rgba(251, 146, 60, 0.24);
  --theme-accent: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  --theme-accent-soft: linear-gradient(135deg, rgba(251, 146, 60, 0.55), rgba(249, 115, 22, 0.24));
  --theme-badge: rgba(251, 146, 60, 0.08);
  --theme-badge-shadow: rgba(251, 146, 60, 0.15);
  --theme-label: rgba(251, 146, 60, 0.76);
  --theme-swatch: #f97316;
}

[data-theme="rainbow"] {
  --theme-main: #8b5cf6;
  --theme-light: #ec4899;
  --theme-soft: #c084fc;
  --theme-glow: rgba(192, 132, 252, 0.22);
  --theme-glow-strong: rgba(192, 132, 252, 0.38);
  --theme-border: rgba(168, 85, 247, 0.16);
  --theme-border-soft: rgba(192, 132, 252, 0.28);
  --theme-accent: linear-gradient(135deg, #fb923c 0%, #ec4899 35%, #a78bfa 68%, #22d3ee 100%);
  --theme-accent-soft: linear-gradient(135deg, rgba(251, 146, 60, 0.45), rgba(236, 72, 153, 0.25), rgba(167, 139, 250, 0.22), rgba(34, 211, 238, 0.22));
  --theme-badge: rgba(192, 132, 252, 0.1);
  --theme-badge-shadow: rgba(192, 132, 252, 0.16);
  --theme-label: rgba(216, 180, 254, 0.84);
  --theme-swatch: #c084fc;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.08), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.06), transparent 28%),
    linear-gradient(180deg, #05060a 0%, #090b12 48%, #05060a 100%);
  color: var(--text-primary);
  font-family: 'Manrope', 'DM Sans', system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

body::after {
  content: '';
  position: fixed;
  top: -120px;
  left: -120px;
  width: 620px;
  height: 620px;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle, var(--theme-glow-strong) 0%, rgba(0, 0, 0, 0) 68%);
  filter: blur(18px);
  opacity: 0.24;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

#star-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 60px;
  padding: 7px 14px;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0.94) 0%, rgba(8, 9, 12, 0.78) 100%);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-primary);
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--theme-accent);
  box-shadow: 0 0 14px var(--theme-glow-strong);
  animation: pulse-dot 2.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px var(--theme-glow-strong);
  }

  50% {
    transform: scale(1.14);
    box-shadow: 0 0 18px var(--theme-glow-strong);
  }
}

#profile-info {
  display: flex;
  align-items: center;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition:
    max-width 0.45s ease,
    opacity 0.45s ease,
    transform 0.45s ease,
    visibility 0.45s ease;
}

#profile-info.visible {
  max-width: 370px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.tbar-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 10px 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
}

.tbar-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 62px;
  flex: 0 0 62px;
}

.tbar-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tbar-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  aspect-ratio: 1 / 1;
  padding: 2px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--theme-soft);
  box-shadow: 0 0 0 2px var(--theme-glow);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tbar-avatar::before {
  content: none;
}

.tbar-avatar-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
}

.tbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: inherit;
  background: transparent;
}

.tbar-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tbar-username {
  display: block;
  max-width: 62px;
  color: var(--text-primary);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.tbar-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  flex-shrink: 0;
}

.tbar-row2,
.tbar-row3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tbar-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tbar-stat-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.tbar-stat-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.tbar-fame-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.tbar-fame-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tbar-fame-level {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  text-shadow: 0 0 5px rgba(0, 0, 0, 1);
}

.tbar-xp-wrap {
  min-width: 92px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tbar-xp-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tbar-xp-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--theme-accent);
  box-shadow: 0 0 12px var(--theme-glow-strong);
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.tbar-xp-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tbar-xp-cur,
.tbar-xp-max {
  font-size: 9px;
  font-weight: 600;
}

.tbar-xp-cur {
  color: var(--theme-soft);
}

.tbar-xp-max {
  color: var(--text-muted);
}

.btn-logout {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

.btn-logout:hover {
  border-color: var(--theme-border-soft);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

#main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 48px;
}

body.app-has-panel #main {
  align-items: flex-start;
}

#login-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

#login-panel.hiding {
  opacity: 0;
  transform: scale(0.96) translateY(-12px);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: min(100%, 396px);
  padding: 30px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  overflow: hidden;
  background: var(--panel-bg);
  backdrop-filter: blur(34px) saturate(1.4);
  box-shadow: var(--shadow-panel);
}

.login-card::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle, var(--theme-glow-strong) 0%, rgba(0, 0, 0, 0) 72%);
  opacity: 0.6;
}

.login-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 29px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.card-top,
.card-heading,
.login-form,
.appearance-row,
.theme-swatches {
  position: relative;
  z-index: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--theme-border-soft);
  border-radius: 12px;
  background: var(--theme-badge);
  box-shadow: 0 0 20px 0 var(--theme-badge-shadow);
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-soft);
}

.status-count {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--surface-soft-border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
}

.card-heading {
  margin: 34px 0 28px;
  text-align: center;
}

.card-title {
  margin: 0 0 8px;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.card-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.login-form {
  display: flex;
  flex-direction: column;
}

.field {
  position: relative;
  width: 100%;
  min-height: 60px;
  border-bottom: 1px solid var(--line-soft);
}

.field + .field {
  margin-top: 10px;
}

.field::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--theme-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.field:focus-within::after {
  transform: scaleX(1);
}

.field-label {
  position: absolute;
  top: 10px;
  left: 0;
  color: var(--theme-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.field-control,
.field-select {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
}

.field-control {
  min-height: 58px;
  padding: 20px 0 8px;
}

.field-control::placeholder {
  color: rgba(255, 255, 255, 0.18);
}

.field-select {
  min-height: 58px;
  padding: 24px 28px 8px 0;
  appearance: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.32);
}

.field-select.has-value {
  color: var(--text-primary);
}

.field-select option {
  background: #0a0b10;
  color: #fff;
}

.select-arrow {
  position: absolute;
  right: 0;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.error-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 12px;
  line-height: 1.45;
}

.error-msg.show {
  display: block;
}

.submit-wrap {
  position: relative;
  margin-top: 30px;
}

.submit-glow {
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  opacity: 0;
  background: var(--theme-accent-soft);
  filter: blur(8px);
  transition: opacity 0.22s ease;
}

.submit-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 15px;
  background: var(--theme-accent);
  color: var(--text-primary);
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  opacity: 0.35;
  cursor: not-allowed;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.submit-button:not(:disabled) {
  opacity: 1;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.submit-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.submit-button:not(:disabled):hover + .submit-glow,
.submit-wrap:hover .submit-glow {
  opacity: 1;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

.submit-button .spinner {
  display: none;
  width: 18px;
  height: 18px;
}

.submit-button.loading {
  cursor: progress;
}

.submit-button.loading .spinner {
  display: block;
}

.submit-button.loading .btn-text {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.appearance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 18px;
}

.appearance-line {
  flex: 1;
  height: 1px;
  background: var(--line-divider);
}

.appearance-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.theme-swatches {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.theme-dot {
  position: relative;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-dot::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: var(--swatch-color, var(--theme-swatch));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.theme-dot.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--theme-swatch);
  opacity: 0.5;
}

.theme-dot.active::before {
  box-shadow:
    0 0 12px var(--theme-glow-strong),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.theme-dot-rainbow::before {
  background: linear-gradient(135deg, #fb923c 0%, #ec4899 32%, #a78bfa 64%, #22d3ee 100%);
}

#main-panel {
  width: min(1120px, 100%);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

#main-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-frame {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  background: rgba(10, 10, 14, 0.74);
  backdrop-filter: blur(28px);
  box-shadow: var(--shadow-panel);
}

.dashboard-frame::before {
  content: '';
  position: absolute;
  top: -160px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--theme-glow-strong) 0%, rgba(0, 0, 0, 0) 72%);
  opacity: 0.45;
  pointer-events: none;
}

.dashboard-hero,
.mp-tabs,
.mp-content {
  position: relative;
  z-index: 1;
}

.dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-copy {
  max-width: 620px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--theme-border-soft);
  border-radius: 999px;
  background: var(--theme-badge);
  color: var(--theme-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 10px;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.hero-text {
  margin: 0;
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.hero-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 320px);
}

.hero-stat {
  min-height: 108px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.hero-stat-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stat strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mp-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-divider);
}

.mp-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease;
}

.mp-tab.active,
.mp-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.mp-action-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  min-height: 200px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(10, 10, 14, 0.7);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.mp-action-btn::after {
  content: '';
  position: absolute;
  inset: auto 18px 18px 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--theme-border-soft), transparent);
  opacity: 0.5;
}

.mp-action-btn:hover {
  transform: translateY(-3px);
  border-color: var(--theme-border-soft);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.mp-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--theme-badge);
  color: var(--theme-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mp-action-label {
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.mp-action-desc {
  max-width: 300px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.fm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 3, 6, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.fm-backdrop.visible {
  opacity: 1;
}

.fm-window {
  width: min(100%, 560px);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: rgba(9, 10, 14, 0.92);
  backdrop-filter: blur(26px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.28s ease;
}

.fm-backdrop.visible .fm-window {
  transform: scale(1) translateY(0);
}

.fm-header,
.fm-tabs,
.fm-sub-filters,
.fm-pagination {
  flex-shrink: 0;
}

.fm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-divider);
}

.fm-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Manrope', 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.fm-header-actions {
  display: flex;
  gap: 8px;
}

.fm-icon-btn,
.fm-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease;
}

.fm-icon-btn:hover,
.fm-page-btn:hover:not(:disabled) {
  border-color: var(--theme-border-soft);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.fm-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--line-divider);
  overflow-x: auto;
  scrollbar-width: none;
}

.fm-tabs::-webkit-scrollbar {
  display: none;
}

.fm-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.fm-tab.active,
.fm-tab:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.fm-badge {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.fm-tab.active .fm-badge {
  background: var(--theme-badge);
  color: var(--theme-soft);
}

.fm-sub-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 10px;
}

.fm-filter-btn,
.fm-delete-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease;
}

.fm-filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.fm-filter-btn:hover,
.fm-filter-btn.active {
  border-color: var(--theme-border-soft);
  color: var(--theme-soft);
  background: var(--theme-badge);
}

.fm-delete-all-btn {
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger-text);
}

.fm-delete-all-btn:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.2);
}

.fm-delete-all-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

#friends-loading,
#friends-error {
  margin: 0 18px 14px;
  border-radius: 16px;
}

#friends-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

#friends-error {
  display: none;
  padding: 14px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 12px;
  text-align: center;
}

#friends-list-wrap {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.fm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.fm-list::-webkit-scrollbar {
  width: 6px;
}

.fm-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.fm-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

.fm-card:hover {
  border-color: var(--theme-border-soft);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.fm-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--theme-border-soft);
  box-shadow: 0 0 0 3px var(--theme-glow);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.fm-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-weight: 700;
}

.fm-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fm-username {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-level {
  color: var(--text-secondary);
  font-size: 12px;
}

.fm-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm-card-actions:empty {
  display: none;
}

.fm-action-sq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.fm-del-btn,
.fm-reject-btn {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.2);
  background: rgba(248, 113, 113, 0.08);
}

.fm-del-btn:hover,
.fm-reject-btn:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.38);
}

.fm-accept-btn {
  color: #4ade80;
  border-color: var(--success-border);
  background: var(--success-soft);
}

.fm-accept-btn:hover {
  background: rgba(74, 222, 128, 0.22);
  border-color: rgba(74, 222, 128, 0.4);
}

.fm-empty {
  padding: 44px 0;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.fm-pagination {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line-divider);
}

.fm-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fm-page-info {
  min-width: 64px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

#audio-player {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(8, 9, 12, 0.8);
  color: var(--text-secondary);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

#audio-player:hover {
  transform: translateY(-2px);
  border-color: var(--theme-border-soft);
  color: var(--text-primary);
}

#audio-player.playing {
  color: var(--theme-soft);
  border-color: var(--theme-border-soft);
  box-shadow:
    0 0 0 6px var(--theme-glow),
    0 16px 30px rgba(0, 0, 0, 0.35);
}

#audio-player svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

[data-theme="rainbow"] .site-brand,
[data-theme="rainbow"] .hero-title,
[data-theme="rainbow"] .tbar-stat-val,
[data-theme="rainbow"] .tbar-xp-cur {
  background: linear-gradient(90deg, #fb923c, #ec4899, #a78bfa, #22d3ee, #4ade80, #fb923c);
  background-size: 260% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-slide 6s linear infinite;
}

[data-theme="rainbow"] .tbar-xp-fill,
[data-theme="rainbow"] .brand-dot {
  background: linear-gradient(90deg, #fb923c, #ec4899, #a78bfa, #22d3ee, #4ade80, #fb923c);
  background-size: 260% auto;
  animation: rainbow-slide 6s linear infinite;
}

@keyframes rainbow-slide {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 260% center;
  }
}

@media (max-width: 960px) {
  #top-bar {
    min-height: 56px;
    padding: 6px 12px;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .hero-side {
    width: 100%;
  }
}

@media (max-width: 760px) {
  #top-bar {
    gap: 8px;
  }

  .site-brand {
    font-size: 14px;
    gap: 8px;
  }

  #profile-info.visible {
    max-width: 320px;
  }

  .tbar-card {
    gap: 8px;
    padding: 6px 8px 6px 6px;
  }

  .tbar-avatar-block {
    width: 56px;
    flex-basis: 56px;
  }

  .tbar-avatar {
    width: 40px;
    height: 40px;
  }

  .tbar-username {
    max-width: 56px;
    font-size: 7px;
  }

  .tbar-row2,
  .tbar-row3 {
    gap: 8px;
  }

  .tbar-stat-val {
    font-size: 12px;
  }

  .login-card,
  .dashboard-frame {
    padding: 24px;
    border-radius: 26px;
  }

  .card-title {
    font-size: 24px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-side {
    grid-template-columns: 1fr;
  }

  .fm-window {
    width: 100%;
    max-height: 82vh;
  }
}

@media (max-width: 560px) {
  #top-bar {
    min-height: 54px;
    padding: 6px 8px;
    flex-wrap: nowrap;
    align-items: center;
    row-gap: 0;
  }

  #profile-info {
    gap: 8px;
    min-width: 0;
    flex: 0 1 auto;
  }

  #profile-info.visible {
    max-width: calc(100% - 96px);
    flex-basis: auto;
  }

  .tbar-card {
    width: auto;
    max-width: 100%;
    gap: 7px;
    padding: 6px 7px 6px 5px;
  }

  .tbar-avatar-block {
    width: 48px;
    flex-basis: 48px;
  }

  .tbar-avatar {
    width: 34px;
    height: 34px;
  }

  .tbar-username {
    max-width: 48px;
    font-size: 7px;
  }

  .tbar-xp-wrap {
    display: flex;
    min-width: 62px;
  }

  .tbar-xp-cur,
  .tbar-xp-max {
    font-size: 7px;
  }

  .tbar-stat-icon {
    width: 11px;
    height: 11px;
  }

  .tbar-stat-val {
    font-size: 9px;
  }

  .tbar-fame-wrap {
    width: 20px;
    height: 20px;
  }

  .tbar-fame-level {
    font-size: 7px;
  }

  .btn-logout {
    margin-left: auto;
    align-self: center;
    min-height: 28px;
    padding: 0 8px;
    font-size: 8px;
  }

  .site-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    justify-content: center;
    font-size: 11px;
    padding-top: 0;
  }

  #main {
    padding: 16px 12px 34px;
  }

  .login-card {
    width: 100%;
    padding: 22px 18px;
  }

  .dashboard-frame {
    padding: 16px;
    border-radius: 22px;
  }

  .dashboard-hero {
    gap: 16px;
    margin-bottom: 18px;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-text {
    font-size: 14px;
    line-height: 1.5;
  }

  .hero-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hero-stat {
    min-height: 84px;
    padding: 14px;
    border-radius: 18px;
  }

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

  .mp-action-btn {
    min-height: 150px;
    padding: 16px;
    border-radius: 18px;
  }

  .fm-backdrop {
    padding: 14px;
  }

  .fm-header,
  .fm-tabs,
  .fm-sub-filters,
  .fm-list,
  .fm-pagination {
    padding-left: 14px;
    padding-right: 14px;
  }

  #friends-loading,
  #friends-error {
    margin-left: 14px;
    margin-right: 14px;
  }

  #audio-player {
    right: 16px;
    bottom: 16px;
  }
}
