body { 
    font-family: Arial, sans-serif; 
    background-color: #000000;
    display: flex;
    flex-direction: row;
    gap: 50px;
    width: 100dvw;
    height: 100dvh;
    overflow: hidden;
    margin: 0 !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Unbounded", sans-serif;
    font-optical-sizing: auto;
}

/* Запрет масштабирования для всей страницы */
body {
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Дополнительно для iOS Safari */
html {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.rhythm-game-cont{
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 460px;
    height: 100%;
}


.rhythm-game {
    height: 100%;
    width: 100%;
    background: linear-gradient(180deg, #4462e8 0%, #9d4aef 80%);
    overflow: hidden;
    z-index: 1000;
}

.game-ui {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1010;
    color: white;
    font-family: 'Arial', sans-serif;
}










.score-display {
    padding: 10px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    transition: 0.3s;
    scale: 1;
}
.score-display.hite{
    opacity: 0;
    scale: 0.5;
}

#gameScore{
    font-size: 45px;
}

.scoreAnim{
    animation: pulseAn 0.2s ease-in-out forwards;
}
@keyframes pulseAn {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.scoreAnimRot{
    animation: pulseAn 0.2s ease-in-out forwards;
}
@keyframes pulseAn {
    0% {
        transform: scale(1);
        opacity: 1;
        rotate: 4deg;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
        rotate: -4deg;
    }
    100% {
        transform: scale(1);
        opacity: 1;
        rotate: 4deg;
    }
}


.score, .combo {
    margin: 8px 0;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.247);
    white-space: nowrap;
}

.combo{
    background: #0000003e;
    padding: 10px;
    border-radius: 6px;
    rotate: 4deg;
}






.timer { 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 130px; 
    font-weight: 900;
    color: white;
    text-align: center;
    margin: 30px 0;
    padding: 20px 70px;

    background: rgba(255, 255, 255, 0.043);
    backdrop-filter: blur(25px);

    border-radius: 50px;
    z-index: 99 !important;

}

.timer.show{
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    /* Постоянная анимация пульсации */
    animation: pulse 1s infinite ease-in-out;
}
/* Анимация пульсации */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Плавное появление при первом показе */
.timer.noshow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.3s ease-in-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
}














.note {
    position: absolute;
    width: 100%;
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    opacity: 1;
    transition: 0.2s;
}

.note.pressed {
    opacity: 0.3;
}

.note-block{

}













.hide{
    display: none !important;
}











/* Эффекты для отображения очков */
.points-effect {
    position: absolute;
    top: 220px;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    z-index: 1020;
    padding: 14px;
    border-radius: 30px;
    transform-origin: center;
}

.points-positive {
    color: #ffffff;
    background: #4de74dc1;
    box-shadow: 0 4px 15px rgba(77, 231, 77, 0.3);
}

.points-negative {
    color: #ffffff;
    background: #f44336bb;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

/* ✅ ДОБАВЛЯЕМ НОВЫЙ КЛАСС ДЛЯ ОРАНЖЕВЫХ ЧАСТИЧНЫХ ПРОМАХОВ */
.points-negative.partial-miss {
    background: #ff9800bb; /* Оранжевый */
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}
/* Базовая анимация (для обратной совместимости) */
@keyframes pointsFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(1);
    }
}

/* Новая анимация со случайными траекториями */
@keyframes pointsFloatRandom {
    0% {
        opacity: 1;
        transform: 
            translateX(calc(var(--random-offset-x) * 0.3)) 
            translateY(0) 
            scale(0.8) 
            rotate(0deg);
    }
    25% {
        opacity: 1;
        transform: 
            translateX(calc(var(--random-offset-x) * 0.6)) 
            translateY(-40px) 
            scale(1.0) 
            rotate(calc(var(--random-rotation) * 0.3));
    }
    50% {
        opacity: 1;
        transform: 
            translateX(calc(var(--random-offset-x) * 0.8)) 
            translateY(-80px) 
            scale(var(--random-scale)) 
            rotate(calc(var(--random-rotation) * 0.6));
    }
    75% {
        opacity: 0.7;
        transform: 
            translateX(calc(var(--random-offset-x) * 0.9)) 
            translateY(-120px) 
            scale(calc(var(--random-scale) * 0.9)) 
            rotate(var(--random-rotation));
    }
    100% {
        opacity: 0;
        transform: 
            translateX(var(--random-offset-x)) 
            translateY(-180px) 
            scale(calc(var(--random-scale) * 0.8)) 
            rotate(calc(var(--random-rotation) * 1.2));
    }
}

/* Дополнительные эффекты для большей вариативности */
.points-effect:nth-child(odd) {
    animation-timing-function: cubic-bezier(0.4, 0.1, 0.7, 1.0);
}

.points-effect:nth-child(even) {
    animation-timing-function: cubic-bezier(0.1, 0.8, 0.2, 1.0);
}











#waitGameblock {
    /* Стили для блока ожидания */
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.219);
    backdrop-filter: blur(40px);
    color: white;
    padding: 40px;
    text-align: center;
    z-index: 1000999999999 !important;
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 30px;

    font-size: 40px;
}
#waitGameblock .second_tex{
    font-size: 24px;
}
.loader {
    width: 50px;
    height: 50px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



.result-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    padding: 50px 28px;
    border-radius: 40px;
    text-align: center;
    color: rgb(255, 255, 255);

    background-color: #ffffff13;
    backdrop-filter: blur(25px);

    z-index: 1020;
    max-width: 490px;
    max-height: 100%;
    width: 98vw;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;

    overflow: hidden;
    overflow-y: scroll;
}

