@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

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

:root {
  --bg: #070a11;
  --surface: rgba(16, 20, 31, 0.82);
  --surface-strong: #101625;
  --surface-hover: rgba(27, 33, 49, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(215, 174, 103, 0.22);
  --text: #f4efe6;
  --text-dim: rgba(244, 239, 230, 0.66);
  --accent: #d7ae67;
  --accent-hover: #ebca90;
  --accent-soft: rgba(215, 174, 103, 0.14);
  --accent-strong: #f4d79e;
  --danger: #f87171;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.32);
}

[data-theme="light"] {
  --bg: #f6f0e6;
  --surface: rgba(255, 252, 247, 0.84);
  --surface-strong: #fffaf2;
  --surface-hover: rgba(255, 250, 242, 0.96);
  --border: rgba(84, 60, 31, 0.1);
  --border-strong: rgba(191, 142, 55, 0.26);
  --text: #201710;
  --text-dim: rgba(32, 23, 16, 0.66);
  --accent: #b77b1f;
  --accent-hover: #8f5d12;
  --accent-soft: rgba(183, 123, 31, 0.1);
  --accent-strong: #8f5d12;
  --danger: #dc2626;
}

.page-placeholder {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-dim);
  font-size: 14px;
}

.page-placeholder h1 {
  color: var(--text);
  margin-bottom: 8px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px 14px;
  margin-bottom: 4px;
  flex-wrap: wrap;
  min-height: 52px;
  text-align: left;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 28px 28px;
  background: rgba(10, 14, 23, 0.78);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 30;
}

[data-theme="light"] .site-header {
  background: rgba(255, 251, 245, 0.72);
}

.site-header-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
  order: 1;
}

.site-header-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

[data-theme="light"] .site-header-logo-img {
  filter: invert(1);
}

.site-header-logo:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  .site-header-logo-text {
    display: none;
  }
}

.site-header-breadcrumb {
  display: none;
}

.site-header-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.site-header-breadcrumb a:hover {
  color: var(--accent);
}

.header-nav-dropdown {
  order: 1;
}

.site-header-auth {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  order: 2;
  margin-left: auto;
}

.header-dropdown {
  position: relative;
}

.header-dropdown-trigger {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  min-width: 40px;
}

[data-theme="light"] .header-dropdown-trigger {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(84, 60, 31, 0.08);
}

.header-dropdown-trigger:hover {
  color: var(--accent-hover);
  border-color: var(--border-strong);
}

.header-theme-btn {
  min-height: 40px;
  min-width: 40px;
  padding: 9px 14px;
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

[data-theme="light"] .header-theme-btn {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(84, 60, 31, 0.08);
}

.header-theme-btn:hover {
  color: var(--accent-hover);
  border-color: var(--border-strong);
}

.header-dropdown.open .header-dropdown-trigger {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-color: var(--border-strong);
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 140px;
  background: rgba(13, 17, 27, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

[data-theme="light"] .header-dropdown-menu {
  background: rgba(255, 250, 243, 0.96);
}

.header-dropdown.open .header-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.header-dropdown-item:hover {
  background: var(--border);
}

.header-dropdown-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-header-login {
  min-height: 40px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.site-header-login:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--accent-hover);
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}

.user-bar-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-bar-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text);
  padding: 0;
  font: inherit;
}

.user-bar-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.user-bar-arrow {
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 0.15s;
}

.user-bar.open .user-bar-arrow {
  transform: rotate(180deg);
}

.user-bar-balance {
  font-size: 12px;
  color: var(--accent-strong);
  white-space: nowrap;
  margin-left: 4px;
}

@media (max-width: 768px) {
  #theme-switcher,
  #lang-switcher {
    display: none;
  }
}

.mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu {
    display: flex;
  }

  .mobile-menu.hidden {
    display: none !important;
  }
}

