/**
 * КриптоМир - Основные стили
 * Современный редизайн с продвинутыми анимациями и эффектами
 */

:root {
  /* Основная цветовая палитра - современные оттенки */
  --color-primary: #4361ee;
  --color-secondary: #3a86ff;
  --color-success: #38b000;
  --color-warning: #ffbe0b;
  --color-danger: #ff006e;
  --color-white: #ffffff;
  --color-dark: #121212;
  --color-gray: #333333;
  --color-light-gray: #555555;

  /* Фоны и градиенты */
  --background-dark: rgba(18, 18, 18, 0.95);
  --background-card: rgba(34, 34, 34, 0.8);
  --gradient-primary: linear-gradient(135deg, #4361ee, #3a86ff);
  --gradient-success: linear-gradient(135deg, #38b000, #80b918);
  --gradient-danger: linear-gradient(135deg, #ff006e, #ff5e78);
  --gradient-warning: linear-gradient(135deg, #ffbe0b, #fb8500);
  --gradient-dark: linear-gradient(135deg, #121212, #232323);

  /* Тени и эффекты */
  --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.2);
  --shadow-button: 0 6px 12px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.3);
  --transition-default: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Скругления */
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --border-radius-circle: 50%;

  /* Неоновые эффекты */
  --neon-blue: 0 0 10px rgba(67, 97, 238, 0.7), 0 0 20px rgba(67, 97, 238, 0.5);
  --neon-green: 0 0 10px rgba(56, 176, 0, 0.7), 0 0 20px rgba(56, 176, 0, 0.5);
  --neon-red: 0 0 10px rgba(255, 0, 110, 0.7), 0 0 20px rgba(255, 0, 110, 0.5);
  --neon-yellow: 0 0 10px rgba(255, 190, 11, 0.7), 0 0 20px rgba(255, 190, 11, 0.5);
}

/* Основные стили для тела документа */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--color-dark);
  color: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Основная область клика - монета */
.click-area {
  width: 250px;
  height: 250px;
  border-radius: var(--border-radius-circle);
  display: inline-block;
  cursor: pointer;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
  background-size: cover;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  will-change: transform;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Эффект нажатия на монету */
.click-area:active {
  transform: scale(1.05);
}

/* Эффект свечения при наведении */
.click-area:hover {
  box-shadow: var(--neon-blue);
}

/* Эффект волны при клике */
.ripple {
  position: absolute;
  border-radius: var(--border-radius-circle);
  transform: scale(0);
  animation: ripple 0.8s cubic-bezier(0.11, 0.65, 0.33, 1);
  background-color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Стили для активной навигации */
.footer-bar-6 .active-nav em {
    position: fixed;
    background-image: none !important;
    background: none;
}

.mactive {
  border-bottom: 3px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  background: rgba(67, 97, 238, 0.15);
  transition: var(--transition-default);
  box-shadow: var(--neon-blue);
}

/* Игровая область */
#game-area {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  margin-bottom: -110px;
  background-color: var(--color-dark);
}

/* Звездное небо для фона игры */
.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  opacity: 0.5;
  animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Падающие предметы в игре */
.item {
  position: absolute;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
  z-index: 10;
}

/* Классы для разных типов предметов */
.item.score {
  animation: fall 3s cubic-bezier(0.4, 0, 0.2, 1) forwards, rotate 3s linear infinite, glow 2s infinite;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
}

.item.freeze {
  animation: fall 3.5s cubic-bezier(0.4, 0, 0.2, 1) forwards, spin 3s infinite;
  filter: drop-shadow(0 0 15px rgba(58, 134, 255, 0.8));
}

.item.bomb {
  animation: fall 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards, bounce 1s infinite;
  filter: drop-shadow(0 0 15px rgba(255, 0, 110, 0.8));
}

.item.bonus {
  animation: fall 4s cubic-bezier(0.4, 0, 0.2, 1) forwards, spin 2s infinite, glow-gold 1.5s infinite;
  filter: drop-shadow(0 0 20px rgba(255, 190, 11, 0.9));
}

.item.magnet {
  animation: fall 3.2s cubic-bezier(0.4, 0, 0.2, 1) forwards, pulse 1.5s infinite;
  filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.8));
}

.item.multiplier {
  animation: fall 3.8s cubic-bezier(0.4, 0, 0.2, 1) forwards, rotate 2s linear infinite, glow-rainbow 2s infinite;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
}

/* Увеличенные предметы */
.item.enlarged {
  width: 75px;
  height: 75px;
  filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.4));
}

