
/* --- ВЕСНА (активна) --- */
:root {
  --primary-color:    #3ec049;
  --secondary-color:  #30edae;
  --primary-rgb:      62, 192, 73;
  --secondary-rgb:    48, 237, 174;
  --bg-dark:          #0e180d;
  --bg-darker:        #050f06;
  --bg-extra:         #042701;
  --season-orb1:      #2dba3c;
  --season-orb2:      #00e5aa;
  --season-orb3:      #b8ff6e;
}


/* --- ЛЕТО (раскомментировать) ---*/
/* :root {
  --primary-color:    #bf00ff;
  --secondary-color:  #7b00ff;
  --primary-rgb:      191, 0, 255;
  --secondary-rgb:    123, 0, 255;
  --bg-dark:          #120018;
  --bg-darker:        #07000d;
  --bg-extra:         #1a0028;
  --season-orb1:      #bf00ff;
  --season-orb2:      #6600cc;
  --season-orb3:      #ff66ff;
} */
 

/* --- ОСЕНЬ (раскомментировать) ---
:root {
  --primary-color:    #e05520;
  --secondary-color:  #ffb347;
  --primary-rgb:      224, 85, 32;
  --secondary-rgb:    255, 179, 71;
  --bg-dark:          #180a00;
  --bg-darker:        #0d0500;
  --bg-extra:         #270e00;
  --season-orb1:      #cc3300;
  --season-orb2:      #ff6600;
  --season-orb3:      #ffcc00;
}
*/

/* --- ЗИМА (раскомментировать) ---
:root {
  --primary-color:    #3081ed;
  --secondary-color:  #45f3ff;
  --primary-rgb:      48, 129, 237;
  --secondary-rgb:    69, 243, 255;
  --bg-dark:          #050d18;
  --bg-darker:        #020810;
  --bg-extra:         #001a2c;
  --season-orb1:      #0066cc;
  --season-orb2:      #00ccff;
  --season-orb3:      #99eeff;
}
*/

/* Производные переменные на основе сезонных */
:root {
  --gradient:         linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  --gradient-reverse: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
  --bg-gradient:      linear-gradient(135deg, var(--bg-dark), var(--bg-darker), var(--bg-extra));
  --bg-card:          rgba(255, 255, 255, 0.05);
  --bg-card-hover:    rgba(255, 255, 255, 0.1);
  --bg-features:      rgba(13, 19, 10, 0.7);
  --text-primary:     white;
  --text-secondary:   rgba(255, 255, 255, 0.7);
  --text-muted:       rgba(255, 255, 255, 0.5);
  --border-color:     rgba(255, 255, 255, 0.1);
  --border-gradient:  linear-gradient(to right, var(--primary-color), var(--secondary-color));
  --shadow-primary:   0 10px 20px rgba(var(--primary-rgb), 0.3);
  --shadow-card:      0 10px 25px rgba(var(--primary-rgb), 0.2);
  --shadow-card-gold: 0 10px 25px rgba(var(--secondary-rgb), 0.2);
  --header-height:    80px;
  --max-width:        1400px;
  --border-radius:        16px;
  --border-radius-small:  8px;
  --padding-large:    80px;
  --padding-medium:   40px;
  --padding-small:    20px;
  --transition:       all 0.3s ease;
  --transition-slow:  all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bg-orbs {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  animation: orb-float 18s infinite ease-in-out alternate;
}

.orb-1 {
  width: 480px; height: 480px;
  background: var(--season-orb1);
  top: -120px; left: -120px;
}
.orb-2 {
  width: 560px; height: 560px;
  background: var(--season-orb2);
  bottom: -180px; right: -140px;
  animation-delay: -6s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: var(--season-orb3);
  top: 40%; left: 45%;
  opacity: 0.1;
  animation-delay: -12s;
}

@keyframes orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 50px) scale(1.15); }
}

.profile-page {
    padding-top:  calc(var(--header-height) + 20px) !important;
  }

.header {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 80px;
  box-sizing: border-box;
  z-index: 1000;
  background: val(--season-bg-dark);
  backdrop-filter: blur(10px);
  transition: box-shadow 0.3s ease;
}

/* --- Шапка: добавляем "схематическую" линию снизу --- */
.header {
  background: val(--season-bg-dark);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid val(--season-bg-darker);
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--primary-color) 30%,
    var(--secondary-color) 70%,
    transparent 100%);
  opacity: 0.6;
  animation: scan-line 6s linear infinite;
}

