@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: 'Poppins';
}

html {
    width: 100%;
    height: 100%;
}

body {
    background-color: #191919;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    height: 100%;
    padding: 50px 0;
}

.back-btn {
    top: 20px;
    left: 20px;
    background: #252525;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #212121;
}

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

.modal-content {
    background-color: #252525;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.modal-content p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #aaa;
}

.modal-content input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #404040;
    border-radius: 8px;
    background-color: #191919;
    color: white;
    margin-bottom: 20px;
    font-family: 'Poppins';
    transition: border-color 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: white;
}

.modal-content button {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    background-color: #151515;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-content button:hover {
    background-color: #101010;
    transform: scale(1.02);
}

.modal-info {
    font-size: 13px;
    color: #666;
    margin-top: 15px;
}

.game-over-message {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(234, 100, 23, 0.95);
    padding: 30px 50px;
    border-radius: 15px;
    text-align: center;
    z-index: 100;
    animation: pulseAnimation 1s ease infinite;
}

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

.game-over-message h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.game-over-message p {
    font-size: 16px;
    color: #fff;
}

.game {
    display: flex;
    flex-direction: row;
    gap: 25px;
    margin-right: 41px;
}

canvas {
    background-color: #252525;
    box-shadow: 0 0 15px rgb(0, 0, 0, 0.5);
}

.menu-sidebar {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 25px;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    color: white;
}

.score-box h1 {
    font-size: 40px;
}

.score-box h2 {
    font-size: 120px;
    line-height: 90px;
}

.players-section {
    width: 100%;
    background-color: #252525;
    border-radius: 10px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.players-title {
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #191919;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.player-item:hover {
    background-color: #2a2a2a;
}

.player-item.current-player {
    background-color: #2a4020;
    border: 2px solid #45D831;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #404040;
}

.player-name {
    font-size: 14px;
    font-weight: 500;
}

.player-score {
    font-size: 18px;
    font-weight: 700;
    color: #45D831;
}

.snake-color {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;    
}

.snake-color button {
    border-radius: 999px;
    border: 5px solid #404040;
    padding: 15px;
    transition: all 0.3s ease;
}

.snake-color button:hover  {
    border: 5px solid #606060;
    transition: all 0.3s ease;
}

.snake-color button.active {
    border: 5px solid #707070;
    transition: all 0.3s ease;
}

#snake-default {
    background-color: #CCCCCC;
    aspect-ratio: 1/1;
}

#snake-blue {
    background-color: #0088EC;
    aspect-ratio: 1/1;
}

#snake-green {
    background-color: #45D831;
    aspect-ratio: 1/1;
}

#snake-orange {
    background-color: #EA6417;
    aspect-ratio: 1/1;
}

#snake-purple {
    background-color: #A20EC0;
    aspect-ratio: 1/1;
}

#snake-yellow {
    background-color: #FFD900;
    aspect-ratio: 1/1;
}

.btn-play {
    border: 0;
    padding: 5px 20px;
    border-radius: 999px;
    color: white;
    font-weight: 600;
    background-color: #252525;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-play:hover {
    background-color: #303030;
    transition: all 0.3s ease;
}