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

html {
  scroll-behavior: smooth;
}

body {
  background-color: #060608;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(143, 127, 240, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(183, 166, 255, 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(120, 90, 200, 0.1), transparent);
  min-height: 100vh;
  position: relative;
}

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

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: float 18s ease-in-out infinite;
}

.orb-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -80px;
  background: rgba(143, 127, 240, 0.35);
}

.orb-2 {
  width: 320px;
  height: 320px;
  bottom: 10%;
  right: -60px;
  background: rgba(183, 166, 255, 0.2);
  animation-delay: -6s;
}

.orb-3 {
  width: 260px;
  height: 260px;
  top: 45%;
  left: 35%;
  background: rgba(100, 80, 180, 0.12);
  animation-delay: -12s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(24px, -20px) scale(1.05);
  }
}

.glass {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.glass-strong {
  background: rgba(12, 12, 16, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.modal-backdrop {
  background: rgba(4, 4, 8, 0.82);
  backdrop-filter: blur(8px);
}

.fade-up {
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

input,
textarea,
button {
  font-family: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
  color: #f0eee8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: rgba(183, 166, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(183, 166, 255, 0.12);
  background: rgba(0, 0, 0, 0.55);
}

.input-field {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: 0.875rem;
  background: rgba(0, 0, 0, 0.35);
}

.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f0eee8;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.nav-profile-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(183, 166, 255, 0.35);
}

.profile-dropdown {
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 1rem;
  background: rgba(14, 14, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.profile-dropdown a,
.profile-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  color: #d4d4d8;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.profile-dropdown .danger:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.user-card:hover {
  transform: translateY(-2px);
  border-color: rgba(183, 166, 255, 0.35);
  background: rgba(183, 166, 255, 0.06);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.media-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 2/3;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.4);
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s;
}

.media-card.editable {
  cursor: pointer;
}

.media-card.editable:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

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

.media-card .score-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(8, 8, 10, 0.85);
  color: #b7a6ff;
  border: 1px solid rgba(183, 166, 255, 0.35);
}

.media-card .media-title {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 2rem 0.5rem 0.5rem;
  font-size: 0.65rem;
  line-height: 1.3;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92));
  color: #e4e4e7;
}

.tab-pill {
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-pill.active {
  color: #08080a;
  background: linear-gradient(135deg, #b7a6ff, #8f7ff0);
  border-color: transparent;
  font-weight: 600;
}

.tab-pill:not(.active):hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.username-hint {
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.username-hint.ok {
  color: #4ade80;
}

.username-hint.bad {
  color: #f87171;
}

.hero-glow {
  background: linear-gradient(135deg, #f0eee8 0%, #b7a6ff 50%, #8f7ff0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.media-card .rank-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  border-radius: 0.5rem;
  background: rgba(8, 8, 10, 0.85);
  color: #f0eee8;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.media-card[draggable="true"] {
  cursor: grab;
}

.media-card.dragging {
  opacity: 0.4;
}

.media-card.drag-over {
  outline: 2px dashed rgba(183, 166, 255, 0.6);
  outline-offset: 2px;
}

.top-five-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .top-five-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.top-five-card .top-rank {
  background: linear-gradient(135deg, #b7a6ff, #8f7ff0);
  color: #08080a;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.status-tag {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--status-color, #96938c);
}

.status-filter-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #96938c;
  transition: all 0.15s ease;
}

.status-filter-pill:hover {
  color: #f0eee8;
  border-color: rgba(255, 255, 255, 0.25);
}

.status-filter-pill.active {
  background: var(--status-color, #b7a6ff);
  color: #08080a;
  border-color: transparent;
  font-weight: 600;
}

.status-filter-pill[data-status="all"].active {
  background: #b7a6ff;
}

#sortSelect {
  cursor: pointer;
}


