@font-face {
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Orbitron.ttf') format('truetype');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

@keyframes open {
    0%{
        opacity: 0;
        top: -100%;
    }
    100%{
        opacity: 1;
        top: 0;
    }
}

@keyframes close {
    0%{
        opacity: 1;
        top: 0;
    }
    100%{
        opacity: 0;
        top: 100%;
    }
}

body {
    font-family: 'Orbitron', sans-serif;
    background-image: url('../img/fon.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    height: 100vh;
    color: #ffffff;
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}
.screen_open{
    animation: open .3s ease;
}
.screen_close{
    animation: close .3s ease;
}
.countdown{
    width: 100%;
    height: 100%;
    position: absolute;
    font-size: 72px;
    display: none;
    justify-content: center;
    align-self: center;
    text-align: center;
}
.start-container {
    background: rgba(20, 20, 50, 0.9);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}
.start-container h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}
.start-container input {
    padding: 10px;
    font-size: 18px;
    margin-bottom: 20px;
    width: 200px;
    border: none;
    border-radius: 5px;
    background: #333;
    color: #fff;
}

.difficulty {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.difficulty label {
    padding: 10px 20px;
    background: #444;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.difficulty input[type="radio"] {
    display: none;
}

.difficulty input[type="radio"]:checked + label {
    background: #00ffff;
    color: #000;
}

.start-btn {
    padding: 15px 30px;
    font-size: 20px;
    background: #00ffff;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

.start-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 15px #00ffff;
}

/* Game Screen */
#game-screen {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* HUD */
.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud div {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
}

.timer, .coins, .fuel {
    font-size: 20px;
}

.health-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar img {
    width: 20px;
    height: 20px;
}

.health-bar .bar {
    width: 200px;
    height: fit-content;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
}

.health-bar .bar div {
    width: 100%;
    height: 100%;
    background: #00ff00;
    transition: width 0.3s;
}

/* Pause Screen */
#pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 12;
}

.pause-container {
    background: rgba(20, 20, 50, 0.9);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.pause-container h2 {
    font-size: 36px;
    color: #00ffff;
}

/* Game Over Screen */
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-over-container {
    background: rgba(20, 20, 50, 0.9);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
}

.game-over-container h2 {
    font-size: 36px;
    color: #ff0000;
    margin-bottom: 20px;
}

.leaderboard {
    width: 300px;
    margin: 20px auto;
    border-collapse: collapse;
}

.leaderboard th, .leaderboard td {
    padding: 10px;
    border: 1px solid #00ffff;
}

.leaderboard th {
    background: #00ffff;
    color: #000;
}

.retry-btn, .menu-btn {
    padding: 10px 20px;
    font-size: 18px;
    margin: 10px;
    background: #00ffff;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.retry-btn:hover, .menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px #00ffff;
}

/* Countdown */
#countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    display: none;
}