/* Modern Snake Arcade - Styles */

:root {
    --bg-color: #0a0f1a;
    --bg-secondary: #111827;
    --accent-primary: #10b981;
    --accent-primary-light: #34d399;
    --accent-secondary: #f43f5e;
    --accent-secondary-light: #fb7185;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(ellipse at top, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(244, 63, 94, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

/* Main Container */
.game-container {
    background: linear-gradient(145deg, var(--glass-bg), rgba(0, 0, 0, 0.2));
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 480px;
    width: 100%;
}

/* Header Section */
.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--glass-border);
}

.score-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.score-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    font-weight: 600;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.score-value.current {
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.score-value.best {
    color: var(--text-secondary);
}

.logo {
    text-align: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Canvas Container */
.game-canvas-container {
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    box-shadow:
        0 0 40px rgba(16, 185, 129, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.3) inset;
}

canvas {
    display: block;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
}

/* Overlay Screens */
.overlay-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.overlay-screen.hidden {
    display: none;
}

/* Start Screen */
.start-screen {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.play-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow:
        0 10px 30px rgba(16, 185, 129, 0.4),
        0 0 0 8px rgba(16, 185, 129, 0.1);
    animation: pulse-glow 2s infinite ease-in-out;
}

.play-icon svg {
    width: 32px;
    height: 32px;
    margin-left: 4px;
    color: white;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 10px 30px rgba(16, 185, 129, 0.4),
            0 0 0 8px rgba(16, 185, 129, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            0 15px 40px rgba(16, 185, 129, 0.5),
            0 0 0 12px rgba(16, 185, 129, 0.15);
    }
}

.overlay-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.overlay-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* Game Over Screen */
.game-over-screen {
    background: rgba(127, 29, 29, 0.85);
    backdrop-filter: blur(12px);
}

.game-over-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-secondary);
    text-shadow: 0 0 30px rgba(244, 63, 94, 0.6);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.final-score {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-light) 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--accent-secondary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Footer Controls */
.controls-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
}

.control-box {
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: background 0.2s ease;
}

.control-box:hover {
    background: var(--glass-bg-hover);
}

.key-group {
    display: flex;
    gap: 0.25rem;
}

.key {
    background: var(--bg-secondary);
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    min-width: 1.75rem;
    text-align: center;
}

.control-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    font-weight: 600;
}

.badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-primary);
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 480px) {
    .game-container {
        padding: 1.25rem;
        border-radius: 24px;
    }

    .game-canvas-container {
        width: 320px;
        height: 320px;
    }

    canvas {
        width: 320px;
        height: 320px;
    }

    .header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .logo {
        order: -1;
        width: 100%;
    }

    .score-value {
        font-size: 1.5rem;
    }

    .controls-footer {
        grid-template-columns: 1fr;
    }
}
