/* Импорт Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Сброс и базовые стили */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
}

html {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  overflow: hidden;
  position: relative;
}

/* Анимированный фон */
.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.animated-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
  animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
    opacity: 1; 
  }
  50% { 
    transform: translateY(-20px) rotate(180deg); 
    opacity: 0.8; 
  }
}

/* Частицы */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  width: 4px;
  height: 4px;
  animation: floatUp 20s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 18s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 22s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 20s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; animation-duration: 24s; }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; animation-duration: 19s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; animation-duration: 21s; }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; animation-duration: 23s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; animation-duration: 17s; }
.particle:nth-child(9) { left: 90%; animation-delay: 16s; animation-duration: 25s; }
.particle:nth-child(10) { left: 15%; animation-delay: 18s; animation-duration: 20s; }
.particle:nth-child(11) { left: 25%; animation-delay: 1s; animation-duration: 22s; }
.particle:nth-child(12) { left: 35%; animation-delay: 3s; animation-duration: 19s; }
.particle:nth-child(13) { left: 45%; animation-delay: 5s; animation-duration: 21s; }
.particle:nth-child(14) { left: 55%; animation-delay: 7s; animation-duration: 23s; }
.particle:nth-child(15) { left: 65%; animation-delay: 9s; animation-duration: 18s; }
.particle:nth-child(16) { left: 75%; animation-delay: 11s; animation-duration: 24s; }
.particle:nth-child(17) { left: 85%; animation-delay: 13s; animation-duration: 20s; }
.particle:nth-child(18) { left: 95%; animation-delay: 15s; animation-duration: 22s; }
.particle:nth-child(19) { left: 5%; animation-delay: 17s; animation-duration: 19s; }
.particle:nth-child(20) { left: 12%; animation-delay: 19s; animation-duration: 21s; }

