/* CSS Переменные для централизованного управления */
:root {
  /* Цвета */
  --color-primary: #008080;
  --color-primary-hover: #00bfff;
  --color-text: #fff;
  --color-text-muted: #aaa;
  --color-bg-dark: rgba(0, 0, 0, 0.4);
  
  /* Размеры */
  --border-radius-sm: 8px;
  --border-radius-md: 15px;
  --border-radius-lg: 20px;
  --spacing-xs: 5px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 30px;
  
  /* Переходы */
  --transition-fast: 0.25s ease;
  --transition-smooth: 0.3s ease;
  
  /* Z-index слои (упорядоченные) */
  --z-base: 0;
  --z-content: 13;
  --z-controls: 1000;
  --z-tooltips: 2000;
  --z-cursor-tail: 99997;
  --z-cursor-dot: 99998;
  --z-loading: 9999;
  
  /* Тени */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 12px;
}

/* Общие сбросы */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  /* Оптимизация для тач-устройств */
  -webkit-tap-highlight-color: rgba(0, 191, 255, 0.2);
  -webkit-touch-callout: none;
}

/* Улучшенная прокрутка для мобильных */
html {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Черный экран перехода - скрыт по умолчанию */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 1.5s;
}

/* Показываем черный экран при переходе - ПЛАВНО */
body.transitioning::before {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

/* Скрываем черный экран */
body.loaded::before {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 1.5s;
}

/* Основной фон */
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: var(--color-text);
  text-align: center;
  overflow-x: hidden;
  background: linear-gradient(270deg, #0a0a0a, #001f3f, #0a0a0a);
  background-size: 600% 600%;
  animation: gradientShift 20s ease infinite;
}

/* Динамический фон (задается через JS или напрямую) */
body.bg-image {
  background: url('../repository/back/back1.jpg') center/cover no-repeat;
  background-attachment: fixed;
  position: relative;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Анимация появления - отключена для ручного запуска через splash screen */
.container, .card, h1, .subtitle, .socials, #visit-counter {
  /* Оптимизация анимации */
  will-change: opacity, transform;
}

@keyframes fadeInScale {
  0% { 
    opacity: 0; 
    transform: scale(0.7);
    visibility: visible;
  }
  60% { 
    opacity: 0.7; 
    transform: scale(1);
    visibility: visible;
  }
  100% { 
    opacity: 1; 
    transform: scale(1);
    visibility: visible;
  }
}

/* Контейнер */
.container {
  backdrop-filter: blur(3px);
  background: var(--color-bg-dark);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-md);
  z-index: 10003; /* Выше партиклов (10001) */
  position: relative;
  /* Оптимизация */
  transform: translateZ(0);
}

/* Карточки с Glassmorphism */
.card {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm) 15px;
  margin: var(--spacing-sm) 0;
  transition: 
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  transform-style: preserve-3d;
  overflow: hidden;
  /* Оптимизация */
  will-change: transform;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,191,255,0.15), rgba(0,128,128,0.15));
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.card:hover {
  transform: perspective(1000px) translateY(-8px) rotateX(2deg) scale(1.03);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 191, 255, 0.2);
}

.card:hover::before {
  opacity: 1;
}

.card > * {
  position: relative;
  z-index: 1;
}

/* Скрываем все элементы до входа */
.container.before-enter .card,
.container.before-enter h1,
.container.before-enter .subtitle,
.container.before-enter .socials {
  opacity: 0;
  transform: scale(0.9);
  visibility: hidden;
}

/* Аватар скрываем без блокировки анимации */
.container.before-enter .avatar {
  opacity: 0;
  visibility: hidden;
}

.card.main-card {
  flex-direction: column;
  gap: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 191, 255, 0.3);
  border-radius: 18px;
  padding: var(--spacing-md);
  box-shadow: 0 8px 32px rgba(0, 191, 255, 0.15);
  overflow: visible;
  position: relative;
  transform-style: preserve-3d;
  transition: 
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Градиент для главной карточки */
.card.main-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.1), rgba(0, 128, 128, 0.1));
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  border-radius: 18px;
  z-index: 0;
}

.card.main-card:hover::before {
  opacity: 1;
}

/* Содержимое поверх градиента */
.card.main-card > * {
  position: relative;
  z-index: 1;
}

.card.main-card:hover {
  transform: perspective(1000px) translateY(-5px) scale(1.01);
  box-shadow: 0 12px 40px rgba(0, 191, 255, 0.25);
}