@keyframes scan-line {
  0%   { transform: scaleX(0); transform-origin: left; }
  50%  { transform: scaleX(1); transform-origin: left; }
  51%  { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* Стили скроллбара */
::-webkit-scrollbar {
  width: 6px;
  background: var(--bg-darker);
}

::-webkit-scrollbar-track {
  background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
    border-radius: 3px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-gradient);
  position: relative;
  overflow-x: hidden;
  color: var(--text-primary);
  font-family: 'Arial', sans-serif;
  background-attachment: fixed;
  margin: 0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  pointer-events: none;
  z-index: -3;
  background: radial-gradient(white 1px, transparent 1px);
  background-size: 20px 20px;
  animation: pan 60s linear infinite;
  opacity: 0.1;
}

body::after {
  background: radial-gradient(circle at 1px 1px, white 1px, transparent 0);
  background-size: 80px 80px;
  animation-duration: 120s;
  opacity: 0.03;
}

@keyframes pan {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-20%, -20%);
  }
}

.background-radar {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 400%;
  height: 400%;
  margin-left: -200%;
  margin-top: -200%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.05) 0%, transparent 70%),
              repeating-radial-gradient(circle, rgba(var(--primary-rgb), 0.05), rgba(var(--primary-rgb), 0.02) 10%, transparent 20%);
  z-index: -2;
  animation: radar-scan 10s linear infinite;
  pointer-events: none;
}

@keyframes radar-scan {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.background-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}

.background-particles span {
  position: absolute;
  border-radius: 50%;
  background: white;
  opacity: 0.1;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.1;
  }
  100% {
    transform: translateY(-100vh) scale(1.5);
    opacity: 0;
  }
}

.background-particles span:nth-child(1) {
  width: 2px;
  height: 2px;
  top: 10%;
  left: 20%;
  animation-duration: 8s;
}
.background-particles span:nth-child(2) {
  width: 1px;
  height: 1px;
  top: 30%;
  left: 60%;
  animation-duration: 10s;
}
.background-particles span:nth-child(3) {
  width: 3px;
  height: 3px;
  top: 70%;
  left: 40%;
  animation-duration: 12s;
}


.header-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 32px;
    font-weight: bold;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    cursor: pointer;
    margin-right: auto;
}

.logo:hover {
  font-size: 33px;
}

.main-menu {
  display: flex;
    gap: var(--padding-medium);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.main-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  position: relative;
  transition: var(--transition);
  background-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  background-size: 0% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
}

.main-menu a:hover {
  -webkit-text-fill-color: transparent;
  background-size: 100% 100%;
}

.main-menu a:hover::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient);
}

.profile-page {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 30px;
}

.profile-cover-container {
  top: -4px;
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  border-radius: var(--border-radius); 
  box-shadow:
    0px 0px 15px -5px rgba(var(--primary-rgb), 0.5),
    0px 0px 10px -5px rgba(var(--primary-rgb), 0.5),
    0px 0px 10px 0px rgba(var(--primary-rgb), 0.5),
    0 10px 20px rgba(var(--primary-rgb), 0.4);
  transition: box-shadow 0.3s ease;
  --neon-reflection: linear-gradient(
    to bottom,
    transparent 60%,
    rgba(var(--primary-rgb), 0.1) 80%,
    rgba(var(--primary-rgb), 0.05) 90%,
    transparent 100%
  );
}

.profile-cover-container::before {
  content: '';
  position: absolute;
  bottom: 0; /* Зафиксировано внизу */
  left: 0;
  right: 0;
  height: 10px;
  background: var(--neon-reflection);
  z-index: 1;
  filter: blur(5px);
}

@keyframes neon-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.5), 
                0 0 30px rgba(var(--primary-rgb), 0.3),
                0 0 45px rgba(var(--primary-rgb), 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.8), 
                0 0 40px rgba(var(--primary-rgb), 0.5),
                0 0 60px rgba(var(--primary-rgb), 0.3);
  }
}


.profile-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-cover-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: var(--transition);
  border: none;
}

.upload-cover-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.profile-content {
  padding: 0 var(--padding-medium);
  margin-top: var(--padding-medium);
}

.profile-info-container {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--padding-large);
}

.profile-details {
  flex: 1;
  padding-top: 30px;
}

.username-container {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.profile-username {
  font-size: 28px;
  margin: 0;
  color: var(--text-primary);
}

.tokens-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--border-radius-small);
  background: var(--bg-card);
  font-size: 14px;
}

.tokens-icon {
  font-size: 18px;
}

#tokens-count {
  font-weight: 500;
  color: var(--primary-color);
}


.profile-avatar-outer-container {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  margin-right: 30px; 
}

.profile-avatar-container {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: 
    linear-gradient(white, white) padding-box,
    var(--gradient) border-box;
  border: 4px solid transparent;
}


.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.premium-crown {
  position: absolute;
  top: -50px;
  right: 90px;
  width: 70px;
  height: 70px;
  background: transparent; 
  color: rgba(255, 215, 0, 0.8); 
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 65px; 
  transform: rotate(-30deg);
  z-index: 100;
  border: none; 
  animation: crownAppear 0.5s ease-out forwards;
}

.premium-crown span {
  display: inline-block;
  text-shadow: 
    0 0 8px rgba(255, 215, 0, 0.6),
    0 0 15px rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
}


