/* ========================================
   SNAKE.IO GAME STYLES
   Created by Shivanya
   ======================================== */

/* CSS Variables - Easy to change colors! */
:root {
    --bg-color: #0f172a;           /* Dark blue background */
    --game-bg: #1e293b;            /* Game area background */
    --text-color: #ffffff;         /* White text */
    --accent-color: #f472b6;       /* Pink accent */
    --button-color: #8b5cf6;       /* Purple buttons */
}

/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Make icons filled instead of outlined */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Body styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Main container for everything */
.game-container {
    text-align: center;
    max-width: 700px;
    width: 100%;
}

/* Header styles */
header {
    margin-bottom: 15px;
}

/* Back button to return to main portal */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.back-button:hover {
    transform: translateX(-5px);
}

/* Main title */
header h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #4ade80, #22d3ee, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

header h1 .material-symbols-rounded {
    -webkit-text-fill-color: #4ade80;
}

/* Subtitle under the title */
.subtitle {
    color: #94a3b8;
    font-size: 1rem;
}

/* Score board showing stats */
.score-board {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    flex-wrap: wrap;
}

.score, .high-score, .snake-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.score {
    color: #4ade80;
}

.high-score {
    color: #fbbf24;
}

.snake-count {
    color: #22d3ee;
}

/* Main game area */
main {
    position: relative;
    display: inline-block;
}

/* The canvas where the game happens */
#game-canvas {
    background: var(--game-bg);
    border: 3px solid #334155;
    border-radius: 10px;
    display: block;
    max-width: 100%;
    height: auto;
    cursor: none;
}

/* Overlay screens (start and game over) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    gap: 12px;
    padding: 20px;
}

/* Hide overlay when not needed */
.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #4ade80, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay p {
    color: #94a3b8;
    font-size: 1.1rem;
}

.controls-hint {
    font-size: 0.9rem !important;
    color: #64748b !important;
    margin-top: 10px;
}

/* Play and restart buttons */
.play-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--button-color), #a78bfa);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.5);
}

/* Difficulty selection */
.difficulty-label {
    margin-top: 10px;
    font-weight: bold;
    color: white;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.difficulty-btn .material-symbols-rounded {
    font-size: 32px;
}

.difficulty-btn:hover {
    transform: scale(1.1);
}

/* Easy button - Green */
.difficulty-btn.easy {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
}

.difficulty-btn.easy:hover {
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.6);
}

/* Medium button - Orange */
.difficulty-btn.medium {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.difficulty-btn.medium:hover {
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.6);
}

/* Hard button - Red */
.difficulty-btn.hard {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 15px rgba(248, 113, 113, 0.4);
}

.difficulty-btn.hard:hover {
    box-shadow: 0 6px 20px rgba(248, 113, 113, 0.6);
}

/* Instructions */
.instructions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    color: #64748b;
    font-size: 0.9rem;
}

/* Footer with credits */
footer {
    margin-top: 15px;
}

.created-by {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--accent-color), #ec4899);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 650px) {
    header h1 {
        font-size: 1.5rem;
    }

    .score-board {
        font-size: 0.95rem;
        gap: 15px;
    }

    .overlay h2 {
        font-size: 2rem;
    }
}