/* Заголовки с неоновым свечением */
h1 { 
  font-size: 28px; 
  font-weight: 600; 
  margin-bottom: 5px;
  text-shadow: 
    0 0 10px rgba(0,191,255,0.6),
    0 0 20px rgba(0,191,255,0.4),
    0 0 30px rgba(0,191,255,0.2),
    0 0 40px rgba(0,128,128,0.1);
}

/* Анимация свечения только после входа */
.container.entering h1 {
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(0,191,255,0.6), 0 0 20px rgba(0,191,255,0.4), 0 0 30px rgba(0,191,255,0.2); }
  50% { text-shadow: 0 0 15px rgba(0,191,255,0.8), 0 0 25px rgba(0,191,255,0.5), 0 0 35px rgba(0,191,255,0.3); }
}

.subtitle { 
  font-size: 16px; 
  opacity: 0.7; 
  margin-bottom: var(--spacing-md); 
}

.main-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.main-card .subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}

/* Аватары с плавающей анимацией */
.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(0,191,255,0.5);
  margin-bottom: 15px;
  transition: 
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 0 20px rgba(0,191,255,0.4),
    0 0 40px rgba(0,191,255,0.2);
  animation: smoothFloat 4s ease-in-out infinite;
}

@keyframes smoothFloat {
  0%, 100% { 
    transform: translateY(0px);
  }
  50% { 
    transform: translateY(-15px);
  }
}

.avatar:hover { 
  animation: smoothFloatHover 4s ease-in-out infinite;
  box-shadow: 
    0 0 30px rgba(0,191,255,0.6),
    0 0 60px rgba(0,191,255,0.3),
    0 10px 30px rgba(0,0,0,0.4);
  will-change: transform;
}

@keyframes smoothFloatHover {
  0%, 100% { 
    transform: translateY(0px) scale(1.1) rotate(5deg);
  }
  50% { 
    transform: translateY(-15px) scale(1.1) rotate(5deg);
  }
}

.discord-left .avatar-small {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  transition: transform 0.3s ease;
}

.discord-left .avatar-small:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(128,128,128,0.6);
}

/* Скиллы с прогрессивной анимацией */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  justify-content: center;
}

.skills li {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #ddd;
  transition: 
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
  opacity: 1;
}

/* Скрываем skills до входа */
.container.before-enter .skills li {
  opacity: 0;
  transform: translateY(20px);
}

/* Мгновенное появление skills без анимации */
.container.entering .skills li {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.skills li a {
  color: inherit;
  text-decoration: none;
}

.skills li:hover {
  background: rgba(0,191,255,0.2);
  border-color: rgba(0,191,255,0.5);
  color: var(--color-primary-hover);
  transform: scale(1.15) translateY(-3px);
  box-shadow: 
    0 0 15px rgba(0,191,255,0.6),
    0 5px 20px rgba(0,191,255,0.3);
  text-shadow: 0 0 10px rgba(0,191,255,0.8);
}

/* Discord карточка с glassmorphism */
.discord-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(114, 137, 218, 0.3);
  border-radius: 18px;
  padding: 16px var(--spacing-md);
  box-shadow: 0 8px 32px rgba(114, 137, 218, 0.15);
  overflow: visible;
  position: relative;
  transform-style: preserve-3d;
  transition: 
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Плавное появление Discord карточки */
.container.entering .discord-card {
  animation: smoothFadeInUp 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.11s;
}

@keyframes smoothFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Градиент для Discord карточки */
.discord-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(114, 137, 218, 0.1), rgba(88, 101, 242, 0.1));
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  border-radius: 18px;
  z-index: 0;
}

.discord-card:hover::before {
  opacity: 1;
}

.discord-card:hover {
  transform: perspective(1000px) translateY(-5px) scale(1.01);
  box-shadow: 0 12px 40px rgba(114, 137, 218, 0.25);
}

/* Содержимое поверх градиента */
.discord-card > * {
  position: relative;
  z-index: 1;
}

.discord-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 2;
  margin-top: 25px;
}

#discord-username {
  font-size: 22px;
  font-weight: 700;
}

#discord-status {
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* Статусы Discord с пульсацией */
.status-online { 
  color: #43b581; 
  text-shadow: 0 0 6px rgba(67,181,129,0.6);
}