.mobile-menu-trigger {
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

[data-theme="light"] .mobile-menu-trigger {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(84, 60, 31, 0.08);
}

@media (max-width: 480px) {
  .user-bar-balance {
    display: none;
  }
}

.user-bar-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: rgba(13, 17, 27, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

[data-theme="light"] .user-bar-menu {
  background: rgba(255, 250, 243, 0.96);
}

.user-bar.open .user-bar-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-bar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
}

.user-bar-menu-item:hover {
  background: var(--border);
}

.user-bar-menu-item.danger {
  color: var(--danger, #f87171);
}

.user-bar-menu-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.user-menu-item-compact {
  display: none;
}

@media (max-width: 768px) {
  .user-menu-item-compact {
    display: flex;
  }
}

.user-bar-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.auth-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

.auth-wall-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
}

.auth-widget {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 320px;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  color: #fff;
}

.auth-btn:hover {
  opacity: 0.85;
}

.auth-btn svg {
  flex-shrink: 0;
}

.auth-btn-yandex {
  background: #fc3f1d;
}

.auth-btn-vk {
  background: #0077ff;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}

.auth-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.auth-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.auth-modal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-modal-text {
  font-size: 14px;
  color: var(--text-dim);
}

.auth-modal .auth-widget {
  max-width: 100%;
}

body.auth-modal-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.offer-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  padding: 16px;
}

.offer-modal-card {
  background: var(--surface, #1a1a1f);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius, 12px);
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.offer-modal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.offer-modal-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim, #71717a);
}

.offer-modal-link {
  font-size: 13px;
  color: var(--accent, #a78bfa);
  text-decoration: none;
  transition: color 0.15s;
}

.offer-modal-link:hover {
  color: var(--accent-hover, #c4b5fd);
}

.offer-modal-btn {
  background: var(--accent, #a78bfa);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.offer-modal-btn:hover {
  background: var(--accent-hover, #c4b5fd);
}

.site-footer {
  width: min(calc(100% - 40px), 1220px);
  margin: 8px auto 0;
  padding: 14px 0 calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim, #71717a);
  background: transparent;
  border-top: 1px solid var(--border, #2a2a30);
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.site-footer-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer a {
  color: var(--text-dim, #71717a);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: var(--accent, #a78bfa);
}

.site-footer-sep {
  opacity: 0.4;
}

@media (max-width: 680px) {
  .site-footer {
    width: min(calc(100% - 24px), 1220px);
    margin-top: 2px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

body.has-cookies-banner {
  padding-bottom: calc(148px + env(safe-area-inset-bottom));
}

.cookies-banner {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 9997;
  width: min(900px, calc(100% - 24px));
  background: var(--surface, #1a1a1f);
  border: 1px solid var(--border, #2a2a30);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md, 0 18px 44px rgba(0, 0, 0, 0.24));
  backdrop-filter: blur(18px);
}

.cookies-banner-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim, #71717a);
}

.cookies-banner-text a {
  color: var(--accent, #a78bfa);
  text-decoration: none;
}

.cookies-banner-text a:hover {
  color: var(--accent-hover, #c4b5fd);
}

.cookies-banner-btn {
  border: none;
  border-radius: 12px;
  min-height: 40px;
  padding: 0 16px;
  background: var(--accent, #a78bfa);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cookies-banner-btn:hover {
  background: var(--accent-hover, #c4b5fd);
}

@media (max-width: 640px) {
  body.has-cookies-banner {
    padding-bottom: calc(196px + env(safe-area-inset-bottom));
  }

  .cookies-banner {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    bottom: calc(52px + env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
  }

  .cookies-banner-btn {
    width: 100%;
  }
}

.upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px;
}

.upload-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

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

.upload-action-icon {
  font-size: 20px;
  line-height: 1;
}

.fp-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.fp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.fp-panel {
  position: relative;
  background: var(--surface, #1a1a1f);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius, 12px);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #2a2a30);
}

.fp-title {
  font-size: 16px;
  font-weight: 600;
}

.fp-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-dim, #71717a);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.fp-close:hover {
  color: var(--text, #e4e4e7);
}

.fp-filters {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
}

.fp-filter {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border, #2a2a30);
  background: none;
  color: var(--text-dim, #71717a);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.fp-filter:hover {
  border-color: var(--accent, #a78bfa);
  color: var(--text, #e4e4e7);
}

.fp-filter.active {
  background: var(--accent, #a78bfa);
  border-color: var(--accent, #a78bfa);
  color: #fff;
}

.fp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  grid-auto-rows: minmax(0, auto);
  align-items: start;
  gap: 8px;
  padding: 0 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}

.fp-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
  background: var(--bg, #0e0e10);
}

.fp-card:hover {
  border-color: var(--border, #2a2a30);
}

.fp-card.selected {
  border-color: var(--accent, #a78bfa);
  box-shadow: 0 0 0 1px var(--accent, #a78bfa);
}

.fp-card img,
.fp-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-card-audio {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}

.fp-card-audio-icon {
  font-size: 24px;
}

.fp-card-audio audio {
  width: 100%;
  max-height: 32px;
}

.fp-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-dim, #71717a);
  font-size: 14px;
}

.fp-load-more {
  margin: 12px auto;
  padding: 6px 20px;
  border-radius: 8px;
  border: 1px solid var(--border, #2a2a30);
  background: none;
  color: var(--text, #e4e4e7);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.fp-load-more:hover {
  border-color: var(--accent, #a78bfa);
}

.fp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border, #2a2a30);
}

.fp-btn-cancel,
.fp-btn-select {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.fp-btn-cancel {
  background: none;
  border: 1px solid var(--border, #2a2a30);
  color: var(--text, #e4e4e7);
}

.fp-btn-cancel:hover {
  border-color: var(--accent, #a78bfa);
}

.fp-btn-select {
  background: var(--accent, #a78bfa);
  border: none;
  color: #fff;
}

.fp-btn-select:hover {
  background: var(--accent-hover, #c4b5fd);
}

.fp-btn-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .fp-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #e0e0e5;
  --text: #1a1a1f;
  --text-dim: #6b6b76;
  --accent: #7c5cfc;
  --accent-hover: #6344e0;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}

[data-theme="light"] .offer-modal {
  background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .offer-modal-btn {
  color: #fff;
}