.premium-crown::before,
.premium-crown::after {
  display: none;
}



/* Стили для кнопки управления короной */
.crown-toggle-btn {
  position: absolute;
  top: 120px;
  right: 55px;
  width: 25px;
  height: 25px;
  background: transparent;
  border-radius: 50%;
  display: none; /* По умолчанию скрыта */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  border: none;
}

.crown-toggle-btn .crown-icon {
  font-size: 60px;
  transition: all 0.3s ease;
  color: var(--secondary-color);
}

.crown-toggle-btn:hover {
  transform: scale(1.1);
  color: var(--secondary-color);
}

.crown-toggle-btn:hover .crown-icon {
  transform: scale(1.2);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}


.crown-toggle-btn.active .crown-icon {
  color: gold;
  animation: crownBounce 0.5s ease;
}

@keyframes crownBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.crown-appear {
  animation: crownAppear 0.5s ease-out forwards;
}

.crown-disappear {
  animation: crownDisappear 0.5s ease-out forwards;
}

@keyframes crownAppear {
  0% { transform: rotate(-30deg) scale(0); opacity: 0; }
  100% { transform: rotate(-30deg) scale(1); opacity: 1; }
}

@keyframes crownDisappear {
  0% { transform: rotate(-30deg) scale(1); opacity: 1; }
  100% { transform: rotate(-30deg) scale(0); opacity: 0; }
}


.premium-toggle-btn:hover::after {
  opacity: 0.5;
}

.premium-toggle-btn.active::after {
  opacity: 0.7;
  animation: ripple 2s infinite;
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 0.7; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}

.profile-avatar-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}


/* Основной контейнер био */
.bio-container {
  position: relative;
  display: inline-block;
  width: 100%;

  max-width: max-content;
  margin: 5px 0;
}

/* Текст био */
.profile-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  min-height: 20px;
  width: max-content;
  max-width: 400px;
  word-break: break-word;
}

/* Режим редактирования */
.profile-bio[contenteditable="true"] {
  border: 1px dashed var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  padding: 8px 35px 8px 12px;
}

/* Кнопка редактирования */
.edit-bio-btn {
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.edit-bio-btn:hover {
  opacity: 1;
}

/* Контейнер кнопок действий */
.bio-actions {
  display: none;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
  align-items: center; 
}

/* Общие стили кнопок */
.action-button {
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

/* Кнопка Сохранить */
.save-btn {
  background: rgba(76, 175, 80, 0.25);
  color: #4CAF50;
}

.save-btn:hover {
  background: rgba(76, 175, 80, 0.35);
}

/* Кнопка Отмена */
.cancel-btn {
  background: rgba(244, 67, 54, 0.25);
  color: #f44336;
}

.cancel-btn:hover {
  background: rgba(244, 67, 54, 0.35);
}


.highlight {
  animation: highlight-fade 1.5s ease-out;
}

@keyframes highlight-fade {
  0% { background: rgba(76, 175, 80, 0.2); }
  100% { background: rgba(255, 255, 255, 0.05); }
}

.bio-counter {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 4px;
  margin-left: 2px;
  margin-right: 8px;
  transition: all 0.2s ease;
  display: none; 
}

.bio-container.editing .bio-counter {
  display: inline-block;
}

.bio-counter.error {
  color: #ff4444;
  font-weight: bold;
}

.bio-shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

.profile-posts-section {
  margin-top: var(--padding-large);
}

.profile-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  justify-content: center;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--border-radius-small);
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary-color);
}

.rating-selector {
  margin-bottom: var(--padding-medium);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-selector label {
  color: var(--text-secondary);
}

.rating-selector select {
  background: var(--bg-darker);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  padding: 8px 12px;
  cursor: pointer;
  transition: var(--transition);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--padding-small);
  margin-top: var(--padding-medium);
}

.post-card {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  aspect-ratio: 0.75/1;
  transition: var(--transition);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}

.post-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  object-position: top;
}

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-dark);
  margin: 5% auto;
  padding: 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  width: 80%;
  max-width: 800px;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.close-btn {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 30px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10;
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

.post-details-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (min-width: 768px) {
  .post-details-content {
    flex-direction: row;
    max-height: 80vh;
  }
}

.post-image-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 20px;
}