@keyframes floatUp {
  from {
    transform: translateY(100vh) translateX(0px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  to {
    transform: translateY(-100px) translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

/* Плавающие геометрические фигуры */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.shape {
  position: absolute;
  opacity: 0.1;
  animation: floatShape 25s infinite ease-in-out;
}

.shape-1 {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  border-radius: 20px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #4834d4, #686de0);
  border-radius: 50%;
  top: 60%;
  right: 15%;
  animation-delay: 5s;
}

.shape-3 {
  width: 100px;
  height: 40px;
  background: linear-gradient(45deg, #00d2d3, #54a0ff);
  border-radius: 20px;
  top: 80%;
  left: 20%;
  animation-delay: 10s;
}

.shape-4 {
  width: 50px;
  height: 50px;
  background: linear-gradient(45deg, #ff9ff3, #f368e0);
  transform: rotate(45deg);
  top: 30%;
  right: 25%;
  animation-delay: 15s;
}

.shape-5 {
  width: 70px;
  height: 70px;
  background: linear-gradient(45deg, #feca57, #ff9ff3);
  border-radius: 50% 10px;
  top: 10%;
  right: 40%;
  animation-delay: 20s;
}

@keyframes floatShape {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-30px) translateX(20px) rotate(90deg);
  }
  50% {
    transform: translateY(-60px) translateX(-10px) rotate(180deg);
  }
  75% {
    transform: translateY(-30px) translateX(-30px) rotate(270deg);
  }
}

/* НОВЫЕ СТИЛИ ДЛЯ ЭКРАНА БЛОКИРОВКИ */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.lock-background {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 720px;
  background: linear-gradient(180deg, 
    #1a1a2e 0%, 
    #16213e 25%, 
    #0f3460 50%, 
    #533483 75%, 
    #7209b7 100%);
  border-radius: 35px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 50px 30px 40px;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.8),
    0 15px 30px rgba(102, 126, 234, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.lock-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(102, 126, 234, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.lock-time {
  text-align: center;
  color: white;
  margin-top: 80px;
  position: relative;
  z-index: 2;
}

.lock-hours {
  font-size: 72px;
  font-weight: 200;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lock-date {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lock-notifications {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.notification {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 20px 25px;
  margin: 10px 0;
  max-width: 320px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: notificationPulse 3s ease-in-out infinite;
}

.notification-app {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 5px;
}

.notification-text {
  font-size: 16px;
  font-weight: 500;
  color: white;
  margin-bottom: 8px;
}

.notification-preview {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

@keyframes notificationPulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  50% { 
    transform: scale(1.02); 
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
  }
}

.unlock-area {
  position: relative;
  z-index: 2;
}

.unlock-indicator {
  text-align: center;
}

.unlock-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.unlock-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
}

.unlock-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 15px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.unlock-arrow {
  font-size: 24px;
  color: white;
  animation: arrowBounce 2s ease-in-out infinite;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@keyframes arrowBounce {
  0%, 100% { 
    transform: translateX(0px); 
    opacity: 1;
  }
  50% { 
    transform: translateX(15px); 
    opacity: 0.7;
  }
}

.lock-screen.unlocking {
  animation: unlockAnimation 0.8s ease-in-out forwards;
}

@keyframes unlockAnimation {
  0% {
    transform: scale(1) translateX(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.05) translateX(20px);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.2) translateX(100%);
    opacity: 0;
  }
}

/* Прелоадер */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader-content {
  text-align: center;
  color: white;
}

.modern-loader {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 30px;
}

.loader-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.loader-ring:nth-child(2) {
  width: 60px;
  height: 60px;
  top: 10px;
  left: 10px;
  animation-delay: 0.2s;
}

.loader-ring:nth-child(3) {
  width: 40px;
  height: 40px;
  top: 20px;
  left: 20px;
  animation-delay: 0.4s;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-content p {
  font-size: 18px;
  font-weight: 300;
  opacity: 0.9;
}

/* Контейнер телефона */
.phone-container {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Уникальный дизайн устройства - гибрид планшета и телефона */
.phone {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 720px;
  background: linear-gradient(145deg, #0a0a0a 0%, #1a1a2e 30%, #16213e 70%, #2d3748 100%);
  border-radius: 35px 35px 45px 45px;
  overflow: hidden;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 15px 30px rgba(102, 126, 234, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3),
    0 0 0 2px rgba(102, 126, 234, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  border: 3px solid transparent;
  background-clip: padding-box;
  transform: rotateX(3deg) rotateY(-1deg) scale(0.98);
  transition: all 0.4s ease;
}

.phone:hover {
  transform: rotateX(0deg) rotateY(0deg) scale(1);
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 20px 40px rgba(102, 126, 234, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Добавляем уникальные декоративные элементы по бокам */
.phone::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 25%;
  width: 6px;
  height: 50px;
  background: linear-gradient(180deg, #667eea, #764ba2);
  border-radius: 3px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 1001;
}

.phone::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 30%;
  width: 6px;
  height: 35px;
  background: linear-gradient(180deg, #ff6b6b, #ee5a24);
  border-radius: 3px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 1001;
}

/* Убираем Dynamic Island и заменяем на уникальную панель */
.status-bar {
  height: 45px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.status-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.status-bar::after {
  content: '●●●';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  letter-spacing: 2px;
}

/* Хедер */
.header {
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
}

.header-left {
  flex-shrink: 0;
}

.header-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.header-avatar:hover {
  transform: scale(1.1);
}

.header-center {
  flex: 1;
  text-align: center;
  padding: 0 15px;
}

.header-title {
  font-size: 19px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.header-controls {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.control-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.btn-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Чат контейнер */
.chat-container {
  flex: 1;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.5) transparent;
}

.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.7);
}

/* Стартовый экран */
.start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 30px;
  box-sizing: border-box;
  backdrop-filter: blur(20px);
}

.start-content {
  text-align: center;
  max-width: 300px;
}

.game-logo h2 {
  margin: 0 0 8px 0;
  color: #2d3748;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  color: #4a5568;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.start-overlay p {
  margin: 0 0 30px 0;
  color: #718096;
  font-size: 16px;
  line-height: 1.5;
}

.start-btn {
  position: relative;
  padding: 16px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  overflow: hidden;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.btn-glow {
  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;
}

.start-btn:hover .btn-glow {
  left: 100%;
}

/* Сообщения */
.message {
  max-width: 80%;
  margin: 10px 0;
  padding: 16px 20px;
  border-radius: 24px;
  position: relative;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message.visible {
  opacity: 1;
  transform: translateY(0);
}

.message.left {
  align-self: flex-start;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  color: #2d3748;
  border: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.message.right {
  align-self: flex-end;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.message.left::after {
  content: '';
  position: absolute;
  border: 12px solid transparent;
  border-right-color: #ffffff;
  left: -24px;
  top: 20px;
}

.message.right::after {
  content: '';
  position: absolute;
  border: 12px solid transparent;
  border-left-color: #667eea;
  right: -24px;
  top: 20px;
}

.message img {
  max-width: 100%;
  width: 250px;
  border-radius: 16px;
  cursor: pointer;
  display: block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.message img:hover {
  transform: scale(1.02);
}

/* Контейнер выборов */
.choice-container {
  display: flex;
  justify-content: space-around;
  margin: 15px 0;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

/* Кнопки выбора */
.choice-btn {
  padding: 16px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 150px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.choice-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.choice-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.choice-btn:hover::before {
  left: 100%;
}

/* Кнопка перезапуска */
.restart-btn {
  display: block;
  margin: 20px auto;
  padding: 14px 28px;
  border: none;
  border-radius: 25px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

/* Модальные окна */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  background: white;
  z-index: 1001;
}

.image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #f8fafc;
}

.modal img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 1002;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Галерея */
.gallery-modal-content {
  max-width: 95%;
  max-height: 95%;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.gallery-header {
  padding: 25px 30px 15px;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.gallery-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.gallery-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  padding: 25px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.5) transparent;
}

.gallery-content::-webkit-scrollbar {
  width: 8px;
}

.gallery-content::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-content::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 4px;
}

.gallery-content img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.gallery-content img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Возрастное предупреждение */
.age-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #fef3c7 100%);
  color: #92400e;
  padding: 15px 20px;
  margin: 15px;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #fed7aa;
  box-shadow: 0 4px 15px rgba(146, 64, 14, 0.1);
}

/* Анимация ввода */
.typing-indicator {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

/* Скрытие аудио элементов */
audio {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  pointer-events: none !important;
}

audio::-webkit-media-controls-panel,
audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display,
audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-volume-slider,
audio::-webkit-media-controls-mute-button,
audio::-webkit-media-controls-enclosure {
  display: none !important;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
  .phone-container {
    padding: 0;
  }
  
  .phone {
    width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
  
  .lock-background {
    border-radius: 0;
    max-height: none;
    height: 100vh;
  }
  
  .dynamic-island {
    display: none;
  }
  
  .gallery-content {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 15px;
  }
  
  .choice-container {
    flex-direction: column;
  }
  
  .choice-btn {
    margin-bottom: 8px;
    min-width: auto;
  }
  
  .floating-shapes {
    display: none;
  }
}

@media (max-height: 600px) {
  .header {
    height: 60px;
  }
  
  .header-title {
    font-size: 16px;
  }
  
  .control-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .lock-hours {
    font-size: 56px;
  }
  
  .lock-time {
    margin-top: 40px;
  }
}

/* Защита от выделения и перетаскивания */
img {
  -webkit-user-drag: none !important;
  pointer-events: auto;
}

*:not(input):not(textarea) {
  -webkit-touch-callout: none !important;
}

/* Дополнительные анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.visible {
  animation: fadeIn 0.4s ease-out;
}

.choice-btn {
  animation: fadeIn 0.5s ease-out;
}

.start-btn {
  animation: fadeIn 0.6s ease-out;
}

/* ===== SKIN: DESKTOP MESSENGER WINDOW ===== */
body.skin-window {
  background: radial-gradient(1200px 600px at 50% 0%, #eef2ff 0%, #e2e8f0 35%, #cbd5e1 100%);
}

/* Reduce outer padding for window look */
.skin-window .phone-container { padding: 32px; }

/* Desktop messenger window instead of phone */
.skin-window .phone {
  max-width: 960px; max-height: 680px;
  width: min(960px, 95vw); height: min(680px, 92vh);
  border-radius: 12px; transform: none;
  background: #f5f7fb; box-shadow: 0 30px 80px rgba(2,6,23,.25);
}

/* Hide phone-only chrome */
.skin-window .phone::before,
.skin-window .phone::after,
.skin-window .dynamic-island { display: none !important; }

/* Title bar */
.skin-window .window-bar{
  height: 32px; display:flex; align-items:center; gap:8px;
  padding: 0 12px; border-bottom:1px solid #d1d5db;
  background:#e5e7eb;
}
.skin-window .window-bar .window-dot{
  width:12px; height:12px; border-radius:50%; display:inline-block;
}
.skin-window .window-dot.red{background:#ff5f56;}
.skin-window .window-dot.yellow{background:#ffbd2e;}
.skin-window .window-dot.green{background:#27c93f;}
.skin-window .window-title{
  margin-left:8px; font:600 12px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color:#374151; opacity:.85;
}

/* Header tweaks */
.skin-window .header{
  background:#f8fafc; color:#111827; border-bottom:1px solid #e5e7eb;
}
.skin-window .header-title{ color:#111827; text-shadow:none; }
.skin-window .header-subtitle{ color:#6b7280; }
.skin-window .control-btn{
  background:#e5e7eb; color:#111827; border:1px solid #d1d5db;
}

/* Chat container & bubbles */
.skin-window .chat-container{
  background:#ffffff;
}
.skin-window .message{
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.skin-window .message.left::after,
.skin-window .message.right::after{ display:none !important; }

/* Lock screen background as a neutral panel */
.skin-window .lock-background{
  max-width: 960px; max-height: 680px; border-radius:12px;
  background: linear-gradient(135deg,#0f172a,#1e293b);
}

/* SAVE INFO STYLES */
.start-actions{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.start-buttons-wrap{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
}
.save-info{
  font-size: 14px;
  color: #64748b;
  margin-bottom: 4px;
}
.continue-btn span::before{
  content: "⏩ ";
}
.restart-btn span::before{
  content: "🔁 ";
}

/* SWIPE TOUCH-ACTION FIX */
#lock-screen, #lock-screen * {
  touch-action: none; /* allow JS-driven horizontal swipe */
}



/* === MOBILE FULL-BLEED FIX (Yandex Games) === */
@media (pointer: coarse), (max-width: 768px) {
  :root {
    /* fallback custom viewport unit */
    --vh: 1vh;
  }
  html, body {
    width: 100vw !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    min-height: calc(var(--vh, 1vh) * 100) !important;
    overflow: hidden !important;
  }
  /* kill decorative phone frame & transforms so fixed children anchor to the real viewport */
  .phone-container, .phone {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    perspective: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .phone::before, .phone::after,
  .window-bar, .dynamic-island, .status-bar {
    display: none !important;
  }
  /* ensure the game stretches */
  #game-container {
    width: 100vw !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
  }
}


/* MOBILE-ONLY ORIENTATION PATCH */
@media (pointer: coarse), (max-width: 768px) {
  :root { --vh: 1vh; }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    min-height: calc(var(--vh, 1vh) * 100) !important;
    overflow: hidden !important;
    background: #0000; /* keep page bg transparent behind canvas */
  }

  /* растягиваем основной контейнер игры */
  #game-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    max-width: none !important;
    max-height: none !important;
  }

  /* убираем декор-рамку телефона и 3D-трансформации */
  .phone, .phone-container {
    transform: none !important;
    perspective: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .phone::before, .phone::after,
  .window-bar, .dynamic-island, .status-bar {
    display: none !important;
  }

  /* отступы под безопасные зоны и низ экрана (на случай баннера) */
  #game-container { 
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
  }
}