/* Табло счета */
.scoreboard {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 18px;
  z-index: 100;
  background: rgba(18, 18, 18, 0.7);
  color: var(--color-white);
  padding: 15px 20px;
  border-radius: var(--border-radius-md);
  margin-top: 10px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  min-width: 150px;
}

.scoreboard.pulse-bg {
  animation: pulse-bg 0.5s infinite;
  border: 1px solid rgba(58, 134, 255, 0.5);
  box-shadow: var(--neon-blue);
}

/* Комбо-счетчик */
.combo-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  z-index: 100;
  background: rgba(18, 18, 18, 0.7);
  color: var(--color-white);
  padding: 15px 20px;
  border-radius: var(--border-radius-md);
  margin-top: 10px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  display: none;
  min-width: 150px;
  text-align: center;
}

.combo-counter.active {
  display: block;
}

.combo-counter.level-1 {
  border-color: rgba(58, 134, 255, 0.5);
  box-shadow: var(--neon-blue);
}

.combo-counter.level-2 {
  border-color: rgba(138, 43, 226, 0.5);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.7), 0 0 20px rgba(138, 43, 226, 0.5);
}

.combo-counter.level-3 {
  border-color: rgba(255, 190, 11, 0.5);
  box-shadow: var(--neon-yellow);
}

/* Индикатор уровня */
.level-indicator {
  position: absolute;
  top: 80px;
  left: 10px;
  font-size: 16px;
  z-index: 100;
  background: rgba(18, 18, 18, 0.7);
  color: var(--color-white);
  padding: 10px 15px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  min-width: 100px;
}

/* Сообщение об окончании игры */
.endgame-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: none;
  z-index: 1000;
  background: rgba(18, 18, 18, 0.9);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 300px;
  animation: fadeIn 0.5s ease-out;
}

.endgame-message h1 {
  font-size: 36px;
  margin: 0 0 20px;
  color: var(--color-white);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  background: linear-gradient(to right, #4361ee, #3a86ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.endgame-message p {
  margin: 10px 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
}

.endgame-message p strong {
  color: #ffbe0b;
  font-weight: 700;
}

.endgame-message button {
  font-size: 18px;
  padding: 15px 30px;
  margin-top: 20px;
  cursor: pointer;
  background: var(--gradient-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-button);
  transition: var(--transition-bounce);
  font-weight: 600;
}

.endgame-message button:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.endgame-message .stats {
  margin: 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
}

/* Оверлеи для игры */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none;
  backdrop-filter: blur(5px);
}

.freeze-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(58, 134, 255, 0.2), rgba(67, 97, 238, 0.5));
  z-index: 500;
  pointer-events: none;
  display: none;
  animation: pulse 2s infinite;
  backdrop-filter: blur(4px);
}

/* Анимации пульсации */
@keyframes pulse {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 0.2;
  }
}

@keyframes pulse-bg {
  0% {
    background-color: rgba(58, 134, 255, 0.3);
  }
  50% {
    background-color: rgba(58, 134, 255, 0.6);
  }
  100% {
    background-color: rgba(58, 134, 255, 0.3);
  }
}

/* Анимации вспышек */
@keyframes flash-red {
  0% {
    background-color: rgba(255, 0, 110, 0.7);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.7);
  }
  100% {
    background-color: rgba(255, 0, 110, 0);
    box-shadow: 0 0 0px rgba(255, 0, 110, 0);
  }
}

.flash-red {
  animation: flash-red 0.5s cubic-bezier(0.11, 0, 0.5, 0);
}

@keyframes flash-green {
  0% {
    background-color: rgba(56, 176, 0, 0.5);
    box-shadow: 0 0 30px rgba(56, 176, 0, 0.5);
  }
  100% {
    background-color: rgba(56, 176, 0, 0);
    box-shadow: 0 0 0px rgba(56, 176, 0, 0);
  }
}

.flash-green {
  animation: flash-green 0.5s cubic-bezier(0.11, 0, 0.5, 0);
}