.post-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--border-radius-small);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.post-rating {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.prompt-container:hover .copy-overlay {
  opacity: 1;
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.footer {
  background: var(--bg-card);
  padding: 0px 20px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-title {
  font-size: 24px;
  margin-bottom: 40px;
  line-height: 1.5;
  color: var(--text-primary);
}

.footer-social {
  display: flex;
  justify-content: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 40px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 10px 15px;
  border-radius: 8px;
  background-color: rgba(var(--primary-color-rgb), 0.1);
}

.social-link:hover {
  background-color: rgba(var(--primary-color-rgb), 0.2);
  transform: translateY(-2px);
}

.social-icon {
  width: 20px;
  height: 20px;
}

.footer-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.legal-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.legal-link:hover {
  color: var(--primary-color);
}

.footer-copyright {
  color: var(--text-secondary);
  font-size: 14px;
}

@media (max-width: 768px) {
   /* Общие стили */
  :root {
    --padding-large: 40px;
    --padding-medium: 20px;
    --padding-small: 15px;
  }

  .logo:hover {
    font-size: 21px !important; /* убираем эффект увеличения на мобиле */
  }

  /* Шапка */
  .header {
    padding: 15px 20px;
    height: 60px;
  }

  .logo {
    font-size: 20px;
  }

  .main-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-darker);
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    border-top: 1px solid var(--border-color);
  }

  .main-menu.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
  }

  /* Основной контент */
  .main-container {
    padding-top: calc(var(--header-height));
  }

  .main-container .content-wrapper .card {
    width: auto;
    max-width: 200px;
    margin-left: auto;
}

  .profile-avatar-outer-container {
    display: flex;
    justify-content: center;
    margin-right: 0px;
  }

  .crown-toggle-btn {
    top: 80px;
    right: 63px;
  }
  

  .main-menu {
    flex-direction: column;
    gap: 10px;
  }
  
  .masonry-gallery {
    columns: 2;
  }
  
  .footer {
    padding: 0px 20px;
  }
  
  .footer-title {
    font-size: 20px;
  }
  
  .footer-social {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .masonry-gallery {
    columns: 1;
  }
}

.generation-card {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  aspect-ratio: 1/1;
  transition: var(--transition);
  background: var(--bg-card);
  border: 1px solid rgba(var(--primary-rgb), 0.3); /* Фиолетовая рамка */
}

.generation-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

.generation-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.generation-card:hover .generation-hover-overlay {
  opacity: 1;
}

.generation-hover-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Сетка публикаций */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--padding-small);
  margin-top: var(--padding-medium);
}

.post-card {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  aspect-ratio: 0.75/1;
  transition: var(--transition);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}

.post-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  object-position: top;
}

.post-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.post-card:hover .post-hover-overlay {
  opacity: 1;
}

.post-hover-content {
  color: white;
  text-align: center;
}


/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-darker);
  margin: 5% auto;
  padding: 20px;
  border-radius: var(--border-radius);
  max-width: 500px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  position: relative;
  animation: slideDown 0.3s ease-out;
}

.auth-modal-content {
  text-align: center;
  padding: 40px;
}

.auth-modal-image {
  margin-bottom: 20px;
}

.auth-modal-image img {
  max-width: 200px;
  height: auto;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
}

.auth-modal-text h2 {
  font-size: 24px;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.auth-modal-text p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 25px;
  line-height: 1.5;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Кнопка закрытия модального окна */
.close-modal {
  position: absolute;
  top: 15px;
  right: 50px;
  color: var(--text-secondary);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--primary-color);
}

.small-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 10px;
}

.modal .btn {
  margin-top: 20px;
  width: 100%;
}

.btn-primary {
  background: var(--gradient);
  color: var(--text-primary);
  padding: 20px 30px;
  cursor: pointer;
  border-radius: 30px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-primary);
}

.btn-primary {
  width: 100%;
  text-align: center;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 14px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover::before { left: 100%; }

.btn-primary:hover {
  box-shadow: 0 10px 30px rgba(64, 64, 64, 0.5),
              0 0 60px rgba(83, 83, 83, 0.3);
  transform: translateY(-3px);
}

.modal .btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 18px 30px;
  cursor: pointer;
  border-radius: 30px;
  font-weight: bold;
  text-decoration: none;
  transition: var(--transition);
}

.modal .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

#auth-button-container {
  display: flex;
  align-items: center;
}

#auth-button {
  padding: 10px 20px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .profile-info-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-avatar-container {
    width: 120px;
    height: 120px;
  }

  .profile-details {
    padding-top: 10px;
  }

  .username-container {
    flex-direction: column;
    gap: 10px;
  }

  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .post-details-content {
    flex-direction: column;
  }

  .post-info-wrapper {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .profile-cover-container {
    height: 150px;
    margin-top: -20px;
  }

  .post-info-wrapper {
    padding: var(--padding-small);
  }
}

/* Стили для модального окна оферты */
.offer-modal-content {
  text-align: center;
  padding: 40px;
  max-height: 70vh;
  overflow-y: auto;
}

