html {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none !important;
    -webkit-overflow-scrolling: auto !important;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Override touch-action for scrollable content */
.prizes-modal,
.prizes-modal *,
.prizes-content,
.prizes-content *,
.prizes-list,
.prizes-list *,
.rules-modal,
.rules-modal *,
.rules-content,
.rules-content *,
#top-score-players,
#top-score-players * {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: auto !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
            radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: gradientShift 10s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

.game-container {
    background: rgba(18, 18, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 15px;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
}

.header-text{
    font-size: 12px;
    color: #fff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.title {
    font-size: 28px;
    color: #fff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}



.score-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

#player-scores .score-item {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
    font-size: 14px; /* Немного уменьшаем шрифт для 4 элементов */
    padding: 8px 12px; /* Немного уменьшаем padding */
}

#top-score-players {
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

.score-item-top{
    width: 100%;
    /*background: white;*/
    /*background: linear-gradient(135deg, #1a1a1a, #2d2d2d);*/
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(45, 45, 45, 0.3));


    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    
    /* Включаем скроллинг как в модальном окне призов */
    max-height: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
}

/* Стилизация скроллбара для топа игроков */
.score-item-top::-webkit-scrollbar {
    width: 4px;
}

.score-item-top::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.score-item-top::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.score-item-top::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Анимация обновления для топа игроков */
.score-item-top.updating {
    filter: blur(4px);
    opacity: 0.6;
    transform: scale(0.98);
    transition: all 0.3s ease;
}

.score-item-top.updating::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Leaderboard styling */
.leaderboard-title {
    margin-bottom: 8px;
    font-weight: bold;
    text-align: center;
}

.click-hint {
    font-size: 10px;
    color: rgba(255, 170, 0, 0.8);
    font-weight: normal;
    margin-top: 2px;
    opacity: 0.7;
    animation: clickHintPulse 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes clickHintPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Добавляем стили для кликабельного топа */
#top-score-players {
    cursor: pointer;
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#top-score-players:hover {
    transform: scale(1.02);
}

#top-score-players:active {
    transform: scale(0.98);
}

.score-item-top {
    /* pointer-events отключены - пусть клики проходят через родительский элемент */
}

.score-item-top * {
    /* pointer-events отключены - пусть клики проходят через родительский элемент */
}

.leaderboard-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
}

