/* ══════════════════════════════════════════════
   FILE DROP v2 — Strict Black & White Design
   ══════════════════════════════════════════════ */

/* ─── Reset & Variables ─── */

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

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-elevated: #161616;
  --bg-hover: #1a1a1a;
  --bg-input: #0e0e0e;
  --border: #1e1e1e;
  --border-hover: #333333;
  --text: #e8e8e8;
  --text-muted: #888888;
  --text-dim: #555555;
  --accent: #ffffff;
  --danger: #ff4444;
  --danger-hover: #cc3333;
  --success: #22c55e;
  --pending: #f59e0b;
  --star: #f59e0b;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: 0.2s ease;

  --nav-height: 57px;

  /* Алиасы для messages.css / прочих компонентов */
  --surface: #111111;
  --primary: #ffffff;
  --primary-rgb: 255, 255, 255;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text);
  text-decoration: none;
}

/* ─── Navigation ─── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.nav__logo:hover {
  opacity: 0.8;
}

.nav__logo-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* --- Nav zones --- */
.nav__left {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.nav__center {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav__link {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav__link:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav__link--accent {
  color: var(--bg);
  background: var(--accent);
  font-weight: 600;
}

.nav__link--accent:hover {
  background: #ddd;
  color: var(--bg);
}

.nav__link--dim {
  color: var(--text-dim);
}

.nav__link--btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.nav__link--logout {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.nav__link--logout:hover {
  color: var(--danger);
}

.nav__link--upload {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.nav__link--upload:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* Profile pill — smooth organic shape */
.nav__profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  border-radius: 100px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text);
}

.nav__profile-pill:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.nav__profile-name {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Icon button for settings gear */
.nav__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.nav__icon-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
  transform: rotate(45deg);
}

.nav__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.nav__avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
}

.nav__form {
  display: inline;
}

/* ─── Layout ─── */

.main {
  flex: 1;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ─── Hero ─── */

.hero {
  text-align: center;
  padding: 48px 0 40px;
}

.hero__logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.hero__icon {
  width: 52px;
  height: 52px;
  color: var(--accent);
  flex-shrink: 0;
  animation: heroIconPulse 3s ease-in-out infinite;
}

@keyframes heroIconPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.6)); }
}

.hero__title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

/* ─── Section ─── */

.section {
  margin-bottom: 48px;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section__header .section__title {
  margin-bottom: 0;
}

.section__link {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.section__link:hover {
  color: var(--accent);
}

.section__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
}

/* ─── Categories Grid ─── */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--radius-xl);
}

.category-card--games::before { background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08), transparent 70%); }
.category-card--utilities::before { background: radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.08), transparent 70%); }
.category-card--media::before { background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08), transparent 70%); }
.category-card--other::before { background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.08), transparent 70%); }

.category-card:hover::before {
  opacity: 1;
}

.category-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.category-card svg {
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.3s ease;
}

.category-card:hover svg {
  color: var(--accent);
  transform: scale(1.1);
}

.category-card__name {
  font-size: 0.85rem;
  font-weight: 600;
}

.category-card__count {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ─── Category Filter ─── */

.category-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.category-filter__item {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-filter__item:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.category-filter__item--active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

.category-filter__item--active:hover {
  background: #ddd;
  color: var(--bg);
}

.category-filter__count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  opacity: 0.7;
}

/* ─── Cards Grid ─── */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--transition), transform 0.3s ease, box-shadow 0.3s ease;
}

.card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card__banner {
  width: 100%;
  height: 140px;
  background: var(--bg-elevated);
  background-size: cover;
  background-position: center;
  position: relative;
}

.card__banner--wide {
  aspect-ratio: 16 / 10;
  height: auto;
}

.card__banner-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  opacity: 0.3;
}

.card__downloads-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card__avatar-wrap {
  display: flex;
  justify-content: center;
  margin-top: -28px;
  position: relative;
  z-index: 1;
}

.card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  object-fit: cover;
  background: var(--bg-elevated);
}

