/**
 * Стили для MobileInputModal - модального окна ввода на мобильных устройствах.
 * Мультистрочное поле ввода в верхней части экрана.
 * Подтверждение через кнопку "Done" на виртуальной клавиатуре.
 */

.mobile-input-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 99999 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.mobile-input-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.mobile-input-modal__input-container {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}

.mobile-input-modal__textarea {
  width: 100%;
  min-height: 80px;
  padding: 16px;
  font-family: 'mainFont', system-ui, -apple-system, sans-serif;
  font-size: 20px;
  font-weight: bold;
  color: #563610;
  text-align: left;
  background: linear-gradient(180deg, #fff 0%, #f5f0e0 100%);
  border: 3px solid #a67c52;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
  outline: none;
  resize: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.mobile-input-modal__textarea:focus {
  border-color: #8b5a2b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(139, 90, 43, 0.3), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mobile-input-modal__textarea::placeholder {
  color: #a89070;
  font-weight: normal;
}

/* Поддержка старого класса input для обратной совместимости */
.mobile-input-modal__input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-family: 'mainFont', system-ui, -apple-system, sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: #563610;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #f5f0e0 100%);
  border: 3px solid #a67c52;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.3);
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Анимация появления */
@keyframes mobile-input-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mobile-input-modal-slide-down {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mobile-input-modal {
  animation: mobile-input-modal-fade-in 0.2s ease-out;
}

.mobile-input-modal__input-container {
  animation: mobile-input-modal-slide-down 0.3s ease-out;
}

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}

html {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: fixed;
  touch-action: pan-x pan-y;
}

:root {
  --safe-area-inset-top: env(safe-area-inset-top);
  --safe-area-inset-right: env(safe-area-inset-right);
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
  --safe-area-inset-left: env(safe-area-inset-left);
}

body {
  -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
  -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
  -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-image: linear-gradient(top, #a7a7a7 0%, #e4e4e4 51%);
  font-family: system-ui, -apple-system, -apple-system-font, 'Segoe UI', 'Roboto', sans-serif;
  font-size: 12px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  line-height: 1.5;
  background-color: #f1f3fb;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  position: fixed;
  touch-action: pan-x pan-y;
}

#loading-screen {
  width: 100%;
  height: 100%;
  background: #000000 url(assets/screen.0c77619f8064fefa6c1f.jpg) center;
  position: absolute;
  background-repeat: no-repeat;
  background-size: auto 100%;
  top: 0;
  overscroll-behavior: none;
  touch-action: none;
}

#progress-bar {
  position: relative;
  top: 90%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 90%;
  max-width: 466px;
  aspect-ratio: 466 / 37;

  background: url(assets/progress_bar.17f7b478f39ce2c2b431.png) no-repeat center center;
  background-size: 100% 100%;
  overflow: hidden;
}

#progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: url(assets/progress_bar_fill.d65591a545d397bc2ec4.png) no-repeat left center;
  background-size: auto 100%;
}

#game {
  width: 100%;
  height: 100%;
  /* Гарантируем минимальные размеры для предотвращения ошибки
     "Framebuffer status: Incomplete Attachment" при нулевых размерах */
  min-width: 1px;
  min-height: 1px;
}

*,
*:after,
*:before {
  box-sizing: border-box;
}

input:focus {
  outline: none;
}

input:active {
  outline: none;
}

input {
  position: absolute;
  top: 50%;
  left: 50%;
  font-weight: 800;
  color: #862c00;
  background: none;
  user-select: none;
  border: none;
}

input::placeholder {
  color: #c38560;
}

/* Стили для TextInput компонента Phaser - перезаписывают глобальные */
input.phaser-text-input,
input.phaser-text-input:focus,
input.phaser-text-input:active,
input.phaser-text-input:hover {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  outline: 0 !important;
  outline-width: 0 !important;
  outline-style: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  color: transparent !important;
  /* каретка видимая - цвет задаётся inline */
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

@media (max-height: 540px) {
  #progress-bar {
    transform: translate(-50%, 0) scale(0.5);
    top: 85%;
  }
}

/* общий стиль: положим прямо в <head> или ваш index.css */
#paystation-custom-close {
  position: fixed; /* поверх всего, не зависит от DOM-слоя Pay Station */
  top: 8px;
  right: 12px;
  z-index: 2000; /* по умолчанию lightbox = 1000, так что 2000 с запасом */
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  font-size: 26px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  display: none; /* покажем позже JS-ом */
}

@media (orientation: portrait) {
  #loading-screen {
    background-size: 200%;
  }
}

/* Подключаем стили для мобильного ввода */