.offer-text {
  text-align: left;
  margin: 20px 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.offer-text p, .offer-text li {
  margin-bottom: 15px;
}

.offer-text h3 {
  font-size: 1.5em;
  margin: 25px 0 15px;
  color: var(--text-primary);
}

.offer-text h4 {
  font-size: 1.3em;
  margin: 20px 0 12px;
  color: var(--text-primary);
}

.offer-text h5 {
  font-size: 1.1em;
  margin: 18px 0 10px;
  color: var(--text-primary);
}

.offer-text ol, .offer-text ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.modal-image {
  margin-bottom: 20px;
}

.modal-image img {
  max-width: 200px;
  height: auto;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
}

.modal-text h2 {
  font-size: 24px;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.load-more-button {
  grid-column: 1 / -1;
  padding: 12px 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  margin: 20px auto;
  transition: all 0.5s ease;
  opacity: 1;
  transform: translateY(0);
}

.load-more-button.hiding {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.load-more-button.appearing {
  opacity: 0;
  transform: translateY(-20px);
  animation: appear 0.5s ease forwards;
}

.post-video-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.post-video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* или cover, если нужно заполнить всю область */
}

@keyframes appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.load-more-button.loading {
  position: relative;
  color: transparent;
}

.load-more-button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Адаптивные стили для модального окна */
@media (max-width: 768px) {
  .modal-content {
    margin: 20% auto;
    width: 80%;
  }
  
  .offer-modal-content {
    padding: 20px;
  }
  
  .modal-image img {
    max-width: 150px;
  }
  
  .offer-text h3 {
    font-size: 1.3em;
  }
  
  .offer-text h4 {
    font-size: 1.1em;
  }
}


/* Бургер-меню */
.burger-menu {
  display: none;
}

.burger-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.burger-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
  margin: 5px 0;
  transition: all 0.3s ease;
}

.burger-content {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-darker);
  padding: 20px;
  z-index: 1000;
  border-top: 1px solid var(--border-color);
}

.burger-nav {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.burger-nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  padding: 10px;
  border-radius: var(--border-radius-small);
  transition: var(--transition);
}

.burger-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Анимация бургера при открытии */
.burger-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-toggle.active span:nth-child(2) {
  opacity: 0;
}

.burger-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Показываем бургер-меню на мобильных */
@media (max-width: 768px) {
  .burger-menu {
    display: block;
  }
  
  .burger-toggle {
    display: block;
  }
  
  .main-menu {
    display: none;
  }
  
  #auth-button-container {
    display: none;
  }
  
  #telegram-auth {
    display: none;
  }
  
  .burger-content.active {
    display: block;
  }
  
  #burger-auth {
    padding: 15px 0;
    margin-top: 10px;
  }
  
  #burger-auth .btn {
    width: 75%;
  }
}

/* Управление видимостью auth элементов */
.desktop-auth {
  display: block;
}

.mobile-auth {
  display: flex;
  justify-content: center;
}

