:root {
    --grid-size: 20;
    --cell-size: 20px;
    --neon-blue: #00ffff;
    --neon-green: #00ff00;
    --background-dark: #111;
    --grid-line-color: #222;
    --libre-green: #4ade80;
    --proprio-red: #ef4444;
}

body {
    background-color: var(--background-dark);
    color: var(--neon-blue);
    font-family: 'Consolas', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    padding: 20px 0;
    transition: background-color 0.3s;
}

body.secret-mode-active {
    background: linear-gradient(135deg, #1a0a1a 0%, #0a1a0a 100%);
}

header {
    text-align: center;
    margin-bottom: 15px;
}

h1 {
    text-shadow: 0 0 10px var(--libre-green);
    letter-spacing: 3px;
    margin: 10px 0;
    font-size: 1.8em;
    color: var(--libre-green);
}

header p {
    font-size: 0.9em;
    margin: 5px 0;
}

.info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 400px;
    margin-top: 10px;
    font-size: 1.1em;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(20, 20px);
    grid-template-rows: repeat(20, 20px);
    border: 3px solid var(--libre-green);
    box-shadow: 0 0 15px var(--libre-green), inset 0 0 5px var(--libre-green);
    background-color: #000;
    width: 400px;
    height: 400px;
    position: relative;
}

.secret-mode-active #game-board {
    border-color: var(--libre-green);
    box-shadow: 0 0 25px var(--libre-green), inset 0 0 15px rgba(74, 222, 128, 0.3);
    animation: glitch 0.3s infinite;
}

@keyframes glitch {

    0%,
    100% {
        transform: translate(0);
    }

    25% {
        transform: translate(-1px, 1px);
    }

    50% {
        transform: translate(1px, -1px);
    }

    75% {
        transform: translate(-1px, -1px);
    }
}

.snake {
    background-color: var(--libre-green);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--libre-green);
    transition: background-color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.secret-mode-active .snake {
    animation: rainbow 2s linear infinite;
}

@keyframes rainbow {
    0% {
        background-color: #4ade80;
        box-shadow: 0 0 8px #4ade80;
    }

    25% {
        background-color: #60a5fa;
        box-shadow: 0 0 8px #60a5fa;
    }

    50% {
        background-color: #a78bfa;
        box-shadow: 0 0 8px #a78bfa;
    }

    75% {
        background-color: #f472b6;
        box-shadow: 0 0 8px #f472b6;
    }

    100% {
        background-color: #4ade80;
        box-shadow: 0 0 8px #4ade80;
    }
}

.snake-head {
    background-color: var(--libre-green);
    box-shadow: 0 0 15px var(--libre-green);
    border-radius: 50%;
    font-size: 16px;
}

.secret-mode-active .snake-head {
    animation: pulse-head 0.5s infinite alternate;
}

@keyframes pulse-head {
    from {
        transform: scale(0.9);
    }

    to {
        transform: scale(1.1);
    }
}

.food {
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    animation: pulse 1s infinite alternate;
}

.obstacle {
    background-color: var(--proprio-red);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--proprio-red);
    animation: obstacle-pulse 1.5s infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

@keyframes obstacle-pulse {
    from {
        box-shadow: 0 0 5px var(--proprio-red);
    }

    to {
        box-shadow: 0 0 20px var(--proprio-red);
    }
}

.powerup {
    background-color: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 15px #fbbf24;
    animation: powerup-spin 2s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

@keyframes powerup-spin {
    from {
        transform: rotate(0deg) scale(0.8);
    }

    to {
        transform: rotate(360deg) scale(1.2);
    }
}

@keyframes pulse {
    from {
        transform: scale(0.8);
    }

    to {
        transform: scale(1.1);
    }
}

#overlay {
    position: fixed;
    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;
    text-align: center;
    z-index: 10;
    padding: 20px;
    box-sizing: border-box;
}

#overlay.active {
    display: flex;
}

#overlay h2 {
    color: var(--libre-green);
    text-shadow: 0 0 15px var(--libre-green);
    font-size: 2em;
    margin: 10px 0;
}

#overlay p {
    margin: 8px 0;
    line-height: 1.6;
}

#overlay .nird-fact {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--libre-green);
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    max-width: 500px;
}

#secret-activator {
    cursor: pointer;
    font-size: 2em;
    transition: all 0.3s;
    filter: grayscale(0.5);
}

#secret-activator:hover {
    transform: scale(1.2);
    filter: grayscale(0);
}

#secret-activator.active {
    filter: grayscale(0);
    animation: key-glow 1s infinite alternate;
}

@keyframes key-glow {
    from {
        text-shadow: 0 0 10px #fbbf24;
    }

    to {
        text-shadow: 0 0 30px #fbbf24, 0 0 40px var(--libre-green);
    }
}

#mode-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    color: var(--libre-green);
    font-weight: bold;
    text-shadow: 0 0 10px var(--libre-green);
    display: none;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid var(--libre-green);
}

#mode-indicator.active {
    display: block;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0.5;
    }
}

#stats {
    display: flex;
    gap: 20px;
    margin-top: 5px;
    font-size: 0.9em;
    color: var(--libre-green);
}

#powerup-status {
    color: #fbbf24;
    margin-left: 15px;
    display: none;
}

#powerup-status.active {
    display: inline;
    animation: pulse-text 0.5s infinite alternate;
}

@keyframes pulse-text {
    from {
        text-shadow: 0 0 5px #fbbf24;
    }

    to {
        text-shadow: 0 0 15px #fbbf24;
    }
}

.legend {
    margin-top: 10px;
    font-size: 0.85em;
    color: #888;
    text-align: center;
}

.legend-item {
    display: inline-block;
    margin: 0 10px;
}