.status-idle { color: #faa61a; text-shadow: 0 0 6px rgba(250,166,26,0.6); }

.status-dnd { color: #f04747; text-shadow: 0 0 6px rgba(240,71,71,0.6); }

.status-offline { color: #747f8d; text-shadow: 0 0 6px rgba(116,127,141,0.4); }

/* Бейджи */
.badges {
  display: flex;
  gap: 8px;
  margin-left: 5px;
  align-items: center;
  position: relative;
  z-index: 10001; /* Выше всех элементов */
}

.badge {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  padding: 4px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 10002; /* Выше контейнера badges */
}

.badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.badge:hover {
  transform: scale(1.1);
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

.badge::after {
  content: attr(data-title);
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: linear-gradient(135deg, rgba(0,0,0,0.95), rgba(20,20,40,0.95));
  border: 1px solid rgba(0,191,255,0.3);
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.8),
    0 0 10px rgba(0,191,255,0.2);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 10003;
}

.badge::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  border: 8px solid transparent;
  border-bottom-color: rgba(0,0,0,0.95);
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 10003; /* Максимальный z-index */
}

.badge:hover::after,
.badge:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Соцсети */
.socials {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: var(--spacing-md);
}

.socials a {
}

.socials img {
width: 36px;
height: 36px;
transition: 
transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
filter: grayscale(0.3);
}

.socials a:nth-child(1) img:hover {
/* Spotify - зеленый */
transform: scale(1.2) rotate(5deg);
filter: drop-shadow(0 0 15px #1DB954) grayscale(0);
}

.socials a:nth-child(2) img:hover {
/* Discord - синий */
transform: scale(1.2) rotate(-5deg);
filter: drop-shadow(0 0 15px #5865F2) grayscale(0);
}

.socials a:nth-child(3) img:hover {
/* Telegram - голубой */
transform: scale(1.2) rotate(5deg);
filter: drop-shadow(0 0 15px #0088cc) grayscale(0);
}

/* Счетчик посещений */
#visit-counter {
position: fixed;
bottom: 25px;
right: 25px;
backdrop-filter: blur(6px);
background: var(--color-bg-dark);
color: var(--color-primary);
font-weight: 600;
font-size: 16px;
padding: var(--spacing-md) 25px;
border-radius: var(--border-radius-lg);
box-shadow: var(--shadow-md);
z-index: var(--z-controls);
transition: 
transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
/* Оптимизация */
will-change: transform;
}

#visit-counter:hover {
transform: scale(1.1);
box-shadow: var(--shadow-glow) rgba(0,128,128,0.4);
}

/* Музыкальный плеер - минималистичный */
#music-player {
  position: fixed;
  bottom: 15px;
  left: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 35px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  z-index: var(--z-controls);
  transition: all 0.3s ease;
}

#music-player:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 191, 255, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7),
    0 0 15px rgba(0, 191, 255, 0.2);
}

.player-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

/* Ripple эффект */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 191, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

.player-btn:hover {
  color: #00bfff;
  transform: scale(1.15);
}

.player-btn:active {
  transform: scale(0.85);
  transition-duration: 0.1s;
}

.player-btn svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.player-btn img {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  filter: brightness(0.9);
  transition: all 0.2s ease;
  pointer-events: none;
}

.play-btn {
  width: 42px;
  height: 42px;
  background: transparent;
  border: none;
  position: relative;
}

.play-btn svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 4px rgba(0, 191, 255, 0.5));
}

.play-btn:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(0, 191, 255, 0.8));
}

.play-btn:active svg {
  transform: scale(0.9);
}

.play-icon,
.pause-icon {
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.play-icon.hiding,
.pause-icon.hiding {
  opacity: 0;
  transform: scale(0.3) rotate(180deg);
}

.play-icon.showing,
.pause-icon.showing {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

@keyframes playGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(0, 191, 255, 0.5)); }
  50% { filter: drop-shadow(0 0 10px rgba(0, 191, 255, 1)); }
}

.play-btn:hover .play-icon {
  animation: playGlow 1.5s ease-in-out infinite;
}

@keyframes pauseShift {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.8); }
}

.play-btn:hover .pause-icon rect {
  animation: pauseShift 0.6s ease-in-out infinite;
}

.play-btn:hover .pause-icon rect:first-child {
  animation-delay: 0s;
}

.play-btn:hover .pause-icon rect:last-child {
  animation-delay: 0.3s;
}

.prev-icon,
.next-icon {
  font-size: 16px;
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.volume-slider {
  width: 0;
  height: 4px;
  opacity: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  background: linear-gradient(90deg, 
    #00bfff 0%, 
    #008080 50%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.2) 100%);
  background-size: 200% 100%;
  background-position: right;
  border-radius: 4px;
  outline: none;
  transition-timing-function: ease-out;
}

.volume-control:hover .volume-slider {
  width: 80px;
  opacity: 1;
  transition-timing-function: ease-in;
}

.volume-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: transparent;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00bfff;
  box-shadow: 0 0 6px rgba(0, 191, 255, 0.5);
  margin-top: -4px;
  transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.7);
}

