/* css/pages/snake.css - ПОЛНАЯ РАБОЧАЯ ВЕРСИЯ */

.game-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.game-header {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 20px;
    background: rgba(78, 204, 163, 0.1);
    border-radius: 30px;
    border: 1px solid rgba(78, 204, 163, 0.3);
}

.back-link {
    color: #4ecca3;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 15px;
    border: 1px solid #4ecca3;
    border-radius: 25px;
    transition: all 0.3s;
}

.back-link:hover {
    background: #4ecca3;
    color: #1a1a2e;
}

.player-info {
    color: #fff;
    font-size: 1rem;
}

.player-name {
    color: #4ecca3;
    font-weight: bold;
    margin-left: 5px;
}

.game-title {
    color: #4ecca3;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(78, 204, 163, 0.5);
    text-align: center;
}

.game-container {
    width: 100%;
    max-width: 700px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(78, 204, 163, 0.2);
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-block {
    background: rgba(78, 204, 163, 0.1);
    border-radius: 10px;
    padding: 8px 5px;
    text-align: center;
    border: 1px solid rgba(78, 204, 163, 0.3);
}

.stat-label {
    color: #aaa;
    font-size: 0.75rem;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #4ecca3;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.1;
}

.stat-unit {
    font-size: 0.7rem;
    color: #666;
    margin-left: 3px;
}

.game-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 450px;
    margin: 0 auto;
    background: #0f3460;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    margin-bottom: 12px;
    border: 2px solid #4ecca3;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.center-start-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #4ecca3;
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 0 #2e8b6f;
    transition: all 0.2s;
    border: 2px solid #fff;
}

.center-start-btn:hover {
    background: #3daa8a;
    transform: translate(-50%, -52px);
    box-shadow: 0 6px 0 #2e8b6f;
}

.center-start-btn:active {
    transform: translate(-50%, -47px);
    box-shadow: 0 4px 0 #2e8b6f;
}

.center-start-btn.hidden {
    display: none;
}

.pause-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    z-index: 20;
    display: none;
    border: 3px solid #f9a828;
    box-shadow: 0 0 50px rgba(249, 168, 40, 0.3);
    min-width: 250px;
}

.pause-title {
    color: #f9a828;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(249, 168, 40, 0.5);
}

.pause-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    border-radius: 12px;
}

.game-over h2 {
    color: #e94560;
    font-size: 2.2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.game-over p {
    color: #4ecca3;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.game-over-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.controls-panel {
    margin-top: 10px;
    text-align: center;
}

.controls-info {
    color: #aaa;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.mobile-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 250px;
    margin: 0 auto 12px;
}

.control-btn {
    background: #4ecca3;
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 0 #2e8b6f;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #2e8b6f;
}

.btn-up {
    grid-column: 2;
    grid-row: 1;
}

.btn-left {
    grid-column: 1;
    grid-row: 2;
}

.btn-right {
    grid-column: 3;
    grid-row: 2;
}

.btn-down {
    grid-column: 2;
    grid-row: 2;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.action-btn {
    background: #e94560;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 0 #b33a4e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.action-btn:hover {
    background: #d63e56;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #b33a4e;
}

.action-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #b33a4e;
}

.action-btn.start-btn {
    background: #4ecca3;
    box-shadow: 0 3px 0 #2e8b6f;
}

.action-btn.start-btn:hover {
    background: #3daa8a;
    box-shadow: 0 5px 0 #2e8b6f;
}

.action-btn.pause-btn {
    background: #f9a828;
    box-shadow: 0 3px 0 #b37e1a;
}

.action-btn.resume-btn {
    background: #4ecca3;
    box-shadow: 0 3px 0 #2e8b6f;
}

.action-btn.finish-btn {
    background: #6c757d;
    box-shadow: 0 3px 0 #4a525a;
}

.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confirm-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 3px solid #4ecca3;
    box-shadow: 0 0 50px rgba(78, 204, 163, 0.3);
}

.confirm-title {
    color: #4ecca3;
    font-size: 2rem;
    margin-bottom: 20px;
}

.confirm-text {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 30px;
    background: #4ecca3;
    color: #1a1a2e;
    border-radius: 50px;
    font-weight: bold;
    z-index: 2000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    display: none;
    border: 2px solid #fff;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 10px;
        border-radius: 20px;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pause-panel {
        min-width: 200px;
    }
    
    .game-over-buttons {
        flex-direction: column;
    }
}

@media (max-height: 800px) {
    .game-wrapper {
        max-width: 350px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .mobile-controls {
        max-width: 200px;
    }
    
    .control-btn {
        font-size: 1.3rem;
        padding: 8px;
    }
}

/* Для очень высоких экранов */
@media (min-height: 1200px) {
    .game-wrapper {
        max-width: 600px;
    }
    
    .game-container {
        max-width: 900px;
    }
    
    .game-title {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }
}