@media (max-width: 768px) {
  .desktop-auth {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-auth {
    display: none !important;
  }
}



.music-control-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  margin-left: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-control-btn:hover {
  background: rgba(var(--secondary-rgb), 0.2);
  transform: scale(1.1);
}

.music-control-btn.active {
  color: var(--secondary-color);
  background: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.music-control-btn.muted {
  color: #666;
  opacity: 0.7;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Анимация пульсации при воспроизведении */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.music-control-btn.playing {
  animation: pulse 2s infinite;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .music-control-btn {
    margin-left: 5px;
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  
  #burger-music-control {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 5px 0;
    font-size: 16px;
  }
}


.post-action-btn.delete-btn {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.post-action-btn.delete-btn:hover {
  background: rgba(244, 67, 54, 0.3);
  border-color: rgba(244, 67, 54, 0.5);
}

.post-action-btn.delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(244, 67, 54, 0.1);
}


/* ============================================================
   ============================================================
   CIVITAI-STYLE LAYOUT (десктоп ≥1024px)
   sidebar + banner + featured + posts
   ============================================================
   ============================================================ */

@media (min-width: 1024px) {
  .profile-page {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-areas:
      "sidebar banner"
      "sidebar featured"
      "posts   posts";
    column-gap: 24px;
    row-gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 30px 60px;
    box-sizing: border-box;
    align-items: start;
  }

  /* Баннер */
  .profile-cover-container {
    grid-area: banner;
    width: 100% !important;
    height: 360px !important;
    margin: 0 !important;
    border-radius: 16px;
    top: 0 !important;
  }

  /* Контент-обертка делает grid прозрачным */
  .profile-content {
    display: contents;
  }

  /* Sidebar — НЕ прокручивается, разрастается под содержимое */
  .profile-info-container {
    grid-area: sidebar;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 16px;
    padding: 28px 20px;
    margin: 0 !important;
    height: auto !important;
    overflow: visible !important;
    gap: 14px !important;
    position: relative;
    align-self: start;
  }

  /* Угловые скобки sidebar */
  .profile-info-container::before,
  .profile-info-container::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: var(--primary-color);
    border-style: solid;
    opacity: 0.55;
    pointer-events: none;
    z-index: 3;
  }

  .profile-info-container::before {
    top: 8px; left: 8px;
    border-width: 2px 0 0 2px;
    border-radius: 4px 0 0 0;
  }

  .profile-info-container::after {
    bottom: 8px; right: 8px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 4px 0;
  }

  /* Аватар */
  .profile-avatar-outer-container {
    margin: 0 auto !important;
    position: relative;
  }

  .profile-avatar-container {
    width: 140px !important;
    height: 140px !important;
    border-radius: 50%;
    border: 3px solid var(--primary-color) !important;
    box-shadow: 0 0 24px rgba(var(--primary-rgb), 0.4),
                0 8px 20px rgba(0, 0, 0, 0.6) !important;
    overflow: hidden;
  }

  .profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Детали */
  .profile-details {
    flex: none !important;
    padding: 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .username-container {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
    width: 100%;
  }

  .profile-username {
    font-size: 24px !important;
    text-align: center;
    margin: 0 !important;
    line-height: 1.2;
    word-break: break-word;
  }

  .tokens-container {
    margin: 0 auto;
    font-size: 13px !important;
  }

  .bio-container {
    width: 100% !important;
    text-align: center;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px;
  }

  .profile-bio {
    text-align: center !important;
    margin: 0 !important;
    width: 100%;
    font-size: 13px;
    line-height: 1.5;
  }

  .bio-actions {
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .crown-toggle-btn {
    position: absolute;
    bottom: 0;
  }

  /* ============================================================
     SIDEBAR EXTRAS
     ============================================================ */

  .profile-action-btn {
    width: 100%;
    padding: 11px 16px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3);
  }

  .profile-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(var(--primary-rgb), 0.45);
  }

  .profile-action-btn.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    box-shadow: none;
  }

  .profile-action-btn.secondary:hover {
    background: rgba(var(--primary-rgb), 0.1);
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.25);
  }

  .profile-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
      transparent 0%,
      rgba(var(--primary-rgb), 0.3) 50%,
      transparent 100%);
    margin: 4px 0;
  }

  .profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .stat-card {
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    transition: all 0.25s;
  }

  .stat-card:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.12);
  }

  .stat-value {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
    line-height: 1;
    margin-bottom: 4px;
  }

  .stat-label {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  .profile-achievements-title {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary-color);
    opacity: 0.7;
    margin: 0;
    align-self: flex-start;
    width: 100%;
    text-align: left;
  }

  .profile-achievements-title::before {
    content: '// ';
    opacity: 0.6;
  }

  .achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
  }

  .achievement-badge {
    aspect-ratio: 1;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
  }

  .achievement-badge:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.15);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
  }

  .achievement-badge.locked {
    opacity: 0.3;
    filter: grayscale(1);
    cursor: not-allowed;
  }

  .achievement-badge.locked:hover {
    transform: none;
    box-shadow: none;
  }

  .achievement-badge[data-title]:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid var(--primary-color);
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
  }

  /* ============================================================
     БЛОК ИЗБРАННЫХ ПУБЛИКАЦИЙ (под баннером справа)
     ============================================================ */
  .profile-featured-section {
    grid-area: featured;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 14px;
    padding: 18px 20px;
    position: relative;
  }

  .profile-featured-section::before,
  .profile-featured-section::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--primary-color);
    border-style: solid;
    opacity: 0.45;
    pointer-events: none;
  }

  .profile-featured-section::before {
    top: 6px; left: 6px;
    border-width: 2px 0 0 2px;
    border-radius: 4px 0 0 0;
  }

  .profile-featured-section::after {
    bottom: 6px; right: 6px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 4px 0;
  }

  .featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
  }

  .featured-title {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
  }

  .featured-title::before {
    content: '// ';
    opacity: 0.6;
  }

  .featured-subtitle {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  .featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .featured-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    background: rgba(var(--primary-rgb), 0.04);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
  }

  .featured-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
  }

  .featured-item img,
  .featured-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Заглушка для пустого слота */
  .featured-item.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.04);
    border-style: dashed;
    cursor: default;
  }

  .featured-item.empty:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(var(--primary-rgb), 0.3);
  }

  .featured-item.empty::after {
    content: '∅';
    font-size: 24px;
    color: var(--primary-color);
    opacity: 0.3;
  }

  /* Иконка-индикатор "избранное" */
  .featured-item .featured-star {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: gold;
    backdrop-filter: blur(4px);
    z-index: 2;
    pointer-events: none;
  }

  .featured-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }

  .featured-empty-state::before {
    content: '∅';
    display: block;
    font-size: 28px;
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 8px;
    font-family: sans-serif;
  }

  /* ============================================================
     БЛОК ПОСТОВ — на всю ширину снизу
     ============================================================ */
  .profile-posts-section {
    grid-area: posts;
    width: 100%;
    margin-top: 10px;
  }

  .profile-tabs {
    justify-content: center !important;
    margin: 0 auto 24px !important;
  }

  .rating-selector {
    justify-content: center !important;
    margin: 0 auto 20px !important;
  }

  .upload-cover-btn {
    bottom: 16px !important;
    right: 16px !important;
  }
}