@keyframes flash-blue {
  0% {
    background-color: rgba(58, 134, 255, 0.5);
    box-shadow: 0 0 30px rgba(58, 134, 255, 0.5);
  }
  100% {
    background-color: rgba(58, 134, 255, 0);
    box-shadow: 0 0 0px rgba(58, 134, 255, 0);
  }
}

.flash-blue {
  animation: flash-blue 0.5s cubic-bezier(0.11, 0, 0.5, 0);
}

@keyframes flash-gold {
  0% {
    background-color: rgba(255, 190, 11, 0.5);
    box-shadow: 0 0 30px rgba(255, 190, 11, 0.5);
  }
  100% {
    background-color: rgba(255, 190, 11, 0);
    box-shadow: 0 0 0px rgba(255, 190, 11, 0);
  }
}

.flash-gold {
  animation: flash-gold 0.5s cubic-bezier(0.11, 0, 0.5, 0);
}

/* Анимация падения */
@keyframes fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0.8;
  }
}

/* Анимация вращения */
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Анимация отскока */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

/* Анимация кручения */
@keyframes spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Анимация пульсации */
@keyframes pulse-item {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Анимация свечения */
@keyframes glow {
  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
  }
}

@keyframes glow-gold {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(255, 190, 11, 0.7));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(255, 190, 11, 1));
  }
}

@keyframes glow-rainbow {
  0% {
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
  }
  16.6% {
    filter: drop-shadow(0 0 10px rgba(255, 165, 0, 0.8));
  }
  33.3% {
    filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.8));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.8));
  }
  66.6% {
    filter: drop-shadow(0 0 10px rgba(0, 0, 255, 0.8));
  }
  83.3% {
    filter: drop-shadow(0 0 10px rgba(75, 0, 130, 0.8));
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(238, 130, 238, 0.8));
  }
}

/* Монета */
.coin {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--color-warning);
  border-radius: var(--border-radius-circle);
  animation: fall 1s linear;
  box-shadow: 0 0 15px rgba(255, 190, 11, 0.9);
}

.content {
  position: relative;
  overflow: hidden;
}

/* Анимация всплывающего текста */
.float-up {
  position: absolute;
  font-size: 36px;
  color: var(--color-white);
  animation: float-up 1s cubic-bezier(0.43, 0.13, 0.23, 0.96);
  pointer-events: none;
  font-weight: 600;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-75px) scale(1.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  }
  100% {
    opacity: 0;
    transform: translateY(-150px) scale(1);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Анимация появления */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Анимация исчезновения */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Отключенные элементы */
.card-game .content[disabled],
.card-gift .content[disabled] {
  pointer-events: none;
  opacity: 0.6;
  background-color: var(--background-dark);
  color: white;
  text-align: center;
  transition: var(--transition-default);
}

/* Карточки бустеров */
.booster-card {
  color: var(--color-white) !important;
  background: var(--color-dark);
  transition: var(--transition-bounce);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.booster-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.booster-card img {
  margin-bottom: 10px;
  transition: var(--transition-default);
  border-radius: var(--border-radius-sm);
}

.booster-card:hover img {
  transform: scale(1.05);
}

/* Общие стили */
svg {
  vertical-align: middle;
}

/* Стили для модальных окон SweetAlert2 */
.swal2-popup {
    font-size: 100% !important;
    background: #222;
}

/* Канвас для фейерверков */
#fireworksCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Стили для эффекта замедления времени */
.slow-motion {
  animation-duration: 5s !important;
  filter: saturate(1.5) brightness(1.2);
}

/* Стили для эффекта магнита */
.magnet-effect {
  animation: magnet-pull 1s forwards !important;
}

@keyframes magnet-pull {
  to {
    transform: translate(var(--target-x), var(--target-y)) scale(0.8);
    opacity: 0.8;
  }
}

/* Стили для эффекта щита */
.shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67, 97, 238, 0.2) 0%, rgba(67, 97, 238, 0) 70%);
  animation: shield-pulse 2s infinite;
  pointer-events: none;
  z-index: 50;
}

@keyframes shield-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

/* Стили для эффекта взрыва */
.explosion {
  position: absolute;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 190, 11, 0.8) 0%, rgba(255, 0, 110, 0) 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: explode 0.5s forwards;
  pointer-events: none;
  z-index: 100;
}

@keyframes explode {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(5);
    opacity: 0;
  }
}