.player-name {
    flex: 0 0 auto;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dots {
    flex: 1 1 auto;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
    margin: 0 4px;
    height: 1px;
    min-width: 20px;
}

.player-score {
    flex: 0 0 auto;
    font-weight: bold;
    color: #ffaa00;
}



.score-item {
    /*background: linear-gradient(135deg, #1a1a1a, #2d2d2d);*/
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(45, 45, 45, 0.3));


    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.score-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.score-item:hover {
    transform: translateY(-2px);
    box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.score-item:hover::before {
    opacity: 1;
}

canvas {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: block;
    margin: 0 auto;
    background: #0a0a0a;
    box-shadow:
            0 10px 30px rgba(0, 0, 0, 0.5),
            inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    width: 100% !important;
    max-width: 100%;
    transition: none;
}

.controls {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.control-btn {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 15px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.control-btn:hover::before {
    width: 100%;
    height: 100%;
}


.menu-buttons{
    /*background: #aaaaaa;*/
    display: flex;
    justify-content: space-between;
    margin-top: max(10px, 3vh);
    margin-bottom: max(10px, 2vh);
    width: 100%;
    height: max(40px, 6vh);
    /*gap: 5px;*/

}

.menu-btn{
    width: 30%;
    height: 100%;
    /*background: linear-gradient(135deg, #1a1a1a, #2d2d2d);*/
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(45, 45, 45, 0.1));

    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    /*background: linear-gradient(135deg, #ff4458, #ff6b6b);*/
    /*color: white;*/
    /*border: none;*/
    /*padding: 15px 40px;*/
    /*border-radius: 30px;*/
    /*font-size: 18px;*/
    /*cursor: pointer;*/
    /*transition: all 0.3s ease;*/
    /*box-shadow:*/
    /*        0 4px 20px rgba(255, 68, 88, 0.4),*/
    /*        inset 0 1px 0 rgba(255, 255, 255, 0.2);*/
    /*text-transform: uppercase;*/
    /*letter-spacing: 1px;*/
    /*font-weight: bold;*/
}
.control-btn:active {
    transform: scale(0.95);
    box-shadow:
            0 2px 10px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-btn:nth-child(1) { grid-column: 2; }
.control-btn:nth-child(2) { grid-column: 1; }
.control-btn:nth-child(3) { grid-column: 3; }
.control-btn:nth-child(4) { grid-column: 2; }

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1000;
    animation: bounceIn 0.5s ease-out;
    backdrop-filter: blur(20px);
}

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

/* Анимация для достижений в топе */
.game-over p[style*="color: #4CAF50"],
.game-over p[style*="color: #ff6b6b"] {
    animation: achievementPulse 2s ease-in-out infinite;
}

@keyframes achievementPulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 5px currentColor;
    }
    50% { 
        transform: scale(1.05);
        text-shadow: 0 0 15px currentColor;
    }
}

@keyframes rulesModalIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes rulesContentIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(50px);
    }
    60% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes rulesModalOut {
    0% {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
    100% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes rulesContentOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
}

.game-over h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 36px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.game-over p {
    color: #aaa;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 300;
}

.restart-btn {
    background: linear-gradient(135deg, #ff4458, #ff6b6b);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
            0 4px 20px rgba(255, 68, 88, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow:
            0 6px 25px rgba(255, 68, 88, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.restart-btn:active {
    transform: translateY(0);
}

.rules-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 2000;
    backdrop-filter: blur(10px);
    animation: rulesModalIn 0.4s ease-out;
}

.rules-modal.closing {
    animation: rulesModalOut 0.3s ease-in forwards;
}

.rules-content {
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 20px;
    width: 100%;
    max-width: 90%;
    min-height: auto;
    max-height: none;
    margin: auto;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: rulesContentIn 0.6s ease-out;
    text-align: center;
    -webkit-overflow-scrolling: touch;
    overflow: visible;
}

.rules-modal.closing .rules-content {
    animation: rulesContentOut 0.3s ease-in forwards;
}

.rules-content h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.rules-content p {
    color: #ccc;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.rules-content ul {
    color: #ccc;
    text-align: left;
    margin-bottom: 15px;
    padding-left: 15px;
}

.rules-content li {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.close-rules-btn {
    background: linear-gradient(135deg, #ff4458, #ff6b6b);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 20px rgba(255, 68, 88, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    margin-top: 20px;
}

.close-rules-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(255, 68, 88, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.close-rules-btn:active {
    transform: translateY(0);
}

/* Confirmation Modal Styles */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(15px);
    animation: confirmationModalIn 0.6s ease-out;
}

.confirmation-content {
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 30px;
    max-width: 90%;
    min-width: 280px;
    text-align: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: confirmationContentIn 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes confirmationModalIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(15px);
    }
}

@keyframes confirmationContentIn {
    0% {
        opacity: 0;
        transform: scale(0.4) translateY(-100px) rotateX(90deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) translateY(20px) rotateX(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
}

.confirmation-content h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.confirmation-content p {
    color: #ccc;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.4;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.confirm-btn,
.cancel-btn {
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 120px;
    min-width: 120px;
    flex: 0 0 120px;
}

.confirm-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    box-shadow:
        0 4px 20px rgba(76, 175, 80, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(76, 175, 80, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cancel-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow:
        0 4px 20px rgba(244, 67, 54, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(244, 67, 54, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.confirm-btn:active,
.cancel-btn:active {
    transform: translateY(0);
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #ff4458;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-subtext {
    color: #aaa;
    font-size: 14px;
    text-align: center;
    animation: pulse 2s ease-in-out infinite 0.5s;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Progress dots animation */
.loading-dots {
    display: inline-block;
    margin-left: 5px;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Fade out animation for loading overlay */
.loading-overlay.fadeOut {
    animation: fadeOut 0.5s ease-in forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Prizes Modal Styles */
.prizes-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    backdrop-filter: blur(15px);
    animation: rulesModalIn 0.4s ease-out;
}

.prizes-modal.closing {
    animation: rulesModalOut 0.3s ease-in forwards;
}

.prizes-content {
    background: rgba(18, 18, 18, 0.65);
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 20px;
    max-width: 90%;
    max-height: 95%;
    overflow-y: auto;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: rulesContentIn 0.6s ease-out;
    text-align: center;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
}

.prizes-modal.closing .prizes-content {
    animation: rulesContentOut 0.3s ease-in forwards;
}

.prizes-content h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.prizes-info {
    color: #ffaa00;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: bold;
}

.prizes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.prize-item {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(45, 45, 45, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s ease;
    text-align: left;
}

.prize-item.available {
    border-color: rgba(76, 175, 80, 0.3);
}

.prize-item.unavailable {
    opacity: 0.6;
    border-color: rgba(244, 67, 54, 0.3);
}

.prize-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.prize-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.prize-name {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.prize-cost {
    color: #ffaa00;
    font-size: 16px;
    font-weight: bold;
}

/* .prize-description removed as descriptions are no longer shown */

.select-prize-btn {
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.select-prize-btn.available {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
    box-shadow:
        0 4px 15px rgba(255, 170, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.select-prize-btn.available:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(255, 170, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.select-prize-btn.unavailable {
    background: linear-gradient(135deg, #666, #555);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.select-prize-btn.unavailable:hover {
    transform: none;
    box-shadow: none;
}

.unavailable-text {
    color: #ff6b6b;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    display: block;
    padding: 10px;
}

.close-prizes-btn {
    background: linear-gradient(135deg, #ff4458, #ff6b6b);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 20px rgba(255, 68, 88, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    margin-top: 10px;
}

.close-prizes-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(255, 68, 88, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.close-prizes-btn:active {
    transform: translateY(0);
}

/* QR Code Styles */
.qr-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.qr-container img {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 5px;
}

@media (max-height: 600px) {
    .game-container {
        padding: 10px;
    }
    .title {
        font-size: 24px;
        margin-bottom: 5px;
    }
    .score-container {
        margin-bottom: 10px;
    }
    #player-scores .score-item {
        font-size: 12px;
        padding: 6px 8px;
    }
}

@media (max-width: 360px) {
    #player-scores .score-item {
        font-size: 12px;
        padding: 6px 4px;
        min-width: 60px;
    }
}









.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 10px;
}

.vertical-the {
    writing-mode: vertical-rl;
    transform: rotate(180deg); /* делает текст снизу вверх */
    font-size: 16px ;
    letter-spacing: 1px;
    margin-right: 1px;
    /*margin-bottom: -2px;*/
    font-weight: bold;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.main-text {
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 3px;
}

.line {
    width: 96%;
    height: 1px;
    background-color: white;
    margin: 4px 0;
}

.sub-text {
    font-size: 8px;
    letter-spacing: 3px;
    word-spacing: 42px;
}

/* Дополнительные медиа-запросы для малых экранов */
@media (max-height: 700px) {
    .menu-buttons {
        margin-top: max(5px, 2vh);
        margin-bottom: max(5px, 1vh);
        height: max(35px, 5vh);
    }
    
    .menu-btn {
        font-size: 12px;
        padding: 8px 15px;
    }
}

@media (max-height: 600px) {
    .game-container {
        padding: 10px;
    }
    
    .menu-buttons {
        margin-top: 5px;
        margin-bottom: 5px;
        height: 35px;
    }
    
    .menu-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Для очень маленьких экранов (iPhone SE и подобные) */
@media (max-height: 550px) {
    .menu-buttons {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        margin: 0;
        height: 30px;
        z-index: 1000;
    }
    
    .menu-btn {
        font-size: 10px;
        padding: 5px 10px;
    }
    
    .game-container {
        padding-bottom: 50px;
    }
}