/* Очень широкие экраны — увеличиваем sidebar */
@media (min-width: 1600px) {
  .profile-page {
    grid-template-columns: 360px 1fr;
  }
}

/* ============================================================
   Sidebar extras + featured — только на десктопе
   ============================================================ */
.profile-sidebar-extras {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile-featured-section {
  display: none;
}

@media (min-width: 1024px) {
  .profile-sidebar-extras { display: flex; }
  .profile-featured-section { display: block; }
}

/* ============================================================
   УВЕЛИЧЕНИЕ ВКЛАДОК ПУБЛИКАЦИИ / ГЕНЕРАЦИИ
   ============================================================ */
.profile-tabs {
  gap: 6px !important;
  padding: 5px !important;
  border-radius: 36px !important;
}

.profile-tabs .tab-btn {
  padding: 14px 32px !important;
  font-size: 14px !important;
  letter-spacing: 0.6px;
  border-radius: 30px !important;
  font-weight: 700 !important;
}

@media (max-width: 768px) {
  .profile-tabs .tab-btn {
    padding: 11px 22px !important;
    font-size: 12px !important;
  }
}

/* ============================================================
   ИСПРАВЛЕНИЕ: canvas как настоящий фон
   ============================================================ */

/* Сам фон — на html, чтобы canvas мог поверх него рендериться */
html, body {
  background: var(--bg-gradient) !important;
}

body {
  background: transparent !important;
}

/* Canvas — фиксирован на весь viewport, под всем контентом */
#canvas-bg {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  opacity: 0.55;
  pointer-events: none;
}

/* Orbs — за canvas */
.bg-orbs {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1 !important;
  overflow: hidden;
  pointer-events: none;
}

/* Радар — еще глубже */
.background-radar { z-index: -2 !important; }

/* Body::before/::after звёздная пыль — еще глубже */
body::before, body::after { z-index: -3 !important; }

/* Весь контент должен быть НАД canvas */

.main-container,
.main-container-news,
.main-container-article,
.features-section,
.discover-section,
.footer,
.burger-menu {
  position: relative;
  z-index: 1;
}

/* Модалки и оверлеи остаются position: fixed (как в их собственных стилях) — только z-index */
.header { z-index: 1000 !important; }
.modal { z-index: 1500 !important; }
.modal-overlay { z-index: 1499 !important; }
.notifications-modal { z-index: 1600 !important; }
.model-modal-overlay { z-index: 2000 !important; }
.cookie-modal { z-index: 10000 !important; }
#page-loader { z-index: 9998 !important; }

/* ============================================================================
   ============================================================================
   ИЗБРАННЫЕ ПОСТЫ — звёздочка-кнопка на карточке поста
   Видна ТОЛЬКО на своём профиле (управляется JS, добавлением класса .is-owner)
   ============================================================================
   ============================================================================ */

.posts-grid {
  position: relative;
}

/* Звёздочка для пина (видна при ховере или если уже запинено) */
.post-card .pin-toggle-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 5;
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: scale(0.85);
}

/* Звёздочка появляется на ховер карточки */
.post-card:hover .pin-toggle-btn {
  opacity: 1;
  transform: scale(1);
}

.post-card .pin-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  color: gold;
  border-color: gold;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
  transform: scale(1.1);
}

/* Активное (закреплено) — золотое и всегда видимо */
.post-card .pin-toggle-btn.active {
  opacity: 1;
  transform: scale(1);
  color: gold;
  border-color: gold;
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
}

/* Звёздочка показывается только владельцу (контейнер posts-grid имеет класс is-owner) */
.posts-grid:not(.is-owner) .pin-toggle-btn,
#generations-container:not(.is-owner) .pin-toggle-btn {
  display: none !important;
}


/* ============================================================================
   ACHIEVEMENT TOOLTIP — плашка-описание при клике на достижение
   ============================================================================ */

.achievement-tooltip {
  position: absolute;
  z-index: 9999;
  min-width: 220px;
  max-width: 300px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.98));
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6),
              0 0 24px rgba(var(--primary-rgb), 0.3);
  backdrop-filter: blur(12px);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: tooltip-pop-in 0.18s ease-out;
}

@keyframes tooltip-pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.achievement-tooltip-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.5));
  flex-shrink: 0;
}

.achievement-tooltip-content {
  flex: 1;
  min-width: 0;
}

.achievement-tooltip-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-color);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.achievement-tooltip-description {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

/* Стрелка-указатель к иконке */
.achievement-tooltip::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(0, 0, 0, 0.96);
  border-left: 1px solid var(--primary-color);
  border-top: 1px solid var(--primary-color);
}

/* Если tooltip выше своей цели — стрелка снизу */
.achievement-tooltip.position-top::before {
  top: auto;
  bottom: -7px;
  border-left: none;
  border-top: none;
  border-right: 1px solid var(--primary-color);
  border-bottom: 1px solid var(--primary-color);
}


