:root {
    --primary-color: #00f3ff;
    --secondary-color: #bc13fe;
    --accent-color: #ffe600;
    --bg-dark: #0a0a12;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    /* Safari */
    touch-action: none;
    /* Globalno onemogoči VSE kretnje */
}

body {
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: 'Exo 2', sans-serif;
    color: white;
    height: 100vh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Naj kliki preidejo na platno, če je potrebno, vendar uporabljamo gumbe */
}

/* UI Elementi potrebujejo dogodke kazalca */
#controls,
.overlay,
#score-board,
#main-footer {
    pointer-events: auto;
}

/* Tabela rezultatov */
#score-board {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 10px var(--primary-color);
    z-index: 10;
}

.combo-item {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
    border-color: var(--accent-color);
    transition: all 0.2s ease;
}

#combo-value {
    transition: transform 0.1s ease;
}

.score-item {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 5px;
}

.value,
#lives {
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.score-increased {
    transform: scale(1.2);
    color: var(--accent-color);
}

/* Prekrivni sloji */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 18, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none !important;
}

#game-over-screen h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

#game-over-screen p {
    margin-bottom: 1rem;
}

#game-over-screen button {
    font-size: 1.1rem;
    padding: 10px 20px;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    text-transform: uppercase;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    text-align: center;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.5));
    animation: title-glow 3s infinite alternate;
}

@keyframes title-glow {
    from {
        filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.3));
    }

    to {
        filter: drop-shadow(0 0 30px rgba(188, 19, 254, 0.8));
    }
}

p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #e0e0e0;
}

.start-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#start-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    /* Assuming --neon-cyan is defined elsewhere or will be added */
    background: var(--neon-cyan);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 0 15px var(--neon-cyan);
    transition: transform 0.1s, box-shadow 0.1s;
}

button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    touch-action: manipulation;
    /* Prepreči povečavo z dvojnim dotikom */
    -webkit-tap-highlight-color: transparent;
    /* Odstrani poudarek na mobilnih napravah */
}

button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(0, 243, 255, 0.4);
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.secondary-btn {
    background: linear-gradient(135deg, #ff4d4d, #c0392b);
    box-shadow: 0 5px 20px rgba(255, 77, 77, 0.4);
}

.secondary-btn:active {
    box-shadow: 0 2px 10px rgba(255, 77, 77, 0.4);
}

/* Najboljši rezultati */
.high-scores-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--primary-color);
    width: 80%;
    max-width: 400px;
    margin-bottom: 20px;
}

.high-scores-container h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-family: 'Orbitron', sans-serif;
}

#high-scores-list,
#high-scores-list-end {
    list-style: none;
    padding: 0;
}

#high-scores-list li,
#high-scores-list-end li {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#high-scores-list li:nth-child(1),
#high-scores-list-end li:nth-child(1) {
    color: #ffd700;
    font-weight: bold;
}

#high-scores-list li:nth-child(2),
#high-scores-list-end li:nth-child(2) {
    color: #c0c0c0;
}

#high-scores-list li:nth-child(3),
#high-scores-list-end li:nth-child(3) {
    color: #cd7f32;
}

/* Vnos za nov rezultat */
#new-high-score-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#player-name {
    padding: 10px 15px;
    font-size: 1.2rem;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    outline: none;
    font-family: 'Exo 2', sans-serif;
    user-select: text;
    /* Dovoli izbiro besedila */
    -webkit-user-select: text;
    touch-action: manipulation;
    /* Dovoli fokus/tipkanje */
}

#player-name:focus {
    box-shadow: 0 0 10px var(--primary-color);
}

#submit-score-btn {
    padding: 10px 30px;
    font-size: 1.2rem;
}

.hidden {
    display: none !important;
}

/* Noga */
#main-footer {
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 50;
    pointer-events: none;
}

/* Kontrole */
#controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
}

.control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.control-btn.fire {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #ff4d4d, #ff9e00);
    border: none;
    font-size: 2.5rem;
    box-shadow: 0 0 30px rgba(255, 77, 77, 0.6);
    animation: pulse 1.5s infinite;
}

.icon-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    font-size: 1.5rem;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    transition: all 0.2s;
    cursor: pointer;
    pointer-events: auto;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.95);
}

.icon-btn.muted {
    filter: grayscale(1);
    opacity: 0.5;
}

@keyframes low-lives-pulse {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0.6;
        transform: scale(1.05);
        color: #ff0000;
    }
}

.low-lives {
    animation: low-lives-pulse 0.4s infinite alternate;
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.icon-btn.muted {
    filter: grayscale(1);
    opacity: 0.5;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 77, 77, 0.6);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(255, 77, 77, 0.8);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 77, 77, 0.6);
    }
}

@media (min-width: 1024px) {
    #controls {
        bottom: 50px;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    #controls {
        left: auto;
        right: 10px;
        transform: none;
        gap: 15px;
        bottom: 20px;
    }

    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .control-btn.fire {
        width: 75px;
        height: 75px;
        font-size: 2rem;
    }

    #score-board {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .score-item {
        padding: 5px 15px;
    }

    .value,
    #lives {
        font-size: 1.2rem;
    }
}