/* Для Webkit браузеров */
.result-screen::-webkit-scrollbar {
    width: 0px;
}

.result-screen::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.result-screen::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #4ba28f);
    border-radius: 4px;
}

.result-screen::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #667eea, #4ba28f);
}


.result-screen.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.result-icon{
    font-size: 60px;
}

.second_text{
    opacity: 0.8;
}


.final-stats {
    margin: 25px 0;
}

.final-stats div {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.final-stats div:last-child {
    border-bottom: none;
}

.final-stats span {
    color: #ffffff;
    font-weight: 900;
}

.final-score{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

}
#finalScore{
    font-size: 50px;
    font-weight: bolder;
}
h2{
    font-size: 28px;
    margin: 10px 0 20px 0;
}
#player_id{
    font-size: 16px;
    text-align: center;
}
#player_name{
    box-sizing: content-box;
    padding: 14px 22px; 
    background-color: #4747ff;
    width: fit-content;
    border-radius: 40px;
    font-size: 20px;
}









.controls {
    text-align: center;
    margin: 20px 0;
}









  .alert_block {
        margin-top: 20px;
        padding: 24px;
        border-radius: 30px;
        background-color: rgba(255, 255, 255, 0.527);
        text-align: center;
    }
    
    .alert_massege {
        color: #f44336;
        margin-bottom: 13px;
        font-size: 16px;
    }
    
    .restart_req {
        background-color: #f44336;
        color: white;
        border: none;
        padding: 14px;
        border-radius: 20px;
        cursor: pointer;
        font-size: 18px;
        transition: opacity 0.3s;
    }
    
    .restart_req:hover:not(:disabled) {
        opacity: 0.8;
    }
    
    .restart_req:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }



































/* Стили для загрузчика */
.game-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
    display: none;
}

/* Стили для ошибок */
.game-error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #f44336;
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 1000;
}


















































#gameContainer{
    pointer-events: auto;
}



.game-lanes {
    display: flex;
    height: 100%;
    position: relative;
    rotate: 180deg;
    pointer-events: auto;
}

.game-animate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform; /* Для оптимизации анимации */
    transition: transform 0.1s linear; /* Для плавности */
    display: flex;
}


.game-lane {
    flex: 1;
    height: 100%;
    width: 25%;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;

        -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;

        z-index: 5; /* Лэйны под нотами */
    pointer-events: auto; /* Лэйны не должны перехватывать касания */
}



.game-lane[data-lane="3"] {
    border-right: none;
}





/* Контейнер для кнопки полноэкранного режима */
.fullscreen-controls {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9999999999999999999999999999999999999999999999999 !important;
}

/* Стили кнопки полноэкранного режима */
.fullscreen-btn {
    padding: 0;
    padding-bottom: 4px;
    width: 50px;
    height: 50px;
    background: transparent;
    border-radius: 50%;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ;

    outline: none;
}

.fullscreen-btn:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

/* Иконка для выхода из полноэкранного режима */
.fullscreen-btn.exit-fullscreen .fullscreen-icon {
    content: "⛷";
}






























.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden; 
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    opacity: 0.2;
    animation: floatShapeDown 10s linear forwards;
}

/* Базовые стили без фиксированных размеров */
.shape-triangle {
    width: 0;
    height: 0;
    border-left: solid transparent;
    border-right: solid transparent;
    border-bottom: solid;
    border-bottom-style: solid;
}

.shape-circle {
    border-radius: 50%;
}

.shape-square {
    transform: rotate(45deg);
}

.shape-star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.shape-hexagon {
    position: relative;
}

/* Анимация СВЕРХУ ВНИЗ */
@keyframes floatShapeDown {
    0% {
        transform: translateY(0) rotate(0deg) scale(var(--scale, 1));
        opacity: 0;
    }
    10% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(100vh) rotate(-360deg) scale(calc(var(--scale, 1) * 0.7));
        opacity: 0;
    }
}

/* Разные скорости для разнообразия */
.floating-shape:nth-child(odd) {
    animation-duration: 8s;
}

.floating-shape:nth-child(even) {
    animation-duration: 12s;
}

















/* Стили для сообщения "Игра уже началась" */
.game-started-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;

    backdrop-filter: blur(25px);
}

.game-started-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-started-content h2 {
    color: #ff4444;
    margin-bottom: 15px;
}

.game-started-content p {
    margin: 10px 0;
    color: #333;
    line-height: 1.5;
}

.reload-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    border: none;
    border-radius: 70px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
    font-size: 20px;
    z-index: 99999999999999999999999;

}

.reload-btn:hover {
    opacity: 0.7;
    transform: scale(1.1);
}
















/* CSS */
#reloadButton{
    position: absolute;
    top: 10px;
    right: 10px;

    box-sizing: border-box;

    padding: 0;
    padding-top: 4px;
    padding-left: 4px;
    width: 50px;
    height: 50px;
    background: transparent;
    border-radius: 50%;
    color: white;

    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;

}
#reloadButton:hover {
    background: rgba(255, 255, 255, 0.272);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.popup {
  position: absolute;
  top: 10px;
  right: 20px;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup__overlay {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;

  height: auto;

  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный черный */
}

.popup__content {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

.hidden {
  display: none;
}

.show {
    display: flex !important;
}





.score, .combo {
    margin: 8px 0;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.247);
    white-space: nowrap;
}

.combo{
    background: #0000003e;
    padding: 10px;
    border-radius: 6px;
    rotate: 4deg;
}