/* ============================================================================
   THEME PICKER — модалка выбора темы
   ============================================================================ */

.theme-picker-container {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.98));
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: 16px;
  padding: 28px;
  max-width: 520px;
  width: 90%;
  margin: auto;
  position: relative;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(var(--primary-rgb), 0.15);
}

.theme-picker-title {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: 0.3px;
}

.theme-picker-title::before {
  content: '// ';
  font-family: 'Courier New', monospace;
  -webkit-text-fill-color: var(--primary-color);
  opacity: 0.5;
}

.theme-picker-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin: 0 0 20px;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(var(--primary-rgb), 0.3);
  transform: translateY(-2px);
}

.theme-option.active {
  border-color: var(--primary-color);
  background: rgba(var(--primary-rgb), 0.08);
  box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.3);
}

.theme-option.active::after {
  content: '✓';
  position: absolute;
  margin-top: 0;
  color: var(--primary-color);
  font-size: 14px;
}

.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s;
}

.theme-option:hover .theme-swatch {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
}

/* Цвета swatch-ей */
.theme-swatch-default {
  background: linear-gradient(135deg, #3ec049, #30edae);
}
.theme-swatch-red    { background: linear-gradient(135deg, #e53e3e, #ff8a8a); }
.theme-swatch-orange { background: linear-gradient(135deg, #ed8936, #ffd089); }
.theme-swatch-yellow { background: linear-gradient(135deg, #ecc94b, #fff3a3); }
.theme-swatch-green  { background: linear-gradient(135deg, #3ec049, #30edae); }
.theme-swatch-blue   { background: linear-gradient(135deg, #3081ed, #45f3ff); }
.theme-swatch-purple { background: linear-gradient(135deg, #9f5ce0, #d48cff); }
.theme-swatch-pink   { background: linear-gradient(135deg, #ed64a6, #ffa3d1); }
.theme-swatch-white  { background: linear-gradient(135deg, #ffffff, #c8c8c8); }
.theme-swatch-dark   { background: linear-gradient(135deg, #94a3b8, #cbd5e1); }


/* ============================================================================
   FEATURED-GRID — клик-меню "Открепить" на закреплённой публикации
   (видно владельцу при ховере)
   ============================================================================ */

.featured-item.pinned {
  position: relative;
}

.featured-item .featured-unpin-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 3;
}

.profile-featured-section.is-owner .featured-item:hover .featured-unpin-btn {
  display: flex;
}

.featured-item .featured-unpin-btn:hover {
  background: rgba(220, 38, 38, 0.85);
  border-color: rgba(220, 38, 38, 1);
  transform: scale(1.1);
}


/* Адаптация модалки темы под мобильные */
@media (max-width: 600px) {
  .theme-picker-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .theme-picker-container {
    padding: 20px;
  }
  .theme-swatch {
    width: 36px;
    height: 36px;
  }
}


/* ============================================================
   AUTH-MODAL — редизайн (логин/пароль + Telegram)
   Те же стили что в stylesGallery/styles — для согласованного вида
   ============================================================ */

.auth-modal-redesign {
  max-width: 440px !important;
  border: 1px solid rgba(var(--primary-rgb), 0.25) !important;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.98)) !important;
  backdrop-filter: blur(16px) saturate(180%);
}

.auth-modal-logo {
  text-align: center;
  margin-bottom: 20px;
}

.auth-modal-logo img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  margin-bottom: 10px;
  box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

.auth-modal-logo h2 {
  font-size: 22px;
  color: white;
  margin: 0 0 5px;
}

.logo-accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 30px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 9px 16px;
  border: none;
  border-radius: 26px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-tab.active {
  background: var(--gradient);
  color: white;
}

.auth-tab-content {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.auth-tab-content.active {
  display: flex;
}

.auth-input {
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 15px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.auth-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.2);
}

.auth-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
  text-align: center;
}

.auth-error {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #ff7070;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 600px) {
  .auth-modal-redesign {
    max-width: 92vw !important;
  }
}

/* ФИКС ХУЙНИ НА ТЕЛЕФОНАЗ */
html {
  background-color: var(--bg-darker);  /* solid подложка */
  background-image: var(--bg-gradient);
  color-scheme: dark;                   /* тёмный overscroll/scrollbar */
}

body {
  background-color: var(--bg-darker);  /* такая же подложка на body */
  background-image: var(--bg-gradient);
  min-height: 100vh;                    /* чтобы body всегда покрывал viewport */
  /* НЕТ background-attachment: fixed на мобильных */
}

@media (hover: hover) and (pointer: fine) {
  html, body {
    background-attachment: fixed;  /* возвращаем только для десктопа */
  }
}

@media (max-width: 768px) {
#canvas-bg {
display: none;
animation: none;
}
}