.volume-slider::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
}

.volume-slider::-moz-range-progress {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #00bfff 0%, #008080 100%);
  border: none;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00bfff;
  box-shadow: 0 0 6px rgba(0, 191, 255, 0.5);
  border: none;
  transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.7);
}

/* ==================== МЕДИА-ЗАПРОСЫ ==================== */

/* Планшеты и небольшие экраны */
@media (max-width: 768px) {
  .container {
    max-width: 95%;
    padding: var(--spacing-md);
  }
  
  /* Увеличенные области клика для планшетов */
  .card {
    padding: 15px;
    margin: 15px 0;
  }
  
  .skills li {
    padding: 8px 14px;
    font-size: 15px;
  }
  
  #visit-counter {
    bottom: 15px;
    right: 15px;
    padding: 15px var(--spacing-md);
    font-size: 14px;
  }
  
  .badge {
    width: 24px;
    height: 24px;
    padding: 5px;
  }
  
  /* Оптимизация splash screen */
  .splash-title {
    font-size: 48px;
  }
  
  .splash-subtitle {
    font-size: 16px;
  }
  
  #enter-btn {
    padding: 14px 32px;
    font-size: 17px;
  }
}

/* Мобильные устройства */
@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }
  
  .container {
    width: 92%;
    padding: 18px 16px;
    margin-bottom: 90px; /* Отступ снизу чтобы контент не перекрывался */
    border-radius: 16px;
  }
  
  h1 {
    font-size: 26px;
    margin-bottom: 8px;
  }
  
  .subtitle {
    font-size: 15px;
    margin-bottom: 16px;
  }
  
  /* Карточки с увеличенными областями */
  .card {
    padding: 14px;
    margin: 14px 0;
    border-radius: 14px;
  }
  
  .card.main-card {
    padding: 18px;
    border-radius: 16px;
  }
  
  /* Упрощенные анимации на мобильных */
  .avatar {
    width: 110px;
    height: 110px;
    animation: smoothFloat 6s ease-in-out infinite; /* Медленнее для производительности */
    margin-bottom: 18px;
  }

  /* Отключение 3D трансформаций на мобильных, активация по тапу */
  .card:active {
    transform: translateY(-3px) scale(0.98);
  }

  .card.main-card:active {
    transform: translateY(-3px) scale(0.98);
  }
  
  /* Убираем hover эффекты на мобильных */
  .card:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.05);
  }

  .card.main-card:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.05);
  }
  
  /* Discord карточка на мобильных */
  .discord-left .avatar-small {
    width: 75px;
    height: 75px;
    border-radius: 12px;
  }
  
  .discord-info {
    margin-top: 18px;
  }
  
  #discord-username {
    font-size: 20px;
  }
  
  #discord-status {
    font-size: 14px;
  }
  
  /* Музыкальный плеер на мобильных - увеличенные кнопки для тача */
  #music-player {
    bottom: 12px;
    left: 12px;
    padding: 10px 14px;
    gap: 10px;
    border-radius: 45px;
  }
  
  .player-btn {
    width: 44px;
    height: 44px;
    /* Увеличенная область тапа */
  }
  
  .play-btn {
    width: 48px;
    height: 48px;
  }
  
  .player-btn svg,
  .player-btn img {
    width: 20px;
    height: 20px;
  }
  
  .play-btn svg,
  .play-btn img {
    width: 24px;
    height: 24px;
  }
  
  /* Активное состояние для тач-устройств */
  .player-btn:active {
    transform: scale(0.9);
  }
  
  .prev-icon,
  .next-icon {
    font-size: 16px;
  }
  
  /* Скрываем контроль громкости на мобильных */
  .volume-control {
    display: none;
  }
  
  /* Счетчик посещений на мобильных */
  #visit-counter {
    bottom: 8px;
    right: 8px;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 14px;
  }
  
  /* Соцсети - увеличенные иконки для тача */
  .socials {
    gap: 22px;
    margin-top: 18px;
  }
  
  .socials img {
    width: 38px;
    height: 38px;
  }
  
  /* Активное состояние для соцсетей */
  .socials a:active img {
    transform: scale(0.95);
  }
  
  /* Увеличенные бейджи Discord на мобильных */
  .badge {
    width: 32px;
    height: 32px;
    padding: 6px;
  }
  
  .badges {
    gap: 8px;
    flex-wrap: wrap;
  }
  
  /* Skills - увеличенные для тача */
  .skills li {
    padding: 10px 16px;
    font-size: 15px;
    margin: 4px;
  }
  
  .skills li:active {
    transform: scale(0.95);
  }
  
  /* Discord карточка */
  .discord-card {
    padding: 16px;
    gap: 14px;
  }
  
  /* Splash screen для мобильных */
  .splash-title {
    font-size: 40px;
    margin-bottom: 10px;
  }
  
  .splash-subtitle {
    font-size: 15px;
    margin-bottom: 24px;
  }
  
  #enter-btn {
    padding: 16px 36px;
    font-size: 18px;
    min-width: 200px;
  }
}

