/* Snake Game Styles */
.game-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.game-instructions {
    color: var(--text-color-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
}

.start-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.start-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.difficulty-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.difficulty-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.difficulty-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.start-btn {
    padding: 1rem 2rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 196, 141, 0.3);
}

/* Game Board */
.game-board-container {
    aspect-ratio: 1;
    max-width: 600px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameBoard {
    border-radius: 8px;
    background: #1a1a1a;
}

/* Controls */
.controls-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    text-align: center;
}

.controls-title {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: fit-content;
    margin: 0 auto;
}

.control-key {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.control-key:nth-child(1) { grid-column: 2; } /* Up */
.control-key:nth-child(2) { grid-column: 1; grid-row: 2; } /* Left */
.control-key:nth-child(3) { grid-column: 2; grid-row: 2; } /* Down */
.control-key:nth-child(4) { grid-column: 3; grid-row: 2; } /* Right */

.control-description {
    margin-top: 1.5rem;
    color: var(--text-color-muted);
    line-height: 1.6;
}

.score-container {
    display: flex;
    gap: 2rem;
}

.score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.player-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.overlay-content {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.player-options {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.room-code {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.join-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.join-form input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.powerup-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.powerup {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.powerup-icon {
    font-size: 1.5rem;
}

.powerup-label {
    color: var(--text-secondary);
}

/* Game Elements */
.snake-body {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

.food {
    background: #f43f5e;
    border-radius: 50%;
}

.powerup-item {
    border-radius: 50%;
}

.speed-boost { background: #fbbf24; }
.shield { background: #60a5fa; }
.double-points { background: #34d399; }

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.food {
    animation: pulse 1s infinite;
}

@keyframes spawn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.powerup-item {
    animation: spawn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        margin: 1rem auto;
    }
    
    .game-board-container {
        margin: 1rem auto;
        padding: 10px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .controls-container {
        padding: 1.5rem;
    }
    
    .difficulty-buttons {
        flex-direction: column;
    }
    
    .difficulty-btn {
        width: 100%;
    }
    
    .control-key {
        width: 40px;
        height: 40px;
    }
}
