/* Базовые настройки */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: "Just Another Hand", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
}

/* Общий фон для обоих экранов */

.background-layer {
  position: absolute;
  inset: 0;
  background: url("bg_you.png") center center / cover no-repeat;
  z-index: 0;
}

/* Экран-слой */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
  opacity: 0;
  pointer-events: none;
}

.screen.active-screen {
  opacity: 1;
  pointer-events: auto;
}

.hidden-screen {
  opacity: 0;
  pointer-events: none;
}

/* Загрузочный экран */

#loading-screen {
  z-index: 10;
}

.centered-loading-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.title-main {
  font-size: 96px;
  letter-spacing: 4px;
}

.push-to-start {
  margin-top: 32px;
  font-family: inherit;
  font-size: 100px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  outline: none;
  padding: 8px 24px;
  text-shadow: 0 3px 0 rgba(0,0,0,0.35),
               0 8px 18px rgba(0,0,0,0.55);
  animation: pushSwing 1.5s ease-in-out infinite alternate;
}

/* Фонари */

.lamp {
  position: absolute;
  top: -5px;
  z-index: 1;
}

.lamp-left {
  left: 15%;
}

.lamp-right {
  right: 15%;
}

/* Анимация покачивания кнопки PUSH TO START */

@keyframes pushSwing {
  0% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
  100% { transform: translateY(0) rotate(-2deg); }
}

/* Основной экран */

#main-screen {
  z-index: 5;
}

.main-screen .background-layer {
  z-index: 0;
}

/* Верхние кнопки справа */

.top-right-buttons {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 40px;
  z-index: 3;
}

.icon-button {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  width: 100px;
  height: 50px;
}

/* Эффект глубины и нажатия */

.icon-button img {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.6));
  transition: transform 0.1s ease, filter 0.1s ease;
}

.icon-button:hover img {
  transform: translateY(-1px);
  filter: drop-shadow(0 5px 0 rgba(0,0,0,0.7));
}

.icon-button:active img {
  transform: translateY(2px) scale(0.96);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.8));
}

/* Баннер с контрактом */

.contract-banner {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: none;
  pointer-events: auto;
  cursor: pointer;
}

.contract-banner.visible-banner {
  display: inline-block;
}

.contract-banner-image {
  display: block;
  width: 360px;
  max-width: 90vw;
}

.contract-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  text-align: center;
  font-family: "Just Another Hand", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-size: 26px;
}

/* Центральная зона: YOU + персонаж + область для текста */

.hero-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-content {
  position: relative;
  width: 100%;
  height: 100%;
}

/* YOU ещё выше */

.hero-content .title-main {
  position: absolute;
  top: 38%;              /* ← поднято выше */
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 110px;
  letter-spacing: 5px;
}

/* Персонаж чуть выглядывает снизу */

.character-wrapper {
  position: absolute;
  left: 50%;
  bottom: -20px;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
}

.character-image {
  width: 700px;
  max-width: 65vw;
}

/* Слой для всплывающих надписей */

.floating-text-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Всплывающие надписи */

.floating-text {
  position: absolute;
  font-family: "Just Another Hand", sans-serif;
  font-size: 55px;
  text-shadow:
    0 2px 0 rgba(0,0,0,0.35),
    0 6px 14px rgba(0,0,0,0.6);
  opacity: 0;
  transform-origin: center;
  animation-name: textAppear, textTilt;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

@keyframes textAppear {
  0% { opacity: 0; }
  20% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes textTilt {
  0% { transform: translate(-50%, -50%) rotate(-4deg); }
  50% { transform: translate(-50%, -50%) rotate(4deg); }
  100% { transform: translate(-50%, -50%) rotate(-4deg); }
}

.floating-text.fade-out {
  opacity: 0 !important;
}

/* Нижний правый текст */

.corner-label {
  position: absolute;
  right: 30px;
  bottom: 20px;
  z-index: 2;
  font-size: 50px;
  text-shadow: 0 2px 0 rgba(0,0,0,0.4);
}
