/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro', sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #FFFFFF;
    margin: 0 auto;
    overflow: hidden;
    display: none;
    max-width: 500px;
}

.screen.active {
    display: block;
}



/* Фоновые элементы */
.sky-background {
    position: absolute;
    width: 100%;
    height: 60%;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
}

.water {
    position: absolute;
    width: 100%;
    height: 80vh;
    left: 0;
    bottom: 0;
    background: url('../img/Вода.png') center top/cover no-repeat;
    background-position: center top;
}

.cloud-left {
    position: absolute;
    width: 30%;
    height: 20%;
    left: -10%;
    top: 0;
    background: url('../img/Левое облако.png') no-repeat;
    background-size: contain;
}

.cloud-right {
    position: absolute;
    width: 30%;
    height: 20%;
    right: -10%;
    top: 0;
    background: url('../img/Правое облако.png') no-repeat;
    background-size: contain;
}

.foreground {
    position: absolute;
    width: 100%;
    height: 80vh;
    left: 0;
    bottom: 0;
    background: url('../img/Передний план.png') center bottom/cover no-repeat;
    z-index: 50;
}

/* Рыбки в меню */
.menu-fish {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 50;
}

.menu-fish.fish1 {
    width: 16%;
    height: 8%;
    top: 45%;
    background-image: url('../img/Рыба 1 лево.png');
    animation: swimRightToLeft 12s linear infinite;
}



.menu-fish.fish3 {
    width: 14%;
    height: 9%;
    top: 25%;
    background-image: url('../img/Рыба 3 право.png');
    animation: swimLeftToRight 18s linear infinite;
    animation-delay: -6s;
}

.menu-fish.fish4 {
    width: 17%;
    height: 10%;
    top: 55%;
    background-image: url('../img/Рыба 4 лево.png');
    animation: swimRightToLeft 14s linear infinite;
    animation-delay: -2s;
}

.menu-fish.fish5 {
    width: 16%;
    height: 9%;
    top: 65%;
    background-image: url('../img/Рыба 5 право.png');
    animation: swimLeftToRight 16s linear infinite;
    animation-delay: -8s;
}

.menu-fish.fish6 {
    width: 12%;
    height: 7%;
    top: 35%;
    background-image: url('../img/Рыба 6 лево.png');
    animation: swimRightToLeft 13s linear infinite;
    animation-delay: -5s;
}

.menu-fish.fish7 {
    width: 12%;
    height: 7%;
    top: 30%;
    background-image: url('../img/Рыба 7 право.png');
    animation: swimLeftToRight 17s linear infinite;
    animation-delay: -4s;
}

.menu-fish.fish8 {
    width: 15%;
    height: 8%;
    top: 80%;
    background-image: url('../img/Рыба 8 лево.png');
    animation: swimRightToLeft 11s linear infinite;
    animation-delay: -7s;
}

.menu-fish.fish9 {
    width: 11%;
    height: 6%;
    top: 70%;
    background-image: url('../img/Рыба 9 право.png');
    animation: swimLeftToRight 19s linear infinite;
    animation-delay: -1s;
}

.menu-fish.fish10 {
    width: 13%;
    height: 7%;
    top: 75%;
    background-image: url('../img/Рыба 10 лево.png');
    animation: swimRightToLeft 20s linear infinite;
    animation-delay: -9s;
}

/* Мусор в меню */
.menu-trash {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 45;
    opacity: 0.4;
}

.menu-trash.trash1 {
    width: 3%;
    height: 2%;
    top: 40%;
    background-image: url('../img/trash1.png');
    animation: swimLeftToRight 25s linear infinite;
    animation-delay: -10s;
}

.menu-trash.trash2 {
    width: 3%;
    height: 2%;
    top: 38%;
    background-image: url('../img/trash2.png');
    animation: swimRightToLeft 22s linear infinite;
    animation-delay: -15s;
}

.menu-trash.trash3 {
    width: 2.5%;
    height: 2%;
    top: 62%;
    background-image: url('../img/trash3.png');
    animation: swimLeftToRight 28s linear infinite;
    animation-delay: -5s;
}

/* Центральная часть меню */
.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 30px;
    position: absolute;
    width: 100%;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 200;
}

.logo-container {
    width: 60vw;
    height: 60vh;
    max-width: 280px;
    max-height: 280px;
    position: relative;
}

