/* styles/main.css */

:root {
  --game-bg: radial-gradient(circle at top left, #7ed4e3, #223100);
}

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

body {
  overflow: hidden;
  background: #000404;
  font-family: 'Segoe UI', system-ui, sans-serif;
  user-select: none;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at top left, #7ed4e3, #223100);
}

.hide {
  opacity: 0 !important;
}

/* Основной контейнер игры */
#game-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100dvw;
  max-width: 700px;
  margin: auto;
}

/* Верхний блок с игрой (85%) */
#game-canvas-container {
  height: 100dvh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
}

canvas {
  display: block;
  outline: none;
  width: 100%;
  height: 100%;
}

/* Нижний блок с джойстиком (15%) */
#joystick-container {
  height: 10vh;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1000;
}

.joystick-area {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.joystick-instruction {
  position: absolute;
  top: 5px;
  left: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 1002;
}

.joystick-thumb {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  transition: background-color 0.2s;
  z-index: 1003;
}

/* Подсказка внизу экрана */
.hint {
  position: fixed;
  bottom: calc(5vh + 20px);
  left: 50%;
  transform: translateX(-50%);
  color: black;
  background: rgba(255, 255, 240, 0.25);
  backdrop-filter: blur(4px);
  padding: 8px 18px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 500;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  z-index: 100;
}

/* Счетчик отскоков */
.bounce-indicator {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 100;
}

/* Индикатор красных платформ */
.killer-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 50, 50, 0.3);
  backdrop-filter: blur(4px);
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(255, 100, 100, 0.3);
  pointer-events: none;
  z-index: 100;
}

.killer-indicator i {
  color: #ff6b6b;
  margin-right: 5px;
}

/* Bootstrap модальное окно - кастомизация */
.modal-content {
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 20px;
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 1.5rem 0.5rem;
}

.modal-body {
  padding: 2rem 1.5rem;
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem 1.5rem;
}

.modal-title {
  font-size: 2rem;
  font-weight: bold;
  color: #ff6b6b;
}

.modal-subtitle {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #aaa;
}

.btn-restart {
  background: linear-gradient(135deg, #ff6b6b, #ff4757);
  border: none;
  padding: 12px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50px;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 75, 75, 0.4);
  background: linear-gradient(135deg, #ff4757, #ff6b6b);
  color: white;
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.8;
}

.btn-close:hover {
  opacity: 1;
}

/* Анимация для модального окна */
.modal.fade .modal-dialog {
  transform: scale(0.8);
  transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
  transform: scale(1);
}

/* Статистика в модальном окне */
.stats-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin: 20px;
  text-align: center;
}

.stat-value {
  font-size: 3rem;
  font-weight: bold;
  color: #f1ff38;
  line-height: 1.2;
}

.stat-label {
  font-size: 1rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  
  .hint {
    font-size: 12px;
  }
  
  .bounce-indicator,
  .killer-indicator {
    font-size: 12px;
    padding: 4px 10px;
  }
}

/* Стили для модального окна победы */
.victory-modal {
  background: linear-gradient(135deg, #1a5f7a, #157145);
  color: #fff;
}
.victory-header {
  border-bottom: 2px solid gold;
}
.victory-star {
  animation: pulse 1.5s infinite;
  display: inline-block;
  margin: 0 5px;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.victory-stats .stat-value {
  color: gold;
  font-size: 2.5rem;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.victory-message {
  color: #ffd700;
  font-size: 1.2rem;
  margin-top: 15px;
}
.victory-footer {
  border-top: 1px solid rgba(255, 215, 0, 0.3);
}

.pause-header {
  border-bottom: 2px solid #3498db;
}
.pause-message {
  color: #3498db;
  font-size: 1.3rem;
  margin: 20px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.pause-tree {
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}
.pause-controls {
  margin: 20px 0;
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
}
.pause-shortcut {
  margin: 10px 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.key {
  display: inline-block;
  background: #2c3e50;
  border: 2px solid #3498db;
  color: #3498db;
  padding: 5px 10px;
  border-radius: 5px;
  font-family: monospace;
  font-weight: bold;
  min-width: 60px;
  text-align: center;
}
.btn-resume {
  background: #27ae60;
  color: white;
  border: none;
  padding: 10px 30px;
  font-size: 1.1rem;
  transition: all 0.3s;
}
.btn-resume:hover {
  background: #2ecc71;
  transform: scale(1.05);
  color: white;
}
.pause-footer {
  border-top: 1px solid #3498db;
  gap: 10px;
}

/* Стили для отображения очков */
.score-indicator {
  position: absolute;
  top: 80px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: gold;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 1.2rem;
  font-weight: bold;
  border: 2px solid gold;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  z-index: 100;
  backdrop-filter: blur(5px);
}
.score-indicator i {
  color: gold;
  margin-right: 8px;
}