.card__avatar--default {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.card__body {
  padding: 12px 20px 20px;
  text-align: center;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__description {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.card__author {
  color: var(--text-muted);
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card__author:hover {
  color: var(--accent);
}

.card__size {
  font-family: var(--font-mono);
}

.card__dot {
  opacity: 0.4;
}

.card__downloads {
  font-family: var(--font-mono);
  color: var(--text-dim);
}

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-family: var(--font);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

.btn--primary:hover {
  background: #d4d4d4;
  border-color: #d4d4d4;
}

.btn--full {
  width: 100%;
  padding: 12px;
}

.btn--lg {
  padding: 12px 24px;
  font-size: 0.9rem;
}

.btn--download {
  width: 100%;
  padding: 10px;
  border-color: var(--border-hover);
}

.btn--download:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn--danger {
  color: var(--danger);
  border-color: transparent;
}

.btn--danger:hover {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.1);
}

.btn--approve {
  color: var(--success);
  border-color: transparent;
}

.btn--approve:hover {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.btn--sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.btn__icon {
  width: 14px;
  height: 14px;
}

/* ─── Empty State ─── */

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.empty-state--sm {
  padding: 32px 20px;
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* ─── Auth Card ─── */

.auth-card {
  max-width: 400px;
  margin: 80px auto;
  padding: 40px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.auth-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
}

.auth-card__footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 20px;
}

.link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link:hover {
  opacity: 0.8;
}

/* ─── Forms ─── */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.875rem;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus {
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  line-height: 1.5;
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%23888' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.form-hint--inline {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

/* ─── Alerts ─── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 24px;
  animation: alertSlideIn 0.3s ease;
}

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

.alert--error {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.2);
  color: var(--danger);
}

.alert--success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--success);
}

/* ─── Drop Zone ─── */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.dropzone--sm {
  padding: 32px 24px;
}

.dropzone:hover,
.dropzone--active {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.dropzone__icon {
  width: 40px;
  height: 40px;
  stroke: var(--text-dim);
  transition: stroke var(--transition);
}

.dropzone:hover .dropzone__icon,
.dropzone--active .dropzone__icon {
  stroke: var(--accent);
}

.dropzone__text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.dropzone__text strong {
  color: var(--accent);
  font-weight: 500;
}

.dropzone__hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ─── Upload: Image Inputs ─── */

.upload-images {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-bottom: 4px;
}

.image-upload {
  position: relative;
  cursor: pointer;
}

.image-upload__preview {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  overflow: hidden;
  transition: border-color var(--transition);
}

.image-upload__preview--wide {
  aspect-ratio: 16/10;
}

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

.image-upload:hover .image-upload__preview {
  border-color: var(--border-hover);
}

.image-upload__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-upload__label {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ─── Screenshots Previews ─── */

.screenshots-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.screenshots-previews img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ─── Edit Screenshots ─── */

.edit-screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.edit-screenshot-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.edit-screenshot-item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

.edit-screenshot-item__delete {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* ─── Progress ─── */

.progress {
  display: none;
  margin-bottom: 24px;
}

.progress--visible {
  display: block;
}

.progress__info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress__filename {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.progress__percent {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.progress__track {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.15s linear;
}

.progress__status {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.progress__status--success { color: var(--success); }
.progress__status--error { color: var(--danger); }

/* ─── Profile ─── */

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 0 40px;
}

.profile-header__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

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

.profile-header__initial {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dim);
}

.profile-header__name {
  font-size: 1.5rem;
  font-weight: 700;
}

.profile-header__username {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.profile-header__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.profile-header__date {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ─── Settings Page ─── */

.settings-page {
  max-width: 600px;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
}

.settings-section__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

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

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.settings-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.settings-avatar__img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.settings-avatar__placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dim);
}

.settings-avatar__edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition);
  border: 2px solid var(--bg-card);
}

.settings-avatar__edit:hover {
  transform: scale(1.1);
}

.settings-avatar__input {
  display: none;
}

.settings-avatar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-avatar-info__username {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.settings-avatar-info__hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ─── File Detail Page ─── */

.file-page {
  max-width: 900px;
  margin: 0 auto;
}

.file-page__banner {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.file-page__banner-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  opacity: 0.2;
}

.file-page__header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.file-page__avatar-wrap {
  flex-shrink: 0;
}

.file-page__avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
}

.file-page__avatar--default {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.file-page__info {
  flex: 1;
  min-width: 0;
}

.file-page__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  word-break: break-word;
}

.file-page__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-page__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.file-page__meta-sep {
  color: var(--text-dim);
  opacity: 0.4;
}

.file-page__author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.file-page__author:hover {
  color: var(--accent);
}

.file-page__author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.file-page__author-name {
  font-weight: 500;
}

.file-page__author-username {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.file-page__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.file-page__section-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.file-page__description {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
}

.file-page__description p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Screenshots ─── */

.file-page__screenshots {
  margin-bottom: 24px;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.screenshot-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.screenshot-item__img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

/* ─── File Info Grid ─── */

.file-page__details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
}

.file-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.file-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-info-item__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.file-info-item__value {
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
}

/* ─── Reviews ─── */

.file-page__reviews {
  margin-bottom: 24px;
}

.review-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-form__rating {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-form__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.star-rating {
  display: flex;
  gap: 4px;
}

.star-rating__star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--text-dim);
  transition: color 0.15s ease, transform 0.15s ease;
  padding: 0;
  line-height: 1;
}

.star-rating__star:hover {
  transform: scale(1.2);
}

.star-rating__star--active {
  color: var(--star);
}

.review-login-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(var(--primary-rgb), 0.2);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
  animation: fadeInUp 0.4s ease both;
}

.review-item:hover {
  border-color: var(--border-hover);
}

.review-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.review-item__user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-item__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.review-item__avatar--default {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
}

.review-item__name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

.review-item__username {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.review-item__stars {
  display: flex;
  gap: 2px;
}

.review-star {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.review-star--filled {
  color: var(--star);
}

.review-item__text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.review-item__date {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ─── Badges ─── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge--admin {
  border-color: var(--accent);
  color: var(--accent);
}

.badge--moderator {
  border-color: var(--pending);
  color: var(--pending);
}

.badge--approved {
  border-color: var(--success);
  color: var(--success);
}

.badge--pending {
  border-color: var(--pending);
  color: var(--pending);
}

.badge--rejected {
  border-color: var(--danger);
  color: var(--danger);
}

.badge--games {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.badge--utilities {
  border-color: var(--success);
  color: var(--success);
}

.badge--media {
  border-color: #3b82f6;
  color: #3b82f6;
}

.badge--other {
  border-color: var(--pending);
  color: var(--pending);
}

/* ─── Admin ─── */

.admin-section {
  margin-bottom: 48px;
}

.admin-section__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  transition: background var(--transition);
  gap: 16px;
}

.admin-row:hover {
  background: var(--bg-hover);
}

.admin-row__info {
  min-width: 0;
  flex: 1;
}

.admin-row__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row__meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-role-form__row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  align-items: center;
}

/* ─── Footer ─── */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 32px 24px;
  margin-top: auto;
}

.footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__logo {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__social-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all var(--transition);
}

.footer__social-link:hover {
  border-color: #0088cc;
  color: #0088cc;
  background: rgba(0, 136, 204, 0.08);
}

.footer__social-link svg {
  color: #0088cc;
}

/* ─── Error Page ─── */

.error-page {
  text-align: center;
  padding: 120px 20px;
}

.error-page__code {
  font-size: 4rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.error-page__message {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ─── Animations ─── */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes blurIn {
  from { opacity: 0; filter: blur(8px); transform: scale(1.02); }
  to   { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.8); }
  70%  { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(40px) rotate(-2deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

/* Cards: alternate between fadeInUp and popIn */
.card {
  animation: fadeInUp 0.5s ease both;
}

.cards-grid .card:nth-child(odd) { animation-name: fadeInUp; }
.cards-grid .card:nth-child(even) { animation-name: popIn; }
.cards-grid .card:nth-child(1) { animation-delay: 0s; }
.cards-grid .card:nth-child(2) { animation-delay: 0.06s; }
.cards-grid .card:nth-child(3) { animation-delay: 0.12s; }
.cards-grid .card:nth-child(4) { animation-delay: 0.18s; }
.cards-grid .card:nth-child(5) { animation-delay: 0.24s; }
.cards-grid .card:nth-child(6) { animation-delay: 0.3s; }

/* Scroll-triggered animations with variety */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero: blur-in for cinematic feel */
.hero {
  animation: blurIn 0.8s ease;
}

/* Category cards: slide from alternating directions */
.categories-grid .category-card:nth-child(odd) {
  animation: slideInLeft 0.5s ease both;
}
.categories-grid .category-card:nth-child(even) {
  animation: slideInRight 0.5s ease both;
}
.categories-grid .category-card:nth-child(1) { animation-delay: 0.05s; }
.categories-grid .category-card:nth-child(2) { animation-delay: 0.1s; }
.categories-grid .category-card:nth-child(3) { animation-delay: 0.15s; }
.categories-grid .category-card:nth-child(4) { animation-delay: 0.2s; }

/* File page sections: each has a different animation */
.file-page__description {
  animation: slideInLeft 0.5s ease both;
}
.file-page__screenshots {
  animation: blurIn 0.6s ease 0.1s both;
}
.file-page__details {
  animation: slideInRight 0.5s ease 0.15s both;
}
.file-page__reviews {
  animation: floatUp 0.5s ease 0.2s both;
}

/* Settings sections staggered with scale */
.settings-section:nth-child(2) { animation: scaleIn 0.4s ease 0.05s both; }
.settings-section:nth-child(3) { animation: scaleIn 0.4s ease 0.1s both; }

/* Profile header: slide from left */
.profile-header {
  animation: slideInLeft 0.5s ease;
}

/* Pulse animation for download button */
.btn--primary {
  position: relative;
  overflow: hidden;
}

.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: none;
}

.btn--primary:hover::after {
  animation: btnShine 0.6s ease forwards;
}

@keyframes btnShine {
  to { transform: translateX(100%); }
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .container { padding: 24px 16px 60px; }
  .hero { padding: 32px 0 24px; }
  .hero__title { font-size: 1.75rem; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .upload-images { grid-template-columns: 1fr; }
  .admin-role-form__row { grid-template-columns: 1fr; }
  .admin-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-header__meta { justify-content: center; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .file-page__header { flex-direction: column; }
  .file-page__actions { width: 100%; }
  .file-page__actions .btn { flex: 1; }
  .file-info-grid { grid-template-columns: 1fr 1fr; }
  .footer__inner { flex-direction: column; gap: 16px; text-align: center; }
  .category-filter { justify-content: center; }
  .settings-avatar-row { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .nav__link { padding: 6px 8px; font-size: 0.72rem; }
  .nav__link span { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .screenshots-grid { grid-template-columns: 1fr; }
  .file-info-grid { grid-template-columns: 1fr; }
}

/* ─── Chat ─── */
.chat-page {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 500px;
  animation: scaleIn 0.5s ease;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  animation: slideInLeft 0.4s ease;
}
.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--success);
  animation: slideInRight 0.4s ease;
}
.chat-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.chat-container {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: blurIn 0.6s ease 0.1s both;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-loading {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.chat-loading__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-msg {
  display: flex;
  gap: 12px;
  max-width: 85%;
}
.chat-msg--new {
  animation: chatMsgIn 0.3s ease both;
}
.chat-msg--mine {
  align-self: flex-end;
  text-align: right;
  flex-direction: row;
}
.chat-msg__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.chat-msg__avatar--default {
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}
.chat-msg__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-msg--mine .chat-msg__content {
  align-items: flex-end;
}
.chat-msg__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.chat-msg--mine .chat-msg__header {
  flex-direction: row-reverse;
}
.chat-msg__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.chat-msg__name:hover {
  color: var(--accent);
}
.chat-msg__name--admin {
  color: var(--danger);
}
.chat-msg__time {
  font-size: 0.65rem;
  color: var(--text-dim);
}
.chat-msg__bubble {
  background: var(--bg-elevated);
  padding: 10px 14px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}
.chat-msg--mine .chat-msg__bubble {
  background: var(--accent);
  color: var(--bg);
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
}
.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.chat-form {
  display: flex;
  gap: 12px;
}
.chat-input {
  flex: 1;
  border-radius: 20px;
  padding: 12px 20px;
}
.chat-send-btn {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Friends ─── */
.friends-page {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeInUp 0.5s ease;
}
.friends-section {
  margin-bottom: 40px;
}
.friends-section:nth-child(odd) { animation: slideInLeft 0.5s ease both; }
.friends-section:nth-child(even) { animation: slideInRight 0.5s ease 0.1s both; }
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color var(--transition), transform 0.2s ease, box-shadow 0.2s ease;
  animation: popIn 0.4s ease both;
}
.friend-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.friend-card__link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.friend-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.friend-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.friend-card__avatar span {
  width: 100%;
  height: 100%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-dim);
}
.friend-card__info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.friend-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-card__username {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.friend-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── News page ─── */
.news-page {
  animation: blurIn 0.6s ease;
}

/* ─── Nav responsive ─── */
@media (max-width: 768px) {
  .nav__inner {
    gap: 4px;
  }
  .nav__left, .nav__center {
    gap: 0;
  }
  .nav__profile-name {
    display: none;
  }
  .nav__profile-pill {
    padding: 4px;
  }
}

@media (max-width: 480px) {
  .nav__center {
    display: none;
  }
  .nav__left .nav__link {
    padding: 6px 8px;
    font-size: 0.72rem;
  }
}

/* Settings Grid & Visuals */
.settings-page-wrapper {
  position: relative;
  z-index: 1;
}

.settings-page {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.settings-bg-glow {
  position: fixed;
  top: -20vh;
  left: -20vw;
  width: 140vw;
  height: 140vh;
  background: radial-gradient(circle at 50% 50%, rgba(var(--primary-rgb), 0.08) 0%, rgba(10, 10, 10, 0) 60%);
  pointer-events: none;
  z-index: 0;
  animation: pulse-glow 10s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.1); opacity: 0.8; }
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch; /* Make items equal height */
}

.settings-section {
  display: flex;
  flex-direction: column;
  height: 100%; /* Stretch to fill grid track */
}

.settings-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.settings-form > .btn {
  margin-top: auto; /* Push button to the bottom */
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Dashboard Stats */
.admin-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}

.admin-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border-color: var(--primary);
}

.admin-stat-card__value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.admin-stat-card__label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Enhancing admin tables */
.admin-row {
  transition: all 0.2s ease;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.01);
  border: 1px solid transparent;
}

.admin-row:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
}

/* Friends Page */
.friends-page {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ═══════════════════════════════════════════════
   FIXES & NEW COMPONENTS (v2.1)
   ═══════════════════════════════════════════════ */

/* ─── Custom scrollbars ─── */
* {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
  background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }

.chat-messages::-webkit-scrollbar,
.messages-list::-webkit-scrollbar,
.messages-friend-list::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb,
.messages-friend-list::-webkit-scrollbar-thumb {
  background: #262626;
  border: none;
}
.chat-messages::-webkit-scrollbar-thumb:hover,
.messages-list::-webkit-scrollbar-thumb:hover {
  background: #383838;
}

/* ─── Twemoji inline emoji ─── */
img.emoji {
  height: 1.15em;
  width: 1.15em;
  margin: 0 0.05em 0 0.1em;
  vertical-align: -0.15em;
  display: inline-block;
}

/* ─── Friends grid / card fixes ─── */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.friend-card {
  gap: 12px;
  flex-wrap: nowrap;
}
.friend-card__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.friend-card__actions form { margin: 0; }
.friend-card__actions .btn {
  white-space: nowrap;
}
/* Кнопка "написать сообщение" в карточке друга */
.friend-card__msg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  flex-shrink: 0;
}

/* ─── Profile friend-action button alignment ─── */
.profile-header__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-header__actions form { margin: 0; }

/* ═══════════════ Звонок (Call UI) ═══════════════ */
.call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.call-btn:hover { transform: scale(1.08); background: #1ea34e; }

.call-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.call-window {
  width: min(720px, 94vw);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.call-window__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.call-window__title { font-size: 1.3rem; font-weight: 700; }
.call-window__status { font-size: 0.85rem; color: var(--text-muted); }
.call-window__videos {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.call-window__videos #remoteVideo {
  width: 100%;
  max-height: 50vh;
  border-radius: var(--radius-lg);
  background: #000;
}
.call-window__videos #localVideo {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 160px;
  max-width: 40%;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #111;
  z-index: 2;
}
.call-window__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-muted);
}
.call-window__avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-window__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.call-ctl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
}
.call-ctl:hover { transform: scale(1.08); background: var(--bg-hover); }
.call-ctl--active { background: #fff; color: #000; }
.call-ctl--hangup { background: var(--danger); color: #fff; }
.call-ctl--hangup:hover { background: var(--danger-hover); }
.call-ctl--accept { background: var(--success); color: #fff; }

.incoming-call {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  animation: slideInRight 0.3s ease;
}
.incoming-call__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.incoming-call .call-ctl { width: 44px; height: 44px; }

/* ═══════════════ Mobile optimization ═══════════════ */
@media (max-width: 768px) {
  .container { padding-left: 14px; padding-right: 14px; }

  .messages-page {
    flex-direction: column;
    height: calc(100vh - var(--nav-height) - 20px);
  }
  .messages-sidebar {
    width: 100%;
    max-height: 34vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .messages-friend-list { display: flex; flex-wrap: wrap; }
  .messages-friend-item { border-bottom: none; }
  .messages-list { padding: 16px; }
  .messages-input-area { padding: 12px 16px; }

  .friends-grid { grid-template-columns: 1fr; }
  .friends-page, .chat-page { max-width: 100%; }

  .chat-page { height: calc(100vh - 150px); }
  .chat-msg { max-width: 92%; }

  .cards-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  .call-window { padding: 16px; gap: 14px; }
  .call-ctl { width: 46px; height: 46px; }

  .admin-dashboard-stats { grid-template-columns: 1fr; }
  .admin-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-row__actions { width: 100%; }
  .admin-role-form__row { flex-direction: column; }
  .admin-role-form__row .form-input,
  .admin-role-form__row .btn { width: 100%; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .friend-card { flex-wrap: wrap; }
  .profile-header { flex-direction: column; text-align: center; align-items: center; }
  .profile-header__actions { justify-content: center; }
  .nav__logo { font-size: 1rem; }
}

/* ═══════════════════════════════════════════════
   ADMIN PANEL REDESIGN (v2.1)
   ═══════════════════════════════════════════════ */
.admin-panel {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  animation: fadeInUp 0.4s ease;
}
.admin-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.admin-panel__head .page-title { margin: 0; }
.admin-panel__badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.admin-stat-card {
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.admin-stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}
.admin-stat-card__value {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}
.admin-stat-card__label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Секции как карточки */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.admin-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-row {
  background: var(--bg-elevated);
  border: 1px solid transparent;
}
.admin-row:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}
.admin-role-form__row {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 10px;
  align-items: center;
}
.admin-maintenance-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ─── Call: демонстрация экрана — мини-аватар + фуллскрин ─── */
.call-window__videos { position: relative; }

.call-window__mini-avatar {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  font-weight: 700;
  color: var(--text);
  z-index: 3;
}
.call-window__mini-avatar img { width: 100%; height: 100%; object-fit: cover; }

.call-fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.2s ease;
}
.call-fullscreen-btn:hover { background: rgba(0,0,0,0.8); }

/* Полноэкранный режим области видео */
.call-window__videos:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #000;
  border-radius: 0;
}
.call-window__videos:fullscreen #remoteVideo {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: contain;
}
.call-window__videos:fullscreen #localVideo {
  width: 220px;
  max-width: 22%;
}