/* Уменьшение анимаций для пользователей с prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  body {
    animation: none;
  }
  
  .container, .card, h1, .subtitle, .socials, #visit-counter {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}

/* Splash Screen - стартовый экран */
#splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 20, 40, 0.98), rgba(0, 10, 20, 0.99));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  animation: splashFadeIn 1.2s ease forwards;
  opacity: 0;
  position: relative;
  z-index: 10002;
}

@keyframes splashFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.splash-title {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #00bfff, #008080);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  animation: splashGlow 2s ease-in-out infinite;
}

@keyframes splashGlow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(0, 191, 255, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(0, 191, 255, 0.5));
  }
}

.splash-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  font-weight: 400;
}

.enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 191, 255, 0.3);
  border-radius: 50px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 191, 255, 0.2);
}

.enter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(0, 128, 128, 0.2));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.enter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 191, 255, 0.6);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 12px 48px rgba(0, 191, 255, 0.3),
    0 0 60px rgba(0, 191, 255, 0.2);
}

.enter-btn:hover::before {
  opacity: 1;
}

.enter-btn:active {
  transform: translateY(-1px) scale(1.02);
}

.enter-btn span,
.enter-btn .enter-icon {
  position: relative;
  z-index: 1;
}

.enter-icon {
  transition: transform 0.4s ease;
}

.enter-btn:hover .enter-icon {
  transform: translateX(5px);
}

/* Скрытие контента до входа */
.container.before-enter {
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  visibility: hidden;
}

/* Плавное появление контейнера */
.container.entering {
  animation: smoothFadeIn 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: auto;
}

@keyframes smoothFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
    visibility: visible;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
  }
}

/* Плавное появление внутренних элементов с задержкой */
.container.entering .avatar {
  opacity: 0;
  visibility: hidden;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.2s;
}

.container.entering h1 {
  opacity: 0;
  visibility: hidden;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.05s;
}

.container.entering .subtitle {
  opacity: 0;
  visibility: hidden;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.08s;
}

.container.entering .card {
  opacity: 0;
  visibility: hidden;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.11s;
}

.container.entering .socials {
  opacity: 0;
  visibility: hidden;
  animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.14s;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
    visibility: visible;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

#music-player.before-enter,
#visit-counter.before-enter {
  opacity: 0 !important;
  transform: scale(0.9) !important;
  pointer-events: none;
  visibility: hidden;
}

/* Плавное появление плеера и счетчика */
#music-player.entering {
  opacity: 0;
  visibility: hidden;
  animation: fadeInScale 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.17s;
  pointer-events: auto;
}

#visit-counter.entering {
  opacity: 0;
  visibility: hidden;
  animation: fadeInScale 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.2s;
  pointer-events: auto;
}

@keyframes playerFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
    visibility: visible;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
  }
}

/* Плавные переходы для дополнительных страниц */
.stars-container.before-enter,
.webdev-container.before-enter,
.blockbench-container.before-enter {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  pointer-events: none;
  visibility: hidden;
}

.stars-container.entering,
.webdev-container.entering,
.blockbench-container.entering {
  animation: smoothPageFadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: auto;
}

@keyframes smoothPageFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    visibility: visible;
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
  }
}

/* Анимация внутренних элементов дополнительных страниц */
.stars-container.entering .page-title,
.webdev-container.entering .page-title,
.blockbench-container.entering .page-title {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.1s;
}

.stars-container.entering .page-subtitle,
.webdev-container.entering .page-subtitle,
.blockbench-container.entering .page-subtitle {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.15s;
}

.stars-container.entering .top-nav,
.stars-container.entering .nav-btn {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.05s;
}

.stars-container.entering .stars-grid,
.webdev-container.entering .services-grid,
.blockbench-container.entering .models-grid {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.2s;
}

.stars-container.entering .order-section,
.webdev-container.entering .info-section,
.webdev-container.entering .contact-section,
.blockbench-container.entering .info-section,
.blockbench-container.entering .contact-section {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.25s;
}

.stars-container.entering .back-btn,
.webdev-container.entering .back-btn,
.blockbench-container.entering .back-btn {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards 0.3s;
}