.logo-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 4%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 80.48%, rgba(0, 0, 0, 0.52) 100%), 
                linear-gradient(0deg, #877500, #877500), 
                radial-gradient(101.55% 101.55% at 22.74% 9.64%, #FFEF86 0%, #FFDD00 100%);
    border-radius: 50%;
}

.logo {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: url('../img/logo.png') center/contain no-repeat, 
                radial-gradient(101.55% 101.55% at 22.74% 9.64%, #FFEF86 0%, #FFDD00 100%);
    border: 4px solid #BAA200;
    border-radius: 50%;
}

.start-button-container {
    width: 80vw;
    height: 18vw;
    max-width: 380px;
    max-height: 120px;
    position: relative;
}

.start-button {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: url('../img/кнопка.png') center/contain no-repeat;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.start-button:hover {
    transform: scale(1.05);
}

.start-button:active {
    transform: scale(0.95);
}

/* Игровой экран */
.game-area {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 60;
}

.game-header {
    position: absolute;
    width: 100%;
    height: auto;
    left: 0;
    top: 60px; /* Увеличено с 20px для iPhone */
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.score-panel {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 6px 10px 6px 6px;
    gap: 10px;
    width: 40vw;
    height: 10vw;
    max-width: 172px;
    max-height: 63px;
    background: url('../img/plashka.png') center/contain no-repeat;
    backdrop-filter: blur(4px);
}

.coin-icon {
    width: 28.37px;
    height: 29px;
    background: url('../img/Монета 1.png') center/contain no-repeat;
    filter: drop-shadow(0px 4px 2.9px rgba(0, 0, 0, 0.2));
}

.score-text {
    width: 85px;
    height: 22px;
    font-family: 'Share';
    font-style: normal;
    font-weight: 700;
    font-size: 32px;
    line-height: 22px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 241, 230, 0.2) 0%, rgba(40, 18, 1, 0.2) 100%), #FFFFFF;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0px 4px 2.9px rgba(0, 0, 0, 0.2);
}

/* Анимация очков */
.score-animation {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0px;
    gap: 5px;
    position: absolute;
    width: 78px;
    height: 30.67px;
    left: 93px;
    top: 406px;
    transform: rotate(17.56deg);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
}

.coin-icon-small {
    width: 30px;
    height: 30.67px;
    background: url('../img/Монета 1.png') center/contain no-repeat;
    filter: drop-shadow(0px 4.09091px 2.72727px rgba(0, 0, 0, 0.14));
}

.score-change {
    width: 43px;
    height: 22px;
    font-family: 'Share';
    font-style: normal;
    font-weight: 700;
    font-size: 22px;
    line-height: 22px;
    text-align: center;
    color: #FFFFFF;
    text-shadow: 0px 3px 2px rgba(0, 0, 0, 0.14);
}

/* Игровые объекты */
.game-object {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: transform 0.1s ease;
    z-index: 150;
    /* Улучшаем отзывчивость касаний на мобильных */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Убираем hover эффекты для мобильных устройств */
@media (hover: hover) {
    .game-object:hover {
        transform: scale(1.1);
    }
}

.game-object.fish {
    /* Анимация будет задаваться динамически в JavaScript */
}

.game-object.trash {
    /* Анимация будет задаваться динамически в JavaScript */
}

.game-object.bomb {
    background-image: url('../img/bomb.png');
    /* Анимация будет задаваться динамически в JavaScript */
}

/* Game Over экран */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-over-screen.hidden {
    display: none;
}

.game-over-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-over-content h2 {
    font-family: 'Unbounded';
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.game-over-content p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #666;
}

.restart-button, .menu-button {
    padding: 15px 30px;
    margin: 10px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.restart-button {
    background: #4CAF50;
    color: white;
}

.restart-button:hover {
    background: #45a049;
}

.menu-button {
    background: #2196F3;
    color: white;
}

.menu-button:hover {
    background: #1976D2;
}

/* Анимации */
@keyframes swimLeftToRight {
    0% {
        left: -10%;
    }
    100% {
        left: 110%;
    }
}

@keyframes swimRightToLeft {
    0% {
        left: 110%;
    }
    100% {
        left: -10%;
    }
}

@keyframes swimFastLeftToRight {
    0% {
        left: -150px;
    }
    100% {
        left: calc(100vw + 150px);
    }
}

@keyframes swimFastRightToLeft {
    0% {
        left: calc(100vw + 150px);
    }
    100% {
        left: -150px;
    }
}

@keyframes scoreUp {
    0% {
        opacity: 1;
        transform: translateY(0px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.2);
    }
}

.score-animation.show {
    animation: scoreUp 1s ease-out;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .screen {
        width: 100vw;
        height: 100vh;
        max-width: none;
    }
    
    .logo-container {
        width: 60vw;
        height: 60vh;
    }
    
    .start-button-container {
        width: 60vw;
        height: 18vw;
    }
    
    .menu-fish, .menu-trash {
        animation-duration: 15s !important;
    }
    
    .game-header {
        top: 50px; /* Еще больше опускаем для мобильных */
    }
    
    .score-panel {
        width: 50vw;
        height: 12vw;
    }
}

@media (max-width: 480px) {
    .menu-content {
        gap: 20px;
    }
    
    .logo-container {
        width: 60vw;
        height: 60vw;
    }
    
    .start-button-container {
        width: 55vw;
        height: 18vw;
    }
}

/* Стили для разных типов рыб */
.game-object.fish1 { background-image: url('../img/Рыба 1 лево.png'); }
.game-object.fish3 { background-image: url('../img/Рыба 3 право.png'); }
.game-object.fish4 { background-image: url('../img/Рыба 4 лево.png'); }
.game-object.fish5 { background-image: url('../img/Рыба 5 право.png'); }
.game-object.fish6 { background-image: url('../img/Рыба 6 лево.png'); }
.game-object.fish7 { background-image: url('../img/Рыба 7 право.png'); }
.game-object.fish8 { background-image: url('../img/Рыба 8 лево.png'); }
.game-object.fish9 { background-image: url('../img/Рыба 9 право.png'); }
.game-object.fish10 { background-image: url('../img/Рыба 10 лево.png'); }

.game-object.trash1 { background-image: url('../img/trash1.png'); }
.game-object.trash2 { background-image: url('../img/trash2.png'); }
.game-object.trash3 { background-image: url('../img/trash3.png'); }
