@font-face {
    font-family: 'PressStart2P';
    src: url('../assets/fonts/PressStart2P-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
}

body {
    font-family: 'PressStart2P', monospace;
    background-color: #111;
    color: #00ff00;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    margin: 0;
    padding: 0;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    max-height: 100vh;
    background-color: #000;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5), 
                inset 0 0 10px rgba(0, 255, 0, 0.3);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 2px solid #00ff00;
    overflow-y: hidden;
    overflow-x: hidden;
}

.game-header {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    padding: 10px;
    background-color: #001a00;
    border: 2px solid #00ff00;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

#game-canvas {
    width: 100%;
    height: 400px;
    background-color: #000;
    border: 2px solid #00ff00;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.3);
    transition: transform 0.1s;
}

#game-canvas.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-instructions {
    font-size: 0.6rem;
    color: #00aa00;
}

button {
    background-color: #003300;
    color: #00ff00;
    border: 2px solid #00ff00;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-family: 'PressStart2P', monospace;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

button:hover {
    background-color: #004400;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

button:active {
    transform: scale(0.95);
}

.hidden {
    display: none;
}

.game-tab {
    display: none;
    overflow-y: hidden;
}

.game-tab.active {
    display: block;
}

.tabs {
    display: flex;
    margin-bottom: 10px;
}

.tab-button {
    background-color: #001a00;
    color: #00ff00;
    border: 2px solid #00ff00;
    padding: 5px 10px;
    margin-right: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.tab-button.active {
    background-color: #003300;
}

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

.game-over.hidden {
    display: none;
}

.game-over-content {
    background-color: #000;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.7);
    text-align: center;
    border: 2px solid #00ff00;
    max-width: 90%;
    width: 400px;
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
    }
    to {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.9);
    }
}

#score-form {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#player-name {
    padding: 8px;
    font-size: 0.8rem;
    background-color: #001a00;
    border: 2px solid #00ff00;
    border-radius: 4px;
    color: #00ff00;
    font-family: 'PressStart2P', monospace;
}

#player-name:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

#leaderboard-container {
    position: relative;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

#leaderboard {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#leaderboard th, 
#leaderboard td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
}

#leaderboard th {
    background-color: #001a00;
    color: #00ff00;
    text-transform: uppercase;
}

#leaderboard tr:nth-child(even) {
    background-color: rgba(0, 255, 0, 0.05);
}

#leaderboard tr:hover {
    background-color: rgba(0, 255, 0, 0.1);
    cursor: pointer;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 5px;
}

.page-button {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background-color: #001a00;
    color: #00ff00;
    border: 1px solid #00ff00;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.page-button.active {
    background-color: #003300;
}

.page-button:hover {
    background-color: #002200;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 0, 0.3);
    border-radius: 50%;
    border-top: 4px solid #00ff00;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading.hidden {
    display: none;
}

.pixel-border {
    position: relative;
}

.pixel-border::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ff00, transparent, #00ff00, transparent);
    background-size: 300% 300%;
    z-index: -1;
    border-radius: 8px;
    animation: border-glow 3s ease infinite;
    pointer-events: none;
}

@keyframes border-glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.crt-effect {
    position: relative;
    overflow: hidden;
}

.crt-effect::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.crt-effect::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.90626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.83891; }
    30% { opacity: 0.65583; }
    35% { opacity: 0.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    70% { opacity: 0.53455; }
    75% { opacity: 0.37288; }
    80% { opacity: 0.71428; }
    85% { opacity: 0.70419; }
    90% { opacity: 0.7003; }
    95% { opacity: 0.36108; }
    100% { opacity: 0.24387; }
}

.title {
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    margin: 10px 0;
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    from { text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00; }
    to { text-shadow: 0 0 15px #00ff00, 0 0 30px #00ff00, 0 0 40px rgba(0, 255, 0, 0.5); }
}

.score-value {
    color: #ffff00;
    font-size: 1.1rem;
    text-shadow: 0 0 5px #ffff00;
}

.score-row {
    opacity: 0;
    transition: all 0.3s ease;
}


@keyframes glow {
    from {
        box-shadow: 0 0 5px #ff0000, 0 0 10px #ff0000;
    }
    to {
        box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#leaderboard-tab h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
    animation: pulse 2s infinite alternate;
}

#leaderboard-wrapper {
    position: relative;
    min-height: 200px;
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
        gap: 10px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        overflow-x: hidden;
    }
    
    #game-canvas {
        height: 300px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .game-header {
        font-size: 0.8rem;
    }
    
    button {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }
    
    #game-canvas {
        height: 200px;
    }
    
    .title {
        font-size: 1.2rem;
    }
    
    .game-instructions p {
        font-size: 0.5rem;
    }
    
    #leaderboard th, 
    #leaderboard td {
        padding: 8px;
        font-size: 0.7rem;
    }
}

@media (min-height: 800px) {
    #game-canvas {
        height: 500px;
    }
}

#leaderboard-tab {
    display: none;
    height: auto;
    overflow-y: hidden;
}

#leaderboard-tab.active {
    display: block;
}

 