/* «Лови десерты с Беком» — стили UI */

/* Фирменный шрифт Ванлав */
@font-face {
  font-family: 'Cera Pro';
  src: url('../fonts/CeraPro-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Cera Pro';
  src: url('../fonts/CeraPro-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Cera Pro';
  src: url('../fonts/CeraPro-Bold.ttf') format('truetype');
  font-weight: 700 900; /* жирные начертания UI рендерим Bold-файлом */
  font-display: swap;
}

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

html, body {
  height: 100%;
  background: #1a1030;
  font-family: 'Cera Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #fff;
  overflow: hidden;
}

/* Игровое поле: мобильная «колонка», по центру на десктопе */
#stage {
  position: relative;
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: linear-gradient(180deg, #2d1b58 0%, #4a2a7a 60%, #6b3fa0 100%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Вспышка при попадании головы Бека */
#stage.flash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(230, 40, 40, 0.45);
  pointer-events: none;
  animation: flash-fade 0.4s ease-out forwards;
}
@keyframes flash-fade {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* --- HUD --- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  pointer-events: none;
  z-index: 5;
}
#hud-score {
  font-size: 28px;
  font-weight: 800;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
#hud-lives .heart {
  font-size: 24px;
  color: #ff4d6d;
  margin-left: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
#hud-lives .heart.lost { color: rgba(255,255,255,0.25); }

/* --- Комбо-попап (fade + движение вверх, раздел 6 ТЗ) --- */
#combo-popup {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  font-weight: 900;
  color: #ffd93d;
  text-shadow: 0 3px 10px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
}
#combo-popup.show {
  animation: combo-pop 1.2s ease-out forwards;
}
@keyframes combo-pop {
  0%   { opacity: 0; transform: translate(-50%, 20px) scale(0.7); }
  15%  { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  30%  { transform: translate(-50%, -6px) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50px) scale(1); }
}

/* --- Экраны Start / Game Over --- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  background: rgba(20, 10, 40, 0.82);
  z-index: 10;
  padding: 24px;
}
.screen.hidden, #hud.hidden, .hidden { display: none; }

.screen h1 {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.2;
}
.screen .subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  max-width: 320px;
}
.screen .big-score {
  font-size: 52px;
  font-weight: 900;
  color: #ffd93d;
}
#new-record {
  font-size: 20px;
  font-weight: 800;
  color: #6bffb8;
}
.screen .best {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
}

button {
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  color: #1a1030;
  background: #ffd93d;
  border: none;
  border-radius: 14px;
  padding: 14px 44px;
  cursor: pointer;
  box-shadow: 0 4px 0 #c9a600;
  transition: transform 0.06s ease;
}
button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #c9a600;
}
